home *** CD-ROM | disk | FTP | other *** search
- C >TCIRCLES a Fortran77 version of the BASIC V program Tcircles
- C K.M.CRENNELL 16 November 1991
- INTEGER GetMod
- M=0
- C M is MODE
- 50 CALL MODE (M )
- CALL Getcls(M,K)
- CALL TAB(0,0)
- PRINT *,' Mode ',M,' has ',K,' colours'
- IH=1020
- Marg=32
- ID=32
- C set the radius depending on no of colours K, ID is distance between circles
- IR=0.5*(IH-2*Marg-ID*(K-1))/K
- IX=Marg
- IY=IH/2
- IDX=2*IR+ID
- DO 60 N=1, K, 1
- CALL GCOL(0,N)
- C set the colour ignore zero because it is black
- C MOVE IX+IR,IY these are the calls for drawing circles
- C PLOT153,IR,0 on the BBC Master
- CALL CIRCLE(IX+IR,IY,IR,.TRUE.)
- IX=IX+IDX
- 60 CONTINUE
- M=GetMod()
- CALL CLS
- IF (M.GE.0) GOTO 50
- STOP
- END
- SUBROUTINEGetcls(M,K)
- C find out the number of colours K for Mode M
- DIMENSION KOLS(0:2)
- C storage for number of colours for each mode used
- K=2
- KOLS(0)=1
- KOLS(1)=3
- KOLS(2)=7
- C should be 16 but 8 are flashing and 0 not included
- IF (M.LT.0 .OR. M.GT.2 )THEN
- K=-1
- ELSE
- K=KOLS(M)
- ENDIF
- RETURN
- END
- INTEGER FUNCTION GetMod()
- C function to ask for another MODE
- 330 PRINT*,' Enter next Mode. 0=< Mode <3 or - to stop'
- IA=IGET()
- C accept only expected numbers or -
- IF (INDEX('-012',CHAR(IA)).EQ.0) GOTO330
- GetMod=IA-48
- RETURN
- END
-