File size: 1,124 Bytes
45f037d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<Interpret>
The player is at row 5, column 3, and the goal is at row 3, column 8.
There are 9 holes. They are at: row 1, column 1; row 1, column 6; row 1, column 8; row 3, column 5; row 3, column 7; row 4, column 3; row 6, column 2; row 7, column 1; row 8, column 1.
<Action Plan>
- Moving Right (R). The player is now at row 5, column 4. This grid is safe.
- Moving Right (R). The player is now at row 5, column 5. This grid is safe.
- Moving Right (R). The player is now at row 5, column 6. This grid is safe.
- Moving Right (R). The player is now at row 5, column 7. This grid is safe.
- Moving Right (R). The player is now at row 5, column 8. This grid is safe.
- Moving Up (U). The player is now at row 4, column 8. This grid is safe.
- Moving Up (U). The player is now at row 3, column 8. This grid is the goal, so we stop here.
<Verification>
1. Right to row 5, column 4 (safe)
2. Right to row 5, column 5 (safe)
3. Right to row 5, column 6 (safe)
4. Right to row 5, column 7 (safe)
5. Right to row 5, column 8 (safe)
6. Up to row 4, column 8 (safe)
7. Up to row 3, column 8 (goal)
<Output>
Action plan: R,R,R,R,R,U,U