Z-ZEE (Awfully Similar to Yahtzee)

General games-related topics
User avatar
XavSnap
Posts: 1955
Joined: Sat May 10, 2008 4:23 pm
Location: 'Zx81 France' Fb group.

Re: Z-ZEE (Awfully Similar to Yahtzee)

Post by XavSnap »

Hi Sanello.
I'm lucky enough to find the double Z-ZEE error !
:lol:
Cap0000.jpg
The program returned to the cursor... and it doesn't.

Code: Select all

 #4035 IF S(15)>0 THEN RETURN 

Please delete this line !
Don't use a GOSUB to the #4000 line, there is no RETURN !

Code: Select all

 1292 IF D(1)=D(2) AND D(2)=D(3) AND D(3)=D(4) AND D(4)=D(5) AND S(14)<>0 THEN GOTO 4000
 (...)
   4000 GOSUB 9200
  4005 IF S(14)=-1 THEN LET S(14)=50
  4010 LET S(15)=S(15)+1
  4020 IF S(15)>0 THEN PRINT AT 13,29;S(15)*100
  4030 PRINT AT 12,29;S(14)
  4032 IF S(15)>0 THEN LET C=1
  4040 GOTO 981
 
Have fun.
Last edited by XavSnap on Thu Jul 28, 2022 10:17 pm, edited 2 times in total.
Xavier ...on the Facebook groupe : "Zx81 France"(fr)
Moggy
Posts: 3316
Joined: Wed Jun 18, 2008 2:00 pm

Re: Z-ZEE (Awfully Similar to Yahtzee)

Post by Moggy »

No scoring still wrong.

EXAMPLE.

Three of a kind- I got three sixes and a two and a four, add the three sixes gives eighteen plus the four and the two should give twenty four whereas your version is only giving the three sixes adding up to eighteen.

Four of a kind doing same thing only adding the four dice and not the fifth.

Small straight gives thirty points no matter what you enter!

Final score still wrong.


Score sheet added to show how scoring should be and a version where the scores are correct.
Attachments
TESTZEE.P
(10.13 KiB) Downloaded 56 times
yahtzee-scorecard-e1631082163363.gif
User avatar
XavSnap
Posts: 1955
Joined: Sat May 10, 2008 4:23 pm
Location: 'Zx81 France' Fb group.

Re: Z-ZEE (Awfully Similar to Yahtzee)

Post by XavSnap »

Ok!

In french:

Code: Select all

# 3 OF A KIND:   #8
  6800 GOSUB 6000
  6810 LET T=3
  6820 GOSUB 6100
  6830 LET S(S)=0
  6840 IF R THEN LET S(S)=D(1)+D(2)+D(3)+D(4)+D(5)
  6850 PRINT AT 6,28;":";S(S)
  6860 GOTO 981

# 4 OF A KIND:   #9
  6900 GOSUB 6000
  6910 LET T=4
  6920 GOSUB 6100
  6930 LET S(S)=0
  6940 IF R THEN LET S(S)=T*A
  6950 PRINT AT 7,28;":";S(S)
  6960 GOTO 981
My last release: (waiting Sanello.'s job to test his release, or mine)


Have fun.


Ps:
Four of a kind doing same thing only adding the four dice and not the fifth.
But, i read "All dices" for the "Four of a kind"... never mind, it's fine, fine fine...
Last edited by XavSnap on Fri Jul 29, 2022 5:50 am, edited 1 time in total.
Xavier ...on the Facebook groupe : "Zx81 France"(fr)
Moggy
Posts: 3316
Joined: Wed Jun 18, 2008 2:00 pm

Re: Z-ZEE (Awfully Similar to Yahtzee)

Post by Moggy »

Nope still wrong, four of a kind only adding four dices when all five should be added same with three of a kind all dices should be added.
User avatar
XavSnap
Posts: 1955
Joined: Sat May 10, 2008 4:23 pm
Location: 'Zx81 France' Fb group.

Re: Z-ZEE (Awfully Similar to Yahtzee)

Post by XavSnap »

Hi Moggy,

In my code:
three of a kind > 1;1;1;6;6 = 3+12=15
four of a kind > 1;1;1;1;6 =4
It's done, no?

.

Have fun, if you can.
Last edited by 1024MAK on Sat Jul 30, 2022 2:26 pm, edited 1 time in total.
Reason: Tidy
Xavier ...on the Facebook groupe : "Zx81 France"(fr)
User avatar
sanello
Posts: 100
Joined: Sat Jul 23, 2022 9:26 pm

Re: Z-ZEE (Awfully Similar to Yahtzee)

Post by sanello »

@XavSnap

I will look I promise. No time during the week.

Question. Are you using some kind of external text editor? The programming I originally posted was actually typed fully on an actual Timex Sinclair 1000 by me years ago. Then, I transferred the audio tape to my computer to use in eightyeight where I made a couple modifications before posting it here. It probably explains some of the lazy programming. It's a lot harder to edit and scroll through screens at 3.25 mhz then in an 8x speed emulator.
-sanello
User avatar
XavSnap
Posts: 1955
Joined: Sat May 10, 2008 4:23 pm
Location: 'Zx81 France' Fb group.

Re: Z-ZEE (Awfully Similar to Yahtzee)

Post by XavSnap »

Hi Sanello,

No probems...
I just start to understand the game.
:shock:

"SUM:" was NOT an option !
zzee.JPG
I'm not a claver genius with dices...

I had to change the cursor moves.
Cap0002.jpg

Code: Select all

      5 GOSUB 9000
     8 LET ZZ=0
    10 DIM D(5)
    20 DIM K(5)
    25 DIM S(15)
    26 FOR I=1 TO 15
    27 LET S(I)=-1
    28 NEXT I
   980 GOSUB 8000
   981 DIM K(5)
   982 FOR O=1 TO 5
   983 PRINT AT 20,1+(O-1)*6;"¸¸¸¶"
   984 NEXT O
   985 LET C=0
   986 GOSUB 3000
   987 RAND
   989 FOR G=1 TO 3
   990 FOR J=1 TO 3
  1000 FOR I=1 TO 5
  1005 IF K(I)=1 THEN GOTO 1020
  1010 LET D(I)=INT (RND*6)+1
  1020 NEXT I
  1030 GOSUB 2000
  1040 NEXT J
  1041 DIM K(5)
  1044 GOSUB 8000
  1045 IF G=3 THEN GOTO 1290
  1050 PRINT AT 21,0;"CHOOSE KEEPERS THEN PRESS ENTER."
  1060 IF INKEY$="" THEN GOTO 1060

  1070 LET A$=INKEY$
  1080 IF A$=CHR$ 118 THEN GOTO 1200

  1090 IF A$="6" THEN GOTO 5000
  1100 IF A$<"1" OR A$>"5" THEN GOTO 1060
  1110 LET A=CODE A$-28
  1120 IF VAL A$=A THEN LET K(A)=NOT K(A)

  1190 PRINT AT 20,1+(A-1)*6;("¸¸¸¶" AND NOT K(A));("¿¿¿¶" AND K(A))
  1195 GOTO 1060
  1200 PRINT AT 21,0;"LOCK IN THAT CHOICE? Y/N        "
  1210 IF INKEY$<>"" THEN GOTO 1210
  1215 IF INKEY$="" THEN GOTO 1215
  1220 LET A$=INKEY$
  1225 PRINT AT 21,0;"                                "
  1230 IF A$="Y" OR A$=CHR$ 118 THEN GOTO 1286
  1240 IF A$="N" THEN GOTO 1260
  1250 GOTO 1200
  1260 DIM K(5)
  1280 GOSUB 8000
  1282 GOTO 1050
  1286 IF K(1)+K(2)+K(3)+K(4)+K(5)<>5 THEN NEXT G
  1292 IF D(1)=D(2) AND D(2)=D(3) AND D(3)=D(4) AND D(4)=D(5) AND S(14)<>0 THEN GOTO 4000
  1300 IF ZZ=1 THEN LET S(14)=0
  1301 IF ZZ=1 THEN PRINT AT 12,29;0
  1302 IF ZZ=1 THEN GOTO 981
  1305 PRINT AT 21,0;"ARROWS AND ENTER TO CHOOSE SCORE"
  1310 PRINT AT 6,9;"Š"
  
  1314 LET P1=0
  1316 LET P2=0
  1320 IF INKEY$="" THEN GOTO 1320
  1330 LET A$=INKEY$
  1340 IF (A$>"4" AND A$<"9") THEN GOTO 1349
  1342 IF A$=CHR$ 118 THEN GOTO 1500
  1345 GOTO 1320
  1349 LET A=VAL A$
  1350 PRINT AT 6+P1,9+(19 AND P2);":"
  1360 LET P1=P1-(1*(A$="7") AND P1>0)+(1*(A$="6") AND P1<(6-NOT P2))
  1370 LET P2=P2-(1*(A$="5") AND P2>0)+(1*(A$="8") AND P2<1)
  1375 IF P2=0 AND P1=6 THEN LET P1=5
  1380 PRINT AT 6+P1,9+(19 AND P2);"Š"
  1390 GOTO 1320

   1500 LET S=(P1+1)+P2*7
   1502 PRINT AT P1+6,9+(19 AND P2);">?"
   1506 IF S(S)>-1 THEN PRINT AT P1+6,9+(19 AND P2);"Š";S(S)
   1508 IF S(S)>-1 THEN GOTO 1320
   1510 IF S=14 THEN GOTO 7400

  1520 DIM C(6)
  1525 DIM F(6)
  1530 FOR I=1 TO 6
  1540 FOR N=1 TO 5
  1550 IF D(N)=I THEN LET C(I)=C(I)+1
  1555 IF D(N)=I THEN LET F(I)=F(I)+1
  1560 NEXT N
  1570 NEXT I
  1575 LET X=1
  1576 DIM D(5)
  1580 FOR I=1 TO 6
  1590 FOR N=1 TO 5
  1600 IF C(I)>0 THEN LET D(X)=I
  1602 IF C(I)>0 THEN LET X=X+1
  1605 IF C(I)>0 THEN LET C(I)=C(I)-1
  1620 NEXT N
  1630 NEXT I


  1800 IF S>6 THEN GOTO 6000+(S*100)
  1810 GOTO 6000

  2000 FOR N=1 TO 5
  2005 LET P=1+(N-1)*6
  2010 IF NOT K(N) THEN GOSUB 2000+(D(N)*100)
  2020 NEXT N
  2030 RETURN 
  2052 IF S(14)=0 THEN GOTO 3065
  2110 PRINT AT 17,P;"   ";AT 18,P;" ¶ ";AT 19,P;"   "
  2150 RETURN 
  2210 PRINT AT 17,P;"¶  ";AT 18,P;"   ";AT 19,P;"  ¶"
  2250 RETURN 
  2310 PRINT AT 17,P;"¶  ";AT 18,P;" ¶ ";AT 19,P;"  ¶"
  2350 RETURN 
  2410 PRINT AT 17,P;"¶ ¶";AT 18,P;"   ";AT 19,P;"¶ ¶"
  2450 RETURN 
  2510 PRINT AT 17,P;"¶ ¶";AT 18,P;" ¶ ";AT 19,P;"¶ ¶"
  2550 RETURN 
  2610 PRINT AT 17,P;"¶ ¶";AT 18,P;"¶ ¶";AT 19,P;"¶ ¶"
  2650 RETURN 

  3000 FOR I=1 TO 6
  3010 IF S(I)=-1 THEN RETURN 
  3020 NEXT I
  3030 FOR I=8 TO 12
  3040 IF S(I)=-1 THEN RETURN 
  3050 NEXT I
  3055 IF S(14)=-1 THEN LET ZZ=1
  3060 IF S(14)=-1 THEN RETURN 
  3065 LET T=0
  3070 FOR I=1 TO 6
  3080 LET T=T+S(I)
  3085 PRINT AT 14,29;T
  3090 NEXT I
  3100 LET S(13)=0
  3110 IF T>62 THEN LET S(13)=35
  3120 PRINT AT 12,10;T
  3130 PRINT AT 13,10;S(13)
  3140 PRINT AT 14,10;S(13)+T
  3150 IF S(15)=-1 THEN LET S(15)=0
  3155 PRINT AT 13,29;S(15)
  3160 LET B=T+(S(15)*100)
  3170 FOR I=8 TO 14
  3180 LET B=B+S(I)
  3190 PRINT AT 14,29;B
  3200 NEXT I
  3210 STOP 

  4000 GOSUB 9200
  4005 IF S(14)=-1 THEN LET S(14)=50
  4010 LET S(15)=S(15)+1
  4020 IF S(15)>0 THEN PRINT AT 13,29;S(15)*100
  4030 PRINT AT 12,29;S(14)
  4032 IF S(15)>0 THEN LET C=1
  4040 GOTO 981

  5000 FOR B=1 TO 5
  5010 LET K(B)=NOT K(B)
  5020 PRINT AT 20,1+(B-1)*6;("¸¸¸¶" AND NOT K(B));("¿¿¿¶" AND K(B))
  5030 NEXT B
  5050 GOTO 1060

# ONES:   #1
# TOWS:   #2
# THREES: #3
# FOURS:  #4
# FIVES:  #5
# SIXES:  #6
6000 DIM R(6)
6010 FOR A=1 TO 5
6020 LET R(D(A))= R(D(A))+1
6030 NEXT A
# 3 or 4 
6035 IF S=8 OR S=9 THEN RETURN
6040 LET S(S)=R(S)*S
6050 PRINT AT 5+S,9;":";S(S)
6060 FOR A=1 TO 6
6065 LET T=0
6070 FOR I=1 TO 6
6075 IF S(I)>=0 THEN LET T=T+S(I)
6080 PRINT AT 12,10;T;"  "
6085 NEXT I
6090 GOTO 981


6100 LET R=0 
6110 FOR A=1 TO 6
6120 IF R(A)=T THEN LET R=1
6130 IF R(A)<>T THEN NEXT A
6140 RETURN

# SUM:   #7
  6700 LET S(7)=D(1)+D(2)+D(3)+D(4)+D(5)
  6710 PRINT AT 12,9;":";S(7)
  6720 GOTO 981

# 3 OF A KIND:   #8
  6800 GOSUB 6000
  6810 LET T=3
  6820 GOSUB 6100
  6830 LET S(S)=0
  6840 IF R THEN LET S(S)=D(1)+D(2)+D(3)+D(4)+D(5)
  6850 PRINT AT 6,28;":";S(S)
  6860 GOTO 981

# 4 OF A KIND:   #9
  6900 GOSUB 6000
  6910 LET T=4
  6920 GOSUB 6100
  6930 LET S(S)=0
  6940 IF R THEN LET S(S)=T*A
  6950 PRINT AT 7,28;":";S(S)
  6960 GOTO 981

# FULL HOUSE:   #10
  7000 LET V=0
  7010 IF D(1)=D(2) AND D(2)=D(3) AND D(4)=D(5) THEN LET V=1
  7020 IF D(1)=D(2) AND D(3)=D(4) AND D(4)=D(5) THEN LET V=1
  7060 IF V=1 THEN LET S(S)=25
  7070 IF V<>1 THEN LET S(S)=0
  7080 PRINT AT 8,28;":";S(S)
  7090 GOTO 981

# SMALL STRAIGHT:   #11
  7100 LET V=0
  7105 IF C=1 THEN LET V=1
  7110 IF F(1)>0 AND F(2)>0 AND F(3)>0 AND F(4)>0 THEN LET V=1
  7120 IF F(2)>0 AND F(3)>0 AND F(4)>0 AND F(5)>0 THEN LET V=1
  7130 IF F(3)>0 AND F(4)>0 AND F(5)>0 AND F(6)>0 THEN LET V=1
  7160 IF V=1 THEN LET S(S)=30
  7170 IF V<>1 THEN LET S(S)=0
  7180 PRINT AT 9,28;":";S(S)
  7190 GOTO 981

# LARGE STRAIGHT:   #12
  7200 LET V=0
  7205 IF C=1 THEN LET V=1
  7210 IF D(2)=D(1)+1 AND D(3)=D(2)+1 AND D(4)=D(3)+1 AND D(5)=D(4)+1 THEN LET V=1
  7260 IF V=1 THEN LET S(S)=40
  7270 IF V<>1 THEN LET S(S)=0
  7280 PRINT AT 10,28;":";S(S)
  7290 GOTO 981

# CHANCE:   #13
  7300 LET S(S)=D(1)+D(2)+D(3)+D(4)+D(5)
  7310 PRINT AT 11,28;":";S(S)
  7320 GOTO 981

# Z-ZEE:   #14
  7400 IF S(14)>-1 THEN GOTO 1320
  7405 LET S(14)=0
  7410 PRINT AT 12,28;":";S(14)
  7420 GOTO 981

#  BONUS Z-ZEE: #15

  8000 FOR N=1 TO 5
  8005 LET P=1+(N-1)*6
  8010 PRINT AT 20,P;("¸¸¸¶" AND NOT K(N));("¿¿¿¶" AND K(N))
  8020 PRINT AT 16,P-1;"¼¸¸¸º";AT 17,P-1;"º";AT 17,P+3;"º";AT 18,P-1;"º";AT 18,P+3;"º";AT 19,P-1;"º";AT 19,P+3;"º"
  8060 NEXT N
  8070 RETURN 

  9000 PRINT AT 6,5;"ONES:";AT 7,5;"TWOS:";AT 8,3;"THREES:";AT 9,4;"FOURS:";AT 10,4;"FIVES:";AT 11,4;"SIXES:";AT 12,0;"µµµµµ«sum:0";AT 13,0;"bonusš:-";AT 14,0;"grand«sum:-";AT 6,17;"3 OF A KIND:";AT 7,17;"4 OF A KIND:";AT 8,18;"FULL HOUSE:";AT 9,14;"SMALL STRAIGHT:";AT 10,14;"LARGE STRAIGHT:";AT 11,22;"CHANCE:";AT 12,23;"Z-ZEE:";AT 13,17;"bonus«z‘zee:-";AT 14,17;"total«score:-";AT 20,0;"1     2     3     4     5     6";AT 19,30;"l";AT 18,30;"l";AT 17,30;"a"
  9200 FOR I=0 TO 4
  9210 PRINT AT 0,I;"«"
  9220 PRINT AT 4,I;"«"
  9230 PRINT AT 0,I+7;"«"
  9240 PRINT AT 4,I+7;"«"
  9250 PRINT AT 0,I+13;"«"
  9260 PRINT AT 2,I+13;"«"
  9270 PRINT AT 4,I+13;"«"
  9280 PRINT AT 0,I+19;"«"
  9290 PRINT AT 2,I+19;"«"
  9300 PRINT AT 4,I+19;"«"
  9310 PRINT AT I,13;"«"
  9320 PRINT AT I,19;"«"
  9330 PRINT AT I,4-I;"«"
  9340 PRINT AT I,11-I;"«"
  9350 NEXT I
  9360 PRINT AT 2,5;"««"
  9390 NEXT I
  9400 FOR I=0 TO 4
  9410 PRINT AT 0,I;"½"
  9420 PRINT AT 4,I;"½"
  9430 PRINT AT 0,I+7;"½"
  9440 PRINT AT 4,I+7;"½"
  9450 PRINT AT 0,I+13;"½"
  9460 PRINT AT 2,I+13;"½"
  9470 PRINT AT 4,I+13;"½"
  9480 PRINT AT 0,I+19;"½"
  9490 PRINT AT 2,I+19;"½"
  9500 PRINT AT 4,I+19;"½"
  9510 PRINT AT I,13;"½"
  9520 PRINT AT I,19;"½"
  9530 PRINT AT I,4-I;"½"
  9540 PRINT AT I,11-I;"½"
  9550 NEXT I
  9560 PRINT AT 2,5;"½½"
  9570 PRINT AT 1,24;"CODE BY:"
  9580 PRINT AT 3,24;"S.ANELLO"
  9699 RETURN 
  9900 SAVE "Z-ZEE"
  9999 RUN
  
Emulator file:
z-zee.p
(8.69 KiB) Downloaded 57 times
Zipped Wav file 8.35 Mo (8 762 490 bytes):
(SAVE"ZZEE.WAV" in VB81 XuR)
Z-ZEE.zip
(67.01 KiB) Downloaded 52 times
All my stuff is done on a "Notepad" in text mode. Easy to copy/paste or lines move. Easy to load in VB81 or ZxText2P.
Xavier ...on the Facebook groupe : "Zx81 France"(fr)
User avatar
XavSnap
Posts: 1955
Joined: Sat May 10, 2008 4:23 pm
Location: 'Zx81 France' Fb group.

Re: Z-ZEE (Awfully Similar to Yahtzee)

Post by XavSnap »

Xavier ...on the Facebook groupe : "Zx81 France"(fr)
Moggy
Posts: 3316
Joined: Wed Jun 18, 2008 2:00 pm

Re: Z-ZEE (Awfully Similar to Yahtzee)

Post by Moggy »

Vous y êtes presque mon ami.


The 3 and 4 of a kind are still scoring incorrectly.
The small straight gives you 30 points even when you do not have a straight, it should be zero.

The final score is still wrong, see picture test2 the total should be 102 not 83.

If you have 4 of a kind and the 4 of a kind box is filled then you are allowed to use the 3 of a kind box which gives a score of ALL the dice added together, your code gives a zero see picture test1.

With 3 of a kind you have to add up ALL the dice not just the 3 dice.
With 4 of a kind you have to add up ALL the dice not just the 4 dice.

A link to the rules of Yahtzee.

https://www.hasbro.com/common/instruct/yahtzee.pdf
Attachments
test1.jpg
test1.jpg (14.3 KiB) Viewed 1396 times
test2.jpg
test2.jpg (14.34 KiB) Viewed 1396 times
User avatar
XavSnap
Posts: 1955
Joined: Sat May 10, 2008 4:23 pm
Location: 'Zx81 France' Fb group.

Re: Z-ZEE (Awfully Similar to Yahtzee)

Post by XavSnap »

Hi,
Yes:

Code: Select all

6100 LET R=0 
6110 FOR A=1 TO 6
# Almost equal to
6120 IF R(A)>=T THEN LET R=1
6130 IF R(A)<T THEN NEXT A
6140 RETURN
and

Code: Select all

  6940 IF R THEN LET S(S)=D(1)+D(2)+D(3)+D(4)+D(5)
With 4 of a kind you have to add up ALL the dice not just the 4 dice.
Yes, not only the 4 dices...


The sum..
3+4+3+8+5+6=29 :s(1-6))=s(7)=T
25+30+18=73 : s(8)+s(9)+s(10)+s(11)+s(12)+s(13)+s(14)+100*s(15)
73+29=102

Seem ok !

Code: Select all

 3160 LET B=T+(S(15)*100)
  3170 FOR I=8 TO 14
  3180 LET B=B+S(I)
  3190 PRINT AT 14,29;B
  3200 NEXT I
  3210 STOP 
But,

Code: Select all

  3100 LET S(13)=0
  3110 IF T>62 THEN LET S(13)=35
  3120 PRINT AT 12,10;T
  3130 PRINT AT 13,10;S(13)
  3140 PRINT AT 14,10;S(13)+T
S(13) is the "Chance:" slot... and can't be used to store the "Grand Sum:" bonus...
Chance=0 or 35
S(7) tag should be use for the "Chance" stat ...
Last edited by XavSnap on Fri Jul 29, 2022 10:21 pm, edited 1 time in total.
Xavier ...on the Facebook groupe : "Zx81 France"(fr)
Post Reply