Temperature Code Golf puzzle discussion

Haaa. This is the sad answer to what I had been wondering for a while now.

I was able to finish in seventh position in pure Javascript (60 characters), and was seeking knowledge about these mysteriously low top six submissions…

Little bit sad, but I guess it’s part of the game… :pensive:

In fact, this answer is deprecated (5 years old, ouch …). Since now CodinGame uses NodeJS and not SpiderMonkey anymore.

And calling a bash command in NodeJS will require too many characters. Javascript solutions in golf puzzles are now (as far as I know) pure javascript solutions.

But, this answer is still valid for many other languages such as python, ruby, C++, C, perl …

Are the golf leaderboards ever recalculated? The last update broke calls to ruby (now you have to use the full path /usr/local/bin/ruby), but this only impacts new solutions.

Thanks for the info @Magus. This restores my faith in javascript golfing!

In the last 30 minutes I indeed learned and tested a way to run a Bash script in JS and ended up with a minimum of 49 characters to call an empty bash script. I suppose this proves the 31 char Bash solution isn’t worth calling from JS to get the top score on temperature.

golf puzzles are now (as far as I know) pure javascript solutions

Would anyone be able to confirm that for the JS enthousiast?

Yes, I think the step you are missing is compression to unicode. You can compress JS 2:1 with an overhead of 26 characters. So your 60 can go down to 26+60/2= 56 which would tie for the best.

1 Like

I can confirm that it’s pure JS (compressed).

I’m launching a recompute of code golf solutions, puzzle per puzzle. I think the last Dart update also impacted solutions. It will take some time

2 Likes

Wow, many codes will be broken :rofl:

Mostly because of the bash update.

1 Like

Thanks for the tip haha!

Oh nice trick, thx !

Hello !!!
Everything’s fine until I submit my solution.
Only validator 7 isn’t right and impossible to know why ?
How is it possible to understand where is the problem ?

Thank you

It’s in Java.

as said in report, validator 7 is with the same negative number twice

have you tried with custom tests to be sure that your code works in this case ?
( -10 -10 )
( -77 -77 )

1 Like

I’ve a problem with case 7, help me!!! please :<

Yes, I tried and it works fine.
I can’t understand what’s the problem.
Would it be possible to have the real case ?

How do you manage 29 chars in Perl, secret magic, calling another language or hard coded ?

1 Like

Any hints for test case 2? I can pass everything else

Thank-you so much !! You solve my problem :grin::grin:

Salut à tous,
Après avoir parcouru tout ce topic, le naïf que je suis réalise qu’il est possible de tricher pour grimper au score. Il est impensable que les spécialistes en programmation de ce site ne puissent pas contrer cela.
Et sinon, il convient de faire 2 classements, un pour les codingamers orthodoxes et un pour les tricheurs. Je garde le classement des tricheurs car je me doute qu’il faut tout autant réfléchir pour y arriver dans cette seconde catégorie.
Qu’en pensez-vous ? Merci.

There’s no hardcode on Temperature and Chuck Norris so if you want a hardcode-free competition you can focus on these two.

And if you find unfair the use of system to call another language, focus on languages with a short synthax (Perl, Ruby, Python, JS) cause it’s usually pointless to call another language with them (the cost of the system call is not worth it).