Rollout
- Type
- Game
- Category
- Dice game with live probability statistics
- Author
- Robert "Rassilon" Patton
- Published in
- Antic, January 1988 (Vol. 6, No. 9), Game of the Month ("Rassilon's Triple-Header")
- Year
- 1988
- Language
- Atari BASIC
- Requirements
- Any Atari 8-bit, any memory size, Atari BASIC, joystick in port 1
About the program
Antic's January 1988 Game of the Month was three short games by Robert Patton, who signed his work "Rassilon", a name taken from Doctor Who. He was an industrial engineer with the U.S. Postal Service and had already written Taxman (Antic, April 1986). Antic said he specialised in short, clean games that are easy to type. Rollout is the first of the three. The others are Pegboard and Bounce.
You have a bar of numbers from 1 to 10. Roll two dice, then remove the number on one die, both dice's numbers, or any set of numbers that adds up to the dice total. Clear the bar in as few rolls as possible. Antic called it "Yahtzee-like", but it plays much like the traditional pub game Shut the Box. The article suggested it as an adding drill for young children. For older players, the screen doubles as a running experiment in probability. A 6×6 grid counts how often each combination of dice has come up, a table counts each total from 2 to 12, and the mean of all rolls is shown, all updated on every throw.
Typing it in
The dice faces are built from cursor-control strings (lines 630–690). Each string draws one row of a die, moves {DOWN} and five {LEFT}s, then draws the next row. Type {DOWN} and {LEFT} as ESC followed by CTRL-= and CTRL-+. {CTRL-B}, {CTRL-V} and {CTRL-.} (the pip) are CTRL plus that key, and {inv} means the Atari (inverse) key. Each DIE$ slice must be exactly 27 characters. Lines 700–710 draw the grid's frame with CTRL-Q, CTRL-R, CTRL-Z and similar line-drawing characters. Several of these lines run off the right edge of this page, so copy them exactly.
How to play
At "How many games do we play" type a number up to 10 (0 ends the program). Press the joystick button to roll. The marker under the bar jumps to the number matching the dice total. Move it left or right with the stick (it wraps around at the ends) and press the button to take that number. To remove a combination, pick its numbers one after another. If a choice doesn't fit the roll, it's ignored. When the dice have been fully used, they're cleared and you roll again. The top line keeps track of rolls, game number and your average rolls per game.
Patton's hints: get rid of the big numbers early. Sometimes it's better to leave 1, 2 and 3 alone, and keep track of which combinations are still possible, not just which numbers.
How it works
The statistics come almost for free. Every roll adds 1 to DICE(D1,D2) and to CARD(D1+D2), and line 100 computes the mean as Σ(total × count) / number of rolls. Over a few games you can watch 7 become the most common total and the 6×6 grid even out, which shows RND behaving like a fair die. Line 330 "rolls" seven times in a row, printing each face, for a quick tumbling animation before the dice settle. The player's running choice is kept in N and checked against D1, D2 and D1+D2 in lines 490–550. When a selection overshoots the total, it's simply reset.
Variations to try
- Use a bar of 1 to 12. That means changing the 10s in lines 280, 440, 580 and 590, the starting total
NSUM=55(to 78) and the marker limits in lines 130 and 180–190. - After a hundred rolls, compare
CARD()with the theoretical odds: a total T should come up (6−|T−7|)/36 of the time.
Listing
5 REM ROLLOUT
10 REM BY ROBERT PATTON
20 REM (c)1987, ANTIC PUBLISHING
30 GOSUB 600
40 GOSUB 120:POKE 77,0:T=0:T1=0:T2=0:N=0:D1=0:D2=0
50 IF NSUM=0 THEN GOSUB 590:TROLLS=TROLLS+ROLL:ROLL=0:AVG=TROLLS/GAME:GAME=GAME+1:NSUM=55
60 AVG=(INT(AVG*1000))/1000:IF GAME>MAX THEN GOSUB 750
70 GOTO 40
80 POSITION 10,11:POKE 82,10
90 FOR YY=1 TO 6:FOR XX=1 TO 6:? " ";DICE(XX,YY);" ";:NEXT XX:? :? :NEXT YY:POKE 82,0:SUM=0:CARD=0
100 FOR X=2 TO 12:POSITION 30,9+X:? CARD(X);" of ";X;"'s";:SUM=SUM+(X*CARD(X)):CARD=CARD+CARD(X):NEXT X
110 MEAN=SUM/CARD:MEAN=(INT(MEAN*100))/100:POSITION 30,9:? "Mean=";MEAN;:RETURN
120 GOSUB 280
130 POSITION COL,4:? " ";:GOSUB 270:GOSUB 320:COL=3*(D1+D2):IF COL>30 THEN COL=30
140 STK=STICK(0):INC=0
150 IF STK=7 THEN INC=3
160 IF STK=11 THEN INC=-3
170 IF INC THEN POSITION COL,4:? " ";:GOSUB 260:COL=COL+INC
180 IF COL<3 THEN COL=30
190 IF COL>31 THEN COL=3
200 POSITION COL,4:? "{CTRL-H}{inv}^{/inv}{CTRL-J}";
210 IF (STK=15 AND STRIG(0)=0) THEN GOSUB 430
220 FOR WAIT=1 TO 10:NEXT WAIT
230 IF (D1+D2=0 OR NSUM=0) THEN 250
240 GOTO 140
250 RETURN
260 SOUND 0,28,10,2:FOR WAIT=1 TO 10:NEXT WAIT:SOUND 0,0,0,0:RETURN
270 POSITION 5,1:? "ROLL ";ROLL;" GAME #";GAME;" AVG=";AVG;" ";:RETURN
280 POSITION 3,3:FOR X=1 TO 10
290 IF N(X,0)<>0 THEN ? "{inv} {/inv}";N(X,0);"{inv} {/inv}";
300 IF N(X,0)=0 THEN ? "{inv} {/inv}";
310 NEXT X:? :? :RETURN
320 ROLL=ROLL+1:POSITION 5,1:? "ROLL ";ROLL;" ";
330 FOR X=0 TO 6
340 D1=INT(RND(0)*7):IF D1=0 THEN 340
350 D2=INT(RND(0)*7):IF D2=0 THEN 350
360 POSITION 14,6:? DIE$((D1-1)*27+1,(D1-1)*27+27)
370 POSITION 20,6:? DIE$((D2-1)*27+1,(D2-1)*27+27)
380 NEXT X
390 CARD(D1+D2)=CARD(D1+D2)+1
400 DICE(D1,D2)=DICE(D1,D2)+1
410 GOSUB 80
420 RETURN
430 POSITION COL,4:? " ";
440 FOR X=1 TO 10
450 IF N(X,1)=COL THEN T=N(X,0)
460 NEXT X
470 T2=T
480 IF N=0 THEN T1=T
490 N=N+T:IF N>D1+D2 THEN N=0:RETURN
500 IF N=0 THEN POP :GOTO 130
510 IF N=D1 THEN D1=0:POSITION 14,6:? ZAP$:GOSUB 580
520 IF N=D2 THEN D2=0:POSITION 20,6:? ZAP$:GOSUB 580
530 IF (N=D1+D2 AND D1+D2<>0) THEN 550
540 GOTO 560
550 POSITION 14,6:? ZAP$:POSITION 20,6:? ZAP$:N=T1:GOSUB 580:N=T2:GOSUB 580:D1=0:D2=0
560 GOSUB 280
570 RETURN
580 N(N,0)=0:NSUM=0:SOUND 3,33,14,3:FOR X=1 TO 10:NSUM=NSUM+N(X,0):NEXT X:SOUND 3,0,0,0:N=0:RETURN
590 FOR X=1 TO 10:N(X,0)=X:N(X,1)=X*3:NEXT X:RETURN
600 DIM DIE$(162),ZAP$(27),N(10,1),DICE(6,6),CARD(12)
610 GRAPHICS 0:POKE 752,1:POKE 82,0:POKE 710,98:POKE 712,98:POKE 709,106
620 FOR X=0 TO 12:CARD(X)=0:NEXT X:FOR X=0 TO 6:FOR Y=0 TO 6:DICE(X,Y)=0:NEXT Y:NEXT X:GAME=1:NSUM=55
630 DIE$(1,27)="{CTRL-B}{inv} {/inv}{CTRL-V}{DOWN}{LEFT}{LEFT}{LEFT}{LEFT}{LEFT}{CTRL-B}{inv} {CTRL-.} {/inv}{CTRL-V}{DOWN}{LEFT}{LEFT}{LEFT}{LEFT}{LEFT}{CTRL-B}{inv} {/inv}{CTRL-V}"
640 DIE$(28,54)="{CTRL-B}{inv}{CTRL-.} {/inv}{CTRL-V}{DOWN}{LEFT}{LEFT}{LEFT}{LEFT}{LEFT}{CTRL-B}{inv} {/inv}{CTRL-V}{DOWN}{LEFT}{LEFT}{LEFT}{LEFT}{LEFT}{CTRL-B}{inv} {CTRL-.}{/inv}{CTRL-V}"
650 DIE$(55,81)="{CTRL-B}{inv}{CTRL-.} {/inv}{CTRL-V}{DOWN}{LEFT}{LEFT}{LEFT}{LEFT}{LEFT}{CTRL-B}{inv} {CTRL-.} {/inv}{CTRL-V}{DOWN}{LEFT}{LEFT}{LEFT}{LEFT}{LEFT}{CTRL-B}{inv} {CTRL-.}{/inv}{CTRL-V}"
660 DIE$(82,108)="{CTRL-B}{inv}{CTRL-.} {CTRL-.}{/inv}{CTRL-V}{DOWN}{LEFT}{LEFT}{LEFT}{LEFT}{LEFT}{CTRL-B}{inv} {/inv}{CTRL-V}{DOWN}{LEFT}{LEFT}{LEFT}{LEFT}{LEFT}{CTRL-B}{inv}{CTRL-.} {CTRL-.}{/inv}{CTRL-V}"
670 DIE$(109,135)="{CTRL-B}{inv}{CTRL-.} {CTRL-.}{/inv}{CTRL-V}{DOWN}{LEFT}{LEFT}{LEFT}{LEFT}{LEFT}{CTRL-B}{inv} {CTRL-.} {/inv}{CTRL-V}{DOWN}{LEFT}{LEFT}{LEFT}{LEFT}{LEFT}{CTRL-B}{inv}{CTRL-.} {CTRL-.}{/inv}{CTRL-V}"
680 DIE$(136,162)="{CTRL-B}{inv}{CTRL-.} {CTRL-.}{/inv}{CTRL-V}{DOWN}{LEFT}{LEFT}{LEFT}{LEFT}{LEFT}{CTRL-B}{inv}{CTRL-.} {CTRL-.}{/inv}{CTRL-V}{DOWN}{LEFT}{LEFT}{LEFT}{LEFT}{LEFT}{CTRL-B}{inv}{CTRL-.} {CTRL-.}{/inv}{CTRL-V}"
690 ZAP$=" {DOWN}{LEFT}{LEFT}{LEFT}{LEFT}{LEFT} {DOWN}{LEFT}{LEFT}{LEFT}{LEFT}{LEFT} "
700 POSITION 0,7:? "{inv}RASSILON'S{/inv}":? :? " {inv}ROLLOUT{/inv}":POSITION 9,10:? "{CTRL-Q}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-E}"
710 POSITION 9,22:? "{CTRL-Z}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-C}{RIGHT}{DOWN}{inv}DIE 1{/inv}";
720 FOR X=11 TO 21:POSITION 9,X:? "|";:POSITION 28,X:? "|";:NEXT X
730 FOR X=1 TO 6:POSITION 7,9+(X*2):? X;:POSITION 8+(X*3),23:? X;:NEXT X
740 POSITION 0,16:? "{inv}DIE 2{/inv}";:POSITION 29,7:? " {inv}Dice Sums{/inv}";:GOSUB 590
750 GOSUB 270:POSITION 3,3:? " {inv}How many games do we play{/inv} {LEFT}{LEFT}{LEFT}{LEFT}";:INPUT MAX:GAME=1:IF MAX=0 THEN END
760 IF MAX>10 THEN MAX=10
770 RETURN
Download
The original program from the Antic disk, to LOAD or ENTER instead of typing it: ROLLOUT.BAS.
Credits
- Program listing: Rollout — program listing (Antic, January 1988 (Vol. 6, No. 9), Game of the Month ("Rassilon's Triple-Header")) — Robert "Rassilon" Patton
- Picture: Two rolls into a game: the 4 has gone from the bar, and the statistics grid is starting to fill. — Robert "Rassilon" Patton (program); screenshot by the site
- Antic, January 1988 - Vol. 6 No. 9 — article: games by Robert "Rassilon" Patton — Robert "Rassilon" Patton, 1988
- Antic Software Archive — January 1988 - Vol. 6 No. 9 disk: ROLLOUT.BAS — AtariMagazines.com (Kevin Savetz), 1988
