Classic Computer Magazine Archive ANTIC VOL. 7, NO. 10 / FEBRUARY 1989

Type-In Software
GAME OF THE MONTH

Roulette, Atari Style

You won't lose your shirt to the 8-bit croupier. By Michael Pemberton

Why buy a roulette table when your Atari can be a championship casino croupier? This BASIC program works on 8-bit Atari computers with 48K memory, disk or cassette.

My luck in casinos has been consistently poor. I figured that the best way to survive an upcoming trip to Vegas would be to practice the games I was most interested in--craps, black-jack and roulette.

Now, I own some dice and some cards, but I don't know anyone with a roulette table stashed away in the garage. Undaunted, I rolled up my sleeves, put on my shaded visor and wrote a program to play Roulette on my Atari 800.

GETTING STARTED

Type in Listing 1, ROULETTE.BAS, check it with TYPO II and SAVE a copy before you RUN it.

If you have trouble typing the special characters in lines 140-144, don't type them in. Instead, type Listing 2, check it with TYPO II and SAVE a copy. When you RUN Listing 2, it creates these hard-to-type lines and stores them in a file called LINES.LST. To merge the two programs, disk users LOAD "D:ROULETTE.BAS" and then ENTER "D:LINES.LST." Cassette users: CLOAD Listing 1, then insert the separate cassette used for Listing 2 and ENTER "C:". Remember to SAVE the completed program before you RUN it.

When you RUN Roulette, the titles will appear and the screen will go blank for about 10 seconds while the program draws the gameboard, coloring the "red" numbers with Player/Missile graphics. When the screen turns on again, the Roulette board will appear with the cursor in the upper left-hand corner.

With a joystick in Port 1, you can move the cursor to any position on the board and place bets. Pressing the joystick button puts a chip at the cursor position. A buzzer will sound if you try to place a bet on an illegal spot.

You'll be asked to verify the bet and say how much money you want to wager. You can risk any amount on a single bet, as long as you don't exceed the amount of cash you have on hand. Betting $0 counts as no bet, and your chip will be removed from the board. To increase the amount of a bet, just put a second bet in the same area of the board and the software will add it in.

Once you place all your bets, press [START] to spin the wheel. The spinning numbers will appear below the betting board and will go through the whole sequence at least twice before settling an a winning number.

When that winning number comes up, the computer will determine your winnings, if any, listing each successful bet with the amount of money it's won for you. If you go broke, the computer will let you start over. To bet again, just press [RETURN]. That's all there is to it.

BETTING ON ROULETTE

Now all you have to do is learn the authorized roulette bets.

There are 11 different kinds of bets in Roulette. This may sound complex, but the system is actually very easy to learn, and you place bets with this program exactly as you would if you were in a real casino. Here is how the bets work:

1. Straight bets: you bet on any single number. Put your chip right inside that number's square. Pays 35 to 1.

2. Split bets: you bet on any two adjoining numbers (0 and 00 adjoin only each other). Put your chip on the line between the two numbers. Pays 17 to 1.

3. Street bets: you bet on any three numbers in a vertical line. Put your chip on the outside edge of the board (top or bottom) where the "street" ends. Pays 11 to 1.

4. Square bets: you bet any numbers grouped together in a square (for example, 7, 8, 10, 11). Put your chip at the point where they all meet. Pays 8 to 1.

5. Line bets (5): you bet on the five numbers 0, 00, 1, 2, 3. Put your chip at the top or bottom of the line that connects these five numbers. Pays 6 to 1.

6. Line bets (6): you bet on the six numbers that border one of the 11 vertical lines on the board (for example, 13 through 18). Put your chip at the top or bottom of the line you're betting on. Pays 5 to 1.

7. Column bets: you bet on the 12 numbers in one of the three horizontal ranks across the board. Put your chip on the right-hand edge of the column you're betting on. Pays 2 to 1.

8. Dozen bets: you bet on either the frrst, second or third dozen numbers on the wheel. All dozens lose on 0 or 00. Put your chip inside the 1ST DOZEN, 2ND DOZEN or 3RD DOZEN box. Pays 2 to 1.

9. High/low bets: you bet on either 1 to 18, or 13 to 36. All high/low bets lose on 0 or 00. Place your chip in either the 1-18 box or the 19-36 box respectively. Pays even money.

10. Odd/Even bets: you bet on whether the winning number will be odd or even. All odd/even bets lose on 0 or 00. Put your chip in the ODD or EVEN box. Pays even money.

11. Black/Red bets: same as Odd/Even, except you put your chip in the BLACK or RED box. Pays even money.

I have yet to find any betting strategy that wins consistently (no surprise there!), but I'll keep trying. Maybe you'll do better.

PROGRAM TAKE-APART

The key to this Roulette program lies in the configuration of BET$, which identifies the kind of bet being made. The ATASCII value of each character in BET$ specifies a certain type of bet--1-38 are the straight bets, 39 is a line bet (5), 40-97 are the split bets, etc. The program notes the cursor's horizontal and vertical position when a bet is made, uses them to identify a corresponding character in BET$, translates this character into a numerical value with the ASC function and then decodes and records the bet in the appropriate variable.

The wheel is spun via the RND function, and it will go through two to five complete rotations before stopping on a number. The starting position for successive spins is the number which has just won. (This happens in Las Vegas roulette too.)

Finding out which bets (if any) have won is simple. The possible winning numbers are determined for each bet, and if one matches the actual winning number, the original amount bet is automatically returned to your stake and the winnings are calculated.

10-510 GameSetup
900-1070 Cursor Movement
1075-1160 Interpret Bet Type
1190-1630 Record Bets and Amounts
2000-2040 Spin the Wheel
3000-3530 Display Winnings
4100-4520 Bet and Gameboard Subroutines
5000-5060 Gameboard Configuration
6000-6120 BET$ Character Codes
6130-6140 Roulette Wheel Numbers

Michael Pemberton is working on a Ph.D. in English at the University of California, San Diego.

Listing: ROULETTE.BAS Download