Démineur :
ClrText
"1-CONTINUER"
"2-COMMENCER"
?->A
A=1=>Goto 2
Lbl 6
0->A~Z
"NBRE DE MINES :"
?->W
W->G
W<1 Or W>30=>Stop
ViewWindow 0,127,0,1,63,0
Lbl 0
Text 1+8A,5+8B,"?"
B+1->B
B=11=>A+1->A
B=11=>0->B
A8=>Goto 0
For 1->A To 65 Step 8
Green F-Line 1,A,90,A
Next
For 1->A To 97 Step 8,1
Green F-Line A,1,A,63
Next
{10,13}->Dim Mat A
W->A
Lbl 1
Int (Ran#x8+2)->L
Int (Ran#x11+2)->C
Mat A[L,C]=1 Or (L=2 And C=2)=> Goto 1
1->Mat A[L,C]
A-1->A
A0=>Goto 1
Text 1,92,"NBRE DE"
Text 7,92,"MINES :"
Text 19,92,"SCORE:"
2->C
2->L
Goto 4
Lbl 2
C->D
L->M
Text 1+8(L-2),5+8(C-2)," "
Text 1+8(L-2),5+8(C-2),"X"
Do
LpWhile (Getkey)=0
Getkey->r
r=72=>Goto A
r=62=>Goto B
r=52=>Goto C
r=73=>Goto D
r=53=>Goto E
r=74=>Goto F
r=64=>Goto G
r=54=>Goto H
Goto 2
Lbl A
L=9 Or C=2=>Goto 2
L+1->L:C-1->C
Goto 3
Lbl B
L=9=>Goto 2
L+1->L
Goto 3
Lbl C
L=9 Or C=12=>Goto 2
L+1->L:C+1->C
Goto 3
Lbl D
C=2=>Goto 2
C-1->C
Goto 3
Lbl E
C=12=>Goto 2
C+1->C
Goto 3
Lbl F
L=2 Or C=2=>Goto 2
L-1->L:C-1->C
Goto 3
Lbl G
L=2=>Goto 2
L-1->L
Goto 3
Lbl H
L=2 Or C=12=>Goto 2
L-1->L:C+1->C
Lbl 3
Text 1+8(M-2),5+8(D-2)," "
If Mat A[L,C]=1
Then 2->A~B
Text 43,92,"PERDU..."
Goto P
IfEnd
Lbl 4
Text 13,102,Int (Mat A[L-1,C-1]+Mat
A[L-1,C]+Mat A[L-1,C+1]+Mat
A[L,C-1]+Mat A[L,C+1]+Mat
A[L+1,C-1]+Mat A[L+1,C]+Mat
A[L+1,C+1]
If Mat A[L,C]=0
Then W+1->W
W=88=>0->W
W=0=>Text 43,92,"GAGNE!!!"
W=0=>2->A~B
W=0=>Goto P
0,1->Mat A[L,C]
S+G->S
Else S-1->S
IfEnd
Text 25,98,S
Goto 2
Lbl P
Text 1+8(A-2),5+8(B-2)," "
Mat A[A,B]=1=>Text 1+8(A-2),4+8(B-2),"*"
B-1->B
B=13=>A+1->A
B=13=>2->B
A=10=>Goto 5
Goto P
Lbl 5
Do
LpWhile (Getkey)=0
Goto 6
Principe du jeu :
Il faut découvrir tout le damier. Pour se
déplacer il faut utiliser les touches 1, 2, 3, 4, 6,
7, 8 et 9. Attention, il ne faut pas aller sur une case
où il y a une mine. En haut à droite, vous
pouvez voir le nombre de mines qu'il y a autour de
vous.
|
Truc :
Lbl 0
For 1->A To -1
Goto 0
Principe :
Mettez ce programme en route et vous ne pourrez plus
arrêter la calculatrice, même en appuyant sur la
touche AC. Le seul moyen de l'arrêter est d'appuyer
sur le bouton P à l'arrière de la machine puis
de sélectionner "No" lorsqu'on vous demande si vous
voulez tout effacer. Ce programme est très court, il
vous suffit de le mettre dans la calculatrice de quelqu'un
qui le mettra en marche un jour. Effet de panique
garanti...
|