-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdefinedTrackSolution.txt
68 lines (60 loc) · 2.22 KB
/
definedTrackSolution.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
Generate a JSON object containing directions for a robot to navigate a 6x4 grid room, avoiding obstacles to reach specific coordinates.
Return in JSON format a list of steps for a robot that only accepts the commands UP/DOWN/LEFT/RIGHT.
- RIGHT changes the position to (x+1,y)
- LEFT changes the position to (x-1,y)
- UP changes the position to (x,y+1)
- DOWN changes the position to (x,y-1)
- the robot starts at the position (3,0)
- the robot must go to the target (3,5) avoiding the obstacles
- NEVER move the robot to coordinates with obstacles: (0,1), (2,1), (3,1), (1,3), (2,3).
- UNDER NO CIRCUMSTANCES should the robot move outside the 6x4 grid room.
- before generating JSON list your thoughts including the current robot position, the available moves and their outcomes
- don't produce any markdown formatting
- ALWAYS wrap the output JSON in the <RESULT> </RESULT>
Grid coordinates:
(0,0) (0,1) (0,2) (0,3) (0,4) (0,5)
(1,0) (1,1) (1,2) (1,3) (1,4) (1,5)
(2,0) (2,1) (2,2) (2,3) (2,4) (2,5)
(3,0) (3,1) (3,2) (3,3) (3,4) (3,5)
R = Robot (3,0)
O = Obstacle (0,1), (2,1), (3,1), (1,3), (2,3)
T = Target (3,5)
path to the target: (2,0), (1,0), (1,1), (1,2), (2,2), (3,2), (3,3), (3,4), (3,5)
OUTPUT:
place for thoughts
<RESULT>
{
"steps": "Comma-separated directions"
}
</RESULT>
Thoughts example for the three moves:
1:
robot position: (3,0)
possible moves:
UP (2,0): ok - on the path to the target
DOWN (4,0): no - moves outside the grid
LEFT (3,-1): no - moves outside the grid
RIGHT (3,1): no - moves into the obstacle (3,1)
path remaining: (2,0), (1,0), (1,1), (1,2), (2,2), (3,2), (3,3), (3,4), (3,5)
selected move: UP
new robot position: (2,0)
2:
robot position: (2,0)
possible moves:
UP (1,0): ok - on the path to the target
DOWN (3,0): ok - already visited
LEFT (2,-1): no - moves outside the grid
RIGHT (2,1):no - moves into the obstacle (2,1)
path remaining: (1,0), (1,1), (1,2), (2,2), (3,2), (3,3), (3,4), (3,5)
selected move: UP
new robot position: (1,0)
3:
robot position: (1,0)
possible moves:
UP (0,0): ok
DOWN (2,0): ok - already visited
LEFT (1,-1): no - moves outside the grid
RIGHT (1,1): ok - on the path to the target
path remaining: (1,1), (1,2), (2,2), (3,2), (3,3), (3,4), (3,5)
selected move: RIGHT
new robot position: (1,1)