Temperature Code Golf puzzle discussion

Hey !
Seems logical your code doesn’t work. If you are only searching for values lower than 999, 5526 will never be selected…
But I don’t know how your code is made, so I could be wrong…

Initialize to 9^9 if you can…
Same length, and high enough :wink:

I think you have misunderstood.

My code passes ALL the test case even the submit ones. I’m conscious that my code is wrong. I’m not searching for a solution or any kind of optimisation here (I like to search by myself). All i’m saying is that the test where there is only 1 value wich is the maximum does not exist. It allows (in my case) to win 1 char on a code that shouldn’t be good.

PS:
@hoeskioeh, in java doing 9^9 is pretty long

Math.pow(9,9)

Math.pow

if double is fine you can use 1e9

Yes but it’s not fine, don’t have space to convert everything when int is enough.

Moreover I said

I’m not searching for a solution or any kind of optimisation here (I like to search by myself).

All i’m saying is that the test where there is only 1 value wich is the maximum does not exist.

Given that Bash ‘sort’ command behaviour has changed recently, so that at least my old solution do not pass validators any more, would it be a good idea to recalculate the scores?

1 Like

Sorry for annoying question but are there any possibility to help me understand what exactly happens in Validator 1 & 12?
Maybe it was too hard day for me or something other - but I can’t find at the moment any reasons why my solution in bash failed on them

P.S. I event checked my solutions with other languages but they are fine

Bash was recently updated: https://www.codingame.com/forum/t/languages-update/1574/106

Thank you for your answer!
It is now like new challenge - read all “what’s new” and understand what exactly affect it :slight_smile:

OK, I didn’t realize what exactly changed in Bash :slight_smile:
Any hints about either Validator 1 or Validator 12 conditions?
P.S. If not - I’m OK with it :wink:

in fact we should recalculate scores no ?

1 Like

Where I can find the solution?

The solutions should be re-calculated. My 27 character Perl solution relied on undocumented behavior of the Unix utility sort which has broken in the recent update. My new shortest solution is 37 characters! Without a recalculation, I suspect it is impossible to match the current solutions.

4 Likes

A post was merged into an existing topic: Temperatures puzzle discussion

You can indeed use scanf only once.
If anyone wonders how many chars you can do in C without system, my solution without system is 69 chars.
I don’t know if it can get lower than this.

1 Like

every tests pass for me, but when I submit, the validator 7 don’t pass… Any possible way to know what’s happening, or what’s wrong?
Got 248 chars using Java

both given temperatures are the same.

Well, I don’t like, that you just can copy one others solution from the practice section.
Also whitespace should not be counted as characters in code golf imho. i = 1 vs. i=1 should give the same code length.

You can see others solutions only if you have solved the puzzle, and only for the language(s) you have used.
Why spaces should not be counted ? If you can write an instruction without spaces do it.

You can see others solutions only if you have solved the puzzle, and only for the language(s) you have used.

Sure, but you can solve it somehow (overcomplicated or just not short) in practice and then just copy the best solution found from another person to the competition.

Why spaces should not be counted ? If you can write an instruction without spaces do it.

That’s exactly why it should not be counted. If the instruction works either way, the formatting should not affect code length. Every editor tells you to write nice code and then we shall forget everything, even if it does not make a difference.