home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
AMOS PD CD
/
amospdcd.iso
/
totallyamos
/
issue3
/
source_progs
/
recursion2.amos
/
recursion2.amosSourceCode
Wrap
AMOS Source Code
|
1991-07-30
|
2KB
|
61 lines
'===================================================================
'
'DATE: 23/02/92
'TIME: 21:31
'NAME: RECURSION2.AMOS
'CODE: UNCLE SIME
'NOTE: SIMPLE EXAMPLE OF RECURSION. SEE TUTORIAL RECURTION.DOC
'
'===================================================================
' * MODULE LEVEL CODE *
'===================================================================
'
MAIN
End
'
'===================================================================
' * PROCEDURE LEVEL CODE *
'===================================================================
'
Procedure MAIN
'
' This procedure sets up the environment, initialises strings etc,
' prints text messages, performs the initial call to procedure BACKCOUNT.
'
Screen Open 0,320,200,2,Lowres
SET_SCREEN
Locate 7,10
Centre "COUNTING BACKWARDS FROM 15 TO 0"
Locate 7,11
Centre "-------------------------------"
Locate 0,16
BACKCOUNT[0]
Locate ,22
Centre "Press A Key To End"
Wait Key
End Proc
'
Procedure BACKCOUNT[COUNT]
'
' This procedure performs the recursive bit (see tutorial)
' I would recomend that you run this with the follow command
' below active (take out the ') and watch what happens, this
' will help you understand what is happening.
'
' follow count
If COUNT<15
BACKCOUNT[COUNT+1]
End If
Print COUNT;
End Proc
'
Procedure SET_SCREEN
'
' Yeh old procedure to set environment
'
Flash Off
Curs Off
Hide On
Cls 0
Colour 1,$FFF
End Proc