Avertissement :Il s'agit d'une page optimisée pour la navigation mobile. Voir la
page originale.
Jeu de dés : 5000
Ratuss le 09/04/2007 à 19:08
Introduction
Voici un petit jeu de dés (de chance en fait), qui consiste à avoir 5000 points en faisant plusieurs combinaison, comme des trimplettes des 1 ou des 5 (la règle est expliqué dans le prog)... pour ceux qui connaissent le jeu du 5000, c'est exactement la meme chose.
Il peut y avoir jusqu'a 5 joueurs et vaut mieux jouer à plusieurs vu que pour l'instant il n'y a pas encore d'intelligence artificielle.
Le programme (environ 3000 octets)
Code
:Lbl M
:ClrHome
:Menu("******5000******","JOUER",J,"REGLES DU JEU",R,"CREDITS",C,"QUITTER",Q
:Lbl J
:0=>H
:While H<1 or H>5 or int H[pas égal à]H
:Disp "COMBIEN DE
:Input "JOUEURS ? (1-5) ",H
:End
:0=>A:0=>B:0=>C:0=>D:0=>E:0=>J
:Lbl F
:If ø=0:Then
:If J=1:S+A=>A
:If J=2:S+B=>B
:If J=3:S+C=>C
:If J=4:S+D=>D
:If J=5:S+E=>E
:End
:ClrHome
:Disp " SCORES :"," "
:For(ø,1,H
:Disp "JOUEUR :
:Output(ø+2,7,ø
:End
:Output(3,11,A
:If H>1
:Output(4,11,B
:If H>2
:Output(5,11,C
:If H>3
:Output(6,11,D
:If H>4
:Output(7,11,E
:J+1=>J
:If J>H:1=>J
:Pause
:ClrHome
:4=>V:4=>W:4=>X:4=>Y:4=>Z:0=>T:0=>S:1=>R
:Lbl 1
:T+1=>T
:If T>3 or (V>4 and W>4 and X>4 and Y>4 and Z>4
:Goto F
:Output(1,1,"JOUEUR :
:If J=1:A=>ø
:If J=2:B=>ø
:If J=3:C=>ø
:If J=4:D=>ø
:If J=5:E=>ø
:Output(1,11,ø
:Output(1,7,J
:Output(8,1,"TOUR
:Output(8,5,T
:If ø<A:R+1=>R
:If ø<B:R+1=>R
:If ø<C:R+1=>R
:If ø<D:R+1=>R
:If ø<E:R+1=>R
:Output(8,11,R
:Output(8,12,"ER
:If R>1
:Output(8,13,"ME
:Output(3,5,"9-----9 ! ! 6-----6
:For(ø,1,5
:If ø=1 and V>6:ø+1=>ø
:If ø=2 and W>6:ø+1=>ø
:If ø=3 and X>6:ø+1=>ø
:If ø=4 and Y>6:ø+1=>ø
:If ø=5 and Z>6:Goto 3
:Lbl 4
:0=>K
:While K[pas égal à]105 and K[pas égal à]45
:int rand6+1=>G
:Output(4,ø+5,G
:getKey=>K
:End
:If K=45
:Menu("QUITTER","NON",4,"OUI",Q
:If ø=1:G=>L
:If ø=2:G=>M
:If ø=3:G=>N
:If ø=4:G=>O
:If ø=5:G=>P
:End
:
:Lbl 3
:0=>S:0=>U
:L+V/10^9=>L
:M+W/10^9=>M
:N+X/10^9=>N
:O+Y/10^9=>O
:P+Z/10^9=>P
:If (L=M and (L=N or L=O or L=P)) or (L=N and (L=O or L=P)) or (L=O and L=P
:Then
:100*int Lü (
) S
:If int L=5:S-150=>S
:If int L=1:S+600=>S
:If V=4:0=>ø
:If int Lø1 and int Lø5:U+3=>U
:Goto S
:End
:If (M=N and (M=O or M=P)) or (M=O and M=P
:Then
:100int M=>S
:If int M=5:S-150=>S
:If int M=1:S+600=>S
:If W=4:0=>ø
:If int M[pas égal à]1 and int M[pas égal à]5:U+3=>U
:Goto S
:End
:If N=O and O=P
:Then
:100int N=>S
:If int N=5:S-150=>S
:If int N=1:S+600=>S
:If X=4:0=>ø
:If int N[pas égal à]1 and int N[pas égal à]5:3+Uü (
) U
:End
:Lbl S
:int Lü (
) L:int M=>M:int N=>N:int O=>O:int P=>P
:If L=1 or L=5:Then:U+1=>U
:If V=4:0=>ø:End
:If M=1 or M=5:Then:U+1=>U
:If W=4:0=>ø:End
:If N=1 or N=5:Then:U+1=>U
:If X=4:0=>ø:End
:If O=1 or O=5:Then:U+1=>U
:If Y=4:0=>ø:End
:If P=1 or P=5:Then:U+1=>U
:If Z=4:0=>ø:End
:If ø[pas égal à]0:Then
:Output(8,1," DOMMAGE!
:Pause :Goto F
:End
:If L=5:50+S=>S
:If M=5:50+S=>S
:If N=5:50+S=>S
:If O=5:50+S=>S
:If P=5:50+S=>S
:If L=1:100+S=>S
:If M=1:100+S=>S
:If N=1:100+S=>S
:If O=1:100+S=>S
:If P=1:100+S=>S
:Output(8,1,"
:Output(8,1,S
:Output(1,16,U
:8=>Q
:Output(3,Q,"+
:Output(5,Q,"+
:
:Lbl 2
:0=>K
:While K=0
:getKey=>K:End
:If K=24 and Q>6
:Q-1=>Q
:If K=26 and Q<10
:Q+1=>Q
:If K=24 or K=26
:Then
:Output(3,6,"-----
:Output(5,6,"-----
:Output(3,Q,"+
:Output(5,Q,"+
:End
:
:If K=25:4=>I
:If K=34:6=>I
:If K=21:Then
:4=>I
:If Vù (
) 6:1+Vü (
) V
:If W[plus grand ou égal à]6:1+W=>W
:If Xù (
) 6:1+Xü (
) X
:If Yù (
) 6:1+Yü (
) Y
:If Z[plus grand ou égal à]6:1+Z=>Z
:End
:If K=25 or K=34 or K=21:Then
:If Q=6 and V<7:I=>V
:If Q=7 and W<7:I=>W
:If Q=8 and X<7:I=>X
:If Q=9 and Y<7:I=>Y
:If Q=10 and Z<7:I=>Z
:Output(4,Q,"
:Output(6,Q,"
:If K=21:Output(6,6,"
:If (Q=6 or K=21) and V<8:Output(V,6,L
:If (Q=7 or K=21) and W<8:Output(W,7,M
:If (Q=8 or K=21) and X<8:Output(X,8,N
:If (Q=9 or K=21) and Y<8:Output(Y,9,O
:If (Q=10 or K=21) and Z<8:Output(Z,10,P
:End
:If (K=21 or K=31) and U=5:Then
:ClrHome
:Disp " NOTE!","","VOUS AVEZ","UTILISE TS VOS","DES, VOUS POUVEZ","CHOISIR DE","REJOUER and DE"
:Pause
:Disp "GARDER VOS PTS","A CONDITION DE","NE PAS FAIRE","ZERO AU PROCHAIN","SCORE)
:Pause
:End
:If K=21:Goto 1
:If K=31
:Menu("GARDER ?","OUI",F,"NON",2
:If K=45
:Menu("QUITTER ?","NON",2,"OUI",Q
:Goto 2
:
:Lbl R
:Disp " REGLE DU JEU"
:Output(4,1,"BUT DU JEU : AVOIR 5000 PTS"
:Pause
:Output(3,1,"5 = 50 PTS 1 = 100 PTS 222 = 200 PTS 333 = 300 PTS 444 = 400 PTS 555 = 500 PTS"
:Pause
:Output(3,1,"666 = 600 PTS 111 = 1000 PTS (LES TRIPLETTE DOIVENT SE FAIRE SUR UN SEUL TOUR"
:Pause
:Output(3,1,".SI LE SCORE DES DES LANCES FONT ZERO, ANNULATION DU SCORE, JOUEUR SUIVANT"
:Pause
:Goto M
:Lbl C
:Output(7,4,"RATUSS
:Output(6,5,"18/02/06
:Pause
:Goto M
:Lbl Q
:ClrHome
Invité le 05/03/2010 à 00:24
Est-ce normal que je ne sois capable de bouger d'un seul coté le + pour choisir les dés? Je ne peut que le bouger À droite, si quelqu'un peut m'aider...linkakro le 05/03/2010 à 19:33
Je n'ai pas tout compris au programme, mais ton problème doit venir de ces lignes là.
Code
While K=0
:getKey=>K:End
:If K=24 and Q>6
:Q-1=>Q
:If K=26 and Q<10
:Q+1=>Q
-Coco- le 06/03/2010 à 18:59
Hé hé, étant donné que je suis un feignant.... t'aurais pas un .83p s'il te plait? ^^ Avertissement :Il s'agit d'une page optimisée pour la navigation mobile. Voir la
page originale.