Thank you !!
In the 4 tricks you told me I just know one ( global variables ), the 3 other are very helpful
Ok ok I will post in english.
edit: it made me gain 38 characters !!
Thank you !!
In the 4 tricks you told me I just know one ( global variables ), the 3 other are very helpful
Ok ok I will post in english.
edit: it made me gain 38 characters !!
Any tricks for JS? I am finding it difficult to see how someone can get down to the currently winning 49 with readline.split, even if readline is aliased to another var.
readline = 8 char
split(ā ') = 10 char
print() = 7 char
alias readline and call it twice: 5 char
That is 29 char right there, only leaves 20 char for everything else???
I believe 49 chars is a bash program wrapped in system() in JS
I confirm. The 49 characters solution in javascript is this one:
system("bash solution in 37 characters")
And itās the same for many languages. In pure javascript i can do 66 characters.
That feels like cheating.
I know and thatās why i donāt really likes code golfing puzzles. But donāt worry, thereās many many interesting things to do on codingame
I fully agree with you guys, Iāll try to remove the system function tomorrow. This looks fairly easy to do but I want to test it properly before updating all the servers ;).
If you remove the system
function for javascript, you must also remove it too for every languages. Java, C#, C++, C, ruby, php ā¦ All languages can execute a bash command and it is almost always shorter.
But if you do that, youāll have to replay/reset all code for all code golfing puzzles ? It will be a huge chaos But i like the idea.
If you do that you deserve 25 likes (one for each language)
Of course. It would be meaningless if not reset.
Is the bash version using a command line tool like awk? If so, I would argue that is cheating as well. Maybe all the solutions need to be reviewed to make sure they arenāt exploiting command line tools to do the job.
I should be able to recompute all the submissions for temperature, but its way more complex to do it to the other code golf puzzles :/.
And regarding the other languages, I donāt think that will be as easy but at least the problem will be solved for JavaScriptā¦ I have another idea of approach to deal with all the languages but we are all quite busy right nowā¦
Bash is useless without command line tools. To answer your question, my bash version doesnāt use awk.
I agree about Bash being useless without the command line tools and I think this should not be changed, I learned a lot trying to reduce my code in Bash and the tools.
But āawkā was just an example, could be: sed, sort, tr, ā¦
For me, just remove the system, and the ways to run system calls.
Even if I (ab)used the system()
trick, I agree on disabling the possibility to run external commands (except for bash of course).
A workaround can be to clear the PATH environment variable when running the submission, to discourage the use of external commands.
Thatās something Iāve tried this afternoon but the additional characters that you would have to add are still too lowā¦ If we aim at solving this problem for all languages, Iād prefer a better solution. It guess it should be possible to disable some external programs for specific languages (e.g. no grep when language != bash and no python when language = bash). But thatās not easy as easy as it sounds because the FS is shared between multiple instances used for different languages. We will keep you informed anyway.
bash should be able to use any bash command. Or it will be useless. Iām not really sure if bash should access some command like python, rb, gcc (every command that could compile and run something else than bash). But itās not a problem for golfing puzzles. It could be a problem for the 15 puzzles achievement in bash, no big deal.
If you can disable bash commands for every langages, it will be so great.
All the submissions in Javascript have been recomputed. Solutions based on the system function no longer work.
Thanks a lot for that, is it only in javascript as of now?
Yes, because Iāve patched spidermonkey to disable the function. We still need to find a solution for every languages.