home *** CD-ROM | disk | FTP | other *** search
/ AMOS PD CD / amospdcd.iso / 451-475 / apd453 / city-square.amos / city-square.amosSourceCode
AMOS Source Code  |  1993-01-08  |  734b  |  33 lines

  1. ' Robert Farnsworth. 
  2. ' Speed Comparison: (before I AMOSed it) 
  3. ' GFA Basic  - 17.8 sec  
  4. ' AMOS1.2    - 14.6 sec
  5. ' AMOS1.3    - 12.8 sec  
  6. ' Compiled   -  6.8
  7. ' AmigaBasic - NA (Can't do recursion) 
  8. Screen Open 0,640,256,4,Hires
  9. Colour 0,$EAF
  10. Flash Off : Curs Off : Cls 0
  11. S=Timer
  12. GRID[320,128,400,6]
  13. Print(Timer-S)/50.0
  14. End 
  15. Procedure GRID[X,Y,S,L]
  16.    If L>0
  17.       SQUARE[X,Y,S]
  18.       ' top left 
  19.       GRID[X-S/4,Y-S/8,S/2-4,L-1]
  20.       ' top right
  21.       GRID[X+S/4,Y-S/8,S/2-4,L-1]
  22.       ' bottom left
  23.       GRID[X-S/4,Y+S/8,S/2-4,L-1]
  24.       ' bottom right 
  25.       GRID[X+S/4,Y+S/8,S/2-4,L-1]
  26.    End If 
  27. End Proc
  28. Procedure SQUARE[X,Y,SIDE]
  29.    Shared C
  30.    Add C,1,1 To 3
  31.    Ink C
  32.    Box X-SIDE/2,Y-SIDE/4 To X+SIDE/2,Y+SIDE/4
  33. End Proc