home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Media Share 9
/
MEDIASHARE_09.ISO
/
basic
/
lb09c.zip
/
TURTLE.BAS
< prev
next >
Wrap
BASIC Source File
|
1992-03-09
|
1KB
|
55 lines
' This is a turtle graphics demo
dim color$(4)
color$(1) = "red"
color$(2) = "green"
color$(3) = "yellow"
color$(4) = "blue"
print "Opening turtle.txt"
open "turtle.txt" for output as #turtleOut
print "Writing spiral data..."
print #turtleOut, "home"
print #turtleOut, "down"
print #turtleOut, "north"
print #turtleOut, "fill black"
for x = 1 to 200
print #turtleOut, "color "; color$(1 + x - int(x/4) * 4)
print #turtleOut, "turn 122"
print #turtleOut, "go "; str$(x*2)
next x
print "Closing turtle.txt" : print
close #turtleOut
print "Opening turtle.txt"
open "turtle.txt" for input as #turtleIn
print "Opening Graphics Window"
open "Turtle Graphics Example" for graphics_fs as #gWindow
print "Retrieving and plotting graphics..."
[nextLine]
input #turtleIn, text$
print #gWindow, text$
if eof(#turtleIn) = 0 then [nextLine]
print #gWindow, "flush"
input "Press 'Return' "; r$
print "Closing turtle.txt"
close #turtleIn
close #gWindow
print "Done."