home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Black Box 4
/
BlackBox.cdr
/
proglang
/
ladybug1.arj
/
DEMO3.BUG
< prev
next >
Wrap
Text File
|
1991-01-13
|
3KB
|
137 lines
; demo3.bug
to "lasty
PU SETXY -250 -150 PD SETXY 250 -150
end
to "yline :SIZE
PU SETXY -250 :SIZE PD SETXY 250 :SIZE
IF :SIZE = -150 STOP
YLINE :SIZE - 20 HT
end
to "lastx
PU SETXY 250 150 PD SETXY 250 -150
end
to "xline :SIZE
PU SETXY :SIZE 150 PD SETXY :SIZE -150
IF :SIZE = 250 STOP
XLINE :SIZE + 20 HT
end
to "graph
PC 1 XLINE -250 LASTX YLINE 150 LASTY
PU HOME PD ST PC 3
end
to "y
PU SETXY -20 100
PD BK 10 FD 10 RT 45 FD 10 BK 10 LT 90
FD 10 PU HOME PD
end
to "x
PU SETXY 120 -20
PD RT 45 FD 10 BK 20 FD 10 RT 90 FD 10
BK 20 PU HOME PD
end
to "g :R
REPEAT 25 [D]
RT 90
REPEAT 15 [D]
end
to "start
HT DRAW CS
PR [Let's take a look at x-y coordinates.]
WAIT 5 CS
G 120 GRAPH
TYPE [The turtle is HOME at 0,0.]
WAIt 8 JB
end
to "wait :t
IF :T = 0 [stop]
WAIT :T - 0.1
end
to "d
RT 90 FD 10 LT 90 BK 5 FD 5 RT 90
FD 10 LT 90 FD 2 BK 7 FD 5
end
to "pr :LIST
PRINT :LIST
end
to "jb
PR [The X axis runs side to side,] WAIT 8
PR [each line is 20 steps apart.] WAIT 8
PR [The Y axis runs up and down,] WAIT 8
PR [each vertical line is 20 steps apart.] WAIT 8
PR [The X axis runs from -250 to the left,] WAIT 8
PR [to 250 on the right.] WAIT 8
PR [The Y axis runs from -150 below,] WAIT 8
PR [to 150 at the top of the screen.] WAIT 8
PR [Let's see how to set x-y coordinates.]
POS DRAW HT
SEE.IT
CLEARWS
LOAD "DEMO4
START
end
to "pos
DRAW ST
PR [SETXY 0 0 takes the turtle HOME.] WAIT 8
PR [SETX -100] SETX -100 WAIT 5
PR [SETY 100] SETY 100 WAIT 5
PR [SETXY 0 0] SETXY 0 0 WAIT 5
PR [SETXY 100 100] SETXY 100 100 WAIT 5
PR [SETY 0] SETY 0 WAIT 5
PR [SETX 0] SETX 0 WAIT 5
PR [You can even draw using] WAIT 8
PR [the coordinate commands.] WAIT 8
end
to "what :x
SETXY :X + 25 25 SETXY :X + 30 20
SETXY :X + 35 25 SETXY :X + 35 15
SETXY :X + 30 0 SETXY :X + 35 -10
SETXY :X + 30 -15 SETXY :X + 25 -5
SETXY :X + 25 -15 SETXY :X + 15 -15
SETXY :X + 5 -5 SETXY :X + 10 -15
SETXY :X + 0 -15
SETXY :X - 5 -5 SETXY :X - 5 -15
SETXY :X - 15 -15 SETXY :X - 10 -5
SETXY :X - 15 5 SETXY :X - 20 0
SETXY :X - 25 -10 SETXY :X - 30 -15
SETXY :X - 35 -15 SETXY :X - 40 -10
SETXY :X - 40 -5 SETXY :X - 35 -10
SETXY :X - 35 -10 SETXY :X - 30 -10
SETXY :X - 25 0 SETXY :X - 25 10
SETXY :X - 30 15 SETXY :X - 30 25
SETXY :X - 20 35 SETXY :X - 15 35
SETXY :X - 10 30 SETXY :X - 5 25
SETXY :X - 5 30 SETXY :X + 0 30
SETXY :X + 5 25 SETXY :X + 5 10
SETXY :X - 5 5 SETXY :X - 10 5
SETXY :X - 10 10 SETXY :X - 15 5
PU HOME PD
end
to "whatis :X
IF :X < -140 [STOP]
PU SETXY :X + 5 25 PD
WHAT :X
MAKE "X :X - 70
WHATIS :X
end
to "see.it
WHATIS 210
PR [The circus has come to town.] WAIT 8
end