home *** CD-ROM | disk | FTP | other *** search
- to "poly :d :a
- forward :d
- right :a
- poly :d :a
- end
-
- to "drive
- FORWARD 5
- YES.MASTER
- DRIVE
- 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
-
- make "c "'FALSE
- to "readkey
- IF KEYP THEN OUTPUT READCHAR
- OUTPUT "FALSE
- end
-
- to "quit
- TOPLEVEL
- end
-
- to "abs :N
- IF :N <0 THEN OUTPUT :N
- OUTPUT :N
- end
-
- to "drivea
- FORWARD 5
- IF ABS XCOR > 200 THEN RIGHT 120
- IF ABS YCOR > 100 THEN RIGHT 120
- DRIVEA
- end
-
- to "and :a :b
- if :a = "true [output :b = "true]
- output "false
- end
-
- to "or :a :b
- if :a = "true [output "true]
- output :b = "true
- end
-
- to "while :condition :list
- if ( run :condition ) = "false then stop
- run :list
- while :condition :list
- end
-
- to "forever :list
- repeat 32000 :list
- forever :list
- end
-
- to "xor :a :b
- if :a = "true [output :b = "false]
- output :b = "true
- end
-
- to "wait :seconds
- tone 32000 20 * :seconds
- tone 32000 1 ;above times the wait; this makes us wait
- end
-
- to "max :a :b
- if :a > :b [output :a]
- output :b
- end
-
- to "min :a :b
- if :a > :b [output :b]
- output :a
- end
-
- to "start
- SETH 30
- MAKE "SPEED 5
- DRIVEB
- end
-
- to "driveb
- FORWARD :SPEED
- YES.MASTER
- DRIVEB
- end
-
- make "speed "'35
- to "start
- SETH 30
- MAKE "SPEED 5
- DRIVEB
- en