Programming Boule

Authors

Publication

Pub Details

Date

Pages

See all articles from SYNC v4 n2

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 instructions.

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.

Products

 

Downloadable Media

 

Image Gallery

Scroll to Top