Keep It Simple, Stupid | |
PerlMonks |
Challenge: Ricochet Robotsby LanX (Saint) |
on Feb 18, 2021 at 16:16 UTC ( [id://11128527]=perlmeditation: print w/replies, xml ) | Need Help?? |
Ricochet Robots is a board game about optimizing moves. (see wikipedia description) The 4 pieces represent the "robots" Blue, Yellow, Red and Green on a board with 16x16 cells and some walls. Rules: Each round one of the robots can be moved horizontally or vertically, and does not stop until it reaches an obstacle - either a wall or another robot. E.G. in this example the Yellow on B14 can only reach A14 or B16 in one move, and nothing in between. You can only move one robot per round. The object of the game is to bring one specific robot to an indicated target (here C9 marked with * ) using as few moves as possible. (Since the goal has no neighboring wall you'll need to position other robots as obstacles nearby to reach it)
Question:
Bonus question:If you are still bored...
CarefulI do have a script I wrote 16 years ago. It needed over an hour back than and runs today in 1:30 min on my laptop, so it's solvable within the given margin. :) But it took me two days to write it, and you might run into memory problems.
FUNI had a lot back then, and learned a lot. Hope you too ... :)
Cheers Rolf
Editsadded some clarifications and links
UPDATEhere the positions of the walls (yes strings as non-strict barewords, this script is old)
UPDATEIt's specifically requested to bring Yellow on target, the first version was misleading, sorry.
Back to
Meditations
|
|