Le but du jeu est de déminer toutes les cases en s’aidant du nombre de mines dans les 8 cases a coté qui apparait lors du déminage d’une case.
Il faut imperativement créer une matrice Mat V [9,14] avec 14 dans Mat V[3,1] et [5,1] et avec 08 dans Mat V[4,1] et [6,1].
Programme DEMINEUR Alias Prog Q : 688 pas
DEMINEUR
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 |
"DEMINEUR" " PAR REMI P." Disp Lbl 0 " " " - DEMINEUR -" " 0 - QUITTER" " 1 - NOUVEAU" " 2 - REPRENDRE" " 3 - CONTINUER" " 4 - DIMENSIONNER" "CHOIX"?->A A=0=>Goto Z A=1=>Goto A A=2=>Goto B A=3=>Goto C A=4=>Goto D Goto 0 Lbl A Mat V[1,4]->W:Lbl 1 Mat V[1,3]->V:Lbl 2 99->Mat V[W+1,V] Dsz V: Goto 2 Dsz W: Goto 1 Mat V[1,7]->U Lbl 3 Int (Ran#*(Mat V[1,3]-0))+1->V Int (Ran#*Mat V[1,4]-0))+1->W Mat V[W+1,V]99=>Goto 3 10->Mat V[W+1,V] Dsz U:Goto3 1->Mat V[1,1] 1->Mat V[1,2] 0->Mat V[1,8] 3200->A Prog S Goto 0 Lbl C 3100->A Prog S Goto 0 Lbl B 0->A Prog S Goto 0 Lbl D "0 : AU HASARD" Lbl 4 " LARGEUR "?->A A=0=>Int (Ran#*(Mat V[1,5]-1))+1->A A>Mat V[1,5]=>Goto 4 A->Mat V[1,3] Lbl 5 " HAUTEUR "?->A A=0=>Int (Ran#*(Mat V[1,6]-1))+1->A A>Mat V[1,6]=>Goto 5 A->Mat V[1,4] Lbl 6 " NB DE MINES "?->A A=0=>Int (Ran#*((Mat V[1,3]*Mat V[1,4])-2))+1->A A>=Mat V[1,3]*Mat V[1,4]=>Goto 6 A->Mat V[1,7] Goto 0 Lbl Z "OK" |
Programme DEMIN-GRAPH Alias Prog R : 290 pas
DEMIN-GRAPH
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 |
Range 1,127,0,1,63,0 Cls Mat V[1,4]+1->W Lbl 0 Plot 1,69-(W*8) (Mat V[1,7]*7)+1->U Plot U,69-(W*8) Line: Dsz W: Goto 0 Mat V[1,3]+1->V:Lbl1 Plot (V*7)-6,61 61-Mat V[1,4]*8->U Plot (V*7)-6,U Line : Dsz V: Goto 1 A=3200=>Goto Z Mat V[1,4]->W:Lbl 2 Mat V[1,3]->V: Lbl 3 Mat V[W+1,V]->Z Z=10=>Goto 4 Z=99=>Goto 4 (V*7)-4->X 64-(W*8)+3->Y V->P:W->Q:Z->W Prog W P->V:Q->W Lbl 4 Dsz V:Goto 3 Dsz W:Goto 2 Lbl Z |
Programme DEMIN-RUN Alias Prog S : 730 pas
DEMIN-RUN
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 |
A3100=>Prog R Mcl Mat V[1,1]->A Mat V[1,2]->B Mat V[1,3]->C Mat V[1,4]->D Mat V[1,7]->H:(C*D)-H->H Mat V[1,8]->F Lbl A (A*7)-5->X 68-(B*8)->Y Plot X,Y Disp X>C*7=>Goto A YGoto A Int ((X-1)/7)+1->A Int ((69-Y)/8)->B (A*7)-4->X 67-(B*8)->Y Mat V[B+1,A]->E E=10=>Goto B E=99=>Goto C Goto A Lbl B 10->W Prog r 1200->O Goto F Lbl 4 "VOUS AVEZ ECHOUE." Disp Goto Z Lbl C F+1->F F->Mat V[1,8] 0->G A>1=>Mat V[B+1,A-1]=10=>G+1->G A>1=>B>1=>Mat V[B,A-1]=10=>G+1->G B>1=>Mat V[B,A]=10=>G+1->G B>1=>AMat V[B,A+1]=10=>G+1->G AMat V[B+1,A+1]=10=>G+1->G ABMat V[B+2,A+1]=10=>G+1->G BMat V[B+2,A]=10=>G+1->G BA>1=>Mat V[B+2,A-1]=10=>G+1->G G->Mat V[B+1,A] G->W Prog W F=H=>Goto D Goto A Lbl D 1300->O Goto F Lbl 5 "BRAVO, VOUS AVEZ BIENDEJOUE LES PLANS DE L'ENNEMI." Goto Z Lbl F D->J:Lbl 6 C->I:Lbl 7 Mat V[J+1,I]10=>Goto 8 10->W (I*7)-4->U 64-(J*8)->V Plot U+1, V: Plot U+2, V: Line Plot U+0, V+1: Plot U+3, V+1:Line Plot U+0, V+2:Plot U+3, V+2:Line Plot U+1, V+3: Plot U+2, V+3: Line Lbl 8 Dsz I:Goto 7 Dsz J:Goto 6 Line Disp O=1300=>Goto 5 O=1200=>Goto 4 Lbl Z |
Programme DIGITS Alias Prog V : 333 pas
DIGITS
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
' ENTREE ' X - ABSCISSE ' Y - ORDONNEE ' Z - CARACTERE 0->V~W X->V:Y->W ZGoto 1:Z-64->Z: Plot V+0, W-4:Plot V+2,W-4:Line Lbl 1:ZGoto 2:Z-32->Z Plot V+2, W-4:Plot V+2, W-2: Line Lbl 2:ZGoto 3:Z-16->Z Plot V+0, W-4: Plot V+0, W-2: Line Lbl 3:ZGoto 4: Z-8->Z Plot V+0, W-2:Plot V+2,W-2:Line Lbl 4:ZGoto 5:Z-4->Z Plot V+2, W-2:Plot V+2, W-0:Line Lbl 5:ZGoto 6:Z-2->Z Plot V+0, W-2:Plot V+0,W+0:Line Lbl 6:ZGoto 7: Z-1->Z Plot V,W-0:Plot V+2,W-0:Line Lbl 7 |
Programme NUMERIX Alias Prog W :107 pas
NUMERIX
1 2 3 4 5 6 7 8 9 10 11 |
W=1=>36->Z W=2=>93->Z W=3=>109->Z W=4=>46->Z W=5=>107->Z W=6=>123->Z W=7=>37->Z W=8=>127->Z W=9=>111->Z W=0=>119->Z Prog V |
© Copyright 1995 – Rémi Peyronnet