h yatzeeer original by jl helms & mf pezok for cciiz| coronado, ca adapted to ibm pc by patrick leabo tucson, azh adapted to commodore 128 by john teeplez$ omaha, ne`)* pc(6):l21$6:pc(l)2l*6::pc(5)26:pc(1)2114. c(5): k(18,7): f(5): a$(7)`8 s(6,5): m(13),tn(6),du(6):g 5,2:^5,1b 1150: n2 1 $ 6: tn(n):lv 50901`c12 39:c22 63:c32 33:c42 56aj^5,1: 4670lt 4430d~ 49,51,53,54,56,61o 6820u` ,0,23,& "how many players? ";:` ,0,0: 2090d0 7100: n2f(kb$)+48]: n3 1 0 n1 6 ' 1180qd n3 6 ' 6000n cc2 1 ' 5480x a2 1 $ n\b` ,0,23: " ";:` ,0,23l "player number "a;" name please ";5v 2090: a$(a): a$(a)2 "" ' ~"mb": 1250ja$(a)2h(a$(a),9)r  ay cc2 1 ' n2 n* 1:a$(n)2 " c-128 "` ,0,22(a2 02-< next roll preset3fmpa2 a* 1: a1 n ' a2 1]zh2 0: 5340od a2 0 ' 4760 n k(18,a)2 2 ' 1360f 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 rollv!a!" 7080s!, h1 2 ' 1940a!6 " how many dice to roll again? ";: 2080: 7100:f$2kb$: f$;:f2f(f$)+48x!@ f2 + 1 ' 35000q!j f3 0 0 f1 5 ' 1570"t f2 0 ' 1940"^ f2 5 ' 1430"h>"r player selects dice to rolld"|p"h2 h* 1[" 7080v" 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 ' 17205#l f(nd);:d#vx2 2:xf2 0s#` j2 1 $ fe#j f2 1 ' 1790#t f(j)2 f(j* 1)' x2 1#~ f(1)2 0 ' xf2 16# j: xf2 1 ' h2 h+ 1: 1570j# x 1680,1820p#o#& player rolls dice againu#0$: b2 1 $ 4$d f(b)2 0 ' 19205$nc(f(b))2 5 (6, ;(1)* 1)q$xdie2 c(f(b)):j2 f(b)+ 1\$b 5250g$l 5530s$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+ 70%f 2120: i1 9 '  g (i* 55);: 20109%p i;s%z i3 1 0 i1 13 ' 1970u%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 clickl&*~ "mb"r&4x&>^&hd&rj&wp&\&f dice logic&p clear/set s(m,k) &z/& m2 0 $ 6>& k2 0 $ 5l&s(m,k)2 0t&" k\&, mk&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 qtyy'rb'|x2 0w'  j2 5 $ 1 ) + 1 '  m2 6 $ 1 ) + 1%' s(m,0)3 1 j ' 2350;'$ s(0,x)2 m:x2 x* 1c'.  mk'8  ja'b a, cc2 n ' 2740s'l i1 6 ' 2460y'v (`  check player board 1-6(j ((t 6110<(~ x2 + 1 ' 2720w( k(i,a)2 i, s(s(0,x),0)b( 3980h( (&  check player board 7-13 (0 =(:  i+ 6 2500,2520,2540,2560,2610,2650,2680y(d s(s(0,0),0)3 3 ' 2720k(n 6190: 3980)x s(s(0,0),0)3 4 ' 2720)b 6190: 3980j)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 ' 2600v) 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* 27203*( k(10,a)2 30: 3980j*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 2720c*p k(11,a)2 40: 3980a*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 8z,z s(s(0,0),0)2 4 / k(8,a)2 0 ' 6190: 3980c, 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: 3980c, k(11,a)3 1 0 ' 2900m," 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 ' 2890f-@ 2900]-j k(11,a)2 40: 3980w-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 ' 2960w-r s(2,0)1 0 / s(3,0)1 0 / s(4,0)1 0 / s(5,0)1 0 ' 29602.| s(3,0)1 0 / s(4,0)1 0 / s(5,0)1 0 / s(6,0)1 0 ' 2960=. 2970t. k(10,a)2 30: 3980f. h3 3 ' 3140o.$ i2 6&.. s(6,0)1 2 / k(6,a)2 0 ' k(6,a)2 6, s(6,0): 3980/.8 i2 5f.b s(5,0)1 2 / k(5,a)2 0 ' k(5,a)2 5, s(5,0): 3980o.l i2 4&/v s(4,0)1 2 / k(4,a)2 0 ' k(4,a)2 4, s(4,0): 3980//` i2 3f/j s(3,0)1 2 / k(3,a)2 0 ' k(3,a)2 3, s(3,0): 3980o/t i2 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): 3980i/ i2 10& s(1,0)1 2 / k(1,a)2 0 ' k(1,a)2 s(1,0): 3980=00 i2 13: k(13,a)3 1 0 ' 3140t0: c(1)* c(2)* c(3)* c(4)* c(5)1 19 ' 6190: 3980z0d 0n  clear dice number f(b)(0x  computer.0b =0l  b2 1 $ 5i0v f(b)2 0q0  bw0 o0  get dice control0  computer1( 12 h2 h* 1: h1 3 ' 3840<1< i2 m(mr): i3 1 0 ' 3290[1f mr2 mr* 1: mr1 13 ' mr2 1f1p 32601z i2 12 / k(12,a)1 + 1 ' 3330!1d k(i,a)3 1 0 ' 327031n i2 9 ' 3440n1x i2 10 0 i2 11 ' 3560t1 l1  get dice 1,2,3,4|1  computer2 2* m2 0:j2 1*24 m2 m* 1: m1 4 ' 3720f2> k2 s(0,m): k2 0 ' 3720z2h  l2 1 $ s(k,0)s2r f(j)2 s(k,l):j2 j* 1{2\  l2f 3380 2p 2z  get dice fh/2  computer52 c2 m2 0:j2 1]2" m2 m* 1: m1 4 ' 3720y2, k2 s(0,m): k2 0 ' 3720 36 k1 1 ' 34903@  l2 1 $ s(k,0)83j f(j)2 s(k,l):j2 j* 1@3t  lk3^ 3490q3h j3r  get dice lg/sm stz3|  computer33m2 0:j2 1(3m2 m* 1: m1 4 ' 3680d3$k2 s(0,m): k2 0 ' 3680[3. s(k,0)2 1 ' 3610o38 l2 1 $ s(k,0)4bf(j)2 s(k,l):j2 j* 14l l4v 361024` f(1)3 1 0 ' 3720h4jl2 5 (2, ;(1)* 1)t4tf(1)2 5i4~ l2 1 ' f(1)2 1o4 4 computer roll again44& b2 1 $ 4440 f(b)3 1 ' 3810p4:c(f(b))2 5 (6, ;(1)* 1)l4ddie2 c(f(b)):j2 f(b)+ 1w4n 52505x 55305bf(b)2 05l b!5v 2140'5b5  computer must scoreh5g5mr2 mr* 1: mr1 13 ' mr2 15(i2 m(mr): i2 0 ' 387052 k(i,a)3 1 0 ' 3870-5< i1 6 ' 396085f 6110l5p x2 + 1 ' 3970e5z k(i,a)3 1 0 ' 3870{5dk(i,a)2 s(i,0), i6n k(i,a)3 1 0 ' 398066x i2 13 / k(13,a)2 0 ' 6190t6 k(i,a)2 0 ' k(i,a)2 + 1z6 w6 get scoreboard totals}6 6* j2 14 $ 1764k(j,a)2 0$6> j36h j2 1 $ 6j6r k(j,a)3 0 ' 4070g6\k(15,a)2 k(15,a)* k(j,a)o6f j7p k(15,a)1 62 ' k(14,a)2 357z j2 7 $ 1367 k(j,a)3 0 ' 4120s7k(16,a)2 k(16,a)* k(j,a)[7 j7"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";: 42308r k(j,a)3 1 ' 4230>8|` ,4, (a+ 1)* 14,j: {"###";k(j,a);f8 jv8 j2 7 $ 13 8 k(j,a)3 0 ' ` ,4, (a+ 1)* 14,j*3: " 0": 4280#8$ k(j,a)3 1 ' 4280m8.` ,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,29t a, cc3 1 n ' 1330$9~j9 reset m(i) computer prioritiesp9`9 b2 1 $ 13v9& m(b)2 12 ' 4410:0 m(b)2 i ' m(b)2 0:: b!:d 1330':n<:x instructionsb:bv: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.":)*! aa$: aa$2"" ' 4650>4a>>` ,10,6: "yahtzee.bas ver 3.2"[>h` ,10,8: "27 jun 79"y>r` ,10,10: "developed by"(>\` ,13,11: "j.l. helms & m.f. pezok"x>f` ,13,12: "1009 leyte rd / 1321 saipan rd">p` ,17,13: "coronado, ca. 92118"*?z` ,15,14: "(714) 435-6992 / 437-4659"[?}` ,10,16: "adapted to c-128 by john teeple"u?~` ,13,17: "4 nov 85" ? l21$3500::^5,1??1?" end - sort winner7?,n?6x2 2: n2 1 ' 4870`?@ j2 1 $ n+ 1@j k(17,j)1 k(17,j* 1)' 48501@tk2 k(17,j):k(17,j)2 k(17,j* 1):k(17,j* 1)2 k\@^a$2 a$(j):a$(j)2 a$(j* 1):a$(j* 1)2 a$@cpc2 pc(j):pc(j)2 pc(j* 1):pc(j* 1)2pc@hx2 1@r j+@| x 4760,48701@q@ print winners standingsw@b@$ 5200q@. j2 1 $ n0a8` ,0,24: " ";kab j1 1 / j2 n ' 5240\al` ,0,24: a$ av a$;" ";:g 5,pc(j): a$(j);" ";:g 5,28a`tt2 500, (n+ j* 1): tt3 1500 ' tt2 1500laj t2 1 $ tt: ttat jb~` ,0,24: " ";` ,49,4, j* 3*j:" "; ec` ,49,4, j* 4*j:" ";ehg 5,7ere\6ef check if done` ,49,4,j*3*j: "b b";ih` ,49,4,j*4*j: "jccccck";im get outirg 5,2.i\ char ,0,04if:ipqiz computer optionwiaicc2 0mi` ,0,23$j" "do you wish to play against me? y/n ";: 2090ej,! y$: y$2"" ' 6060:u ~"mb"vj6 y$2 "n"' lj@ y$3 1 "y"' 6040vjjcc2 1|jtj^+jh check for aces-sixes any position1jr 3 no die=3!ph 4 2 3 5 2 fours positions 3 and 5tpr 5 1 1 1 five position 1q\ 6 1 4 1 six position 4$qf + +_qp + + ++++++++++++++++ section for position dataqz + +------------------ column indicates qtyqq +------------------------ index equates to die valuewqr m(13) priority numbers for must score where value?r" refers to play board numberer,|r6 to run internal checks section - enter a -1 for/r@ playing board number or qty of dice to rollarj again - - data will not be lost and screenst will be reset with current dice shown - -es^ players/computers score will not show until]sh after their turncsr~s| computer prioriries s 6800-s 11,9,12,8,1,2,3,4,5,6,10,7,13ls y2 1 $ 13: m(y): : :rs$bs.^5,1:g 5,16t8" a b c d e f "?tb"aces........1\...\...\...\...\...\...\1"ntl"twos........2\...\...\...\...\...\...\2"tv"threes......3\...\...\...\...\...\...\3"pt`"fours.......4\...\...\...\...\...\...\4 y"uj"fives.......5\...\...\...\...\...\...\5 a"6ut"sixes.......6\...\...\...\...\...\...\6 h"iu~" ************************* t"u"total upper..\...\...\...\...\...\...\ z"ou" ************************* e"v"3 of a kind.7\...\...\...\...\...\...\7 e"1v&"4 of a kind.8\...\...\...\...\...\...\8"`v0"full house..9\...\...\...\...\...\...\9"v:"sm straight.a\...\...\...\...\...\...\a">vd"lg straight.b\...\...\...\...\...\...\b"mvn"yahtzee.....c\...\...\...\...\...\...\c"wx"chance......d\...\...\...\...\...\...\d"jwb" *************************"xwl"total lower..\...\...\...\...\...\...\"&wv"top bonus....\...\...\...\...\...\...\"tw"grand total..\...\...\...\...\...\...\"x " *************************"-x n21 $ 5:` ,45,n,4+3*(n): n;::g 5,23x|x(` ,0,23: " ";:` ,0,23:x2 kb input and escape/x<! kb$: kb$2""' 71005xf