home *** CD-ROM | disk | FTP | other *** search
/ Media Share 9 / MEDIASHARE_09.ISO / basic / lb09c.zip / BUTTONS.BAS < prev    next >
BASIC Source File  |  1993-01-24  |  1KB  |  81 lines

  1.  
  2.     ' This is a turtle graphics demo
  3.  
  4.     size$ = "100"
  5.     size = val(size$)
  6.     color$ = "black"
  7.  
  8.     button #1, Triangle, [triangle], LR, 158, 5
  9.     button #1, Square, [square], LR, 97, 5
  10.     button #1, Size, [size], LR, 52, 5
  11.     button #1, Quit, [quit], LR, 7, 5
  12.     button #1, Red, [colorRed], UL, 5, 5
  13.     button #1, Blue, [colorBlue], UL, 42, 5
  14.     button #1, Green, [colorGreen], UL, 87, 5
  15.     open "This is a turtle graphics window!" for graphics as #1
  16.  
  17.     print"Press one of the buttons in the graphics window"
  18.  
  19. [loop]
  20.     input a$
  21.     goto [loop]
  22.  
  23.  
  24. [triangle]
  25.  
  26.     print #1, "color "; color$
  27.     print #1, "cls ; home ; down ; north"
  28.  
  29.     for x = 1 to size
  30.         print #1, "turn 122 ; go "; str$(x*2)
  31.     next x
  32.  
  33.     print #1, "flush"
  34.     goto [loop]
  35.  
  36.  
  37. [square]
  38.  
  39.     print #1, "color "; color$
  40.     print #1, "cls ; home ; down ; north"
  41.  
  42.     for x = 1 to size
  43.         print #1, "turn 88 ; go "; str$(x*2)
  44.     next x
  45.  
  46.     print #1, "flush"
  47.     goto [loop]
  48.  
  49.  
  50. [colorRed]
  51.  
  52.     color$ = "red"
  53.     goto [loop]
  54.  
  55.  
  56. [colorBlue]
  57.  
  58.     color$ = "blue"
  59.     goto [loop]
  60.  
  61.  
  62. [colorGreen]
  63.  
  64.     color$ = "green"
  65.     goto [loop]
  66.  
  67. [size]
  68.  
  69.     prompt "What size figure?"; size$
  70.     size = val(size$)
  71.     if size < 1 then beep : goto [size]
  72.     goto [loop]
  73.  
  74.  
  75. [quit]
  76.     confirm "Do you want to quit?"; quit$
  77.     if quit$ = "no" then [loop]
  78.     close #1
  79.     end
  80.  
  81.