home *** CD-ROM | disk | FTP | other *** search
AMOS Source Code | 1993-06-16 | 2.2 KB | 114 lines |
- ' ---------------------------------
- '
- ' AMOSPro Compiler Example
- '
- ' Recursive Fractal Drawing
- '
- ' By Jean-Baptiste BOLCATO
- '
- ' (c) 1993 Europress Software Ltd.
- '
- ' ---------------------------------
- '
- '
- ' --------------------------------------------
- ' Remark: A quadratic circlar fractal
- '
- ' Average Acceleration: 200 %
- '
- ' Test configuration: A1200, 6Mb
- '
- ' Original AMOS Compiler: 175 %
- ' --------------------------------------------
- ' ---- Screen Inits ----
- Screen Open 0,208,200,8,Lowres
- Screen Display 0,180,45,,
- Curs Off : Cls 0 : Flash Off : Hide
- For I=0 To 15 : Colour I,$222*I : Next I
- ' ---- Let's Go!! ----
- Timer=0
- CALC_EXT[100,100,32,0]
- T#=Timer
- Get Bob 1,0,0 To 100,100
- Paste Bob 100,100,1
- Get Bob 1,0,100 To 100,200
- Paste Bob 100,0,1
- Get Bob 1,100,0 To 200,100
- Paste Bob 0,100,1
- Get Bob 1,100,100 To 200,200
- Paste Bob 0,0,1
- Erase 1
- ' --- Final Report ---
- Home : Paper 0 : Pen 7
- Print " < Needs";T#/50;" seconds. >"
- Print " ( =";T#;" VBLs ) "
- Print
- Print " Press mouse key to end"
- Repeat
- Wait 1
- Until Mouse Key or(Inkey$<>"")
- End
- ' --- Recursive Fractal procedures ---
- Procedure CALC_EXT[X,Y,R,T]
- _INK[R] : Ink Param
- Circle X,Y,R
- If R=1 : Pop Proc : End If
- R2=R/2
- R3=R+R2+1
- ' o
- 'oOo
- '---
- If T=1
- CALC_EXT[X-R3,Y,R2,4]
- CALC_EXT[X,Y-R3,R2,1]
- CALC_EXT[X+R3,Y,R2,2]
- End If
- '|o
- '|Oo
- '|o
- If T=2
- CALC_EXT[X,Y-R3,R2,1]
- CALC_EXT[X+R3,Y,R2,2]
- CALC_EXT[X,Y+R3,R2,3]
- End If
- '---
- 'oOo
- ' o
- If T=3
- CALC_EXT[X-R3,Y,R2,4]
- CALC_EXT[X+R3,Y,R2,2]
- CALC_EXT[X,Y+R3,R2,3]
- End If
- ' o|
- 'oO|
- ' o|
- If T=4
- CALC_EXT[X,Y+R3,R2,3]
- CALC_EXT[X-R3,Y,R2,4]
- CALC_EXT[X,Y-R3,R2,1]
- End If
- ' o
- 'oOo
- ' o
- If T=0
- CALC_EXT[X,Y-R3,R2,1]
- CALC_EXT[X+R3,Y,R2,2]
- CALC_EXT[X,Y+R3,R2,3]
- CALC_EXT[X-R3,Y,R2,4]
- End If
-
- R2=R2/2
- If R2=0 : Pop Proc : End If
- CALC_EXT[X,Y-R+R2+1,R2,3]
- CALC_EXT[X+R-R2-1,Y,R2,4]
- CALC_EXT[X,Y+R-R2-1,R2,1]
- CALC_EXT[X-R+R2+1,Y,R2,2]
-
- End Proc
- Procedure _INK[R]
- I=0
- Repeat
- R=R/2
- I=I+1
- Until R=0
- End Proc[I]