Jeu de Mastermind.
Il est indispensable de créér une matrice Z de 35*5 ( si tu n’en a pas, essaie de l’émuler)
Programme MASTER
MENU-MASTER
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 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 |
A=1=>Goto X:Prog "MENU":Goto Z Lbl X:0->A:"MASTERMIND" " PAR REMI P" Disp 3->P_ Lbl I 35->O Lbl J 0->Mat Z[O,P] Dsz O Goto J Dsz P Goto I 0->A~Z "ENTREZ LE NOMBRE DE CHIFFRES : " ?->L Int (Ran#*10^L)->A A->R Lbl A L->O Lbl 2 Int (R/10^(0-1))-Int (R/10^O)*10->A[19+O] Dsz O Goto 2 0->M 0->N " " "ENTREZ UN NOMBRE:" ?->A L->O Q+1->Q A=R=>Goto C A=-1=>Goto D A=-2=>Goto E Q=33=>Goto D Lbl 3 Int (A/10^(O-1))-Int(A/10^O)*10->A[1+O] Dsz O Goto 3 L->O Lbl 4 A[O+1]=A[O+19]=>Goto 5 Goto 6 Lbl 5 12->A[O+19] 14->A[0+1] M+1->M Goto 6 Lbl 6 Dsz O Goto 4 L->O Lbl 7 L->P Lbl 8 A[1+O]A[19+P]=>Goto B Lbl 9 13->A[O+1] 15->A[P+19] N+1->N Goto B Lbl B Dsz P Goto 8 Dsz O Goto 7 M=0=>"BIEN PLACE 0" M=1=>"BIEN PLACE 1" M=2=>"BIEN PLACES 2" M=3=>"BIEN PLACES 3" M=4=>"BIEN PLACES 4" M=5=>"BIEN PLACES 5" M=6=>"BIEN PLACES 6" M=7=>"BIEN PLACES 7" N=0=>"MAL PLACE 0" N=1=>"MAL PLACE 1" N=2=>"MAL PLACES 2" N=3=>"MAL PLACES 3" N=4=>"MAL PLACES 4" N=5=>"MAL PLACES 5" N=6=>"MAL PLACES 6" N=7=>"MAL PLACES 7" N=8=>"MAL PLACES 8" A->Mat Z[Q,1] M->Mat Z[Q,2] N->Mat Z[Q,3] Goto A Lbl C "BRAVO VOUS AVEZ GAGNE NOMBRE DE COUPS : " A->Mat Z[Q,1] L->Mat Z[Q,2] Q Disp Goto 2 Lbl D R Disp "C'ETAIT LE NOMBRE A TROUVER. UNE AUTRE ?" Goto 2 Lbl E Mat Z Disp Q-1->Q Goto A Lbl Z:0->A~Z "OK" |
© Copyright 1995 – Rémi Peyronnet