预定/报价
数据结构代写 | CSCI-1200 Data Structures — Spring 2020
数据结构代写 | CSCI-1200 Data Structures — Spring 2020
yet2024-07-28 17:52:48
这个作业是完成机器人的弹跳问题
CSCI-1200 Data Structures — Spring 2020
Homework 6 — Ricochet Robots Recursion
Your task for this homework is to solve robot movement puzzles using the technique of recursion. This
homework is inspired by the board game “Ricochet Robots”:
http://en.wikipedia.org/wiki/Ricochet_Robot
http://riograndegames.com/Game/163-Ricochet-Robots
Understanding the non-linear word search program from Lecture 12 will be helpful in thinking about how
you will solve this type of problem. We strongly urge you to study and play with that program, including
tracing through its behavior using a debugger or cout statements or both. Please carefully read the entire
assignment and study the provided code before beginning your implementation.
You will be given a two-dimensional play space and one or more robots that move around within the space.
Each robot has a starting position on the board and moves by sliding in the 4 primary directions: north,
east, south, or west. The input file will also specify one or more goal locations that must be simultaneously
occupied by robots to “solve” the puzzle. The challenge is to navigate the robots to the goal position(s)
in the fewest total moves. The catch is that when a robot is directed to move, it continues to slide until
it bumps into either a wall or another robot. To solve the puzzle, the robot must come to rest on the goal
position. It does not count as a solution if the robot simply slides over and past the goal location. The input
file will indicate that either a specific robot must reach the goal, or that the puzzle can be solved with any
robot at that goal. First, let’s look at a sample input file, puzzle1.txt.