home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Black Box 4
/
BlackBox.cdr
/
proglang
/
ladybug1.arj
/
ROBOT.BUG
< prev
next >
Wrap
Text File
|
1991-01-13
|
933b
|
57 lines
;robot.bug
to "abs :N
IF :N <0 THEN OUTPUT 0 - :N
OUTPUT :N
end
to "quit
TOPLEVEL
end
to "readkey
IF KEYP THEN OUTPUT READCHAR
OUTPUT "FALSE
end
to "yes.master
MAKE "C READKEY
IF :C = "R THEN RIGHT 30
IF :C = "L THEN LEFT 30
IF :C = "U THEN PENUP
IF :C = "D THEN PENDOWN
IF :C = "Q THEN QUIT
IF :C = "S THEN MAKE "SPEED :SPEED + 2
end
to "driveb
FORWARD :SPEED
IF ( ABS XCOR ) > 240 THEN RIGHT 120
IF ( ABS YCOR ) > 140 THEN RIGHT 120
YES.MASTER
DRIVEB
end
to "start
DRAW ST pc 3 bg 0 pd
SETH 30
MAKE "SPEED 5
DRIVEB
end
to "help
print [type R to go right]
print [type L to go left]
print [type U for pen up]
print [type D for pen down]
print [type S to speed up]
print [type Q to quit]
print [type start to begin]
print [hint: turn on CAPS LOCK to play]
end
make "speed "'35
make "c "'FALSE
make "description [drive a turtle (type help)]
print :description