High Rollers

Type
Game
Category
Dice game for 2 to 8 players
Author
Frank Walters
Published in
Antic, June/July 1990 (Vol. 9, No. 2)
Year
1990
Language
Atari BASIC
Requirements
48K RAM, Atari BASIC, disk drive, one joystick in port 1
GRAPHICS 1 title screen reading HIGH ROLLERS by Frank Walters, with INSTRUCTIONS? (Y/N) and three grey dice showing one, three and five pips

About the program

High Rollers was the "Game of the Month" in the June/July 1990 Antic, one of the magazine's last issues. Frank Walters, a retired Air Force fighter pilot who ran an Atari BBS in Panama City, Florida, had played the dice game with friends while he was in the service. The game was fun, but with a crowd of players somebody had to keep everyone's score on a blackboard. A computer, he reasoned, makes a much better scorekeeper. His earlier Antic programs included Lazy Loader (May 1985) and VCR Labeler (May 1989).

It's a classic push-your-luck game. You roll three dice and keep rolling as long as each roll scores. Then you either press your luck or pass the dice and put your points in the bank. One pointless roll and everything you haven't banked is gone.

What you need

An Atari 8-bit with 48K and Atari BASIC (the magazine specified a disk drive), plus one joystick in port 1, which the players pass round. Two to eight players.

Typing it in

The disk version has no TYPO II checksum codes; the magazine printed them beside each line. In this notation {inv}…{/inv} means type with the Atari (inverse) key on, {CTRL-T} and {CTRL-R} mean hold CTRL and press the letter (CTRL-T is the ball used for the pips, CTRL-R the horizontal line), and {DOWN} {LEFT} {UP} {RIGHT} are typed as ESC followed by CTRL and the arrow key. {ESC}{RIGHT} in line 390 is an ESC character (press ESC twice) followed by a cursor-right (ESC, CTRL-right arrow). When printed, the ESC makes the arrow show as a symbol instead of moving the cursor. {CLEAR} is ESC then SHIFT-CLEAR, and {DEL LINE}/{DEL CHAR} in line 860 are ESC then SHIFT-DELETE and ESC then CTRL-DELETE.

Line 690 is the one to check carefully. D$ holds all six die faces, 17 characters each: three rows of three inverse cells with cursor moves between them.

How to play

RUN it, answer Y or N for the two pages of instructions, and type the number of players (one keypress, up to 8) and their names. Walters suggested that with four players or fewer each person enters their name twice, which gives everyone two turns per round. The program picks the first player at random and points to them with an arrow.

  • Push the stick to roll the dice.
  • Press the trigger to pass and bank your points.
  • Each 1 scores 100 and each 5 scores 50. Any three of a kind adds 1,000, so three 1s are worth 1,300.
  • Your first deposit must be at least 500. After that you can bank as little as 50.
  • You must reach exactly 3,000. Going over loses your turn's points.

After a win, START replays with the same players (the Wins column keeps count), SELECT starts again with new players, and OPTION quits.

How it works

  • Dice as strings. Each face is a 17-character slice of D$ (line 690). PRINT draws a die in one go because cursor-down and cursor-left codes are built into the string. Line 950 flashes ten random faces with a click before the last one stays, which gives the rolling effect.
  • Counting. Line 980 tallies how many of each face came up in C(), then lines 50–110 add 1,000 for a triple and 100 or 50 for each 1 or 5. FL remembers whether anything scored at all.
  • Fixed-width scores. Lines 290–330 pad scores to four characters, and each player's bank total is stored in a slot in one long string TOT$, as Atari BASIC has no string arrays. Names are kept in 10-character slots in PLAYR$ the same way.
  • The odds. Walters worked them out in the article. A roll with no 1, no 5 and no triple happens 64 − 4 = 60 times out of 216, so you score 156 times in 216. Near the end the odds turn against you: with 2,950 in the bank only a single 5 helps (48 chances in 216), while from 2,900 a single 1 or two 5s will do (60 in 216).

Variations to try

  • Change the target: replace 3000 in lines 160 and 200.
  • Make the opening deposit easier by changing the 500 in line 170.

Listing

1 REM HIGH ROLLERS
2 REM BY FRANK WALTERS
3 REM (c)1990, ANTIC PUBLISHING, INC.
10 GOTO 670
20 POSITION 10,23:? "                      ";
30 RETURN
40 REM {inv}SCORE{/inv}
50 FL=0:FOR I=1 TO 6
60 IF C(I)=3 THEN TEMP=TEMP+1000:FL=1
70 NEXT I
80 FOR I=1 TO 3
90 IF D(I)=1 THEN TEMP=TEMP+100:FL=1
100 IF D(I)=5 THEN TEMP=TEMP+50:FL=1
110 NEXT I
120 IF  NOT FL THEN TEMP=0:GOSUB 290:GOSUB 420:GOSUB 150
130 FL=0:RETURN
140 REM {inv}END OF TURN{/inv}
150 IF TEMP=0 THEN 210
160 IF TOTAL(P)+TEMP>3000 THEN POSITION 10,23:? " {inv}YOU ARE OVER 3000{/inv}";:GOSUB 1020:FOR I=1 TO 300:NEXT I:FL=1:GOTO 210
170 IF TOTAL(P)=0 AND TEMP<500 THEN POSITION 10,23:? " {inv}NEED 500 TO START{/inv}";:FOR I=1 TO 300:NEXT I:GOTO 460
180 TOTAL(P)=TOTAL(P)+TEMP:TEMP=TOTAL(P):GOSUB 290:TOT$(P*4-3,P*4)=TEMP$
190 GOSUB 420
200 IF TOTAL(P)=3000 THEN POP :GOTO 540
210 POSITION 24,P*2+1:? "    "
220 POSITION 1,P*2+1:? "   "
230 GOSUB 20:IF TEMP AND  NOT FL THEN GOSUB 1000
240 IF FL THEN TEMP=0
250 IF  NOT TEMP THEN GOSUB 1020
260 TEMP$="":TEMP=0:FL=0
270 RETURN
280 REM {inv}FORMAT SCORE{/inv}
290 TEMP$=""
300 IF TEMP<1000 THEN TEMP$(1)=" "
310 IF TEMP<100 THEN TEMP$(2)=" "
320 IF TEMP<10 THEN TEMP$(3)=" "
330 TEMP$(LEN(TEMP$)+1)=STR$(TEMP)
340 RETURN
350 REM {inv}PRINT GAME SCREEN{/inv}
360 POSITION 0,0:? "{CLEAR}{inv}             High Rollers               {/inv}"
370 POSITION 5,1:? "Player       Bank  Score      Wins":POSITION 0,2:? LINE$
380 FOR I=1 TO PN
390 POSITION 5,I*2+1:? PLAYR$(I*10-9,I*10);"-{ESC}{RIGHT}":? LINE$
400 IF WIN(I) THEN TEMP=WIN(I):GOSUB 290:POSITION 35,I*2+1:? TEMP$:TEMP=0
410 NEXT I:RETURN
420 POSITION 18,P*2+1:? TOT$(P*4-3,P*4):RETURN
430 REM {inv}MAIN GAME LOOP{/inv}
440 P=P+1:POKE 77,0:IF P>PN THEN P=1
450 POSITION 1,P*2+1:? AR$
460 GOSUB 20:POSITION 10,23:? "{inv}PUSH STICK TO ROLL{/inv}";
470 IF STRIG(0)=0 THEN GOSUB 640:GOSUB 150:GOTO 440
480 IF STICK(0)=15 THEN 470
490 GOSUB 20:FOR D=1 TO 3:GOSUB 950:NEXT D:GOSUB 980
500 GOSUB 50:GOSUB 290:IF TEMP THEN POSITION 24,P*2+1:? TEMP$
510 IF TEMP=0 THEN 440
520 GOTO 460
530 REM {inv}WINNER ROUTINE{/inv}
540 FOR X=240 TO 50 STEP -2:SOUND 0,X,10,8:NEXT X:SOUND 0,0,0,0:WIN(P)=WIN(P)+1:IF WIN(P)>9 THEN WIN(P)=9
550 POSITION 24,P*2+1:? "{inv}<=={/inv} ":POSITION 1,P*2+1:? "{inv}==>{/inv}"
560 POSITION 0,23:? "{inv}START{/inv}=REPLAY {inv}SELECT{/inv}=RESTART {inv}OPTION{/inv}=QUIT";
570 FOR I=1 TO 10:IF  NOT FL THEN POSITION 28,P*2+1:? "{inv}WINNER{/inv}"
580 IF PEEK(53279)=6 THEN FL=0:POKE 712,0:GOTO 1030
590 IF PEEK(53279)=3 THEN GRAPHICS 0:POKE 82,2:END
600 IF PEEK(53279)=5 THEN RUN
610 IF FL THEN POSITION 28,P*2+1:? "WINNER"
620 NEXT I:FL= NOT FL:POKE 712,PEEK(53770):GOTO 570
630 REM {inv}CAN'T PASS BEFORE ROLL{/inv}
640 IF TEMP=0 THEN GOSUB 20:POSITION 12,23:? "  {inv}ROLL FIRST{/inv}";:FOR I=1 TO 300:NEXT I:POP :GOTO 460
650 RETURN
660 REM {inv}INITIALIZE{/inv}
670 DIM D$(102),D(6),C(6),TEMP$(4),NAME$(11),PLAYR$(80),LINE$(40),AR$(3):AR$="==>"
680 LINE$="{CTRL-R}":LINE$(40)=LINE$:LINE$(2)=LINE$
690 D$="{inv}   {/inv}{DOWN}{LEFT}{LEFT}{LEFT}{inv} {CTRL-T} {/inv}{DOWN}{LEFT}{LEFT}{LEFT}{inv}   {CTRL-T}  {/inv}{DOWN}{LEFT}{LEFT}{LEFT}{inv}   {/inv}{DOWN}{LEFT}{LEFT}{LEFT}{inv}  {CTRL-T}{CTRL-T}  {/inv}{DOWN}{LEFT}{LEFT}{LEFT}{inv} {CTRL-T} {/inv}{DOWN}{LEFT}{LEFT}{LEFT}{inv}  {CTRL-T}{CTRL-T} {CTRL-T}{/inv}{DOWN}{LEFT}{LEFT}{LEFT}{inv}   {/inv}{DOWN}{LEFT}{LEFT}{LEFT}{inv}{CTRL-T} {CTRL-T}{CTRL-T} {CTRL-T}{/inv}{DOWN}{LEFT}{LEFT}{LEFT}{inv} {CTRL-T} {/inv}{DOWN}{LEFT}{LEFT}{LEFT}{inv}{CTRL-T} {CTRL-T}{CTRL-T} {CTRL-T}{/inv}{DOWN}{LEFT}{LEFT}{LEFT}{inv}{CTRL-T} {CTRL-T}{/inv}{DOWN}{LEFT}{LEFT}{LEFT}{inv}{CTRL-T} {CTRL-T}{/inv}"
700 PLAYR$="-":PLAYR$(80)=PLAYR$:PLAYR$(2)=PLAYR$
710 FOR I=1 TO 6:D(I)=0:C(I)=0:NEXT I
720 GRAPHICS 1:POKE 708,10:POKE 710,0:POKE 711,88:POKE 752,1:POSITION 4,3:? #6;"high  rollers"
730 POSITION 9,9:? #6;"{inv}by{/inv}":POSITION 4,11:? #6;"{inv}frank walters{/inv}":POSITION 4,15:? #6;"INSTRUCTIONS?"
740 POSITION 8,17:? #6;"(Y/N)":POKE 657,14:FOR I=1 TO 5 STEP 2:? D$(I*17-16,I*17);"{UP}{UP}{RIGHT}{RIGHT}";:NEXT I:POKE 82,0
750 GOSUB 1220:IF K=89 OR K=121 THEN 1050
760 IF K=78 OR K=110 THEN 790
770 GOTO 750
780 REM {inv}ENTER PLAYERS NAMES{/inv}
790 GRAPHICS 0:POKE 752,1:POKE 710,128:POKE 82,0
800 ? "HOW MANY PLAYERS?";
810 GOSUB 1220
820 IF K<49 OR K>56 THEN 810
830 PN=K-48:? PN:DIM TOTAL(PN),TOT$(PN*4):FOR I=1 TO PN:TOTAL(I)=0:NEXT I:TOT$(1)=" ":TOT$(PN*4)=" ":TOT$(2)=TOT$
840 DIM WIN(PN):FOR I=1 TO PN:WIN(I)=0:NEXT I:POKE 752,0
850 FOR I=1 TO PN
860 POSITION 2,I*2:? "{DEL LINE}PLAYER #";I;" NAME: {DEL CHAR}";:NAME$=""
870 INPUT NAME$:L=LEN(NAME$):IF L>10 THEN ? :? "MAX 10 LETTERS PLEASE!":FOR X=1 TO 500:NEXT X:? "{UP}{DEL LINE}":GOTO 860
880 IF  NOT LEN(NAME$) THEN 860
890 TRAP 40000
900 PLAYR$(I*10-9,I*10)=NAME$
910 NEXT I:POKE 752,1
920 GOSUB 360:P=INT(RND(0)*PN)
930 GOTO 440
940 REM {inv}ROLL ONE DIE{/inv}
950 FOR Y=1 TO 10:D(D)=INT(RND(0)*6)+1:POSITION D*6+6,19:? D$(D(D)*17-16,D(D)*17)
960 SOUND 0,100,12,15:SOUND 0,0,0,0:NEXT Y:RETURN
970 REM {inv}TOTAL ALL 3 DICE{/inv}
980 FOR X=1 TO 6:C(X)=0:NEXT X:FOR D=1 TO 5:C(D(D))=C(D(D))+1:NEXT D:RETURN
990 REM {inv}SOUND SUBROUTINES{/inv}
1000 FOR X=1 TO 2:SOUND 0,3,0,8:FOR Y=1 TO 8:NEXT Y:SOUND 0,0,0,0
1010 FOR Y=1 TO 3:NEXT Y:NEXT X:FOR X=14 TO 0 STEP -0.3:SOUND 0,5,10,X:SOUND 1,20,10,X:NEXT X:RETURN
1020 FOR X=8 TO 12:SOUND 0,50,X,8:NEXT X:FOR X=1 TO 20:NEXT X:SOUND 0,0,0,0:RETURN
1030 L=LEN(TOT$):TOT$=" ":TOT$(L)=TOT$:TOT$(2)=TOT$:FOR I=1 TO PN:TOTAL(I)=0:NEXT I
1040 TEMP=0:TEMP$="":GOTO 920
1050 GRAPHICS 0:POKE 752,1:POKE 710,224
1060 ? "{inv}      Instructions for High Rollers     {/inv}"
1070 ? "  A 3 dice game for 2 to 8 players. If  less than 4 players, recommend each     player enter name 2 or 3 times."
1080 ? :? "OBJECT: To be the first player to bank  exactly 3000 points.":?
1090 ? "JOYSTICK #1:  PUSH TO ROLL DICE":? ,"    TRIGGER TO PASS TURN":? :? "SCORING ON EACH ROLL:":?
1100 ? "    Any 3 of a kind = 1000 points":? ," Each ace =  100 points":? ,"Each five =   50 points":?
1110 ? "The player may continue rolling as long as he/she scores on each roll. The turn ends on a 'no-score' or a pass."
1120 GOSUB 1210:? "{CLEAR}{inv}       page 2    hit <1> for page 1     {/inv}"
1130 ? "Opening BANK deposit requires a minimum of 500 points. Subsequent deposits may  be as little as 50 points.":?
1140 ? "If the point score would cause the BANK to exceed 3000 points, the points are   forfeited and the turn passed."
1150 ? :? "Any time a no-score is rolled, the turn is passed to next player and all points on that turn are forfeited."
1160 ? :? "ORDER OF PLAY:   The first player is    selected at random and the turn passes  in sequence.":?
1170 ? "ODDS:  Any triple   -   6 out of 216":? "       Any score    - 156 out of 216"
1180 ? "       Any no-score -  60 out of 216"
1190 GOSUB 1210:IF K=49 THEN GOTO 1050
1200 GOTO 790
1210 POSITION 6,23:? "{inv} Press any key to continue {/inv}";
1220 OPEN #1,4,0,"K:":GET #1,K:CLOSE #1:RETURN

Download

The original program from the Antic disk, to LOAD or ENTER instead of typing it: HIROLLER.BAS.

Credits