The Challenge
Donald D. Spencer concludes his Game Playing with Basic with a chapter of programming challenges. Among the old favorites he describes is Boule, the casino game popular in Europe and the Caribbean. This article is my response to his challenge.
The Game
The game centers on a wheel like roulette, but, unlike roulette, the wheel is stationary. A ball is spun along the raceway around the rim. As it loses momentum, it drops into one of the 18 numbered slots on the wheel. This number then is the winning number. There are only nine numbers on the wheel (1 to 9), and they appear on opposite sides of the wheel. Five is the house number with the players losing their bets when the ball drops into that slot.
The betting combinations are what make this game so interesting. Figure 1 represents the display after a bet of $50 has been entered and after the betting combination has been selected. The player has six combinations plus the option of betting on a single number. All payoffs are even money except bets on single numbers which pay 7 to 1.


The Program Response
The program developed below to transfer Boule to the computer is straight-forward. The difficult part may be realizing that a black background is used.
The basic game principle in Boule is guessing a random number chosen by flipping the ball along the raceway. In the program we simulate this by using the computer’s ability to select random numbers. However, watching the ball spin, slow down, and then drop into the slot is a big part of the excitement of Boule. The computer does not give us anything interesting to watch while it is selecting the random number that will be the winner. So to provide a little visual interest, we use a “flasher” (lines 470-500) to replace the ball and add some suspense to the game. Without the flasher or some similar delay, the winning number would appear immediately.
To provide further visual interest as well as keep track of what is going on in the game play, the Boule table layout and the betting options remain on the screen at all times. Lines 13 through 22 of the display are used for all other information and entries.
Once the program has been entered, hit RUN and ENTER. The display provides the necessary prompts to the player at each step of the way.
The program has a total of 3689 bytes as determined by using
PEEK 16396+256*PEEK 16397-16509
This total could be reduced by over 550 by assigning numbers 1, 13, 16, 18, 750, and 1300 as variables since each of these numbers appears at least 5 times in the program. Number 1 appears 26 times while 18 occurs 11 times. A total of 579 bytes were saved when I went through that exercise. However, since the numbers make reading the program listing easier, they are used.
Line Notes:
The notes below explain the main features of the program, give the graphics directions, and show in capital letters the text PRINTed as inverse on the screen display (only the inverse text in a particular line is given).
70: Inverse space (32); provides the black backdrop.
90: “BOULE”
100: Graphic on 6 (17).
110: Inverse 1, inverse spaces (4), PAIRS, inverse space (4).
130: Inverse 3.
140: Inverse 5.
150: Inverse 6, inverse space (3), IMPAIRS, inverse space (3).
170: Inverse 8.
180: Inverse graphic 7 (17).
190: Completes layout of Boule board.
200-270: Betting instructios.
200: YOU CAN BET ON.
210: A), inverse space, “PAIRS”.
220: B), inverse space, “IMPAIRS”
230: C), inverse space, “MANQUE”
240: D), inverse space, “PASSE”
250: E), inverse space, BLACK NOS.”
260: F), inverse space, WHITE NOS.”
270: *), inverse space, ANY ONE NO.; “7 TO 1”
280: ALL PAYOFFS ARE EVEN MONEY–, inverse space (4), EXCEPT, inverse space, “*”, inverse space, WHICH PAYS 7 TO 1.
290: NO., IS THE HOUSE NO. YOU, inverse space (5), LOSE IF, COMES UP
300: PRESS ENTER TO CONTINUE.
350: YOUR STAKE IS, ENTER YOUR BET. From this point on the printing is on lines 13-21. The Boule board and betting instructions remain on the screen at all times.
365: Inverse space (10).
370: Inverse space (19).
380: ENTER YOUR CHOICE, (A-F) OR A NUMBER.
400: Inverse space (17); inverse space (17).
405: STAKE.
410: PICKED: Your bet and selection are on line 14 of the screen.
420: PRESS “ENTER” TO ROLL THE BALL.
440: Inverse space (32).
460: Picks the random number 1-9 as the winner.
480: Graphic on T. With 490, the attention getter.
490: Graphic on Y.
510: THE NUMBER IS:
540: SORRY ABOUT THAT HOUSE NUMBER.
580: U$ can contain either a letter or a number, depending on the betting; it is necessary to separate these two elements to determine a win or loss.
600-675: Combining here is possible, e.g., 600 and 620: IF K=1 OR K=3 AND (U$=”B” OR U$=”C” OR U$=”E”) THEN GOTO 750. For illustration the lines were left as is.
675: YOU LOSE.
750: YOU PICKED A WINNER.
800: SORRY, MY FRIEND, BUT IT SEEMS YOU ARE OUT OF CASH. One way of closing out the game when the player loses his $100 stake.
840: BOULE.
900: Changes the alpha to numeric.
920: A BONANZA FOR YOU, inverse space (2).
1000: GOOD TRY..IT COST YOU.
3000: Subroutine to erase 13-21.
3020: Inverse space (32).
3050: Delay subroutine for suspense and reading time.
5 REM "BOULE"
6 REM GEORGE T. MILONAS
7 REM COPYRIGHT 1982
60 FOR I=0 TO 21
70 PRINT "[32 inverse spaces]"
80 NEXT I
90 PRINT AT 1,1;"1 2 MANQUE 3 4";TAB 20;"[inv "BOULE"]"
100 PRINT TAB 1;"[17 x graphic on 6]"
110 PRINT TAB 1;"[inv 1 PAIRS ]2"
120 PRINT TAB 7;"2,4"
130 PRINT TAB 1;"[inv 3]";TAB 7;"6,8";TAB 15;"4"
140 PRINT TAB 8;"[inv 5]"
150 PRINT TAB 1;"[inv 6 IMPAIRS ]7"
160 PRINT TAB 7;"1,3"
170 PRINT TAB 1;"[inv 8]";TAB 7;"7,9";TAB 15;"9"
180 PRINT TAB 1;"[17 x inverse graphic on 7]"
190 PRINT TAB 1;"6 7 PASSE 8 9"
200 PRINT AT 2,17;"[inv YOU CAN BET ON]"
210 PRINT TAB 18;"[inv A) "PAIRS"]"
220 PRINT TAB 18;"[inv B) "IMPAIRS"]"
230 PRINT TAB 18;"[inv C) "MANQUE"]"
240 PRINT TAB 18;"[inv D) "PASSE"]"
250 PRINT TAB 18;"[inv E) BLACK NOS.]"
260 PRINT TAB 18;"[inv F) WHITE NOS.]"
270 PRINT TAB 18;"[inv *) ANY ONE NO.]";TAB 21;"[inv (7 TO 1)]"
280 PRINT AT 13,1;"[inv ALL PAYOFFS ARE EVEN MONEY-- EXCEPT "*" WHICH PAYS 7 TO 1.]"
290 PRINT AT 15,1;"[inv NO.] 5 [inv IS THE HOUSE NO. YOU LOSE IF] 5 [inv COMES UP.]"
300 PRINT AT 20,1;"[inv PRESS ENTER TO CONTINUE.]"
310 INPUT Z$
320 GOSUB 3000
330 LET M=100
350 PRINT AT 13,1;"[inv YOUR STAKE IS] $";M;" ";AT 16,1;"[inv ENTER YOUR BET.]"
360 INPUT H
362 IF H>M THEN GOTO 360
365 PRINT AT 16,1;"[10 inverse spaces]"
366 PRINT AT 16,16;" ";H;" "
370 PRINT AT 13,1;"[19 inverse spaces]"
380 PRINT AT 13,1;"[inv ENTER YOUR CHOICE]";TAB 1;"[inv (A-F) OR A NUMBER]"
390 INPUT U$
400 PRINT AT 13,1;"[17 inverse spaces]";TAB 1;"[17 inverse spaces]"
405 PRINT AT 15,10;"[inv STAKE:] ";M;" "
410 PRINT AT 17,9;"[inv PICKED:] ";U$;" "
420 PRINT AT 20,1;"[inv PRESS "ENTER" TO ROLL THE BALL]"
430 IF INKEY$="" THEN GOTO 430
440 PRINT AT 20,0;"[32 inverse spaces]"
450 RAND
460 LET K=INT (RND*9)+1
470 FOR N=1 TO 50
480 PRINT AT 17,24;"[graphic on T]"
490 PRINT AT 17,24;"[graphic on Y]"
500 NEXT N
510 PRINT AT 19,1;"[inv THE NUMBER IS:] ";K;" "
520 IF K<>5 THEN GOTO 580
540 IF K=5 THEN PRINT AT 13,1;"[inv SORRY ABOUT THAT HOUSE NUMBER]"
550 LET M=M-H
560 IF M<=0 THEN GOTO 800
570 GOTO 1300
580 IF U$>"0" AND U$<"A" THEN GOTO 900
600 IF K=1 AND (U$="B" OR U$="C" OR U$="F") THEN GOTO 750
610 IF K=2 AND (U$="A" OR U$="C" OR U$="F") THEN GOTO 750
620 IF K=3 AND (U$="B" OR U$="C" OR U$="E") THEN GOTO 750
630 IF K=4 AND (U$="A" OR U$="C" OR U$="F") THEN GOTO 750
640 IF K=6 AND (U$="A" OR U$="D" OR U$="E") THEN GOTO 750
650 IF K=7 AND (U$="B" OR U$="D" OR U$="F") THEN GOTO 750
660 IF K=8 AND (U$="A" OR U$="D" OR U$="E") THEN GOTO 750
670 IF K=9 AND (U$="B" OR U$="D" OR U$="F") THEN GOTO 750
675 PRINT AT 20,1;" SORRY [inv YOU LOSE] $";H;" "
680 LET M=M-H
690 IF M<=0 THEN GOTO 800
700 GOTO 1300
750 PRINT AT 20,1;"[inv YOU PICKED A WINNER.]"
760 LET M=M+H
770 GOTO 1300
800 PRINT AT 13,1;"[inv SORRY, MY FRIEND, BUT IT SEEMS YOU ARE OUT OF CASH. ++++++++++ ]"
810 GOSUB 3050
830 CLS
840 PRINT "[inv BOULE] BOULE ";
850 GOTO 840
900 LET P=VAL U$
910 IF K<>P THEN GOTO 1000
920 IF K=P THEN PRINT AT 20,1;"[inv A BONANZA FOR YOU:] $";H*7;" "
930 LET M=M+(H*7)
940 GOTO 1300
1000 PRINT AT 20,1;"[inv GOOD TRY..IT COST YOU] $";H;" "
1010 LET M=M-H
1020 IF M<=0 THEN GOTO 800
1030 GOTO 1300
1300 GOSUB 3050
1310 GOSUB 3000
1320 GOTO 350
3000 PRINT AT 13,0;
3010 FOR I=1 TO 8
3020 PRINT "[32 inverse spaces]"
3030 NEXT I
3040 RETURN
3050 FOR I=1 TO 75
3060 NEXT I
3070 RETURN
Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.