Précédente Accueil Remonter Suivante

Code  source

1000 pages de code source pour Ateliers Aide et Soutien

 

Pages

Lignes

Français Niveau I

100

6880

Français Niveau II

129

8840

Math Niveau I

138

9451

Math Niveau II

190

13058

Géométrie

175

12054

Lecture

92

6308

Gestion

35

2379

Installe

21

1447

Menu

67

4590

Menuexo

24

1637

971

66644

 

Un exemple : Géométrie Primaire version 4.0

 

 

 

Géométrie Primaire

Extrait du code source module exercice

DECLARE SUB attendre (tx!)

DECLARE SUB bilan (ma$(), niveaux%(), fichier$, VarEnreg AS ANY)

DECLARE SUB calmoy (t$(), moy$(), niveaux%())

DECLARE SUB centre (v%, coul%, ph$)

DECLARE SUB chiffres ()

DECLARE SUB convertir (z$)

DECLARE SUB entree ()

DECLARE SUB fleches (v%, h%, w$(), np%, r%, coul%, drap%, v2%, h2%)

DECLARE SUB flechesmenu (w$(), r%, coul%)

DECLARE SUB lettres ()

DECLARE SUB niveau (r%, np%, titr$)

DECLARE SUB quitter ()

DECLARE SUB titre (titr$)

DECLARE SUB cadre (v%, h%, l%, nli%, c%)

DECLARE SUB tableauexo (p$())

DECLARE SUB ouinon (r$)

DECLARE SUB getinvimouse (rr%)

DECLARE SUB agrand (re%, ni%, rt$, gg$, pre$, titr$, noir%, bleu%, vert%, rouge%, marron%, blanc%, vertclair%, cyanclair%, rougeclair%, jaune%, blancbrill%, couleur%, coef1!, coef2!)

DECLARE SUB frise (re%, ni%, rt$, gg$, pre$, titr$, noir%, bleu%, vert%, rouge%, marron%, blanc%, vertclair%, cyanclair%, rougeclair%, jaune%, blancbrill%, couleur%, coef1!, coef2!)

DECLARE SUB symetrie (re%, ni%, rt$, gg$, pre$, titr$, noir%, bleu%, vert%, rouge%, marron%, blanc%, vertclair%, cyanclair%, rougeclair%, jaune%, blancbrill%, couleur%, coef1!, coef2!)

DECLARE SUB aire (re%, ni%, rt$, gg$, pre$, titr$, noir%, bleu%, vert%, rouge%, marron%, blanc%, vertclair%, cyanclair%, rougeclair%, jaune%, blancbrill%, couleur%, coef1!, coef2!)

DECLARE SUB convexe (re%, ni%, rt$, gg$, pre$, titr$, noir%, bleu%, vert%, rouge%, marron%, blanc%, vertclair%, cyanclair%, rougeclair%, jaune%, blancbrill%, couleur%, coef1!, coef2!)

DECLARE SUB droitegauche (re%, ni%, rt$, gg$, pre$, titr$, noir%, bleu%, vert%, rouge%, marron%, blanc%, vertclair%, cyanclair%, rougeclair%, jaune%, blancbrill%, couleur%, coef1!, coef2!)

DECLARE SUB intrus (re%, ni%, motintrus$(), rt$, gg$, pre$, titr$, noir%, bleu%, vert%, rouge%, marron%, blanc%, vertclair%, cyanclair%, rougeclair%, jaune%, blancbrill%, couleur%, coef1!, coef2!)

DECLARE SUB orth (prog%, re%, ni%, mo$(), rt$, gg$, pre$, titr$, noir%, bleu%, vert%, rouge%, marron%, blanc%, vertclair%, cyanclair%, rougeclair%, jaune%, blancbrill%, couleur%, coef1!, coef2!)

DECLARE SUB trouve (re%, ni%, rt$, gg$, pre$, titr$, noir%, bleu%, vert%, rouge%, marron%, blanc%, vertclair%, cyanclair%, rougeclair%, jaune%, blancbrill%, couleur%, coef1!, coef2!)

DECLARE SUB angle1 (re%, ni%, rt$, gg$, pre$, titr$, noir%, bleu%, vert%, rouge%, marron%, blanc%, vertclair%, cyanclair%, rougeclair%, jaune%, blancbrill%, couleur%, coef1!, coef2!)

DECLARE SUB angle2 (re%, ni%, rt$, gg$, pre$, titr$, noir%, bleu%, vert%, rouge%, marron%, blanc%, vertclair%, cyanclair%, rougeclair%, jaune%, blancbrill%, couleur%, coef1!, coef2!)

DECLARE SUB paraperpen (re%, ni%, rt$, gg$, pre$, titr$, noir%, bleu%, vert%, rouge%, marron%, blanc%, vertclair%, cyanclair%, rougeclair%, jaune%, blancbrill%, couleur%, coef1!, coef2!)

DECLARE SUB recoformes (re%, ni%, s%, n$(), rt$, gg$, pre$, titr$, noir%, bleu%, vert%, rouge%, marron%, blanc%, vertclair%, cyanclair%, rougeclair%, jaune%, blancbrill%, couleur%, coef1!, coef2!, programme1$)

DECLARE SUB solide2 (re%, ni%, rt$, gg$, pre$, titr$, noir%, bleu%, vert%, rouge%, marron%, blanc%, vertclair%, cyanclair%, rougeclair%, jaune%, blancbrill%, couleur%, coef1!, coef2!)

DECLARE SUB verti (re%, ni%, rt$, gg$, pre$, titr$, noir%, bleu%, vert%, rouge%, marron%, blanc%, vertclair%, cyanclair%, rougeclair%, jaune%, blancbrill%, couleur%, coef1!, coef2!)

DECLARE SUB vocabu (re%, ni%, rt$, gg$, pre$, titr$, noir%, bleu%, vert%, rouge%, marron%, blanc%, vertclair%, cyanclair%, rougeclair%, jaune%, blancbrill%, couleur%, coef1!, coef2!)

DECLARE SUB coord (re%, ni%, rt$, gg$, pre$, titr$, noir%, bleu%, vert%, rouge%, marron%, blanc%, vertclair%, cyanclair%, rougeclair%, jaune%, blancbrill%, couleur%, coef1!, coef2!)

DECLARE SUB frise1 (re%, ni%, rt$, gg$, pre$, titr$, noir%, bleu%, vert%, rouge%, marron%, blanc%, vertclair%, cyanclair%, rougeclair%, jaune%, blancbrill%, couleur%, coef1!, coef2!)

DECLARE SUB reproduction (re%, ni%, rt$, gg$, pre$, titr$, noir%, bleu%, vert%, rouge%, marron%, blanc%, vertclair%, cyanclair%, rougeclair%, jaune%, blancbrill%, couleur%, coef1!, coef2!)

DECLARE SUB reproduction1 (re%, ni%, rt$, gg$, pre$, titr$, noir%, bleu%, vert%, rouge%, marron%, blanc%, vertclair%, cyanclair%, rougeclair%, jaune%, blancbrill%, couleur%, coef1!, coef2!)

DECLARE SUB symetrie1 (re%, ni%, rt$, gg$, pre$, titr$, noir%, bleu%, vert%, rouge%, marron%, blanc%, vertclair%, cyanclair%, rougeclair%, jaune%, blancbrill%, couleur%, coef1!, coef2!)

DECLARE SUB heure (re%, ni%, rt$, gg$, pre$, titr$, noir%, bleu%, vert%, rouge%, marron%, blanc%, vertclair%, cyanclair%, rougeclair%, jaune%, blancbrill%)

DECLARE SUB mesureduree (re%, ni%, rt$, gg$, pre$, titr$, noir%, bleu%, vert%, rouge%, marron%, blanc%, vertclair%, cyanclair%, rougeclair%, jaune%, blancbrill%)

'GEOMETRIE Primaire souris

'Clerc Daniel 11/5/97

'version 4

 

DEFINT A-Z

'procédures

 

'variables globales

COMMON SHARED prog, programme1$, eleve, rt$, gg$, gg2$, pre$, titr$, noir, bleu, vert, rouge, marron, blanc, vertclair, cyanclair, rougeclair, jaune, blancbrill, couleur, coef1!, coef2!

 

' Inclut  les fichiers contenant les déclarations relatives aux procédures appelées.

'$INCLUDE: 'MOUSE.BI'

'$INCLUDE: 'VBDOS.BI'

 

CONST FALSE = 0

CONST TRUE = NOT FALSE

 

rt$ = CHR$(17) + CHR$(196) + CHR$(217)

gg$ = CHR$(24) + " " + CHR$(25) + " puis " + rt$

gg2$ = CHR$(24) + " " + CHR$(25) + " " + CHR$(27) + " " + CHR$(26) + " puis " + rt$

 

programme1$ = "exo_ge" '===

programme2$ = "cho_ge"   '===

ON ERROR GOTO erreur '===

 

TYPE TypeEnreg

nom     AS STRING * 15

prenom  AS STRING * 15

nbexo   AS STRING * 3

notes   AS STRING * 400

END TYPE

 

DIM VarEnreg AS TypeEnreg

 

ma = 21 '===

DIM niveaux(ma), t$(100), moy$(21), p$(21), un$(9), di$(9), n$(ma)

DIM motintrus$(90), motorth$(40)

 

RANDOMIZE TIMER

 OPEN "point_ge.dat" FOR INPUT AS #1

    INPUT #1, eleve, sens, couleur, fichier$, coef1!, coef2!

 CLOSE

 

couleur = 1

noir = 0: bleu = 1: vert = 2: rouge = 4: marron = 6: blanc = 7: vertclair = 10: cyanclair = 11: rougeclair = 12: jaune = 14: blancbrill = 15

 

SCREEN 0: COLOR , noir, noir: CLS : KEY OFF: LOCATE , , 0

GOSUB init

 

IF sens = 1 AND eleve > 0 THEN

    CALL bilan(p$(), niveaux(), fichier$, VarEnreg)

    OPEN "point_ge.dat" FOR OUTPUT AS #1

    WRITE #1, eleve, 2, 1, fichier$, coef1!, coef2!

    CLOSE

END IF

 

menuprincipal:

' Vérifie que le gestionnaire de souris est installé.

MouseInit

MouseShow

 

COLOR , bleu, noir: CLS

CALL cadre(2, 20, 40, 2, vert)

COLOR , vert

CALL centre(3, blancbrill, "ACTIVITES de GEOMETRIE et de MESURES")

COLOR , bleu

 

IF eleve <> 0 THEN

    'lecture des notes

    OPEN "classes\" + fichier$ FOR RANDOM AS #1 LEN = LEN(VarEnreg)

    GET #1, eleve, VarEnreg

    nom$ = RTRIM$(VarEnreg.nom)

    pre$ = RTRIM$(VarEnreg.prenom)

    nbexo$ = RTRIM$(VarEnreg.nbexo)

    j = 1

        FOR i = 1 TO 200 STEP 2 '===

            t$(j) = MID$(VarEnreg.notes, i, 2)

            j = j + 1

        NEXT

    CLOSE

    CALL calmoy(t$(), moy$(), niveaux())

END IF

 

   IF VAL(nbexo$) > 1 THEN

     COLOR jaune

          z$ = RTRIM$(nbexo$) + " exercices"

     LOCATE 4, 79 - LEN(z$): PRINT z$

   END IF

  LOCATE 4, 2

   COLOR jaune

   IF eleve <> 0 THEN

     w$ = pre$ + " " + nom$

     IF LEN(w$) > 17 THEN

       PRINT nom$

     ELSE

       PRINT w$

     END IF

   END IF

  classe$ = MID$(fichier$, 1, LEN(fichier$) - 4)

'  LOCATE 4, 79 - LEN(classe$): PRINT classe$

 

CALL tableauexo(p$())

 

'affiche liste exo

h1 = 6: h2 = 32: h3 = 58

COLOR blancbrill

LOCATE 7

FOR i = 1 TO 7

 LOCATE , h1: PRINT p$(i): PRINT

NEXT

LOCATE 7

FOR i = 8 TO 14

 LOCATE , h2: PRINT p$(i): PRINT

NEXT

LOCATE 7

FOR i = 15 TO 21

 LOCATE , h3: PRINT p$(i): PRINT

NEXT

 

IF eleve <> 0 THEN

'affiche éval sur trois colonnes

COLOR , noir

debut = 1: fin = 7: h = 4

 FOR boucle = 1 TO 3

    LOCATE 7

    FOR i = debut TO fin

        LOCATE , h

            IF moy$(i) = "" THEN

                PRINT " ": PRINT

            ELSEIF (VAL(moy$(i)) = 9 OR VAL(moy$(i)) = 10) THEN

                COLOR vertclair: PRINT "A": PRINT

            ELSEIF (VAL(moy$(i)) = 7 OR VAL(moy$(i)) = 8) THEN

                COLOR vert: PRINT "B": PRINT

            ELSEIF (VAL(moy$(i)) = 6 OR VAL(moy$(i)) = 5) THEN

                COLOR jaune: PRINT "C": PRINT

            ELSE

                COLOR rougeclair: PRINT "D": PRINT

            END IF

        COLOR blancbrill

    NEXT

    debut = fin + 1: fin = fin + 7: IF fin > ma THEN fin = ma

    h = h + 26

 NEXT boucle

COLOR , bleu

END IF

 

CALL flechesmenu(p$(), prog, rouge)

COLOR , bleu

 

    IF prog = 0 THEN

        LOCATE 22, 1: PRINT SPACE$(80)

        LOCATE 22, 28

        COLOR blanc: BEEP: PRINT "Quitter  ";

        CALL ouinon(r$)

        IF r$ = "O" THEN GOTO fin

        GOTO menuprincipal

    END IF

 

    IF prog = 42 THEN

        CALL bilan(p$(), niveaux(), fichier$, VarEnreg)

        GOTO menuprincipal

    END IF

 

COLOR , noir: CLS

titr$ = p$(prog): ni = 1

 

'valeur de la matière

mat = 0

FOR i = 1 TO prog - 1

mat = mat + niveaux(i)

NEXT

 

SELECT CASE prog

CASE 1

CALL droitegauche(re, ni, rt$, gg$, pre$, titr$, noir, bleu, vert, rouge, marron, blanc, vertclair, cyanclair, rougeclair, jaune, blancbrill, couleur, coef1!, coef2!)

 

CASE 2

CALL verti(re, ni, rt$, gg$, pre$, titr$, noir, bleu, vert, rouge, marron, blanc, vertclair, cyanclair, rougeclair, jaune, blancbrill, couleur, coef1!, coef2!)

 

CASE 3

CALL trouve(re, ni, rt$, gg$, pre$, titr$, noir, bleu, vert, rouge, marron, blanc, vertclair, cyanclair, rougeclair, jaune, blancbrill, couleur, coef1!, coef2!)

 

CASE 4

CALL recoformes(re, ni, 1, n$(), rt$, gg$, pre$, titr$, noir, bleu, vert, rouge, marron, blanc, vertclair, cyanclair, rougeclair, jaune, blancbrill, couleur, coef1!, coef2!, programme1$)

 

CASE 5

CALL recoformes(re, ni, 6, n$(), rt$, gg$, pre$, titr$, noir, bleu, vert, rouge, marron, blanc, vertclair, cyanclair, rougeclair, jaune, blancbrill, couleur, coef1!, coef2!, programme1$)

 

CASE 6

CALL recoformes(re, ni, 11, n$(), rt$, gg$, pre$, titr$, noir, bleu, vert, rouge, marron, blanc, vertclair, cyanclair, rougeclair, jaune, blancbrill, couleur, coef1!, coef2!, programme1$)

 

CASE 7

CALL vocabu(re, ni, rt$, gg$, pre$, titr$, noir, bleu, vert, rouge, marron, blanc, vertclair, cyanclair, rougeclair, jaune, blancbrill, couleur, coef1!, coef2!)

 

CASE 8

CALL paraperpen(re, ni, rt$, gg$, pre$, titr$, noir, bleu, vert, rouge, marron, blanc, vertclair, cyanclair, rougeclair, jaune, blancbrill, couleur, coef1!, coef2!)

 

CASE 9

CALL convexe(re, ni, rt$, gg$, pre$, titr$, noir, bleu, vert, rouge, marron, blanc, vertclair, cyanclair, rougeclair, jaune, blancbrill, couleur, coef1!, coef2!)

 

CASE 10

CALL coord(re, ni, rt$, gg$, pre$, titr$, noir, bleu, vert, rouge, marron, blanc, vertclair, cyanclair, rougeclair, jaune, blancbrill, couleur, coef1!, coef2!)

 

CASE 11

CALL niveau(ni, 4, titr$)

IF ni = 1 THEN

    CALL reproduction1(re, ni, rt$, gg$, pre$, titr$, noir, bleu, vert, rouge, marron, blanc, vertclair, cyanclair, rougeclair, jaune, blancbrill, couleur, coef1!, coef2!)

ELSE

    CALL reproduction(re, ni, rt$, gg$, pre$, titr$, noir, bleu, vert, rouge, marron, blanc, vertclair, cyanclair, rougeclair, jaune, blancbrill, couleur, coef1!, coef2!)

END IF

 

CASE 12

CALL niveau(ni, 4, titr$)

IF ni = 1 OR ni = 2 THEN

CALL frise1(re, ni, rt$, gg$, pre$, titr$, noir, bleu, vert, rouge, marron, blanc, vertclair, cyanclair, rougeclair, jaune, blancbrill, couleur, coef1!, coef2!)

ELSE

CALL frise(re, ni, rt$, gg$, pre$, titr$, noir, bleu, vert, rouge, marron, blanc, vertclair, cyanclair, rougeclair, jaune, blancbrill, couleur, coef1!, coef2!)

END IF

 

CASE 13

CALL agrand(re, ni, rt$, gg$, pre$, titr$, noir, bleu, vert, rouge, marron, blanc, vertclair, cyanclair, rougeclair, jaune, blancbrill, couleur, coef1!, coef2!)

 

CASE 14

CALL niveau(ni, 4, titr$)

IF ni = 1 OR ni = 2 THEN

    CALL symetrie1(re, ni, rt$, gg$, pre$, titr$, noir, bleu, vert, rouge, marron, blanc, vertclair, cyanclair, rougeclair, jaune, blancbrill, couleur, coef1!, coef2!)

ELSE

    CALL symetrie(re, ni, rt$, gg$, pre$, titr$, noir, bleu, vert, rouge, marron, blanc, vertclair, cyanclair, rougeclair, jaune, blancbrill, couleur, coef1!, coef2!)

END IF

 

CASE 15

CALL aire(re, ni, rt$, gg$, pre$, titr$, noir, bleu, vert, rouge, marron, blanc, vertclair, cyanclair, rougeclair, jaune, blancbrill, couleur, coef1!, coef2!)

 

CASE 16

 CALL niveau(ni, 2, titr$)

 IF ni = 1 THEN

  CALL recoformes(re, ni, 16, n$(), rt$, gg$, pre$, titr$, noir, bleu, vert, rouge, marron, blanc, vertclair, cyanclair, rougeclair, jaune, blancbrill, couleur, coef1!, coef2!, programme1$)

 ELSE

  CALL solide2(re, ni, rt$, gg$, pre$, titr$, noir, bleu, vert, rouge, marron, blanc, vertclair, cyanclair, rougeclair, jaune, blancbrill, couleur, coef1!, coef2!)

 END IF

 

CASE 17

CALL angle1(re, ni, rt$, gg$, pre$, titr$, noir, bleu, vert, rouge, marron, blanc, vertclair, cyanclair, rougeclair, jaune, blancbrill, couleur, coef1!, coef2!)

 

CASE 18

CALL angle2(re, ni, rt$, gg$, pre$, titr$, noir, bleu, vert, rouge, marron, blanc, vertclair, cyanclair, rougeclair, jaune, blancbrill, couleur, coef1!, coef2!)

 

CASE 19

 titr$ = "heures - minutes"

 CALL niveau(ni, 4, titr$)

 IF ni = 1 OR ni = 2 THEN

  CALL heure(re, ni, rt$, gg$, pre$, titr$, noir, bleu, vert, rouge, marron, blanc, vertclair, cyanclair, rougeclair, jaune, blancbrill)

 ELSE

  CALL mesureduree(re, ni, rt$, gg$, pre$, titr$, noir, bleu, vert, rouge, marron, blanc, vertclair, cyanclair, rougeclair, jaune, blancbrill)

 END IF

 

CASE 20

CALL orth(prog, re, ni, motorth$(), rt$, gg$, pre$, titr$, noir%, bleu%, vert%, rouge%, marron%, blanc%, vertclair%, cyanclair%, rougeclair%, jaune%, blancbrill%, couleur%, coef1!, coef2!)

 

CASE 21

CALL intrus(re, ni, motintrus$(), rt$, gg$, pre$, titr$, noir%, bleu%, vert%, rouge%, marron%, blanc%, vertclair%, cyanclair%, rougeclair%, jaune%, blancbrill%, couleur%, coef1!, coef2!)

 

 END SELECT

 

GOSUB enregistre

COLOR blanc: LOCATE 23, 37: PRINT rt$

CALL getinvimouse(rr)

 

GOTO menuprincipal

END

 

fin:

IF eleve > 0 THEN

 CALL bilan(p$(), niveaux(), fichier$, VarEnreg)

END IF

COLOR , noir: CLS

RUN programme2$

END

 

init:

DATA Droite-Gauche,3

DATA Verticale-Horizont.,2

DATA Reconnaissance,3

DATA Figures simples,1

DATA Triangles,1

DATA Quadrilatères,1

DATA Vocabulaire,2

DATA Parallèle-Perpend.,2

DATA Convexe-Concave,1

DATA Coordonnées,3

 

DATA Reproduction,4

DATA Frises,4

DATA Agrandir-Réduire,2

DATA Symétrie,4

DATA Périmètre-Aire,1

DATA Solides,2

DATA Nom des angles,1

DATA Valeur des angles,2

DATA Heures-Minutes,4

DATA Orthographe,3

DATA Intrus,2

 

FOR i = 1 TO ma: READ p$(i), niveaux(i): NEXT

 

'data pour recoformes

DATA rectangle,carré,cercle,losange,triangle

DATA triangle quelconque,triangle rectangle (non isocèle),triangle isocèle,triangle équilatéral,triangle rectangle isocèle

DATA rectangle,carré,losange,trapèze,parallélogramme quelconque

DATA cube,parallélépipède quelconque,pyramide,cône,cylindre

  FOR i = 1 TO 20: READ n$(i): NEXT i

 

 

'data intrus

DATA mm,cm,dm,m²*,dam,hm,km,Le "m²" n'est pas une unité de longueur mais d'aire.,"="

DATA carré,rectangle,cercle*,losange,triangle,hexagone,Le cercle n'est pas composé de lignes droites.,"="

DATA rectangle,carré,losange,hexagone*,trapèze,parallélogramme,L'hexagone n'est pas un quadrilatère. Il a 6 côtés.,"="

DATA carré,trapèze*,hexagone,pentagone,octogone,triangle équilatéral,Le trapèze n'est pas un polygone régulier (angles et côtés égaux).,"="

DATA carré,rectangle,triangle rectangle,trapèze rectangle,triangle équilatéral*,Le triangle équilatéral n'a pas d'angle droit.,"="

 

DATA diamètre,diagonale,périmètre,hauteur,surface*,rayon,largeur,La surface n'est pas une longueur.,"="

DATA cube,sphère,cône,cylindre,parallépipède,disque*,tétraèdre,Le disque n'est pas un solide.,"="

DATA mm²,cm*,dm²,m²,dam²,hm²,km²,Le 'cm' n'est pas une unité d'aire mais de longueur.,"="

DATA cube*,cercle,carré,triangle,ellipse,hexagone,pentagone,Le cube n'est pas une surface. C'est un solide.,"="

DATA rayon,circonférence,arc de cercle,diamètre,hauteur*,La hauteur n'est pas utilisée dans les cercles.,"="

 

DATA ""

 

i = 0

DO

i = i + 1

READ motintrus$(i)

LOOP WHILE motintrus$(i) <> ""

 

'niveau 1 (13)

DATA carré,rectangle,losange,largeur,longueur,sommet,triangle,cube,cercle,disque

DATA hauteur,verticale,horizontale

'niveau 2 (13)

DATA angle,aigu,obtus,diagonale,arc,diamètre,rayon,aire,isocèle,parallèle

DATA circonférence,périmètre,trapèze

'niveau 3 (13)

DATA ellipse,pentagone,sphère,coordonnée,cylindre,hexagone,équilatéral,symétrie,pyramide

DATA parallélogramme,périmètre,perpendiculaire,octogone

DATA ""

 

i = 0

DO

i = i + 1

READ motorth$(i)

LOOP WHILE motorth$(i) <> ""

'39

RETURN

 

enregistre:

COLOR , noir

IF eleve = 0 THEN RETURN

CALL centre(23, blanc, "Enregistrement de la note")

re$ = LTRIM$(STR$(re)): IF LEN(re$) = 1 THEN re$ = re$ + " "

pointeur = ni + mat

OPEN "classes\" + fichier$ FOR RANDOM AS #1 LEN = LEN(VarEnreg)

GET #1, eleve, VarEnreg

IF VAL(VarEnreg.nbexo) < 999 THEN

VarEnreg.nbexo = LTRIM$(STR$(VAL(VarEnreg.nbexo) + 1))

END IF

notes$ = VarEnreg.notes

IF pointeur = 1 THEN

notes$ = re$ + MID$(notes$, 2 * pointeur + 1)

ELSE

notes$ = MID$(notes$, 1, (pointeur - 1) * 2) + re$ + MID$(notes$, 2 * pointeur + 1)

END IF

VarEnreg.notes = notes$

PUT #1, eleve, VarEnreg

CLOSE #1

CALL attendre(1.5)

LOCATE 23: PRINT SPACE$(80)

re = 0

RETURN

 

erreur:

programme$ = "exo_ge"

    SCREEN 0

    COLOR , bleu: CLS

    BEEP

    CALL cadre(8, 5, 70, 9, rouge)

    COLOR , rouge

    CALL centre(10, blanc, "ATTENTION")

 

IF ERR = 5 THEN

    CALL centre(12, blancbrill, "Votre ordinateur ne possède pas de carte graphique EGA ou VGA.")

    CALL centre(14, blancbrill, "Les activités de GEOMETRIE et de MESURES ne sont pas accessibles.")

    COLOR , noir

    CALL getinvimouse(w)

    RUN

END IF

 

 

  SELECT CASE ERR

  CASE 71

  CALL centre(12, blancbrill, "Disque non prêt")

 

  CASE 70

  CALL centre(12, blancbrill, "Disquette protégée")

 

  CASE 53, 57, 72

  CALL centre(12, blancbrill, "Problème sur le disque")

 

  CASE 61

  CALL centre(12, blancbrill, "Disque plein")

 

  CASE 25, 26, 68

  CALL centre(12, blancbrill, "Imprimante non prête")

 

  CASE 27

  CALL centre(12, blancbrill, "Imprimante sans papier")

 

  CASE ELSE

    CALL centre(12, blancbrill, "Erreur système n°" + LTRIM$(STR$(ERR)))

    CALL centre(14, blancbrill, "Essayez de relancez le programme.")

    CLOSE

    w$ = INPUT$(1)

    COLOR , noir: CLS

    END

 

 END SELECT

 

  CALL centre(14, blancbrill, "Corrigez puis tapez  " + rt$ + "        [Echap] = Fin")

  CALL getinvimouse(r)

  IF r = 27 THEN COLOR , noir: CLS : END

  COLOR , bleu: CLS : RUN programme$

 RESUME

 

 

DEFINT A-Z

SUB attendre (tx!)

  DEF SEG = 0

  POKE 1050, PEEK(1052)

  DEF SEG

t! = tx! * 2

debut! = TIMER

DO

IF INKEY$ <> "" THEN EXIT DO

fin! = TIMER

LOOP WHILE fin! - debut! < t!

 

END SUB

 

DEFINT A-Z

SUB bilan (ma$(), niveaux(), fichier$, VarEnreg AS TypeEnreg)

ma = 21

DIM t$(100), moy$(ma), bi$(ma)

FOR i = 1 TO ma

 bi$(i) = ma$(i)

 IF LEN(bi$(i)) > 20 THEN bi$(i) = LEFT$(bi$(i), 19) + "."

 NEXT

 

ll$ = STRING$(30, ".")

pt$ = MID$(ll$, 1, 15)

ni$ = "Niveau " + CHR$(26) + " 1  2  3  4"

class$ = MID$(fichier$, 1, LEN(fichier$) - 4)

 

   COLOR , noir: CLS

 

OPEN "classes\" + fichier$ FOR RANDOM AS #1 LEN = LEN(VarEnreg)

GET #1, eleve, VarEnreg

nom$ = RTRIM$(VarEnreg.nom)

pre$ = RTRIM$(VarEnreg.prenom)

nbexo$ = RTRIM$(VarEnreg.nbexo)

CLOSE

  IF VAL(nbexo$) = 0 THEN EXIT SUB

 

CALL titre("bilan - " + class$)

 j = 1

FOR i = 1 TO 200 STEP 2 '===

t$(j) = MID$(VarEnreg.notes, i, 2)

j = j + 1

NEXT

CALL calmoy(t$(), moy$(), niveaux())

 

'moy générale

  tt = 0: nt = 0

  FOR j = 1 TO ma

   IF moy$(j) <> "" THEN tt = tt + VAL(moy$(j)): nt = nt + 1

  NEXT j

  IF nt = 0 THEN moygen$ = " " ELSE moygen$ = LTRIM$(STR$(INT((tt / nt) * 10) / 10))

 

z$ = pre$ + " " + nom$ + " a fait" + STR$(VAL(nbexo$)) + " exercice"

IF VAL(nbexo$) > 1 THEN z$ = z$ + "s"

z$ = z$ + " de géométrie."

COLOR , marron

CALL centre(4, blancbrill, " " + z$ + " ")

COLOR , bleu

LOCATE 6, 16: COLOR vertclair: PRINT ni$: COLOR jaune: LOCATE 6, 36: PRINT "Moy"

COLOR vertclair: LOCATE 6, 57: PRINT ni$: COLOR jaune: LOCATE 6, 77: PRINT "Moy"

 

COLOR , rouge

v = 7: h = 1: debut = 8: fin = 18: GOSUB cadre

v = 7: h = 42: debut = 8: fin = 17: GOSUB cadre

LOCATE 8

FOR i = 1 TO 11

 LOCATE , 2: PRINT bi$(i); " "; LEFT$(ll$, 20 - LEN(bi$(i)))

NEXT

LOCATE 8

FOR i = 12 TO ma

 LOCATE , 43: PRINT bi$(i); " "; LEFT$(ll$, 20 - LEN(bi$(i)))

NEXT

 

'affichage des moyennes

LOCATE 8

FOR i = 1 TO 11

LOCATE , 36

IF moy$(i) = "" THEN

  PRINT

ELSEIF VAL(moy$(i)) = 9 OR VAL(moy$(i)) = 10 THEN

 COLOR blancbrill

   PRINT moy$(i);

 COLOR vertclair

   LOCATE , 38

   PRINT "A"

ELSEIF VAL(moy$(i)) = 7 OR VAL(moy$(i)) = 8 THEN

 COLOR blancbrill

 PRINT moy$(i);

 COLOR vert

 LOCATE , 38

   PRINT "B"

ELSEIF VAL(moy$(i)) = 6 OR VAL(moy$(i)) = 5 THEN

 COLOR blancbrill

   PRINT moy$(i);

   LOCATE , 38

  COLOR jaune

   PRINT "C"

ELSE

 COLOR blancbrill

   PRINT moy$(i);

   COLOR rougeclair

   LOCATE , 38

   PRINT "D"

END IF

NEXT

LOCATE 8

FOR i = 12 TO ma

LOCATE , 77

IF moy$(i) = "" THEN

  PRINT

ELSEIF VAL(moy$(i)) = 9 OR VAL(moy$(i)) = 10 THEN

 COLOR blancbrill

   PRINT moy$(i);

 COLOR vertclair

   LOCATE , 79

   PRINT "A"

ELSEIF VAL(moy$(i)) = 7 OR VAL(moy$(i)) = 8 THEN

 COLOR blancbrill

  PRINT moy$(i);

 COLOR vert

 LOCATE , 79

   PRINT "B"

ELSEIF VAL(moy$(i)) = 5 OR VAL(moy$(i)) = 6 THEN

 COLOR blancbrill

   PRINT moy$(i);

   LOCATE , 79

  COLOR jaune

   PRINT "C"

ELSE

 COLOR blancbrill

   PRINT moy$(i);

   COLOR rougeclair

   LOCATE , 79

   PRINT "D"

END IF

NEXT

COLOR blanc

 

'++++++++++++++

v = 8

debut = 1

FOR Valeur = 1 TO 11

fin = debut + (niveaux(Valeur) - 1)

h = 24: GOSUB place

debut = fin + 1: v = v + 1

NEXT

 

v = 8

FOR Valeur = 12 TO ma

fin = debut + (niveaux(Valeur) - 1)

h = 65: GOSUB place

debut = fin + 1: v = v + 1

NEXT

'++++++++++

 

COLOR , bleu

IF VAL(moygen$) <> 0 THEN

COLOR cyanclair: LOCATE 19, 43

CALL convertir(moygen$)

PRINT "Moyenne générale : "; moygen$; " sur 10"

END IF

CALL entree

 

EXIT SUB

 

place:

LOCATE v

FOR i = debut TO fin

LOCATE , h

IF VAL(t$(i)) < 10 THEN PRINT " ";

IF t$(i) <> "  " THEN PRINT RTRIM$(LTRIM$(t$(i)));  ELSE PRINT "-";

h = h + 3

NEXT

RETURN

 

cadre:

COLOR blancbrill

LOCATE v, h: PRINT "┌─────────────────────┬──┬──┬──┬──┬───┐"

FOR i = debut TO fin

LOCATE , h: PRINT "│                     │  │  │  │  │   │"

NEXT i

LOCATE , h: PRINT "└─────────────────────┴──┴──┴──┴──┴───┘"

RETURN

 

END SUB

 

DEFINT A-Z

SUB cadre (v, h, l, nli, c)

'c est l'intérieur

'le fond écran est bleu

 

v2 = v

 

'cadre

COLOR c, bleu

 

    LOCATE v2, h

    PRINT STRING$(l + 2, 220)

    FOR i = 1 TO nli - 1

        v2 = v2 + 1: LOCATE v2, h

        PRINT STRING$(l + 2, 219)

    NEXT

 

 COLOR , bleu

 LOCATE v2 + 1, h: PRINT CHR$(223)

 

COLOR , 0

    LOCATE v + 1

        FOR i = 1 TO nli

            LOCATE , h + l + 2

            PRINT " "

        NEXT

    LOCATE v2 + 1, h + 1

        PRINT STRING$(l + 1, 223)

COLOR blancbrill

END SUB

 

DEFINT A-Z

SUB cadre3 (v, h, nb, coul)

'inversion de v et h !

LINE (((h - 1) * 8) - 5, ((v - 1) * 14) - 2)-(((h - 1 + nb) * 8) + 5, (v * 14) + 2), coul, B

END SUB

 

DEFINT A-Z

SUB calmoy (t$(), moy$(), niveaux())

'5/5/96

 

debut = 1

FOR Valeur = 1 TO 21 '===

fin = debut + (niveaux(Valeur) - 1)

GOSUB calcul

debut = fin + 1

NEXT

 

EXIT SUB

 

calcul:

  tt = 0: nt = 0

  FOR j = debut TO fin

   IF t$(j) <> "  " THEN tt = tt + VAL(t$(j)): nt = nt + 1

  NEXT j

  IF nt = 0 THEN moy$(Valeur) = "" ELSE moy$(Valeur) = LTRIM$(STR$(INT(INT(tt / nt) * 10) / 10))

RETURN

 

END SUB

 

DEFINT A-Z

SUB centre (v, coul, ph$)

COLOR coul

LOCATE v, INT(41 - (LEN(ph$) / 2))

PRINT ph$

COLOR blancbrill

END SUB

 

DEFINT A-Z

SUB chiffres ()

LOCATE 23, 1, 0

FOR i = 1 TO 80

   xx$ = xx$ + CHR$(SCREEN(23, i))

NEXT

LOCATE 23, 1: PRINT SPACE$(80)

CALL centre(23, rougeclair, "Des chiffres !")

CALL attendre(1)

COLOR blanc: LOCATE 23, 1: PRINT xx$

END SUB

 

DEFINT A-Z

SUB claviernumerique (z$)

 CALL titre(titr$)

 CALL cadre(4, 5, 70, 15, marron)

 COLOR , marron

 w$ = "Avec les touches du clavier numérique, tu vas devoir"

  IF eleve <> 0 THEN

       CALL centre(6, blancbrill, pre$ + ","): w$ = LCASE$(w$)

        CALL centre(8, blancbrill, w$)

  ELSE

    CALL centre(7, blancbrill, w$)

  END IF

 CALL centre(9, blancbrill, z$)

 LOCATE 11: h = 35

 LOCATE , h: PRINT "7   8   9"

 LOCATE , h: PRINT "  \ │ /"

 LOCATE , h: PRINT "4───┼───6"

 LOCATE , h: PRINT "  / │ \"

 LOCATE , h: PRINT "1   2   3"

  CALL centre(17, blancbrill, "Tu peux corriger tes erreurs avec la touche " + CHR$(27) + "- ou la touche suppr.")

 

    CALL entree

z$ = "": w$ = ""

END SUB

 

DEFINT A-Z

SUB consigne (nl, w$, z$, xx$)

CALL titre(titr$)

IF nl = 1 THEN z$ = "": xx$ = ""

IF nl = 2 THEN xx$ = ""

l = LEN(w$)

IF LEN(z$) > l THEN l = LEN(z$)

IF LEN(xx$) > l THEN l = LEN(xx$)

 

l = l + 6

h = INT(40 - l / 2)

 

IF eleve <> 0 THEN nl = nl + 1

 

IF nl = 1 OR nl = 2 THEN

 v = 8

ELSEIF nl = 3 THEN

 v = 7

ELSEIF nl = 4 THEN

 v = 6

END IF

 

 CALL cadre(v, h, l, 4 + (nl * 2), marron)

COLOR , marron

  IF eleve <> 0 THEN

       CALL centre(v + 3, blancbrill, pre$ + ","): w$ = LCASE$(w$)

        CALL centre(v + 5, blancbrill, w$)

        CALL centre(v + 7, blancbrill, z$)

        CALL centre(v + 9, blancbrill, xx$)

  ELSE

        CALL centre(v + 3, blancbrill, w$)

        CALL centre(v + 5, blancbrill, z$)

        CALL centre(v + 7, blancbrill, xx$)

   END IF

  CALL entree

w$ = "": z$ = "": xx$ = ""

 

 

END SUB

 

DEFINT A-Z

SUB convertir (z$)

'convertir les . en ,

s = INSTR(1, z$, ".")

IF s <> 0 THEN z$ = MID$(z$, 1, s - 1) + "," + MID$(z$, s + 1)

END SUB

 

DEFINT A-Z

SUB entree ()

COLOR 7, 0

LOCATE 23, , 0: PRINT SPACE$(37); CHR$(17) + CHR$(196) + CHR$(217) + SPACE$(40)

DEF SEG = 0

POKE 1050, PEEK(1052)

DEF SEG

r$ = ""

DO

    r$ = INKEY$

    ' Obtient l'emplacement de la souris et l'état des boutons.

     MousePoll v_mouse, h_mouse, lButton, rButton

    IF lButton THEN

     r$ = CHR$(13)

    CALL attendre(.5)

    END IF

LOOP WHILE r$ = ""

 

IF LEN(r$) < 2 THEN rr = ASC(r$) ELSE rr = ASC(RIGHT$(r$, 1))

 

'IF rr = 27 THEN CALL quitter

END SUB

 

DEFINT A-Z

SUB erreur (tx!)

LOCATE 23: PRINT SPACE$(60)

CALL centre(23, rougeclair, "Erreur"): CALL attendre(tx!)

END SUB

 

DEFINT A-Z

SUB erreur3 (tx!)

CALL centre(23, noir, SPACE$(10))

CALL centre(23, rougeclair, "Erreur"): CALL attendre(tx!)

CALL centre(23, blancbrill, "      ")

 

END SUB

 

DEFINT A-Z

SUB exact (tx!)

LOCATE 23: PRINT SPACE$(70)

CALL centre(23, jaune, "Exact"): CALL attendre(tx!)

END SUB

 

DEFINT A-Z

SUB exact3 (tx!)

CALL centre(23, noir, SPACE$(10))

CALL centre(23, jaune, "Exact"): CALL attendre(tx!)

CALL centre(23, blancbrill, "      ")

 

END SUB

 

DEFINT A-Z

SUB fleches (v, h, w$(), np, r, coul, drap, v2, h2)

'PRINT v2, h2

'v2 et h2 sont la ligne colonne des fleches

DIM p$(np)

 

LOCATE , , 0

FOR i = 1 TO np: p$(i) = w$(i): NEXT

l2 = 0

FOR i = 1 TO np

l1 = LEN(p$(i)): IF l2 < l1 THEN l2 = l1

NEXT

FOR i = 1 TO np

p$(i) = p$(i) + SPACE$(l2 - LEN(p$(i)))

NEXT

 

IF h2 > 0 THEN

COLOR blanc, noir

LOCATE v2, h2: PRINT gg$

END IF

 

'souris

v_mini = v: v_maxi = v_mini + np - 1

h_mini = h - 1: h_maxi = LEN(p$(1)) + h_mini + 1

'LOCATE 22, 1: PRINT v_mini, v_maxi, h_mini, h_maxi '===

'cadre

IF drap = 1 THEN

    CALL cadre(v - 1, h - 3, l2 + 4, np + 1, coul)

END IF

COLOR blancbrill, coul

 

LOCATE v

     FOR i = 1 TO np

      LOCATE , h - 1: PRINT " "; p$(i); " "

     NEXT

    vt = v - 1

    LOCATE v, h - 1

    IF couleur = 1 THEN COLOR coul, blanc ELSE COLOR noir, blanc

    PRINT " "; p$(1); " "

    COLOR blancbrill, coul

DO

    DEF SEG = 0

    POKE &H417, (PEEK(&H417) AND &H9F)'non numérique

    POKE 1050, PEEK(1052)

    DEF SEG

 souris = 0

  DO

    r$ = INKEY$

    ' Obtient l'emplacement de la souris et l'état des boutons.

        MousePoll v_mouse, h_mouse, lButton, rButton

    'LOCATE 21, 1: PRINT "Position de la souris : "; v_mouse; ", "; h_mouse '===

    IF lButton THEN

         IF v_mouse >= v_mini AND v_mouse <= v_maxi THEN

            IF h_mouse >= h_mini AND h_mouse <= h_maxi THEN

                LOCATE v_mini

                    FOR i = 1 TO np

                        LOCATE , h_mini: PRINT " "; p$(i); " "

                    NEXT

                    calcul = v_mouse - v_mini + 1

                    LOCATE v_mouse, h_mini

                    COLOR coul, blancbrill

                    PRINT " "; p$(calcul); " "

                    CALL attendre(.3)

                    r = calcul

                    EXIT SUB

            ELSE

                BEEP

            END IF

         ELSEIF v_mouse = v2 AND h_mouse = h2 THEN

                  rr = 72 'fleche haut

                  souris = 1

                  CALL attendre(.2)

                  EXIT DO

         ELSEIF v_mouse = v2 AND h_mouse = h2 + 2 THEN

                  rr = 80 'fleche bas

                  souris = 1

                  CALL attendre(.2)

                  EXIT DO

         ELSEIF v_mouse = v2 AND (h_mouse >= h2 + 9 AND h_mouse <= h2 + 11) THEN

                  rr = 13

                  souris = 1

                  CALL attendre(.3)

                  EXIT DO

         ELSE

            BEEP

         END IF

    END IF

 

  LOOP WHILE r$ = ""

 

IF souris = 0 THEN

    IF LEN(r$) < 2 THEN

        rr = ASC(r$)

    ELSE

        rr = ASC(RIGHT$(r$, 1))

    END IF

END IF

 

IF rr = 27 THEN

 CALL quitter

END IF

 

 

    LOCATE v, h - 1: PRINT " "; p$(v - vt); " "

     IF rr = 72 THEN v = v - 1: IF v = vt THEN v = vt + np

     IF rr = 80 THEN v = v + 1: IF v = vt + np + 1 THEN v = vt + 1

    LOCATE v, h - 1

    IF couleur = 1 THEN COLOR coul, blanc ELSE COLOR noir, blanc

    PRINT " "; p$(v - vt); " "

    COLOR blancbrill, coul

LOOP WHILE rr <> 13

    r = v - vt

    COLOR blancbrill

 

END SUB

 

DEFINT A-Z

SUB fleches2 (v%, h%, ll%, nm%, h2%, w$(), r, coul)

DIM p$(nm%)

CONST gauche = 75, droite = 77, bas = 80, haut = 72

 

'on met des espaces à la fin

FOR i = 1 TO nm

     p$(i) = w$(i)

NEXT

    l2 = 0

FOR i = 1 TO nm

    l1 = LEN(p$(i)): IF l2 < l1 THEN l2 = l1

NEXT

FOR i = 1 TO nm

    p$(i) = p$(i) + SPACE$(l2 - LEN(p$(i)))

NEXT

'+++

n! = nm / 2

paire = 0: IF n! = INT(nm / 2) THEN paire = 1

vv = v: hh = h: r = 1

GOSUB affiche

 

 'fleches

    IF couleur = 1 THEN COLOR coul, blanc ELSE COLOR noir, blanc

 LOCATE v, h - 1

 PRINT " "; p$(1); " "

 COLOR blancbrill, coul

 

DO

DEF SEG = 0

POKE &H417, (PEEK(&H417) AND &H9F)'non numérique

POKE &H417, (PEEK(&H417) AND &HBF) 'minus

POKE 1050, PEEK(1052)

DEF SEG

 

souris = 0

DO

    r$ = INKEY$

    ' Obtient l'emplacement de la souris et l'état des boutons.

     MousePoll v_mouse, h_mouse, lButton, rButton

     'LOCATE 22, 1: PRINT v_mouse, h_mouse'===

    IF lButton THEN

      IF v_mouse >= vv AND v_mouse <= vv + ll - 1 THEN

            FOR nombre = 1 TO nm

               IF v_mouse = vv + nombre - 1 THEN

                IF h_mouse >= h AND h_mouse <= h + l2 THEN

                     GOSUB affiche

                     LOCATE v_mouse, h - 1

                    IF couleur = 1 THEN COLOR coul, blanc ELSE COLOR noir, blanc

                    PRINT " "; p$(nombre); " "

                    COLOR blancbrill, coul

                    CALL attendre(.3)

                    r = nombre

                    EXIT SUB

 

                ELSEIF h_mouse >= h2 AND h_mouse <= h2 + l2 THEN

                     GOSUB affiche

                     LOCATE v_mouse, h2 - 1

                    IF couleur = 1 THEN COLOR coul, blanc ELSE COLOR noir, blanc

                    PRINT " "; p$(nombre + ll); " "

                    COLOR blancbrill, coul

                    CALL attendre(.3)

                    r = nombre + ll

                    EXIT SUB

                END IF

            END IF

        NEXT

 

    ELSEIF v_mouse = 23 THEN

            IF h_mouse = 33 THEN

                'fleche haut

                rr = haut

                CALL attendre(.3)

                souris = 1

                EXIT DO

            ELSEIF h_mouse = 35 THEN

                'fleche bas

                rr = bas

                CALL attendre(.3)

                souris = 1

                EXIT DO

            ELSEIF h_mouse = 37 THEN

                'fleche gauche

                rr = gauche

                CALL attendre(.3)

                souris = 1

                EXIT DO

            ELSEIF h_mouse = 39 THEN

                'fleche droite

                rr = droite

                CALL attendre(.3)

                souris = 1

                EXIT DO

            ELSEIF h_mouse >= 46 AND h_mouse <= 48 THEN

                'entree

                rr = 13

                CALL attendre(.3)

                souris = 1

                EXIT DO

 

            END IF

    ELSE

        BEEP

    END IF

  END IF

 

LOOP WHILE r$ = ""

 

IF souris = 0 THEN

    IF LEN(r$) < 2 THEN rr = ASC(r$) ELSE rr = ASC(RIGHT$(r$, 1))

    IF rr = 27 THEN r = 0: EXIT SUB

END IF

 

  LOCATE v, hh - 1

 PRINT " "; p$(r); " "

 

 GOSUB fldirect

 LOCATE v, hh - 1

    IF couleur = 1 THEN COLOR coul, blanc ELSE COLOR noir, blanc

  PRINT " "; p$(r); " "

 COLOR blancbrill, coul

LOOP WHILE rr <> 13

 

EXIT SUB

 

fldirect:

 IF rr = gauche THEN r = r - ll: IF hh = h2 THEN hh = h ELSE IF hh = h THEN hh = h2 'gauche

 IF rr = droite THEN

   IF paire = 0 AND r = ll + 1 THEN

   r = r + ll + 1

   ELSE

   r = r + ll

   END IF

 IF hh = h2 THEN hh = h ELSE IF hh = h THEN hh = h2 'droite

 END IF

 IF rr = haut THEN v = v - 1: r = r - 1 'haut

 IF rr = bas THEN v = v + 1: r = r + 1 'bas

 

 IF r = ll + 1 THEN v = vv: hh = h2

 IF r = ll THEN v = ll + (vv - 1): hh = h

 IF r = 2 * ll THEN v = ll + (vv - 1): hh = h2

 IF r > nm THEN r = 1: v = vv: hh = h

 IF r >= 1 THEN RETURN

r = nm

v = (vv - 1) + nm - ll: hh = h2

RETURN

 

affiche:

COLOR , coul

LOCATE vv

 FOR i = 1 TO ll: LOCATE , h - 1: PRINT " "; p$(i); " ": NEXT

 LOCATE vv

 FOR i = ll + 1 TO nm: LOCATE , h2 - 1: PRINT " "; p$(i); " ": NEXT

RETURN

END SUB

 

DEFINT A-Z

SUB flechesbis (v, h, p$(), np, r)

v2 = 18: h2 = 62

DEF SEG = 0

POKE &H417, (PEEK(&H417) AND &H9F)'non numérique

DEF SEG

    COLOR blancbrill

 

    LOCATE v

     l = 0

     FOR i = 1 TO np

      LOCATE , h: PRINT p$(i)

      IF LEN(p$(i)) > l THEN l = LEN(p$(i))

     NEXT

    vt = v - 1

    LOCATE v, h - 1: COLOR jaune: PRINT "-"; p$(1); "-": COLOR blancbrill

 

'souris

v_mini = v: v_maxi = v_mini + np - 1

h_mini = h - 1: h_maxi = l + h_mini + 1

 

DO

MouseBorder 46, 435, 260, 620

MouseShow

souris = 0

DEF SEG = 0

POKE 1050, PEEK(1052)

DEF SEG

 

DO

    r$ = INKEY$

    ' Obtient l'emplacement de la souris et l'état des boutons.

     MousePoll v_mouse, h_mouse, lButton, rButton

       'LOCATE 21, 1: PRINT v_mouse, h_mouse'===

       'matrice 14 x 8 = transforme en coord écran

       v_mouse = INT(v_mouse / 14) + 1

       h_mouse = INT(h_mouse / 8) + 1

    IF lButton THEN

         IF v_mouse >= v_mini AND v_mouse <= v_maxi THEN

            IF h_mouse >= h_mini AND h_mouse <= h_maxi THEN

                MouseHide

                LOCATE v_mini

                    FOR i = 1 TO np

                        LOCATE , h_mini: PRINT " "; p$(i); " "

                    NEXT

                    calcul = v_mouse - v_mini + 1

                    LOCATE v_mouse, h_mini

                    COLOR jaune

                    PRINT "-"; p$(calcul); "-"

                    CALL attendre(.3)

                    r = calcul

                    EXIT SUB

            ELSE

                BEEP

            END IF

         ELSEIF v_mouse = v2 AND h_mouse = h2 THEN

                  rr = 72 'fleche haut

                  souris = 1

                  CALL attendre(.2)

                  EXIT DO

         ELSEIF v_mouse = v2 AND h_mouse = h2 + 2 THEN

                  rr = 80 'fleche bas

                  souris = 1

                  CALL attendre(.2)

                  EXIT DO

         ELSEIF v_mouse = v2 AND (h_mouse >= h2 + 9 AND h_mouse <= h2 + 11) THEN

                  rr = 13

                  souris = 1

                  CALL attendre(.3)

                  EXIT DO

         ELSE

            BEEP

         END IF

    END IF

 

  LOOP WHILE r$ = ""

 

MouseHide

 

IF souris = 0 THEN

    IF LEN(r$) < 2 THEN rr = ASC(r$) ELSE rr = ASC(RIGHT$(r$, 1))

END IF

 

     IF rr = 27 THEN r = 0: EXIT SUB

    LOCATE v, h - 1: PRINT " "; p$(v - vt); " "

     IF rr = 72 THEN v = v - 1: IF v = vt THEN v = vt + np

     IF rr = 80 THEN v = v + 1: IF v = vt + np + 1 THEN v = vt + 1

    LOCATE v, h - 1: COLOR jaune: PRINT "-"; p$(v - vt); "-": COLOR blancbrill

  LOOP WHILE rr <> 13

    r = v - vt

    COLOR blancbrill

 

END SUB

 

DEFINT A-Z

SUB flechesmenu (w$(), r, coul)

nm = 21 '===

DIM p$(nm)

CONST gauche = 75, droite = 77, bas = 80, haut = 72

h1 = 6: h2 = 32: h3 = 58

 

'on met des espaces à la fin

FOR i = 1 TO nm

     p$(i) = w$(i)

NEXT

    l2 = 0

FOR i = 1 TO nm

    l1 = LEN(p$(i)): IF l2 < l1 THEN l2 = l1

NEXT

FOR i = 1 TO nm

    p$(i) = p$(i) + SPACE$(l2 - LEN(p$(i)))

NEXT

'+++

 

h = h1: v = 7

r = 1

 

DO

 

 IF couleur = 1 THEN COLOR coul, blanc ELSE COLOR noir, blanc

  LOCATE v, h - 1

  PRINT " "; p$(r); " "

  COLOR blancbrill, coul

 

  hh = h: vv = v

 

'fleches

DEF SEG = 0

POKE &H417, (PEEK(&H417) AND &H9F)'non numérique

POKE &H417, (PEEK(&H417) AND &HBF) 'minus

POKE 1050, PEEK(1052)

DEF SEG

 

souris = 0

DO

r$ = INKEY$

 

    ' Obtient l'emplacement de la souris et l'état des boutons.

        MousePoll v_mouse, h_mouse, lButton, rButton

   ' LOCATE 21, 1: PRINT "Position de la souris : "; v_mouse; ", "; h_mouse '===

    IF lButton THEN

         'ligne fleches et entree

         IF v_mouse = 22 THEN

            IF h_mouse = 33 THEN

                'fleche haut

                rr = haut

                CALL attendre(.3)

                souris = 1

                EXIT DO

            ELSEIF h_mouse = 35 THEN

                'fleche bas

                rr = bas

                CALL attendre(.3)

                souris = 1

                EXIT DO

            ELSEIF h_mouse = 37 THEN

                'fleche gauche

                rr = gauche

                CALL attendre(.3)

                souris = 1

                EXIT DO

            ELSEIF h_mouse = 39 THEN

                'fleche droite

                rr = droite

                CALL attendre(.3)

                souris = 1

                EXIT DO

            ELSEIF h_mouse >= 46 AND h_mouse <= 48 THEN

                'entree

                rr = 13

                CALL attendre(.3)

                souris = 1

                EXIT DO

            ELSEIF h_mouse >= 3 AND h_mouse <= 15 THEN

                'ligne echap et *

                  rr = 27

                  CALL attendre(.3)

                  souris = 1

                  EXIT DO

            ELSEIF h_mouse >= 68 AND h_mouse <= 78 THEN

                  rr = 42

                  CALL attendre(.3)

                  souris = 1

                  EXIT DO

            ELSE

                BEEP

            END IF

          END IF

 

         'lignes noms des activités

         IF v_mouse = 7 THEN

            IF h_mouse >= 6 AND h_mouse <= 24 THEN

              GOSUB afficheliste

              r = 1

              LOCATE v_mouse, 5

               IF couleur = 1 THEN COLOR coul, blanc ELSE COLOR noir, blanc

               PRINT " "; p$(r); " "

              CALL attendre(.5)

              EXIT SUB

             ELSEIF h_mouse >= 32 AND h_mouse <= 50 THEN

              GOSUB afficheliste

              r = 8

              LOCATE v_mouse, 31

               IF couleur = 1 THEN COLOR coul, blanc ELSE COLOR noir, blanc

               PRINT " "; p$(r); " "

              CALL attendre(.5)

              EXIT SUB

             ELSEIF h_mouse >= 57 AND h_mouse <= 76 THEN

              GOSUB afficheliste

              r = 15

              LOCATE v_mouse, 57

               IF couleur = 1 THEN COLOR coul, blanc ELSE COLOR noir, blanc

               PRINT " "; p$(r); " "

              CALL attendre(.5)

              EXIT SUB

 

             ELSE

                BEEP

             END IF

         ELSEIF v_mouse = 9 THEN

            IF h_mouse >= 6 AND h_mouse <= 24 THEN

             GOSUB afficheliste

              r = 2

              LOCATE v_mouse, 5

               IF couleur = 1 THEN COLOR coul, blanc ELSE COLOR noir, blanc

               PRINT " "; p$(r); " "

              CALL attendre(.5)

              EXIT SUB

             ELSEIF h_mouse >= 32 AND h_mouse <= 50 THEN

             GOSUB afficheliste

              r = 9

              LOCATE v_mouse, 31

               IF couleur = 1 THEN COLOR coul, blanc ELSE COLOR noir, blanc

               PRINT " "; p$(r); " "

              CALL attendre(.5)

              EXIT SUB

             ELSEIF h_mouse >= 57 AND h_mouse <= 76 THEN

             GOSUB afficheliste

              r = 16

              LOCATE v_mouse, 57

               IF couleur = 1 THEN COLOR coul, blanc ELSE COLOR noir, blanc

               PRINT " "; p$(r); " "

              CALL attendre(.5)

              EXIT SUB

             ELSE

                BEEP

             END IF

         ELSEIF v_mouse = 11 THEN

            IF h_mouse >= 6 AND h_mouse <= 24 THEN

              GOSUB afficheliste

              r = 3

              LOCATE v_mouse, 5

               IF couleur = 1 THEN COLOR coul, blanc ELSE COLOR noir, blanc

               PRINT " "; p$(r); " "

              CALL attendre(.5)

              EXIT SUB

 

             ELSEIF h_mouse >= 32 AND h_mouse <= 50 THEN

              GOSUB afficheliste

              r = 10

              LOCATE v_mouse, 31

               IF couleur = 1 THEN COLOR coul, blanc ELSE COLOR noir, blanc

               PRINT " "; p$(r); " "

              CALL attendre(.5)

              EXIT SUB

             ELSEIF h_mouse >= 57 AND h_mouse <= 76 THEN

              GOSUB afficheliste

              r = 17

              LOCATE v_mouse, 57

               IF couleur = 1 THEN COLOR coul, blanc ELSE COLOR noir, blanc

               PRINT " "; p$(r); " "

              CALL attendre(.5)

              EXIT SUB

 

             ELSE

                BEEP

             END IF

         ELSEIF v_mouse = 13 THEN

            IF h_mouse >= 6 AND h_mouse <= 24 THEN

              GOSUB afficheliste

              r = 4

              LOCATE v_mouse, 5

               IF couleur = 1 THEN COLOR coul, blanc ELSE COLOR noir, blanc

               PRINT " "; p$(r); " "

              CALL attendre(.5)

              EXIT SUB

 

             ELSEIF h_mouse >= 32 AND h_mouse <= 50 THEN

              GOSUB afficheliste

              r = 11

              LOCATE v_mouse, 31

               IF couleur = 1 THEN COLOR coul, blanc ELSE COLOR noir, blanc

               PRINT " "; p$(r); " "

              CALL attendre(.5)

              EXIT SUB

             ELSEIF h_mouse >= 57 AND h_mouse <= 76 THEN

              GOSUB afficheliste

              r = 18

              LOCATE v_mouse, 57

               IF couleur = 1 THEN COLOR coul, blanc ELSE COLOR noir, blanc

               PRINT " "; p$(r); " "

              CALL attendre(.5)

              EXIT SUB

 

             ELSE

                BEEP

             END IF

         ELSEIF v_mouse = 15 THEN

            IF h_mouse >= 6 AND h_mouse <= 24 THEN

              GOSUB afficheliste

              r = 5

              LOCATE v_mouse, 5

               IF couleur = 1 THEN COLOR coul, blanc ELSE COLOR noir, blanc

               PRINT " "; p$(r); " "

              CALL attendre(.5)

              EXIT SUB

 

             ELSEIF h_mouse >= 32 AND h_mouse <= 50 THEN

              GOSUB afficheliste

              r = 12

              LOCATE v_mouse, 31

               IF couleur = 1 THEN COLOR coul, blanc ELSE COLOR noir, blanc

               PRINT " "; p$(r); " "

              CALL attendre(.5)

              EXIT SUB

             ELSEIF h_mouse >= 57 AND h_mouse <= 76 THEN

              GOSUB afficheliste

              r = 19

              LOCATE v_mouse, 57

               IF couleur = 1 THEN COLOR coul, blanc ELSE COLOR noir, blanc

               PRINT " "; p$(r); " "

              CALL attendre(.5)

              EXIT SUB

 

             ELSE

                BEEP

             END IF

         ELSEIF v_mouse = 17 THEN

            IF h_mouse >= 6 AND h_mouse <= 24 THEN

              GOSUB afficheliste

              r = 6

              LOCATE v_mouse, 5

               IF couleur = 1 THEN COLOR coul, blanc ELSE COLOR noir, blanc

               PRINT " "; p$(r); " "

              CALL attendre(.5)

              EXIT SUB

 

             ELSEIF h_mouse >= 32 AND h_mouse <= 50 THEN

              GOSUB afficheliste

              r = 13

              LOCATE v_mouse, 31

               IF couleur = 1 THEN COLOR coul, blanc ELSE COLOR noir, blanc

               PRINT " "; p$(r); " "

              CALL attendre(.5)

              EXIT SUB

             ELSEIF h_mouse >= 57 AND h_mouse <= 76 THEN

              GOSUB afficheliste

              r = 20

              LOCATE v_mouse, 57

               IF couleur = 1 THEN COLOR coul, blanc ELSE COLOR noir, blanc

               PRINT " "; p$(r); " "

              CALL attendre(.5)

              EXIT SUB

 

             ELSE

                BEEP

             END IF

 

         ELSEIF v_mouse = 19 THEN

            IF h_mouse >= 6 AND h_mouse <= 24 THEN

              GOSUB afficheliste

              r = 7

              LOCATE v_mouse, 5

               IF couleur = 1 THEN COLOR coul, blanc ELSE COLOR noir, blanc

               PRINT " "; p$(r); " "

              CALL attendre(.5)

              EXIT SUB

 

             ELSEIF h_mouse >= 32 AND h_mouse <= 50 THEN

              GOSUB afficheliste

              r = 14

              LOCATE v_mouse, 31

               IF couleur = 1 THEN COLOR coul, blanc ELSE COLOR noir, blanc

               PRINT " "; p$(r); " "

              CALL attendre(.5)

              EXIT SUB

             ELSEIF h_mouse >= 57 AND h_mouse <= 76 THEN

              GOSUB afficheliste

              r = 21

              LOCATE v_mouse, 57

               IF couleur = 1 THEN COLOR coul, blanc ELSE COLOR noir, blanc

               PRINT " "; p$(r); " "

              CALL attendre(.5)

              EXIT SUB

 

             ELSE

                BEEP

 

             END IF

 

         ELSE

          BEEP

         END IF

    END IF

LOOP WHILE r$ = ""

 

    IF souris = 0 AND LEN(r$) < 2 THEN

        rr = ASC(r$)

    ELSEIF souris = 0 THEN

        rr = ASC(RIGHT$(r$, 1))

    END IF

 

 SELECT CASE rr

 

 CASE gauche

  h = h - 26

  IF h < h1 THEN

   v = v - 2: h = h3

  END IF

  IF v < 7 THEN

   v = 19

  END IF

 

 CASE droite

  h = h + 26

   IF h > h3 THEN

    v = v + 2: h = h1

   END IF

   IF v > 19 THEN

    v = 7

   END IF

 

 CASE bas

   v = v + 2

   IF v > 19 THEN

    IF h = h1 THEN

     h = h2: v = 7

    ELSEIF h = h2 THEN

     h = h3: v = 7

    ELSEIF h = h3 THEN

     h = h1: v = 7

    END IF

   END IF

 

  CASE haut

   v = v - 2

   IF v < 7 THEN

    IF h = h3 THEN

     h = h2: v = 19

    ELSEIF h = h2 THEN

     h = h1: v = 19

    ELSEIF h = h1 THEN

     h = h3: v = 19

    END IF

   END IF

 

   CASE 13

     GOSUB calculr

     EXIT SUB

 

   CASE 27

    r = 0

   EXIT SUB

 

   CASE 42, 36, 56, 230, 43

    IF eleve <> 0 THEN

    'l'étoile

    r = 42

    EXIT SUB

    END IF

 

END SELECT

 

  COLOR blancbrill, coul

  LOCATE vv, hh - 1

  PRINT " "; p$(r); " "

 

GOSUB calculr

 

LOOP

 

EXIT SUB

 

calculr:

IF h = h1 THEN

 r = ((v - 7) / 2) + 1

ELSEIF h = h2 THEN

 r = ((v - 7) / 2) + 8

ELSEIF h = h3 THEN

 r = ((v - 7) / 2) + 15

END IF

RETURN

 

afficheliste:

'affiche liste exo

h1 = 5: h2 = 31: h3 = 57

COLOR blancbrill

LOCATE 7

FOR i = 1 TO 7

 LOCATE , h1: PRINT " "; p$(i); " ": PRINT

NEXT

LOCATE 7

FOR i = 8 TO 14

 LOCATE , h2: PRINT " "; p$(i); " ": PRINT

NEXT

LOCATE 7

FOR i = 15 TO 21

 LOCATE , h3: PRINT " "; p$(i); " ": PRINT

NEXT

RETURN

 

END SUB

 

DEFINT A-Z

SUB getinvi (rr%)

DEF SEG = 0

POKE 1050, PEEK(1052)

DEF SEG

DO

   r$ = INKEY$

LOOP WHILE r$ = ""

IF LEN(r$) < 2 THEN rr = ASC(r$) ELSE rr = ASC(RIGHT$(r$, 1))

END SUB

 

DEFINT A-Z

SUB getinvimouse (rr)

DEF SEG = 0

POKE 1050, PEEK(1052)

DEF SEG

DO

    r$ = INKEY$

    ' Obtient l'emplacement de la souris et l'état des boutons.

     MousePoll v_mouse, h_mouse, lButton, rButton

    IF lButton THEN

     r$ = CHR$(13)

    CALL attendre(.5)

    END IF

LOOP WHILE r$ = ""

IF LEN(r$) < 2 THEN rr = ASC(r$) ELSE rr = ASC(RIGHT$(r$, 1))

 

 

END SUB

 

DEFINT A-Z

SUB inputgen (nl%, r$, deb%, fin%)

DIM re$(nl + 1)

 

inpdebut:

r$ = "."

DEF SEG = 0

POKE 1050, PEEK(1052)

DEF SEG

IF prog = 20 THEN 'orth

 COLOR noir, blanc

END IF

 

   ligne = CSRLIN

   col = POS(0)

 LOCATE ligne, col: IF fin% = 57 THEN PRINT LEFT$(SPACE$(40), nl)

 LOCATE ligne, col, 1

 FOR ii = 1 TO nl + 1

input0:

  IF ii <= 0 THEN ii = 1

   DO

    re$(ii) = INKEY$

   LOOP WHILE re$(ii) = ""

 

  IF ASC(re$(ii)) = 27 THEN

    LOCATE , , 0

    CALL quitter

    r$ = ""

    EXIT FOR

  END IF

 

  IF LEN(re$(ii)) = 2 THEN z2 = ASC(RIGHT$(re$(ii), 1)): IF ii > 1 AND (z2 = 75 OR z2 = 83 OR z2 = 15) THEN PRINT CHR$(29); " "; CHR$(29); : ii = ii - 1: z2 = 0: GOTO input0 ELSE GOTO input0

 

  IF ASC(re$(ii)) = 13 THEN EXIT FOR

 

  IF ii > 1 AND ASC(re$(ii)) = 8 THEN PRINT CHR$(29); " "; CHR$(29); : ii = ii - 1: GOTO input0 ELSE IF ASC(re$(ii)) = 8 THEN GOTO input0

 

  IF ASC(re$(ii)) < deb OR ASC(re$(ii)) > fin THEN IF deb = 48 THEN CALL chiffres: r$ = "": EXIT FOR ELSE CALL lettres: r$ = "": EXIT FOR

 

  IF ii = nl + 1 THEN BEEP: GOTO input0

 

  PRINT re$(ii);

 NEXT ii

IF r$ = "" THEN LOCATE ligne, col: GOTO inpdebut

PRINT

r$ = "": FOR JJ = 1 TO ii - 1: r$ = r$ + re$(JJ): NEXT

r$ = LTRIM$(r$): r$ = RTRIM$(r$)

IF r$ = "" THEN BEEP: LOCATE ligne, col: GOTO inpdebut

LOCATE , , 0

 

END SUB

 

DEFINT A-Z

SUB lettres ()

LOCATE 23, 1, 0

FOR i = 1 TO 80

   xx$ = xx$ + CHR$(SCREEN(23, i))

NEXT

LOCATE 23, 1: PRINT SPACE$(80)

CALL centre(23, rougeclair, "Des lettres !")

CALL attendre(1)

COLOR blanc: LOCATE 23, 1: PRINT xx$

END SUB

 

DEFINT A-Z

SUB niveau (r%, np%, titr$)

CALL titre(titr$)

 DIM p$(4)

 p$(1) = "1": p$(2) = "2": p$(3) = "3": p$(4) = "4"

 CALL cadre(7, 25, 30, 2, vert)

 COLOR , vert

 CALL centre(8, blancbrill, "Niveau de difficulté")

 COLOR blanc, noir

 CALL centre(23, blanc, gg$)

COLOR 15, bleu

 p$(1) = "1": p$(2) = "2": p$(3) = "3": p$(4) = "4"

'CALL cadre(11, 36, 7, 3 + np, rouge)

 

 DO

        CALL fleches(13, 40, p$(), np, r, rouge, 1, 23, 35)

          IF r = 0 THEN

                CALL quitter

          END IF

 LOOP WHILE r = 0

END SUB

 

DEFINT A-Z

SUB ouinon (r$)

h = POS(0)

v = CSRLIN

 

    DIM regs AS RegType

    regs.ax = &HF00

    INTERRUPT &H10, regs, regs          ' &H10 renvoie informations

                                        ' sur vidéo.

    sWidth = (regs.ax AND &HFF00) \ 256 ' Octet fort de AX (AH).

    sMode = regs.ax AND &HFF            ' Octet faible de AX (AL).

 

    SELECT CASE sMode                   ' Fait correspondre numéros

        CASE 3                          '  de mode vidéo MS-DOS et

            sMode = 0                   '  modes affichage Basic.

        CASE 16

            sMode = 9

            MouseInit

    END SELECT

 

LOCATE v, h

COLOR blanc: PRINT "["; : COLOR jaune: PRINT "O"; : COLOR blanc: PRINT "]ui ou ["; : COLOR jaune: PRINT "N"; : COLOR blanc: PRINT "]on ?"

 

MouseShow

 

DO

            r$ = ""

        DO

                r$ = INKEY$

                ' Obtient l'emplacement de la souris et l'état des boutons.

                MousePoll v_mouse, h_mouse, lButton, rButton

                IF sMode = 9 THEN

                'matrice 14 x 8 = transforme en coord écran

                    v_mouse = INT(v_mouse / 14) + 1

                    h_mouse = INT(h_mouse / 8) + 1

                END IF

                IF lButton THEN

                    IF v_mouse = v AND (h_mouse >= h AND h_mouse <= h + 5) THEN

                        r$ = "o"

                        CALL attendre(.3)

                    ELSEIF v_mouse = v AND (h_mouse >= h + 10 AND h_mouse <= h + 14) THEN

                        r$ = "n"

                        CALL attendre(.3)

                    ELSE

                        BEEP

                    END IF

                END IF

        LOOP WHILE r$ = ""

 

            r$ = UCASE$(r$)

LOOP UNTIL r$ = "O" OR r$ = "N" OR r$ = CHR$(27) OR r$ = CHR$(13)

 

END SUB

 

DEFINT A-Z

SUB quitter ()

'25/2/96

DIM c(80), xx$(80)

x = noir: y = noir

  F = 0

  'on mémorise la zone quitter

  LOCATE 23, 1, 0

  COLOR blanc, x

  FOR i = 1 TO 80

   xx$(i) = CHR$(SCREEN(23, i))

   c(i) = SCREEN(23, i, 1): IF c(i) > 15 THEN F = 1 'erreur à cause du fond

  NEXT

 

  LOCATE 23, 1: PRINT SPACE$(80)

 

  LOCATE 23, 28

  BEEP: PRINT "Quitter  ";

  CALL ouinon(r$)

  IF UCASE$(r$) = "O" THEN COLOR , 0: CLS : RUN "exo_ge" '===

 

  'on restitue la zone quitter

  LOCATE 23, 1

  FOR i = 1 TO 80

   IF F = 0 THEN

   COLOR c(i)

   END IF

    PRINT xx$(i);

  NEXT

  PRINT

COLOR 15, y

END SUB

 

DEFINT A-Z

SUB resultats (re%, ni%)

SCREEN 0

MouseInit

MouseShow

tit$ = titr$

titr$ = "resultats"

CALL titre(titr$)

 

w! = LEN(tit$) / 2

IF w! = INT(LEN(tit$) / 2) THEN n = 4 ELSE n = 2

CALL cadre(5, 38 - INT(LEN(tit$) / 2), INT(LEN(tit$)) + n, 2, blanc)

COLOR , blanc

CALL centre(6, noir, tit$)

COLOR , bleu

 

IF re > 8 THEN

    cc = vertclair: z$ = "Acquis"

ELSEIF re > 4 AND re < 9 THEN

    cc = jaune: z$ = "En cours d'acquisition"

ELSE

    cc = rougeclair: z$ = "Non acquis"

END IF

 

IF nbniv <> 1 THEN

s$ = " au niveau" + RTRIM$(STR$(ni))

ELSE

s$ = ""

END IF

 

CALL centre(10, cc, z$ + s$)

CALL cadre(12, 20, 40, 2, rouge)

LOCATE 13

i2 = 0

FOR i = 1 TO re

 LOCATE , 21 + i2: PRINT "████"; '219

 i2 = i2 + 4

 NEXT

COLOR noir, noir

FOR i = re + 1 TO 10

 LOCATE , 21 + i2: PRINT "    ";

 i2 = i2 + 4

 NEXT

PRINT

 COLOR , bleu

CALL centre(16, 15, "Pourcentage de réussite :" + STR$(re * 10) + " %")

CALL centre(18, 15, "(" + LTRIM$(STR$(re)) + " sur 10)")

 

COLOR blancbrill

END SUB

 

DEFINT A-Z

SUB tableauexo (p$())

 

'tableau des exercices

CALL cadre(5, 2, 75, 16, rouge)

   COLOR , bleu

   LOCATE 22, 3: PRINT "["; : COLOR jaune: PRINT "Echap"; : COLOR blancbrill: PRINT "] = Fin"

   CALL centre(22, blanc, gg2$)

   IF eleve <> 0 THEN

    COLOR blancbrill

    LOCATE 22, 68: PRINT "["; : COLOR jaune: PRINT "*"; : COLOR blancbrill: PRINT "] = Bilan"

   END IF

 

 

l3$ = SPACE$(24) + "│" + SPACE$(25) + "│" + SPACE$(23)

l4$ = STRING$(24, "─") + "┼" + STRING$(25, "─") + "┼" + STRING$(23, "─")

l5$ = STRING$(24, "─") + "┬" + STRING$(25, "─") + "┬" + STRING$(23, "─")

l6$ = STRING$(24, "─") + "┴" + STRING$(25, "─") + "┴" + STRING$(23, "─")

 

COLOR blanc, rouge

LOCATE 6

LOCATE , 3: PRINT l5$

'LOCATE , 3: PRINT l3$

FOR i = 1 TO 6

LOCATE , 3: PRINT l3$

LOCATE , 3: PRINT l4$

NEXT

LOCATE , 3: PRINT l3$

LOCATE , 3: PRINT l6$

 

'affiche liste exo

h1 = 6: h2 = 32: h3 = 58

COLOR blancbrill

LOCATE 7

FOR i = 1 TO 7

 LOCATE , h1: PRINT p$(i): PRINT

NEXT

LOCATE 7

FOR i = 8 TO 14

 LOCATE , h2: PRINT p$(i): PRINT

NEXT

LOCATE 7

FOR i = 15 TO 21

 LOCATE , h3: PRINT p$(i): PRINT

NEXT

 

 

END SUB

 

DEFINT A-Z

SUB titre (titr$)

   w$ = titr$

   COLOR , noir, noir: CLS

   FOR i = 1 TO LEN(w$)

     IF MID$(w$, i, 1) = "é" OR MID$(w$, i, 1) = "è" THEN

       w$ = MID$(w$, 1, i - 1) + "E" + MID$(w$, i + 1)

     END IF

   NEXT

   FOR i = 1 TO LEN(w$)

     IF MID$(w$, i, 1) = "à" THEN

       w$ = MID$(w$, 1, i - 1) + "A" + MID$(w$, i + 1)

     END IF

   NEXT

 

   COLOR , vert

   LOCATE 2, 1: PRINT SPACE$(80)

   CALL centre(2, noir, UCASE$(w$))

   LOCATE 21, 1: PRINT SPACE$(80)

   VIEW PRINT 3 TO 20: COLOR blancbrill, bleu: CLS 2: VIEW PRINT

 

END SUB

 

DEFINT A-Z

SUB titre2 (titr$)

 COLOR , noir: CLS

   w$ = titr$

   FOR i = 1 TO LEN(w$)

     IF MID$(w$, i, 1) = "é" OR MID$(w$, i, 1) = "è" THEN

       w$ = MID$(w$, 1, i - 1) + "E" + MID$(w$, i + 1)

     END IF

   NEXT

 LINE (0, 14)-(640, 27), vert, BF

   CALL centre(2, jaune, " " + UCASE$(w$) + " ")

 LINE (0, 28)-(639, 279), bleu, BF

 LINE (0, 279)-(640, 292), vert, BF

 COLOR blancbrill

END SUB

 

DEFINT A-Z

SUB titre3 (titr$)

 COLOR , noir: CLS

   w$ = titr$

   FOR i = 1 TO LEN(w$)

     IF MID$(w$, i, 1) = "é" OR MID$(w$, i, 1) = "è" THEN

       w$ = MID$(w$, 1, i - 1) + "E" + MID$(w$, i + 1)

     END IF

   NEXT

 

 LINE (0, 14)-(640, 27), vert, BF

   CALL centre(2, jaune, " " + UCASE$(w$) + " ")

 

 LINE (0, 28)-(639, 279), bleu, BF

 LINE (430, 38)-(630, 269), noir, BF

 LINE (430, 38)-(630, 269), rouge, B

 LINE (0, 279)-(640, 292), vert, BF

 COLOR blancbrill

END SUB

 

 

Géométrie Primaire 

 

 

Précédente Accueil Remonter Suivante