home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 9 / 09.iso / l / l196 / 3.ddi / CUBE.BA$ < prev    next >
Encoding:
Text File  |  1990-06-24  |  875 b   |  31 lines

  1. ' Define the macro string used to draw the cube
  2. ' and paint its sides:
  3. One$ =    "BR30 BU25 C1 R54 U45 L54 D45 BE20 P1,1    G20 C2 G20"
  4. Two$ =    "R54 E20 L54 BD5 P2,2 U5 C4 G20 U45 E20 D45 BL5 P4,4"
  5. Plot$ = One$ + Two$
  6.  
  7. APage% = 1    ' Initialize values for the active and visual
  8. VPage% = 0    ' pages as well as the angle of rotation.
  9. Angle% = 0
  10.  
  11. DO
  12.    SCREEN 7, , APage%, VPage% ' Draw to the active page
  13.                      ' while showing the visual page.
  14.  
  15.    CLS 1              ' Clear the active page.
  16.  
  17.    ' Rotate the    cube "Angle%" degrees:
  18.    DRAW    "TA" + STR$(Angle%) + Plot$
  19.  
  20.    ' Angle% is some multiple of    15 degrees:
  21.    Angle% = (Angle% + 15) MOD 360
  22.  
  23.    ' Drawing is complete, so make the cube visible in its
  24.    ' new position by switching the active and visual pages:
  25.    SWAP    APage%,    VPage%
  26.  
  27. LOOP WHILE INKEY$ = ""          ' A keystroke ends the program.
  28.  
  29. END
  30.  
  31.