h yatzee er original by jl helms & mf pezok for ccii z| coronado, ca adapted to ibm pc by patrick leabo tucson, az h adapted to commodore 128 by john teeple z$ omaha, ne `) * pc(6):l21$6:pc(l)2l*6::pc(5)26:pc(1)211 4. c(5): k(18,7): f(5): a$(7) `8 s(6,5): m(13),tn(6),du(6):g 5,2:^5,1 b 1150: n2 1 $ 6: tn(n): l v 5090 1`c12 39:c22 63:c32 33:c42 56 aj^5,1: 4670 lt 4430 d~ 49,51,53,54,56,61 o 6820 u ` ,0,23 ,& "how many players? ";:` ,0,0: 2090 d0 7100: n2f(kb$)+48 ]: n3 1 0 n1 6 ' 1180 qd n3 6 ' 6000 n cc2 1 ' 5480 x a2 1 $ n \b` ,0,23: " ";:` ,0,23 l "player number "a;" name please "; 5v 2090: a$(a): a$(a)2 "" ' ~"mb": 1250 j a$(a)2h(a$(a),9) r a y cc2 1 ' n2 n* 1:a$(n)2 " c-128 " ` ,0,22 (a2 0 2 -< next roll preset 3f mpa2 a* 1: a1 n ' a2 1 ]zh2 0: 5340 od a2 0 ' 4760 n k(18,a)2 2 ' 1360 f x` ,0,22: " "; ^ ` ,4, (a+ 1)* 13,22 { g 5,pc(a): a$(a);:g 5,2 initial roll * . 4h2 h* 1:mr2 0 = > b2 1 $ 5 ^ hj2 b+ 1:c(b)2 5 (6, ;(1)* 1) t rdie2 c(b):f(b)2 0 \ 5250 !f 5530 !p b (!z a, cc2 n ' 2140 .! p! player selects qty to roll v! a!" 7080 s!, h1 2 ' 1940 a!6 " how many dice to roll again? ";: 2080: 7100:f$2kb$: f$;:f2f(f$)+48 x!@ f2 + 1 ' 35000 q!j f3 0 0 f1 5 ' 1570 "t f2 0 ' 1940 "^ f2 5 ' 1430 "h >"r player selects dice to roll d"| p"h2 h* 1 [" 7080 v" nn2 1 $ 4:f(nn)2 0: "$ " roll which";f;"dice again "; 5". 2090: nd2 1 $ f: #8 7100:f$2kb$::f(nd)2 f(f$)+ 48: 2120: f(nd)2 0 / nd2 1 ' nd2 f: 1740 b f(nd)3 1 0 f(nd)1 5 ' 1720 5#l f(nd);: d#vx2 2:xf2 0 s#` j2 1 $ f e#j f2 1 ' 1790 #t f(j)2 f(j* 1)' x2 1 #~ f(1)2 0 ' xf2 1 6# j: xf2 1 ' h2 h+ 1: 1570 j# x 1680,1820 p# o#& player rolls dice again u#0 $: b2 1 $ 4 $d f(b)2 0 ' 1920 5$nc(f(b))2 5 (6, ;(1)* 1) q$xdie2 c(f(b)):j2 f(b)+ 1 \$b 5250 g$l 5530 s$vf(b)2 0 {$ b $ 1540 $ &$ play board number ,$( 7$2 7080 %< " play board number? ";: 2080: 7100:i$2kb$:i2f(i$)+ 48: i1 9 ' i2 i+ 7 0%f 2120: i1 9 ' g (i* 55);: 2010 9%p i; s%z i3 1 0 i1 13 ' 1970 u%d i2 12 / k(12,a)1 + 1 ' 2140 %n k(i,a)2 0 ' 2140 %x~"mb" v%` ,0,24: "no - no - dummy - - try again";: nd21 $ 1000: &` ,0,24: " ";:` ,0,23 (& 1980 @& high pitch click l&*~ "mb" r&4 x&> ^&h d&r j&w p&\ &f dice logic &p clear/set s(m,k) &z /& m2 0 $ 6 >& k2 0 $ 5 l&s(m,k)2 0 t&" k \&, m k&6 j2 1 $ 5 '@x2 c(j):s(x,0)2 s(x,0)* 1 !'jp2 s(x,0):s(x,p)2 j )'t j /'^ s'h set s(0,k)=m sequence by qty y'r b'|x2 0 w' j2 5 $ 1 ) + 1 ' m2 6 $ 1 ) + 1 %' s(m,0)3 1 j ' 2350 ;'$ s(0,x)2 m:x2 x* 1 c'. m k'8 j a'b a, cc2 n ' 2740 s'l i1 6 ' 2460 y'v (` check player board 1-6 (j ((t 6110 <(~ x2 + 1 ' 2720 w( k(i,a)2 i, s(s(0,x),0) b( 3980 h( (& check player board 7-13 (0 =(: i+ 6 2500,2520,2540,2560,2610,2650,2680 y(d s(s(0,0),0)3 3 ' 2720 k(n 6190: 3980 )x s(s(0,0),0)3 4 ' 2720 )b 6190: 3980 j)l s(s(0,0),0)3 1 3 0 s(s(0,1),0)3 1 2 ' 2720 `)v k(9,a)2 25: 3980 ) s(1,0)1 0 / s(2,0)1 0 / s(3,0)1 0 / s(4,0)1 0 ' 2600 v) s(2,0)1 0 / s(3,0)1 0 / s(4,0)1 0 / s(5,0)1 0 ' 2600 * s(3,0)1 0 / s(4,0)1 0 / s(5,0)1 0 / s(6,0)1 0 ' 2600 * 2720 3*( k(10,a)2 30: 3980 j*2 s(1,0)/ s(2,0)/ s(3,0)/ s(4,0)/ s(5,0)2 1 ' 2640 !*< s(2,0)/ s(3,0)/ s(4,0)/ s(5,0)/ s(6,0)2 1 ' 2640 ,*f 2720 c*p k(11,a)2 40: 3980 a*z s(s(0,0),0)3 1 5 ' 2720 +d k(12,a)2 0 ' k(12,a)2 50: 3980 (+n k(12,a)2 k(12,a)* 100: 3980 :+x 6190: 3980 @+ z+ set player invalid `+ p+ k(i,a)2 + 1 {+* 3980 +4 +> computer checks +h (+r i2 12 _+\ s(s(0,0),0)2 5 / k(12,a)2 0 ' k(12,a)2 50: 3980 ,f s(s(0,0),0)2 5 / k(12,a)1 0 ' k(12,a)2 k(12,a)* 100: 3980 ),p i2 8 z,z s(s(0,0),0)2 4 / k(8,a)2 0 ' 6190: 3980 c,i2 9 ), s(s(0,0),0)2 3 / s(s(0,1),0)2 2 / k(9,a)2 0 ' k(9,a)2 25: 3980 c, k(11,a)3 1 0 ' 2900 m,"i2 11 -, s(1,0)/ s(2,0)/ s(3,0)/ s(4,0)/ s(5,0)2 1 ' 2890 ;-6 s(2,0)/ s(3,0)/ s(4,0)/ s(5,0)/ s(6,0)2 1 ' 2890 f-@ 2900 ]-jk(11,a)2 40: 3980 w-t k(10,a)3 1 0 ' 2970 -^i2 10 <-h s(1,0)1 0 / s(2,0)1 0 / s(3,0)1 0 / s(4,0)1 0 ' 2960 w-r s(2,0)1 0 / s(3,0)1 0 / s(4,0)1 0 / s(5,0)1 0 ' 2960 2.| s(3,0)1 0 / s(4,0)1 0 / s(5,0)1 0 / s(6,0)1 0 ' 2960 =. 2970 t.k(10,a)2 30: 3980 f. h3 3 ' 3140 o.$i2 6 &.. s(6,0)1 2 / k(6,a)2 0 ' k(6,a)2 6, s(6,0): 3980 /.8i2 5 f.b s(5,0)1 2 / k(5,a)2 0 ' k(5,a)2 5, s(5,0): 3980 o.li2 4 &/v s(4,0)1 2 / k(4,a)2 0 ' k(4,a)2 4, s(4,0): 3980 //`i2 3 f/j s(3,0)1 2 / k(3,a)2 0 ' k(3,a)2 3, s(3,0): 3980 o/ti2 7 /~ s(s(0,0),0)1 2 / k(7,a)2 0 ' 6190: 3980 )/i2 2 `/ s(2,0)1 2 / k(2,a)2 0 ' k(2,a)2 2, s(2,0): 3980 i/i2 1 0& s(1,0)1 2 / k(1,a)2 0 ' k(1,a)2 s(1,0): 3980 =00i2 13: k(13,a)3 1 0 ' 3140 t0: c(1)* c(2)* c(3)* c(4)* c(5)1 19 ' 6190: 3980 z0d 0n clear dice number f(b) (0x computer .0b =0l b2 1 $ 5 i0vf(b)2 0 q0 b w0 o0 get dice control 0 computer 1( 12h2 h* 1: h1 3 ' 3840 <1<i2 m(mr): i3 1 0 ' 3290 [1fmr2 mr* 1: mr1 13 ' mr2 1 f1p 3260 1z i2 12 / k(12,a)1 + 1 ' 3330 !1d k(i,a)3 1 0 ' 3270 31n i2 9 ' 3440 n1x i2 10 0 i2 11 ' 3560 t1 l1 get dice 1,2,3,4 |1 computer 2 2* m2 0:j2 1 *24 m2 m* 1: m1 4 ' 3720 f2> k2 s(0,m): k2 0 ' 3720 z2h l2 1 $ s(k,0) s2r f(j)2 s(k,l):j2 j* 1 {2\ l 2f 3380 2p 2z get dice fh /2 computer 52 c2 m2 0:j2 1 ]2" m2 m* 1: m1 4 ' 3720 y2, k2 s(0,m): k2 0 ' 3720 36 k1 1 ' 3490 3@ l2 1 $ s(k,0) 83j f(j)2 s(k,l):j2 j* 1 @3t l k3^ 3490 q3h j3r get dice lg/sm st z3| computer 3 3m2 0:j2 1 (3m2 m* 1: m1 4 ' 3680 d3$k2 s(0,m): k2 0 ' 3680 [3. s(k,0)2 1 ' 3610 o38 l2 1 $ s(k,0) 4bf(j)2 s(k,l):j2 j* 1 4l l 4v 3610 24` f(1)3 1 0 ' 3720 h4jl2 5 (2, ;(1)* 1) t4tf(1)2 5 i4~ l2 1 ' f(1)2 1 o4 4 computer roll again 4 4& b2 1 $ 4 440 f(b)3 1 ' 3810 p4:c(f(b))2 5 (6, ;(1)* 1) l4ddie2 c(f(b)):j2 f(b)+ 1 w4n 5250 5x 5530 5bf(b)2 0 5l b !5v 2140 '5 b5 computer must score h5 g5mr2 mr* 1: mr1 13 ' mr2 1 5(i2 m(mr): i2 0 ' 3870 52 k(i,a)3 1 0 ' 3870 -5< i1 6 ' 3960 85f 6110 l5p x2 + 1 ' 3970 e5z k(i,a)3 1 0 ' 3870 {5dk(i,a)2 s(i,0), i 6n k(i,a)3 1 0 ' 3980 66x i2 13 / k(13,a)2 0 ' 6190 t6 k(i,a)2 0 ' k(i,a)2 + 1 z6 w6 get scoreboard totals }6 6* j2 14 $ 17 64k(j,a)2 0 $6> j 36h j2 1 $ 6 j6r k(j,a)3 0 ' 4070 g6\k(15,a)2 k(15,a)* k(j,a) o6f j 7p k(15,a)1 62 ' k(14,a)2 35 7z j2 7 $ 13 67 k(j,a)3 0 ' 4120 s7k(16,a)2 k(16,a)* k(j,a) [7 j 7"k(17,a)2 k(14,a)* k(15,a)* k(16,a) 7, 76 print score !7@ ,7j 2110 :7tg 5,pc(a) i7^ j2 1 $ 6 ~7h k(j,a)3 0 ' ` ,4, (a+ 1)* 14,j: " 0";: 4230 8r k(j,a)3 1 ' 4230 >8|` ,4, (a+ 1)* 14,j: {"###";k(j,a); f8 j v8 j2 7 $ 13 8 k(j,a)3 0 ' ` ,4, (a+ 1)* 14,j*3: " 0": 4280 #8$ k(j,a)3 1 ' 4280 m8.` ,4, (a+ 1)* 14,j*3: { "###";k(j,a) u88 j ~8b` ,4, (a+ 1)* 14,8: { "###";k(15,a) (9l` ,4, (a+ 1)* 14,18: { "###";k(16,a) r9v` ,4, (a+ 1)* 14,19: { "###";k(14,a) |9`` ,4, (a+ 1)* 14,20: { "###";k(17,a) 9jg 5,2 9t a, cc3 1 n ' 1330 $9~ j9 reset m(i) computer priorities p9 `9 b2 1 $ 13 v9& m(b)2 12 ' 4410 :0 m(b)2 i ' m(b)2 0 :: b !:d 1330 ':n <:x instructions b:b v:l " y a h t z e e ": : :v "this is the game of yahtzee - " i: "from 1 to 7 players may play, or one may play against the computer," 4; "with each players current status shown on the screen's game board." {; "you have to @score' each play, and the strategy involved is to" 6; "guess whether you will be lucky in future rolls.": f;( " a yahtzee is five of a kind. " !<2 " a small straight is any sequence of four." ^<< " a large straight is any sequence of five.": )