Don't Panic - Episode 1 - Codesize - Puzzle discussion

I understand your point but hardcoding this problem requires way more creativity than what you think, trying to get a good hardcode is a pretty fun competition, you should give it a try.

About regular solutions, I’ve done a 104 chars solutions in Python monthes ago that would pass any set of randomized validators.
And I was total noob at golfing back then so I’m pretty sure it can be improved a lot and go under 100 chars.
You can probably also go under 100 chars in JS, Ruby, Perl without fishy techniques.

While I’m personally not OK with hardcoded solutions there is one huge difference (IMO) - you have choice to hardcode or not. If you choose to, you have a chance to get shorter solution.
On the other side there is “system call” solution with different language inside. That thing abuses entire leaderbord, because it’s “language X leaderbord”, not “mixed language X+Y leaderbord”, so if solution contains code on language other than X it shouldn’t even compare with language X solutions and get CP at all

2 Likes

with Python 3 I am stuck at 169 char

Can i change the direction each time after using elevator ?

Can i chek the fact of interacting with elevator ?

Thats where you should do it!

“Fair” as in “Life”

1 Like

Even though I can definitely see this “hardcoding” as a fun and creative activity it should be a puzzle of its own. You really don’t need to create different settings derived from popular culture to make this category fun. In fact, the problem definition as well as all these graphics become pointless if the goal is “compress your output to satisfy the expected values of the validators”. In the long run it doesn’t teach you much, but I am realizing recently that’s not the main goal of this site.

1 Like

In JAVA

I just Type this and say “elevatorPos cannot be resolved to a variable Java(33554515)”

if(elevatorPos == 2){
System.out.println(“BLOCK”);
}

why ? this var is define…

1 - The compiler is always right. This is a mantra you should repeat everyday
2 - You did not post enough for us to see what’s wrong in your code

2 Likes

So I finally managed to get below 200 chars in C++, and that was so hard!
I’ve used pretty much everything I could think of. Given so many people do way better, I must be pretty bad at golf :grinning_face_with_smiling_eyes::sweat_smile:.

Half of the code is about parsing stdin, and there’s no macro that makes the code shorter.

I wish I could find genuine solutions to understand… HOW!? :sweat_smile:

1 Like

Hey, I saw people who did it in Rust in less than 200 bytes, how is it possible ? Is there a hidden feature or something ? I think I’m missing something, anyone in top board can light me a little ?

I only for it down to high 300. I need some tips too.

[admin] no sharing of solution here pls

help with this snnipet code, help me to down to 200 characters or less

Yes. Some reponses are hard coded.
What I mean by that, is that, like for Power Of thor, some people found a way to win with the reponses of validators. Hope it helps you.

That was tough! For those who stuck:

  • try different language;
  • check best algos from solutions to “Don’t Panic - Episode 1”;
  • google “golf coding” practices for your language.
2 Likes

Hi All,

I managed to get my code down in 192 in python. I see that some users managed to get down to 61. Given I will probably never go back to this puzzle. Is there any way to see the best solutions, purely from a learning point?

1 Like

No, you can’t; because others won’t have your limits and will cheat.
You can still read solutions in the non-golf puzzle, I’m sure that there are tricks useful for golfing in these solutions.

Hi Nicola,

Thanks for getting back to me.

Is the non-golf puzzle a specific game? I can’t seem to find it, any chance you could share a link?

Thanks,

Vinay

https://www.codingame.com/training/medium/don’t-panic-episode-1

The link is also on the front page of the code golf version of the puzzle.