Power of Thor - Codesize - Puzzle discussion

Have you ever tried?

1 Like

Iā€™m cleary too bad at bash to do a shorter code than my javascript code, so no :smiley: I know system donā€™t work on Temperatures and i was pretty sure that this hack was only for Temperatures puzzles. Iā€™m glad to know that it is also the case on others puzzles.

@CvxFous You are right!! Not going north reduces the code, but tests still pass.
And also you can reduce code just by avoiding tabs and spacesā€¦ I dont like that.

2 Likes

Got 81 in Python3, I donā€™t know how I could make it shorter but there are clearly ways I have not come across yet.

I managed to do 135 char in JS ,without hard-coding (i donā€™t even know how they do that), any tips to do shorter ? is that even possible ?

Check the leaderboard. 58 char is possible.
You donā€™t have to code a proper solution, it should just pass tests instead.

Could we have a leaderboard by language ? Its silly to compare code length from Perl to Java. 557 chars is quite short for the Java Solution, but i canā€™t compare with Java Mates since leaderboard is full of other languages. Iā€™d like to know if there is shorter in Java to optimize my solution !

1 Like

You can filter the leaderboard by language.

How you can improve if you canā€™t see other solutions?

2 Likes

How can anyone compete if anyone else can see [and copy-paste] best solution?

3 Likes

Allowing only one submitting?

I prefer to learn instead of compete.

What do you mean? Do you suggest to change rules to allow a person only one submission but expose the solution to others? This will not prevent copy-pasting but make impossible to improve own solutions.

Yeah, having a couple of golf puzzles for ā€œpracticeā€ section would be nice (Iā€™d prefer another one for ā€œcompeteā€ though)

Yes, and now that you say it, it would be a good idea to have some golf puzzles in practice section, it would be the perfect solution. Imagine being able to merge the best short-coding tricks.

Merging others solutions doesnā€™t feel as good as making your own.

Actually, imagine situation with two people having good but not ideal solutions, and they both can peek at each other solutions. What are the chances they wonā€™t find best solution long before youā€™ll find out about the puzzle?

Would it make sense to have a language specific leaderboard? Or atleast to filter the leader board by languague. I wrote in go but noticed that none of the shortest 1000 solutions is written in go, still I would like to see how my code compares to other go solutions, seeing how each language has different minmal syntax requirements.

1 Like

The ranking is doing something funny, as for the three optimization puzzles I have the best score for New Zealand, but I am ranked 2/x for New Zealand in the profile pageā€¦

Also when looking at the Power Of Thor and picking ā€œNew Zealandā€ or my company name, the headline is picking my worst result as my ranking, as can be seen below, I have the best score rank one, but the header line shows 4 my C# codeā€¦

Thatā€™s code size, not optimization.
There are per-language leaderboards
You get 200 points for being first in a language.
Your best 5 langauges count in the puzzle ranking, so you can get 1000 points at most.
It looks like others solved it in more languages. That alone can make you 2nd.

Thatā€™s code size, not optimization.

I was meaning the yellow 4, the code size is correct 68, but the yellow four is my worst codes ranking, on other filter sets, where the numbers are in the hundereds, the header line yellow number is the ranking of my worst entry, while the code length values is my bestā€¦

There are per-language leaderboards
You get 200 points for being first in a language.
Your best 5 langauges count in the puzzle ranking, so you can get 1000 points at most.
It looks like others solved it in more languages. That alone can make you 2nd.

This explains the bigger picture ranking. Although it seems pointless (to me) to rank a code golf on how many languages you submit inā€¦ but now I know what to game it ā€œwinā€ the ranking I will play that gameā€¦

47 in java8 ?

In the instructions in the IDE, it states that you have to read the remaingTurns:

Input for a game round
Line 1: the number of remaining moves for Thor to reach the light of power: remainingTurns. You can ignore this data but you must read it.

Actually, you donā€™t have to read it (at least not in JavaScript).
Please correct the instructions.