-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpuzzle-5.js
More file actions
35 lines (30 loc) · 799 Bytes
/
Copy pathpuzzle-5.js
File metadata and controls
35 lines (30 loc) · 799 Bytes
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
// Help Rudy the Red Dot collect all the green dots!
// Control Rudy with the following commands:
// up(); -- moves Rudy up one square
// down(); -- ...down one square
// left(); -- ...left one square
// right(); -- ...right one square
// Interact with Rudy's environment using the following commands:
// remainingDots(); -- returns the number of green dots remaining
// getColor(); -- returns the color of Rudy's square
// setColor(color); -- changes the color of Rudy's square, opens gates if colors match
function BluePink()
{
if(getColor()=="blue")
{
down();
}
else
{
up();
}
right();
right();
}
right();
right();
BluePink();
BluePink();
BluePink();
right();
right();