Temperature Code Golf puzzle discussion

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.

Code golf is all about making the shortest code, not the most beautiful, neither the most performant. And spaces are just details, the big work is on finding language tricks and “alternative solutions”. Furthermore the shortest solutions are generally not the simplest ones, so the solutions of the practice section are not a big deal here…

1 Like

In some languages, there are tricks to save characters by properly adjusting spaces.
For example if you want to write in Python:
[1+n*n for n in range(10)]
You can save a space like this:
[n*n+1for n in range(10)]
So they should be counted.

2 Likes

Is 29 char solution hardcoded ?

I doubt it, validators are known but it would take a lot of chars to hardcode it, it’s not worth it.

I wonder if these very low scores are still rechable tho, cause I see a lot of short solutions that are not valid anymore in the puzzle section.

So maybe validators changed at some point and it was easier before, I don’t know.

This one is very mysterious to me, as is the C score for Chuck Norris.

3 Likes

Orabig macros ?

Hi golfers !
With the recent update of the languages, it could be interesting to recompute scores. Some solutions could be now unreachable (ex: kotlin with minBy).
Also as suggested by OptiPanda some test cases are missing and wrong solutions can pass all validators with less characters.
I know that some of you like to bypass validators but I think not everyone does (ok at least me!). That’s why I like temperature over the others.
But there are still some cases not covered and at least one of my solution is not correct.

Here are the cases that I have noticed that can allow me to gain characters :

1
5526

2
1 0 (order is important)

3
4 0 -8 (0 in the middle and 0 < |4| < |-8| is important)

and a suggestion, the ranking in case of a tie is obviously based on timestamp, it could be interesting like in multi to have this time as a tooltip.

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 …