Question: I need help solving this question. It should be pseudocode rather than any particular coding language. 12. Racetrack (also known as Graph Racers and Vector


I need help solving this question. It should be pseudocode rather than any particular coding language.
12. Racetrack (also known as Graph Racers and Vector Rally) is a two-player paper-and-pencil racing game that Jeff played on the bus in sth grade. The game is played with a track drawn on a sheet of graph paper. The players alternately choose a sequence of grid points that represent the motion of a car around the track, subject to certain constraints explained below Each car has a position and a velocity, both with integer x- and y-coordinates. A subset of grid squares is marked as the starting area, and another subset is marked as the finishing area. The initial position of each car is chosen by the player somewhere in the starting area; the initial velocity of each car is always (0,0). At each step, the player optionally increments or decrements either or both coordinates of the car's velocity; in other words, each component of the velocity can change by at most 1 in a single step. The car's new position is then determined by adding the new velocity to the car's previous position. The new position must be inside the track; otherwise, the car crashes and that player loses the race. The race ends when the first car reaches a position inside the finishing area. The actual game is a bit more complicated than the version descrbed here. See http://harmmade.com/vectorracer/ for an excellent online version 12 12. Racetrack (also known as Graph Racers and Vector Rally) is a two-player paper-and-pencil racing game that Jeff played on the bus in sth grade. The game is played with a track drawn on a sheet of graph paper. The players alternately choose a sequence of grid points that represent the motion of a car around the track, subject to certain constraints explained below Each car has a position and a velocity, both with integer x- and y-coordinates. A subset of grid squares is marked as the starting area, and another subset is marked as the finishing area. The initial position of each car is chosen by the player somewhere in the starting area; the initial velocity of each car is always (0,0). At each step, the player optionally increments or decrements either or both coordinates of the car's velocity; in other words, each component of the velocity can change by at most 1 in a single step. The car's new position is then determined by adding the new velocity to the car's previous position. The new position must be inside the track; otherwise, the car crashes and that player loses the race. The race ends when the first car reaches a position inside the finishing area. The actual game is a bit more complicated than the version descrbed here. See http://harmmade.com/vectorracer/ for an excellent online version 12
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
