|
1 |
| -## Step 1 |
| 1 | +A robot factory's test facility needs a program to verify robot movements. |
2 | 2 |
|
3 |
| -The robot factory manufactures robots that have three possible |
4 |
| -movements: |
| 3 | +The robots have three possible movements: |
5 | 4 |
|
6 | 5 | - turn right
|
7 | 6 | - turn left
|
8 | 7 | - advance
|
9 | 8 |
|
10 | 9 | Robots are placed on a hypothetical infinite grid, facing a particular
|
11 | 10 | direction (north, east, south, or west) at a set of {x,y} coordinates,
|
12 |
| -e.g., {3,8}. |
13 |
| - |
14 |
| -## Step 2 |
15 |
| - |
16 |
| -Robots can pivot left and right. |
17 |
| - |
18 |
| -The robot factory manufactures robots that have three possible |
19 |
| -movements: |
20 |
| - |
21 |
| -- turn right |
22 |
| -- turn left |
23 |
| -- advance |
24 |
| - |
25 |
| -The factory's test facility needs a program to verify robot movements. |
26 |
| - |
27 |
| -There are a number of different rooms of varying sizes, measured in |
28 |
| -Robot Units, the distance a robot moves when you instruct it to |
29 |
| -`advance`. |
30 |
| - |
31 |
| -The floor of the room is a grid, each square of which measures 1 square |
32 |
| -RU (Robot Unit). |
33 |
| - |
34 |
| -The rooms are always oriented so that each wall faces east, south, west, |
35 |
| -and north. |
36 |
| - |
37 |
| -The test algorithm is to place a robot at a coordinate in the room, |
38 |
| -facing in a particular direction. |
| 11 | +e.g., {3,8}, with coordinates increasing to the north and east. |
39 | 12 |
|
40 | 13 | The robot then receives a number of instructions, at which point the
|
41 | 14 | testing facility verifies the robot's new position, and in which
|
42 | 15 | direction it is pointing.
|
43 | 16 |
|
44 |
| -## Step 3 |
45 |
| - |
46 |
| -The robot factory manufactures robots that have three possible |
47 |
| -movements: |
48 |
| - |
49 |
| -- turn right |
50 |
| -- turn left |
51 |
| -- advance |
52 |
| - |
53 |
| -The robot factory's test facility has a simulator which can take a |
54 |
| -string of letters and feed this into a robot as instructions. |
55 |
| - |
56 | 17 | - The letter-string "RAALAL" means:
|
57 | 18 | - Turn right
|
58 | 19 | - Advance twice
|
|
0 commit comments