Coding Games and Programming Challenges to Code Better
Send your feedback or ask for help here!
Coding Games and Programming Challenges to Code Better
Send your feedback or ask for help here!
Hi guys,
This topic is about the-holy-grail
The objective of this puzzle is incomplet, it is asked to detect a complete path, and once it is revealed to sprint the holy grail. From the output it seems that you have only one thing to do, return the number the number of tiles that have appeared when you find a path to the grail (thus total_tiles - 2). You will not have to “move”, nor “run”, and will not “fall”.
The puzzle is still interesting to work on path finding algorithm, just not as fun as the description suggest.
A comment about the hardcoded 158 loop was made 5 years ago and it’s not been changed, so I’ve updated it to include a variable [[K]] for the number of tiles to be revealed.
The previous version stub was:
read W:int H:int
loop 158 read tileX:int tileY:int
write answer
Which is not the standard for puzzles and causes a EOF Error as the number of tiles is never 158.
The new version:
read W:int H:int
read K:int
loop K read tileX:int tileY:int
write answer
Oh. This breaks all previous solutions. But it looks like our only options are this or EOF…
I did not consider the other solutions when changing it to be honest… If you think it better to have the EOF and the solutions pass, I can revert my changes.
I just thought it strange to have an error in the stub and that 158 had no relevance to the puzzle given variable sized grids.
Let me know your thoughts and I can revert if you wish.
Don’t worry about it. I completely understand why you made the change. The author made an odd choice to hardcode the maximum number in order to fit the different cases, and really that shouldn’t have been done in the first place. It’s unfortunate your change breaks previous solutions, and might confuse future players looking at older published solutions. However, your change definitely makes the input structure more sensible going forward. I think we’ll just keep your change.
Missing tag