home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
AMOS PD CD
/
amospdcd.iso
/
451-475
/
apd453
/
city-square.amos
/
city-square.amosSourceCode
Wrap
AMOS Source Code
|
1993-01-08
|
734b
|
33 lines
' Robert Farnsworth.
' Speed Comparison: (before I AMOSed it)
' GFA Basic - 17.8 sec
' AMOS1.2 - 14.6 sec
' AMOS1.3 - 12.8 sec
' Compiled - 6.8
' AmigaBasic - NA (Can't do recursion)
Screen Open 0,640,256,4,Hires
Colour 0,$EAF
Flash Off : Curs Off : Cls 0
S=Timer
GRID[320,128,400,6]
Print(Timer-S)/50.0
End
Procedure GRID[X,Y,S,L]
If L>0
SQUARE[X,Y,S]
' top left
GRID[X-S/4,Y-S/8,S/2-4,L-1]
' top right
GRID[X+S/4,Y-S/8,S/2-4,L-1]
' bottom left
GRID[X-S/4,Y+S/8,S/2-4,L-1]
' bottom right
GRID[X+S/4,Y+S/8,S/2-4,L-1]
End If
End Proc
Procedure SQUARE[X,Y,SIDE]
Shared C
Add C,1,1 To 3
Ink C
Box X-SIDE/2,Y-SIDE/4 To X+SIDE/2,Y+SIDE/4
End Proc