@@ -152,26 +152,33 @@ Note that the Block World interpreter will automatically output the initial and
152
152
<a name =" program " />
153
153
## Sample Program:
154
154
```
155
- WORLD proj2(5,5):
155
+ /**
156
+ Dylan Jager-Kujawa and Matt Richardson
157
+ Block World Sample Input
158
+ */
159
+
160
+ WORLD proj2(5,6): // Declare world with dimensions 5x5
156
161
BLOCKS {
157
- var1(1,1);
158
- var2(1,2);
159
- var3(2,4);
160
- arm();
162
+ var1(1,1); // var1 declaration
163
+ var2(1,2); // var2 declaration
164
+ var3(2,4); // var3 declaration
165
+ arm(); // Default arm location = (1,1)
161
166
};
162
167
MOVES [
163
- MOVE(1,1);
164
- GRAB(var1);
165
- MOVE(2,2);
166
- DROP;
167
- MOVE(1,2);
168
- GRAB(var2);
169
- MOVE(2,2);
170
- STACK;
171
- //Errors:
172
- UNSTACK(var1); //ERROR: var 1 not at top of stack
173
- MOVE(6,5); //ERROR: (6,5) not located within proj2
174
- DROP; //ERROR: not holding anything
168
+ MOVE(1,1); // Move arm to (1,1) (unnecessary)
169
+ GRAB(var1); // Pickup var1
170
+ MOVE(2,2); // Move arm to (2,2)
171
+ DROP; // Drop var1
172
+ MOVE(1,2); // Move arm to (1,2)
173
+ GRAB(var2); // Pickup var2
174
+ MOVE(2,2); // Move arm to (2,2)
175
+ STACK; // Stack var2 on var1
176
+ /*
177
+ Errors:
178
+ UNSTACK(var1); //ERROR: var 1 not at top of stack
179
+ MOVE(6,5); //ERROR: (6,5) not located within proj2
180
+ DROP; //ERROR: not holding anything
181
+ */
175
182
];
176
183
```
177
184
0 commit comments