Kevin Cruijssen

Sep 30, 2024 02:51
@jdt Hacky or not, it works. Thanks again. :)
Sep 30, 2024 02:51
@jdt Thanks! I changed the | to || since otherwise inputting 0s beyond 4 characters was possible. Your use of e.key also fixes one of the two known issues as a bonus. :D
Sep 30, 2024 02:51
@jdt Thanks. I've been able to save 4 more bytes by removing the "", ;, and > as I had prior (and I've used !! + |/& instead of ||+&& due to personal preference). And now I also know why it didn't work earlier when l4m2 suggested returning false. Unlike Java, the programming challenge I work with daily, in JavaScript bitwise operations on booleans will convert them to bits - aka true&false will become false in Java, but 0 in JavaScript..
Sep 30, 2024 02:51
@l4m2 I've rolled back my answer and use event.preventDefault() again.
Sep 30, 2024 02:51
@l4m2 I did manage to get my answer working with a return instead of event.preventDefault(). I forgot to invert the checks.. Woops.
Sep 30, 2024 02:51
@l4m2 It does work regarding the return vs event.preventDefault(), but unfortunately it has a different issue (I can still type !@# and alike in your answer (aka Shift + 1,2,3). EDIT: Apparently after all the golfs my answer has the same issue rn.. -_-
Sep 30, 2024 02:51
@l4m2 Since I apparently can still continue typing even if it returns false. At least in the snippet on SE or a JSFiddle (I'm using Chrome if it's relevant)
Sep 30, 2024 02:51
@Shaggy That works as well, thanks. Btw, I just found another bug unfortunately: typing a bunch of ' (or other characters that are typed with a setup keypress of however you want to call it, like ", ^, ~, `````; etc.) still work. -_- Will see if I can fix it later on perhaps.
Sep 30, 2024 02:51
@Shaggy I've just added a !isNaN(...) around the value[3] for now. Still shower than maxlength=4.
Sep 30, 2024 02:51
@Shaggy For me the arrow key is indeed also blocked, but I can still click 'HOME' + 'DELETE' on my keyboard when it's -8.
Sep 30, 2024 02:51
@Shaggy Thanks. The -8 instead of !=8 still allows delete though. But thanks for all the other golfs. :)
Sep 30, 2024 02:51
@Shaggy I've been trying to find a browser that uses asterisk, but Chrome; Edge; FireFox; and Opera all use bullets unfortunately. As for your 69 byter: thanks for some golfs, but the onkeydown you've removed was to prevent 'delete' and other non-backspace key-presses.
Sep 30, 2024 02:51
@Simd I will fix the asterisks instead of circles later today.
 
Aug 26, 2022 14:18
@mousetail What does the input look like when you get that error? If I look at the 05AB1E source code, it seems to check for the trailing """ for multiline inputs. Do you also have a leading """? And which of the programs from the other answers was used as input?
 

 Speed up, slowpoke!

Speed up, slowpoke! Chatting Room, codegolf.stackexchange.com/...
Jun 15, 2022 07:16
@NobodyNeedsNames I barely program in Python, but your changes indeed make sense. Thanks! :)
Jun 15, 2022 07:10
@NobodyNeedsNames ^
Jun 15, 2022 07:10
It's undeleted again. So if you see any errors in it, lmk
Jun 15, 2022 07:09
That's why I deleted it, since I'm currently fixing it.. ;)
Jun 15, 2022 06:31
Could you upload and share the Controller somewhere on github? Since you mentioned fixing/modifying the existing controller on pypi.org.
 
May 30, 2022 15:11
For the rule "Cracking a submission consists of finding any programming language that prints the correct result, not just the intended one. If a submission is run in any language that was not declared or found to work, there are no requirements to do anything, and future answers must be valid in that language.": let's say I intended language X, but someone cracks it in language Y, should all the next answers run in language X or Y? The wording in your rule isn't exactly clear to me as is tbh.
 

 King of the Holster

A room for King of the Holster chat and planning. codegolf.sta...
Apr 25, 2022 17:16
I also noticed it depends on a lot on the position of the bots in the list, so I understand now why you had the shuffle() + sort() before.
Apr 25, 2022 17:13
By changing it's bonus stats a bit it became more competitive, so I've just posted that new bot. I initially had 6,1,1,2, but with the speed of 2 it was death a lot more often because of Destroyer.. But with 9,0,0,1 it's doing a lot better. :)
Apr 25, 2022 17:01
I did came up with a new more basic bot, but if I add it both itself and HpKing drop to 4th/5th place with Destroyed at the top. 😅 So not sure if I want to post it (just yet), haha.
Apr 25, 2022 17:01
Apparently the updated HpKing bot I had in mind doesn't make too much difference. In fact, the regular HpKing bot beats it by a few thousandth or so.
Apr 25, 2022 16:44
@Romanp ok, it should be fixed now. I've updated my answer. I now just use the class-Strings instead of Class directly, then the comparing should be fine. (And with a test run I seem to be in the lead, although I'll still continue working on my second version.)
Apr 25, 2022 16:37
Ok, I'm back. I've just downloaded your github project and will see what the issue is and fix it. I guess it still gives the same error because of the containsKey now that I think about it.. :/
Apr 25, 2022 16:08
I'm going to eat dinner now, so if there are any other issues, I'l try to fix them when I get back. :)
Apr 25, 2022 16:07
You can change the TreeMap<Class<?>> back. And use var shotByClazz = getShotBy().getClass(); \n shotBy.put(shotByClazz, 1 + (shotBy.containsKey(shotByClazz) ? shotBy.get(shotByClazz) : 0)); instead of that entire merge-line.
Apr 25, 2022 16:07
@Romanp I've updated my answer with a fix. Didn't knew Class wasn't Comprable and can't be used with Map's merge. I now do it manually with a regular map.put.
Apr 25, 2022 16:05
@R
Apr 25, 2022 16:00
I'm also working on an updated version of HpKing, since I found a flaw in my general approach. :) Will post it as a separated entry when it's done, though.
Apr 25, 2022 15:59
@Romanp Ah. I think you can fix it by changing TreeMap<Class<?> to TreeMap<Class<PlayerClass> and shotBy.merge(getShotBy().getClass() to shotBy.merge((Class<PlayerClass>) getShotBy().getClass() (not 100% sure, though)
Apr 25, 2022 14:29
@Romanp Ah ok, that makes sense. One more thing: you may want to remove the reload(); in the default makeMove() method of the PlayerClass. Right now I could do super.makeMove(); to have infinite ammo, and then do another action like healing/shooting in that same move.
Apr 25, 2022 14:05
Why is there a Collections.sort(players); after the shuffle in MainClass? Or was that added just for testing purposes?
 
Oct 28, 2020 17:04
@ovs JDF also works (in theory given enough time and resources), but simply takes waaayyy to long in the first few iterations. It will basically loop the 100101010100101001... amount of times, timing out on TIO. With the ¤ it will only loop 0 or 1 times.
Oct 28, 2020 16:01
This time I'll wait with changing my answer until you've confirmed it. But F (and the other ranged loops) error on empty strings, so using ¤F at the end can be used in this case. :)
Oct 28, 2020 16:00
@ovs Ah, stopping with an error is pretty smart. I don't know if we can do it with ¿, but this might work by the looks of it
Oct 28, 2020 14:36
@ovs Ok, I think you're indeed correct that the Δ won't work. With the wrap it's still the same issue as before "000000" being equal to "000". I've tried to fix it like this, but unfortunately it will always loop one additional time before the Δ terminates, so it'll output four As instead of 3.
Oct 28, 2020 14:25
Ah, but the issue still remains. It outputs two AA, but you said it should output three. Let me check what's going on
Oct 28, 2020 14:16
PS: I usually add comments by wrapping them in "..."\ :)
Oct 28, 2020 14:14
@ovs The q in your footer is part of the loop now, so it terminates the entire program right after the first iteration. If you change the q to }q it will work as intended.
Oct 28, 2020 13:52
@ovs Yeah, ik. I tried that initially before I posted my answer. Unfortunately something like 0001 is equal to 1 in 05AB1E's eyes.. Most of the times useful, but in this case the opposite of useful unfortunately.
Oct 28, 2020 13:52
@ovs Actually, your approach of putting the J at the front might make Δ`JD...¸ possible for -1 by the looks of it. :)
Oct 28, 2020 13:52
@ovs Thanks again! That's again a lot better. ;) I also have the feeling the infinite loop could be golfed somehow with a fixed number of iterations, but I'm unable to save bytes thus far. I either also output the length at the cost of 2 bytes in the compressor, and replace [ÐõQ# with IFD in that case. Or I change [ÐõQ# to something like DvÐdi. If I just change [ÐõQ# to DvD, it will output trailing characters equal to the first character of the input-string unfortunately.
Oct 28, 2020 13:52
@ovs Oh, that's indeed a lot better. Thanks for the -18!
 
Sep 30, 2020 00:32
@DominicvanEssen I think that would indeed make the challenge more interesting. As is I have the feeling this challenge will be over rather quickly otherwise... :/ After turn 5, the "Running programs must be irreducible." is gone, which seems to be the most annoying one to deal with tbh. The other four rules thus far (must contain C"pr; may not contains brackets of any kind; must be at least 19 bytes; and may not contain whitespaces) aren't too hard to apply in most golfing languages for example.
Sep 30, 2020 00:32
Then again, it might now give an unfair advantage to the existing answers over new ones..
Sep 30, 2020 00:32
Just to make sure I understand it correctly. Let's say someone posts the turn-5 answer in a bit. After that the starting rules are dropped, and if turn-6 would output Codington Crescent this challenge would be over already?
Sep 30, 2020 00:32
Someone should try to finish the game in the language Mornington Crescent. ;)
 

 The Nineteenth Byte

The Nineteenth Byte: General discussion for codegolf.stackexc...
Jul 22, 2020 11:53
@math I received the +16 again today, so apparently the system does recognize this much after about a day.

The single downvotes every now and then that indeed has been going for months are still there, but I guess that can't be helped. Some people just dislike certain languages I guess..