|
<Interpret> |
|
The player is at row 1, column 5, and the goal is at row 1, column 1. |
|
There are 3 holes. They are at: row 1, column 3; row 2, column 3; row 5, column 4. |
|
<Action Plan> |
|
- Moving Left (L). The player is now at row 1, column 4. This grid is safe. |
|
- Moving Left (L). The player is now at row 1, column 3. This grid contains a hole! Revert this step - the player is still at row 1, column 4. |
|
- Replan: Moving Down (D). The player is now at row 2, column 4. This grid is safe. |
|
- Moving Down (D). The player is now at row 3, column 4. This grid is safe. |
|
- Moving Left (L). The player is now at row 3, column 3. This grid is safe. |
|
- Moving Left (L). The player is now at row 3, column 2. This grid is safe. |
|
- Moving Left (L). The player is now at row 3, column 1. This grid is safe. |
|
- Moving Up (U). The player is now at row 2, column 1. This grid is safe. |
|
- Moving Up (U). The player is now at row 1, column 1. This grid is the goal, so we stop here. |
|
<Verification> |
|
1. Left to row 1, column 4 (safe) |
|
2. Down to row 2, column 4 (safe) |
|
3. Down to row 3, column 4 (safe) |
|
4. Left to row 3, column 3 (safe) |
|
5. Left to row 3, column 2 (safe) |
|
6. Left to row 3, column 1 (safe) |
|
7. Up to row 2, column 1 (safe) |
|
8. Up to row 1, column 1 (safe) |
|
<Output> |
|
Action plan: L,D,D,L,L,L,U,U |