[Community puzzle] Timer for Clash of Code

This topic is about the puzzle Timer for Clash of Code.

Feel free to send your feedback or ask some help here!

I’ve fixed one test and two validators for extraneous trailing blank lines in the output.

(So if your code was failing for totally arbitrary reasons, you may want to submit again now—the error report for “wrong number of trailing lines” looks like this:)

Additionally, I’ve trimmed another case input for a trailing blank line. For consistency.

2 Likes

Just letting everyone know that the Java template results in an exception on the “No one joines” Test.

Confirmed, and fixed (with a band-aid). Please verify that it works correctly now. I believe this to be an error in the Java generation code, and I will submit the information to CG via email.

  • danBhentschel

Hi, i am a bit disturbed, I’ve succeeded all the tests but the first, could someone MP me the value of the test to help me understand my mistake.

Thanks for this puzzle, it’s interesting.

1 Like

If you are failing the first test before submitting, there is a three lines logo in the upper right corner of the test panel. Clicking on that will allow you to see the test case as well as the expected answer.

If you are failing the first test after submitting, then you can’t see the expecte result to avoid hard-coding.

1 Like

if you can understand this, you may comment, else you can like and ask
$<.each{|x|t>(s=60*x[0].to_i+x[2,2].to_i)&&break;t=(5<n)?s:[s-(512>>n+=1),0].max}

Hi,
I’m trying to solve this puzzle in Python3, but I get stuck at Test 4, where I’m getting 0:21 as the answer, whereas it was supposed to be 2:38, and I don’t understandy why it should… Any help? Thanks.

1 Like

I am exactly in the same case. All the tests pass with success, but Test 4 still fails :rage:.

Same issue here. the ide tests are fine, I haven’t hardcoded anything, but the first validation test (“1 time stamp, timer starts game”) fails.

I’ve missed a possible case, but can’t tell what it is…

1 Like

my guess that the author of the puzzle put wrong answer for test 4. you get input that lower the answer it self.

Likewise, I’m going to try some edge cases, but I’m unsure of what I’ve missed.

No, the author didn’t put the wrong answer, nor did the other 100+ users who have successfully solved the puzzle. :slight_smile: You are missing the requirement: “The game starts if: The timer reaches the time it is set to stop at”. This is a subtle one. Here’s my debug output for test #4:

Player 1 joins at 4:51
Game starts at 0:35
Player 2 joins at 4:29
Game starts at 2:21
Player 3 joins at 3:42
Game starts at 2:38
Player 4 joins at 2:25

Notice that Player 4 joined AFTER the game is set to start (at 2:38). This means that by the time Player 4 wants to join, the game has already started. It’s not entirely clear (at least to me) from the problem description, and is just one of the issues that I have with this puzzle.

  • danBhentschel
4 Likes

All tests succeed in IDE but the first submit test (1 timestamp, timer starts game) fails when submitted for C# while all the others succeed. Not sure what I might be missing.

1 Like

somehow i missed this part
now the code work for me :slight_smile: thanks.

How is 2:25 AFTER 2:38?

“The timer starts at 5:00 and runs towards 0:00.”

  • danBhentschel
1 Like

I just dont get the 100% because the first one always fails although it is the easiest one …

1 Like

Lo
I passed all the test cases, submitted but the first one just didn’t want to validate my code 100%. Any idea on what might be wrong?

After @player_one’s explanation, I’m now at 100% before submitting, but still failing that first test case after submission.

There has to be another edge case or something that I’m missing :stuck_out_tongue: