-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpuzzle-4.js
More file actions
33 lines (29 loc) · 826 Bytes
/
Copy pathpuzzle-4.js
File metadata and controls
33 lines (29 loc) · 826 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
// 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
down();
down();
down();
down();
right();
getColor();
var color = getColor();
down();
setColor(color);
right();
right();
right();
up();
getColor();
var color2 = getColor();
down();
setColor(color2);
right();
right();