1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78
CLS
SCREEN 12
largeurcarre = 50
nbligne = 5
nbcol = 5
ecart = 10
Xdep = 30
Ydep = 10
xcercle = 0
ycercle = 0
rayoncercle = largeurcarre / 2
pas = largeurcarre + ecart
WHILE (1)
touche$ = INKEY$
SELECT CASE touche$
CASE CHR$(0) + "H"
CIRCLE (xcercle, ycercle), rayoncercle, 0
ycercle = ycercle - pas
CIRCLE (xcercle, ycercle), rayoncercle, 12
END SELECT
'-----------DAMIER-------------------------------------------------'
'
FOR k = 0 TO (nbligne - 1) '
'
'
FOR j = 0 TO (nbcol - 1) '
'
'
x = Xdep + j * (largeurcarre + ecart) '
y = Ydep + k * (largeurcarre + ecart) '
'
'
'
LINE (x, y)-(x + largeurcarre, y + largeurcarre), 5, B '
'
'
NEXT '
'
x = Xdep '
'
NEXT '
'------------------------------------------------------------------'
'
'création des variables xcercle et ycercle pour la creation du cercle '
xcercle = x + (largeurcarre / 2) '
ycercle = y + (largeurcarre / 2) '
'
'création du cercle avec les coordonnées xcercle, ycercle '
CIRCLE (xcercle, ycercle), rayoncercle, 12
WEND