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