on choisit le type d'opérations qui doivent apparaitre à l'écran (=,-,*,/)
on choisit le nombre de chiffres que l'on veut pour chaque nombre
10 calculs apparaissent 1 par 1 à l'écran, le but est d'avoir la meilleure note sur 10 possible
le code source du jeu :
- Code: Tout sélectionner
Gridoff
CoordOff
AxesOff
LabelOff
ExprOff
ClrHome
While Y!=92 or Y!=93
getKey->Y
If Y=92
Goto 5
If Y=93
Then
Goto Q
End
Output(1,1,"POUR JOUER A CE"
Output(2,1,"JEU, IL FAUT"
Output(3,1,"MASQUER OU"
Output(4,1,"SUPPRIMER LES"
Output(5,1,"FONCTIONS"
Output(6,1,"[1] CONTINUER"
Output(7,1,"[2] QUITTER"
End
Lbl 5
ClrDraw
ClrHome
While Y!=92 or Y!=93 or Y!=94
getKey->Y
If Y=92
Goto 6
If Y=93
Goto I
If Y=94
Then
Goto Q
End
Text(10,10,"CALCUL MENTAL"
For(X,9,58
Pxl-On(17,X
For(A,1,8
End
End
Text(20,10,"BY DORIAN V0.6"
Text(31,10,"[1] JOUER"
Text(38,10,"[2] INSTRUCTIONS"
Text(45,10,"[3] QUITTER"
End
Lbl 6
ClrDraw
While Y!=92 or Y!=93 or Y!=94 or Y!=82
getKey->Y
If Y=92
Then
"+"->Str0
1->N
Goto 3
End
If Y=93
Then
"-"->Str0
2->N
Goto 3
End
If Y=94
Then
"*"->Str0
3->N
Goto 3
End
If Y=82
Then
"/"->Str0
4->N
Goto 3
End
Text(10,10,"TYPE D'OPERATION :"
Text(20,10,"[1] ADDITIONS (+)"
Text(28,10,"[2] SOUSTRACTIONS (-)"
Text(36,10,"[3] MULTIPLICATIONS (X)"
Text(44,10,"[4] DIVISIONS (/)"
End
Lbl 3
ClrDraw
While Y!=92 or Y!=93 or Y!=94 or Y!=82 or Y!=83
getKey->Y
If Y=92
Then
1->U
9->V
6->E
7->F
8->G
Goto 4
End
If Y=93
Then
10->U
99->V
5->E
7->F
8->G
Goto 4
End
If Y=94
Then
100->U
999->V
4->E
7->F
8->G
Goto 4
End
If Y=82
Then
1000->U
9999->V
3->E
7->F
8->G
Goto 4
End
If Y=83
Then
10000->U
99999->V
2->E
7->F
8->G
Goto 4
End
1->Q
0->S
Text(1,1,"NOMBRE DE CHIFFRES :"
For(A,15,47,8
Text(A,10,"["
Text(A,13,Q
Text(A,17,"]"
Text(A,21,Q
Text(A,26,"CHIFFRE"
Q+1->Q
End
For(A,23,47,8
Text(A,54,"S"
End
End
ClrHome
ClrDraw
Lbl 4
For(T,1,10
ClrHome
randInt(U,V->B
randInt(U,V->C
Output(4,E,B
Output(4,F,Str0
Output(4,G,C
If N=1:B+C->O
If N=2:B-C->O
If N=3:B*C->O
If N=4:Then:B/C->O:End
Output(8,2,"SCORE :"
Output(8,9,S
Input "RESULTAT : ",P
If P=O:Then:S+1->S:End
If P!=O:Then:S+0->S:End
End
ClrDraw
While Y!=92 or Y!=93
getKey->Y
If Y=92
Goto 5
If Y=93
Then
Goto Q
End
Text(10,10,"PARTIE TERMINEE"
Text(20,10,"SCORE :"
Text(20,39,S
Text(20,48,"/10"
Text(39,10,"[1] MENU PRINCIPAL"
Text(47,10,"[2] QUITTER"
End
Lbl I
ClrDraw
Text(1,12,"CALCUL MENTAL :"
Text(11,1,"APRES AVOIR SELECTIONNE"
Text(19,1,"LE TYPE D'OPERATION"
Text(27,1,"A FAIRE, LE BUT EST DE"
Text(35,1,"RESOUDRE LES 10 CALCULS"
Text(43,1,"EN FAISANT LE MINIMUM"
Text(51,1,"D'ERREUR"
Repeat getKey
End
ClrDraw
Text(10,10,"NOTE :"
Text(20,1,"POUR UN NOMBRE NEGATIF :"
Text(28,1,"IL FAUT UTILISER"
Text(36,1,"LA TOUCHE (-) QUI SE TROUVE"
Text(44,1,"EN DESSOUS DE LA TOUCHE 3"
Repeat getKey
End
Goto 5
Lbl Q
ClrHome
ClrDraw
cependant plusieurs difficultés auxquelles je suis confrontées :
1- 2 autres modes de jeux dans les quels il faudrait soit résoudre 10 calculs le plus vite possible (si un est faux, la partie est perdue)
et l'autre mode de jeu : faire le maximum de calculs en 25 secondes
si quelqu'un pouvait m'indiquer un peu comment je pourrais gérer le temps
2- il faudrait que j'utilise un autre moyen pour rentrer la solution d'un calcul qu'un input, car plusieurs défauts font leur apparition :
- par exemple, si le calcul est 3+6 , si on rentre 9, le calcul est validé, classique, mais si on rentre 12-3 ou 8+1, ou même 3+6
le calcul est validé également...
- si on efface un chiffre lors de la saisie dans l'input (si on s'est trompé dans la saisie par exemple) le calcul disparait, et ça peut s'averer genant...
- je ne crois pas qu'avec input on puisse fixer des limites de temps, je pense que c'est l'utilisation des input qui limite l'utilisation d'un "timer"
dans ce jeu (les guillemets sont importants)
voila, si quelqu'un a son aide à m'apporter, ce serait plus que bien
