Ti80.Online

Pour plus de programmes...
http://www.ti80.online.fr
ti80@citeweb.net
-----------------------------------

Envoyé par François

Ce programme compte les carrés (4 cartes identiques), les full (3 cartes identiques+2cartes identiques), les brelans (3 cartes identiques), les double-paires et les paires. On peut changer une fois 3 de ces cartes.
@ :Téta
* :Multiplié
=/ :Non égal


PROGRAM:POKER
500->U
CLRHOME
DISP "",""," POKER"
PAUSE
CLRHOME
LBL Z
0->K
0->L
0->M
0->N
0->O
1->@
DISP "TU AS",U,"FRANCS"
IF U>0:GOTO @
IF U<=0:DISP "PERDU":STOP ( plus petit ou égal)
LBL @
DISP "MISE"
INPUT V
IF V>U:GOTO @
(U-V)->U
CLRHOME
PLOTSOFF
FNOFF
1->XMIN
63->XMAX
0->XSCL
1->YMIN
47->YMAX
0->YSCL
CLRDRAW
HORIZONTAL 35
HORIZONTAL 12
CLRHOME
LINE(1,35,1,12)
LINE(13,35,13,12)
LINE(25,35,25,12)
LINE(37,35,37,12)
LINE(50,35,50,12)
LINE(63,35,63,12)
LBL N
0->F
12->G
24->H
37->I
50->J
IF @=1:GOTO O
PAUSE
CLRHOME
DISP "CHANGER?","(1:OUI,2:NON)"
DISP "CARTE 1"
INPUT K
DISP "CARTE 2"
INPUT L
DISP "CARTE 3"
INPUT M
DISP "CARTE 4"
INPUT N
DISP "CARTE 5"
INPUT O
IF K+L+M+N+O<7:GOTO N
CLRHOME
PLOTSOFF
FNOFF
1->XMIN
63->XMAX
0->XSCL
1->YMIN
47->YMAX
0->YSCL
CLRDRAW
HORIZONTAL 35
HORIZONTAL 12
CLRHOME
LINE(1,35,1,12)
LINE(13,35,13,12)
LINE(25,35,25,12)
LINE(37,35,37,12)
LINE(50,35,50,12)
LINE(63,35,63,12)
LBL O
F->X
IF K=2:GOTO P
(INT(RAND*8)+7)->A
LBL P
IF A=7:GOTO A
IF A=8:GOTO B
IF A=9:GOTO C
IF A=10:GOTO D
IF A=11:GOTO E
IF A=12:GOTO F
IF A=13:GOTO G
IF A=14:GOTO H
LBL I
G->X
IF L=2:GOTO R
(INT(RAND*8)+7)->B
LBL R
IF B=7:GOTO A
IF B=8:GOTO B
IF B=9:GOTO C
IF B=10:GOTO D
IF B=11:GOTO E
IF B=12:GOTO F
IF B=13:GOTO G
IF B=14:GOTO H
LBL J
H->X
IF M=2:GOTO T
(INT(RAND*8)+7)->C
LBL T
IF C=7:GOTO A
IF C=8:GOTO B
IF C=9:GOTO C
IF C=10:GOTO D
IF C=11:GOTO E
IF C=12:GOTO F
IF C=13:GOTO G
IF C=14:GOTO H
LBL K
I->X
IF N=2:GOTO V
(INT(RAND*8)+7)->D
LBL V
IF D=7:GOTO A
IF D=8:GOTO B
IF D=9:GOTO C
IF D=10:GOTO D
IF D=11:GOTO E
IF D=12:GOTO F
IF D=13:GOTO G
IF D=14:GOTO H
LBL L
J->X
IF O=2:GOTO X
(INT(RAND*8)+7)->E
LBL X
IF E=7:GOTO A
IF E=8:GOTO B
IF E=9:GOTO C
IF E=10:GOTO D
IF E=11:GOTO E
IF E=12:GOTO F
IF E=13:GOTO G
IF E=14:GOTO H
LBL A
LINE(X+3,16,X+10,30)
LINE(X+10,30,X+3,30)
LINE(X+10,23,X+3,23)
IF X=F:GOTO I
IF X=G:GOTO J
IF X=H:GOTO K
IF X=I:GOTO L
IF X=J:GOTO M
LBL B
LINE(X+3,30,X+10,30)
LINE(X+3,30,X+3,16)
LINE(X+3,23,X+10,23)
LINE(X+3,16,X+10,16)
LINE(X+10,30,X+10,16)
IF X=F:GOTO I
IF X=G:GOTO J
IF X=H:GOTO K
IF X=I:GOTO L
IF X=J:GOTO M
LBL C
LINE(X+3,30,X+10,30)
LINE(X+3,30,X+3,23)
LINE(X+3,23,X+10,23)
LINE(X+3,16,X+10,16)
LINE(X+10,30,X+10,16)
IF X=F:GOTO I
IF X=G:GOTO J
IF X=H:GOTO K
IF X=I:GOTO L
IF X=J:GOTO M
LBL D
LINE(X+3,30,X+3,16)
LINE(X+5,30,X+10,30)
LINE(X+5,30,X+5,16)
LINE(X+5,16,X+10,16)
LINE(X+10,30,X+10,16)
IF X=F:GOTO I
IF X=G:GOTO J
IF X=H:GOTO K
IF X=I:GOTO L
IF X=J:GOTO M
LBL E
LINE(X+3,30,X+7,16)
LINE(X+7,16,X+11,30)
IF X=F:GOTO I
IF X=G:GOTO J
IF X=H:GOTO K
IF X=I:GOTO L
IF X=J:GOTO M
LBL F
LINE(X+4,30,X+4,16)
LINE(X+3,30,X+8,30)
LINE(X+8,30,X+10,27)
LINE(X+10,27,X+10,19)
LINE(X+10,19,X+8,16)
LINE(X+8,16,X+3,16)
IF X=F:GOTO I
IF X=G:GOTO J
IF X=H:GOTO K
IF X=I:GOTO L
IF X=J:GOTO M
LBL G
LINE(X+3,30,X+3,16)
LINE(X+3,30,X+10,30)
LINE(X+10,30,X+10,23)
LINE(X+10,23,X+3,23)
LINE(X+6,23,X+10,16)
IF X=F:GOTO I
IF X=G:GOTO J
IF X=H:GOTO K
IF X=I:GOTO L
IF X=J:GOTO M
LBL H
LINE(X+3,24,X+6,30)
LINE(X+6,30,X+9,24)
LINE(X+4,27,X+8,27)
LINE(X+9,22,X+3,22)
LINE(X+3,22,X+3,19)
LINE(X+3,19,X+9,19)
LINE(X+9,19,X+9,16)
LINE(X+9,16,X+3,16)
IF X=F:GOTO I
IF X=G:GOTO J
IF X=H:GOTO K
IF X=I:GOTO L
IF X=J:GOTO M
LBL M
@+1->@
IF (A=B)(B=C)(C=D):GOTO 1
IF (A=B)(B=C)(C=E):GOTO 1
IF (A=B)(B=D)(D=E):GOTO 1
IF (A=C)(C=D)(D=E):GOTO 1
IF (B=C)(C=D)(D=E):GOTO 1
IF (A=B)(B=C)(D=E):GOTO 2
IF (A=B)(B=D)(C=E):GOTO 2
IF (A=B)(B=E)(C=D):GOTO 2
IF (A=B)(C=D)(D=E):GOTO 2
IF (A=C)(C=D)(B=E):GOTO 2
IF (A=C)(C=E)(B=D):GOTO 2
IF (A=D)(D=E)(B=C):GOTO 2
IF (B=C)(C=D)(A=E):GOTO 2
IF (B=C)(C=E)(A=D):GOTO 2
IF (B=D)(D=E)(A=C):GOTO 2
IF (C=D)(D=E)(A=B):GOTO 2
IF (A=C)(C=E)(B=D):GOTO 2
IF (A=B)(B=C):GOTO 3
IF (A=B)(B=D):GOTO 3
IF (A=B)(B=E):GOTO 3
IF (A=B)(C=D):GOTO 3
IF (A=C)(C=E):GOTO 3
IF (A=D)(D=E):GOTO 3
IF (B=C)(C=D):GOTO 3
IF (B=C)(C=E):GOTO 3
IF (B=D)(D=E):GOTO 3
IF (C=D)(D=E):GOTO 3
IF (A=B)(C=D):GOTO 4
IF (A=B)(C=E):GOTO 4
IF (A=B)(D=E):GOTO 4
IF (A=C)(D=E):GOTO 4
IF (A=C)(B=D):GOTO 4
IF (A=C)(B=E):GOTO 4
IF (A=C)(D=E):GOTO 4
IF (A=D)(B=C):GOTO 4
IF (A=D)(B=E):GOTO 4
IF (A=D)(C=E):GOTO 4
IF (A=E)(B=C):GOTO 4
IF (A=E)(B=D):GOTO 4
IF (A=E)(C=D):GOTO 4
IF (A=B):GOTO 5
IF (A=C):GOTO 5
IF (A=D):GOTO 5
IF (A=E):GOTO 5
IF (B=C):GOTO 5
IF (B=D):GOTO 5 IF (B=E):GOTO 5
IF (C=D):GOTO 5
IF (C=E):GOTO 5
IF (D=E):GOTO 5
IF (A=/B)(B=/C)(C=/D)(D=/E):GOTO Z
LBL 1
(V*20)->V
DISP "CARRE"
GOTO 6
LBL 2
(V*10)->V
DISP "FULL"
GOTO 6
LBL 3
(V*5)->V
DISP "BRELAN"
GOTO 6
LBL 4
(V*4)->V
DISP "PAIRES"
GOTO 6
LBL 5
(V*2)->V
DISP "PAIRE"
GOTO 6
LBL 6
(U+V)->U
DISP "TU GAGNES",V,"FRANCS"
DISP "TU AS",U,"FRANCS"
PAUSE
CLRHOME
GOTO Z