home *** CD-ROM | disk | FTP | other *** search
-
- PROC stone at (INT CONST x, STRUCT (INT start, end) CONST y):
- INT VAR i;
- FOR i FROM y.start UPTO y.end
- REP stone at (x, i)
- ENDREP
- ENDPROC stone at;
-
- PROC stone at (STRUCT (INT start, end) CONST x, INT CONST y):
- INT VAR i;
- FOR i FROM x.start UPTO x.end
- REP stone at (i, y)
- ENDREP
- ENDPROC stone at;
-
- PROC stone at (INT CONST x, y):
- xpos := x;
- ypos := y;
- corner [xpos] [ypos] := stone;
- set cursor;
- put ("X")
- ENDPROC stone at;
-
- PROC karel at (INT CONST x, y):
- xpos := x;
- ypos := y;
- place karel on corner
- ENDPROC karel at;
-
- PROC beeper at (INT CONST x, y):
- xpos := x;
- ypos := y;
- corner [xpos] [ypos] := ball;
- set cursor;
- put ("o")
- ENDPROC beeper at;
-
- start obstruction:
- page;
- disappear karel.
-
- make stairs:
- start obstruction;
- stone at ([7, 9], 1);
- stone at (9, 2);
- stone at (10, [2, 4]);
- stone at ([11, 13], 4);
- stone at (13, [5, 6]);
- stone at ([14, 16], 6);
- stone at ([16, 18], 5);
- stone at (18, 4);
- stone at ([18, 21], 3);
- stone at (21, 2);
- stone at ([21, 24], 1);
- beeper at (23, 2);
- karel at (1, 1).
-
- make labyrinth:
- start obstruction;
- stone at ([8, 10], 3);
- stone at ([3, 6], 5);
- stone at ([10, 15], 5);
- stone at ([7, 10], 7);
- stone at ([5, 10], 9);
- stone at ([12, 13], 9);
- stone at ([12, 13], 10);
- stone at ([9, 10], 11);
- stone at ([6, 7], 12);
- stone at ([9, 10], 12);
- stone at ([12, 13], 12);
- stone at ([4, 8], 14);
- stone at ([10, 14], 14);
- stone at ([3, 8], 16);
- stone at ([10, 15], 16);
- stone at (3, [6, 9]);
- stone at (3, [11, 15]);
- stone at (5, 6);
- stone at (5, 8);
- stone at (5, [11, 12]);
- stone at (7, [3, 5]);
- stone at (7, [10, 11]);
- stone at (8, 5);
- stone at (8, [15, 17]);
- stone at (10, 6);
- stone at (10, 13);
- stone at (10, 17);
- stone at (11, [3, 4]);
- stone at (12, [6, 7]);
- stone at (13, 11);
- stone at (14, 7);
- stone at (15, [6, 15]);
- beeper at (10, 18);
- karel at (9, 4).
-
- make house:
- start obstruction;
- stone at ([11, 16], 5);
- stone at (16, [6, 15]);
- stone at ([11, 15], 15);
- stone at (11, [12, 14]);
- stone at ([9, 10], 12);
- stone at ([9, 11], 10);
- stone at (11, [5, 9]);
- beeper at (10, 8);
- karel at (12, 6);
- turn left.
-