[Community Puzzle] Snail Run

Coding Games and Programming Challenges to Code Better

Send your feedback or ask for help here!

Created by @Eurostar02,validated by @ThomPuce,@Murat_Eroglu and @FredericLocquet.
If you have any issues, feel free to ping them.

What happens if two snails want to occupy the same cell at the same moment because that is the shortest path to their dest?

1 Like

itā€™s the shorter path that counts here there are no collisions between snails, snails teleport

i am trying to create episode 2 with collision

You should specify it in the description :

  • Two snails or more can be at the same place at the same time (no collisions)
1 Like

There is no collision nor change in speed nor effect on each otherā€™s path. The snails do not effect each other.

Though there is a solution that does not rely on mapping the snail paths so exactly.

Hello,

Because of CG Web Dev made the topic creation too hard and glitchy iā€™m actually reply directly here because it rely on the subject so actually Iā€™ve done this puzzle but i canā€™t get 100% in submit with validators Iā€™m stuck at 75% because of test 3 & 8 so my question is how can find whatā€™s going on and why it fails, can we have their unit test to check why Iā€™m failing at these steps?

I can share my code for anyone who want help me.

Thanks in advance :slight_smile:

I think you mean Validators 3 and 8 instead of Tests 3 and 8 (tests are the ones you can see, validators you cannot).

Validator 3 is the same as Test 3 except for the speeds of the snails. Try generating some random numbers within the constraints to test out your code.

Validator 8 is the same as Test 8 except for the map. The lanes are horizontally mirrored and then ordered and numbered differently.

Hope this helps.

Hey ty for ur answer i tried random numbers or speed for V3 it works and get the best snails to win and for V8 tried also to horizontally mirrored my lanes and replace numbers in different places and it works too but still doesnā€™t solve the problem why it doesnā€™t pass these validators even if my code works i will share u my code if u want : https://codeshare.io/MNENNp

Validator 3: For a start, try speedSnail of 1, 2 and 3 (note: not the input of the validator). Your code gives 2 as the answer, while the correct answer is 3.

Validator 8: I tried your code on the validator, and the following error message appeared:

Unhandled exception. System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. (Parameter ā€˜indexā€™)
at System.Collections.Generic.List`1.get_Item
at Race.FillMap on line 413
at Solution.Main on line 532

1 Like

i got the puzzle doneā€¦ but i wonder if for further puzzles to consider more than one ā€œ#ā€ in each row. thank you for the fun!

Hey bro, i would thank you for ur details, now i got 100% and finally done with this puzzle, but iā€™ve a question for u, actually how do u call the validator for a specific code like u did for trigger the exception?

Glad to know youā€™ve made it! :tada:

Validators are accessible in the contribution view of a puzzle. Normally you need to be at higher levels to have access to that view.

ā€œThough there is a solution that does not rely on mapping the snail paths so exactly.ā€

I think that this fact has to be stated in the puzzle description a bit more vivid.
I was confused buy all the tiny details (do snails allow to overlap and what not) thus implemented the boring BFS approach. Only when I was checking other solutions, iā€™ve figured out that there is significantly less involved solution exists.

Hello! Fun puzzle!
I think there might be some ambiguity about the winner number. Indeed if two or more snails arrive to the finish at the same time, the winner number is not defined by any rule but by the implementation of your solution. In my solution all Tests passed with an ā€œ<ā€ update rule then some Validators failed. I replaced by ā€œ<=ā€ and it worked. It might worth to check, if it is possible to add some specific rule

The statement mentions:

For each race there is only one winner.

So there shouldnā€™t be the situation where two or more snails finish the race at the same time.