Roulette

# American Roulette for the HP-41

Overview

-With this program, you play Roulette against your HP-41
-Several wagers are proposed and you bet ( or not ) after each PROMPT
-Then the wheel spins, the HP-41 displays the result and finally, your new cash is displayed.
-The board looks like this:

 HP-41 Casino 0 00
 1to18 1st12 1 2 3 4 5 6 EVEN 7 8 9 10 11 12 RED 2nd12 13 14 15 16 17 18 BLACK 19 20 21 22 23 24 ODD 3rd12 25 26 27 28 29 30 19to36 31 32 33 34 35 36 HP-41 Casino 2to1 2to1 2to1

-The different wagers are:

RED/BLACK                                                                                     paid 1  to  1

ODD/EVEN             0 and 00 are neither odd nor even                      paid  1  to  1

LOW/HIGH

low = numbers between 1 and 18                   paid  1  to  1
high = numbers between 19 and 36                 paid  1  to  1

COLUMN 1-2-3

Column1 = 1 4 7 ...... 31 34                             paid  2  to  1  as written on the board
Column2 = 2 5 8 ....... 32 35                            ----  2  to  1  as written on the board
Column3 = 3 6 9 ....... 33 36                            ----  2  to  1  as written on the board

DOZEN 1-2-3

1st Dozen =  1 to 12                                          paid  2  to  1
2nd Dozen = 13 to 24                                        ----  2  to  1
3rd Dozen =  25 to 36                                       ----  2  to  1

STREET 1 to 12

Street1 = 1 2 3                                                  paid 11  to  1
Street2 = 4 5 6                                                  ---- 11  to  1
.....................                                                     .................

Street12 = 34 35 36                                           ---- 11 to  1

STRAIGHT UP       You bet on a single number     paid   35 to  1

-Other wagers are possible but they are omitted here.

Program Listing

Data Registers:           •  R00 = random numbers            ( Registers R00 and R01 are to be initialized before executing "ROULETT" )

•  R01 = your Cash

R02 = number where the ball falls        R06 = odd       R10 = column 1     R13 = 1st dozen     R16 = street 1         R28 = 0
R03 = what you've won ( or lost )       R07 = even      R11 = column 2     R14 = 2nd dozen    R17 = street 2         R29 = 1
R08 = low       R12 = column 3     R15 = 3rd dozen     .....................          ............
R09 = high                                                                   R27 = street 12       R64 = 36
R65 = 00 = 37
R06 to R65 contain only the bets you've made on these wagers.

Flags: /
Subroutines: /

-If you don't have an HP-41CX, replace lines 02-03 with  RCL 00   RCL 01   CLRG   STO 01   X<>Y   STO 00
-PROMPT may be replaced by  AVIEW  PSE
-Lines 83 to 90 are only useful to simulate the spinning wheel ; otherwise, they can be deleted.

-The append character is denoted  ~

 01  LBL "ROULETT"   02  3.065   03  CLRGX    04  LBL 01   05  CF 22   06  " RED/BLACK?"   07  PROMPT      08  FC?C 22   09  GTO 02   10  3   11  +   12  X<>Y   13  ST- 03   14  STO IND Y   15  LBL 02   16  " ODD/EVEN?"   17  PROMPT   18  FC?C 22   19  GTO 03   20  5   21  +   22  X<>Y   23  ST- 03   24  STO IND Y   25  LBL 03   26  " LOW/HIGH?"   27  PROMPT   28  FC?C 22   29  GTO 04   30  7   31  +   32  X<>Y   33  ST- 03   34  STO IND Y   35  LBL 04 36  "COLUMN1-2-3?"   37  PROMPT   38  FC?C 22   39  GTO 05   40  9   41  +   42  X<>Y   43  ST- 03   44  STO IND Y   45  LBL 05   46  "DOZEN 1-2-3?"   47  PROMPT   48  FC?C 22   49  GTO 06   50  12   51  +   52  X<>Y   53  ST- 03   54  STO IND Y   55  LBL 06   56  "STREET 1-12?"   57  PROMPT   58  FC?C 22   59  GTO 07   60  15   61  +   62  X<>Y   63  ST- 03   64  STO IND Y   65  LBL 07   66  "STRAIGHT UP?"   67  PROMPT   68  FC?C 22   69  GTO 08   70  X=0? 71  X#Y?   72  GTO 07   73  X<> Z   74  37   75  LBL 07   76  28   77  +   78  X<>Y   79  ST- 03   80  STO IND Y   81  GTO 07   82  LBL 08   83  "331642335142"   84  SF 25          85  AVIEW      86  SF 99   87  41   88  LBL 09   89  DSE X   90  GTO 09   91  37   92  RCL 00   93  R-D   94  FRC   95  STO 00   96  38   97  *   98  INT   99  STO 02 100  FIX 0 101  CF 29 102  " "        103  X=Y? 104  "~00"  105  X#Y? 106  ARCL X 107  X#0? 108  X=Y? 109  GTO 10             110  18 111  MOD 112  X=0? 113  X<> L 114  10 115  X L 157  9 158  + 159  RCL IND X 160  3 161  * 162  ST+ 03 163  RCL 02 164  1 165  - 166  12 167  / 168  13 169  + 170  RCL IND X 171  3 172  * 173  ST+ 03 174  RCL 02 175  1 176  - 177  3 178  / 179  16 180  + 181  RCL IND X 182  12 183  * 184  ST+ 03 185  LBL 10             186  AVIEW 187  COS 188  COS 189  COS 190  COS 191  COS 192  RCL 02 193  28 194  + 195  RCL IND X 196  36 197  * 198  ST+ 03 199  RCL 03 200  ST+ 01 201  "  C="   202  ARCL 01 203  "~\$"       204  FIX 4 205  SF 29 206  AVIEW 207  END

( 428 bytes / SIZE 066 )

Example:     1  STO 00    5000  STO 01  ( if you start with 5000\$ )   XEQ "ROULETT"

Suppose you want to bet  200\$  on BLACK ,  200\$  on ODD  ,  200\$  on column 3 , 200\$  on street 8  and  100\$  on number 16

RED/BLACK?          key in  200  ENTER^  2  R/S
ODD/EVEN?           200  ENTER^  1  R/S  or simply  1  R/S  ( because the previous bet: 200\$ is still in X-register )
LOW/HIGH?            simply press R/S
COLUMN 1-2-3?    3  R/S - but for a bet of 100\$, key in 100  ENTER^  3  R/S
DOZEN 1-2-3?        R/S
STREET 1-12?         8  R/S
STRAIGHT UP?      100  ENTER^  16  R/S
STRAIGHT UP?       R/S

The HP-41 displays the spinning wheel, then 11 BLACK ODD and finally your new cash:  C=4900\$

You have betted 900\$  and you receive  200x2 + 200x2 = 800\$
So,  C = 5000\$ - 900\$ + 800\$ = 4900\$

Press  R/S  to continue the game ...

Notes:

-To wager on 00, you can place your bet and then:

ENTER^  0  ENTER^  R/S
or   ENTER^ 37  R/S

-The first 6 wagers are proposed only once,
but simply add  GTO 06  GTO 05  GTO 04  GTO 03  GTO 02  GTO 01
after lines    64           54           44           34            24          14         respectively if you want to bet several times on these wagers

-Contrariwise, delete line 81 if you never bet twice on a single number.