' ********************** USO DEI SOTTOPROGRAMMI --SUB-- ********************
'************************ FUNZIONI GRAFICHE ECCETTO DRAW ********************
' Parte delle dichiarazioni
' Dichiaro le SUB cioŠ i sottoprogrammi
SCREEN 9 'pongo lo schermo in modalit… grafica
' Qui inizia il programma che chiama le varie SUB
Inizializza
CerchiVuoti
Inizializza
CerchiPieni
Inizializza
ArchiVuoti
Inizializza
FetteVuote
Inizializza
FettePiene
Inizializza
EllisseOrizzontaleVuota
Inizializza
EllisseOrizzontalePiena
Inizializza
EllisseVerticaleVuota
Inizializza
EllisseVerticalePiena
Inizializza
ArchiEllisseOrizzontale
Inizializza
FetteVuoteEllisseOrizzontale
Inizializza
FettePieneEllisseOrizzontale
Inizializza
ArchiEllisseVerticale
Inizializza
FetteVuoteEllisseVerticale
Inizializza
FettePieneEllisseVerticale
' do il messaggio Finale
LOCATE 23, 23:
PRINT "Premere un tasto per terminare..." contatore% = 0 'inizializzo contatore%
SUB ArchiEllisseOrizzontale
' ArchiEllisseOrizzontale
' creo un cerchio colorato
CIRCLE (350, 175), 220 - (10 * contatore%
), contatore%
, tot
, contatore%
MOD 7, .5 Aspetta tot
SUB ArchiEllisseVerticale
'Archi di ellisse ad asse maggiore verticale
' creo un cerchio colorato
CIRCLE (350, 215), 220 - (10 * contatore%
), contatore%
, tot
, (contatore%
MOD 7), -1 Aspetta tot
'archi vuoti
' creo un cerchio colorato
CIRCLE (350, 175), 220 - (10 * contatore%
), contatore%
, tot
, contatore%
MOD 7 Aspetta tot
' cerchi pieni
' creo un cerchio colorato
CIRCLE (350, 175), 220 - (10 * contatore%
), contatore%
' dipingo l'interno del cerchio
PAINT (350, 175), contatore%
, contatore%
Aspetta tot
'cerchi vuoti
' creo un cerchio colorato
CIRCLE (350, 175), 220 - (10 * contatore%
), contatore%
Aspetta tot
SUB EllisseOrizzontalePiena
'ellissi piene ad asse maggiore orizzontale
' creo un cerchio colorato
CIRCLE (350, 175), 220 - (10 * contatore%
), contatore%
, , , .5 ' dipingo l'interno del cerchio
PAINT (350, 175), contatore%
, contatore%
Aspetta tot
SUB EllisseOrizzontaleVuota
' ellissi vuote ad asse maggiore orizzontale
' creo un cerchio colorato
CIRCLE (350, 175), 220 - (10 * contatore%
), contatore%
, , , .5 Aspetta tot
SUB EllisseVerticalePiena
' ellissi piene ad asse maggiore verticale
' creo un cerchio colorato
CIRCLE (350, 175), 220 - (10 * contatore%
), contatore%
, , , -4 ' dipingo l'interno del cerchio
PAINT (350, 175), contatore%
, contatore%
Aspetta tot
SUB EllisseVerticaleVuota
' ellissi vuote ad asse maggiore verticale
' creo un cerchio colorato
CIRCLE (350, 175), 220 - (10 * contatore%
), contatore%
, , , -4 Aspetta tot
' aree di cerchio o fette di torta piene
' creo un cerchio colorato
CIRCLE (350, 175), 220 - (10 * contatore%
), contatore%
, -.3, -(contatore%
MOD 5) - tot
' coloro l'area
PAINT (370, 155), contatore%
, contatore%
Aspetta tot
SUB FettePieneEllisseOrizzontale
' Fette di torta di ellisse orizzontale piene
' creo un cerchio colorato
CIRCLE (350, 175), 220 - (10 * contatore%
), contatore%
, -tot
, -(contatore%
MOD 2) + -2.5, .5 ' coloro l'interno della fetta
PAINT (360, 170), contatore%
, contatore%
Aspetta tot
SUB FettePieneEllisseVerticale
' Fette di torta di ellisse orizzontale piene
' creo un cerchio colorato
CIRCLE (350, 215), 220 - (10 * contatore%
), contatore%
, -tot
, -(contatore%
MOD 2) + -2.5, -1 ' coloro l'interno della fetta
PAINT (360, 210), contatore%
, contatore%
' aree di cerchio o fette di torta vuote
' creo un cerchio colorato
CIRCLE (350, 175), 220 - (10 * contatore%
), contatore%
, -.3, -(contatore%
MOD 5) - tot
Aspetta tot
SUB FetteVuoteEllisseOrizzontale
' Fette di torta di ellisse vuote
' creo un cerchio colorato
CIRCLE (350, 175), 220 - (10 * contatore%
), contatore%
, -tot
, -(contatore%
MOD 7) - tot
, .5 Aspetta tot
SUB FetteVuoteEllisseVerticale
' Fette di torta di ellisse orizzontale vuote
' creo un cerchio colorato
CIRCLE (350, 215), 220 - (10 * contatore%
), contatore%
, -tot
, -(contatore%
MOD 2) + -2.5, -1 Aspetta tot
' do il messaggio
contatore% = 0 'inizializzo contatore%
' creo una linea dall'angolo in alto a sinistra a quello in basso a destra
LINE (1 + 10 * contatore%
, 1)-(640 + contatore%
, 350), contatore%
Aspetta tot
NEXT 'contatore% 'qui finisce il ciclo FOR...NEXT
' rettangoli pieni
' creo un rettangolo pieno rosso
LINE (20 + 10 * contatore%
, 20 + 5 * contatore%
)-(200 + 10 * contatore%
, 200 + 10 * contatore%
), contatore%
, BF
Aspetta tot
NEXT ' qui finisce il ciclo FOR...NEXT
'rettangoli vuoti
' creo un rettangolo vuoto in fucsia
LINE (10 + 10 * contatore%
, 10 + 5 * contatore%
)-(100 + 20 * contatore%
, 100 + 10 * contatore%
), contatore%
, B
Aspetta tot
NEXT 'qui finisce il ciclo FOR ... NEXT
'scritte colorate
' pongo il cursore alla riga 1 e colonna 1, uso il colore e scrivo Ciao
Aspetta tot