Format fix 2004/burley/README.md
This commit is contained in:
1 parent
9df839dc37
commit
5f6de61a08
1 file changed
+32
-27
+32
-27
@@ -1,9 +1,9 @@
|
|||||||
# Best Calculated Risk
|
# Best Calculated Risk
|
||||||
|
|
||||||
Brent Burley
|
Brent Burley
|
||||||
500 S. Buena Vista St.
|
500 S. Buena Vista St.
|
||||||
Burbank, CA 91521
|
Burbank, CA 91521
|
||||||
US
|
US
|
||||||
|
|
||||||
## To build:
|
## To build:
|
||||||
|
|
||||||
@@ -37,29 +37,34 @@ echo "Do or do not. There is no try."
|
|||||||
|
|
||||||
## Judges' remarks:
|
## Judges' remarks:
|
||||||
|
|
||||||
This is a draw poker program. You start with $100. Input alternates
|
This is a [draw poker](https://en.wikipedia.org/wiki/Draw_poker) program. You
|
||||||
between your bet and which cards to keep. Example:
|
start with $100. Input alternates between your bet and which cards to keep.
|
||||||
|
Example:
|
||||||
|
|
||||||
5 <== you enter a bet of $5 (defaults to $1)
|
```
|
||||||
J Q J 9 5 <== your hand is Jack of Clubs, Queen of Hearts,
|
5 <== you enter a bet of $5 (defaults to $1)
|
||||||
C H D S C Jack of Diamonds, 9 of Spades, 5 of Clubs
|
J Q J 9 5 <== your hand is Jack of Clubs, Queen of Hearts,
|
||||||
123 <== you enter which cards you want to keep
|
C H D S C Jack of Diamonds, 9 of Spades, 5 of Clubs
|
||||||
(enter 0 to 5 digits between 1 and 5)
|
123 <== you enter which cards you want to keep
|
||||||
J Q J J Q <== your new hand is Jack of Clubs, Queen of Hearts,
|
(enter 0 to 5 digits between 1 and 5)
|
||||||
C H D S C Jack of Diamonds, Jack of Spaces, Queen of clubs
|
J Q J J Q <== your new hand is Jack of Clubs, Queen of Hearts,
|
||||||
$145 (45) <== Your new balance is now $145. You had a Full House
|
C H D S C Jack of Diamonds, Jack of Spaces, Queen of clubs
|
||||||
so your payoff is 9 times your bet == 45
|
$145 (45) <== Your new balance is now $145. You had a Full House
|
||||||
|
so your payoff is 9 times your bet == 45
|
||||||
|
```
|
||||||
|
|
||||||
The payout is according to "Vegas rules":
|
The payout is according to "Vegas rules":
|
||||||
|
|
||||||
Straight Flush 50 times your bet
|
```
|
||||||
Four of a Kind 25 times your bet
|
Straight Flush 50 times your bet
|
||||||
Full House 9 times your bet
|
Four of a Kind 25 times your bet
|
||||||
Flush 6 times your bet
|
Full House 9 times your bet
|
||||||
Straight 4 times your bet
|
Flush 6 times your bet
|
||||||
3 of a Kind 3 times your bet
|
Straight 4 times your bet
|
||||||
2 Pair 2 times your bet
|
3 of a Kind 3 times your bet
|
||||||
Jacks or Better 1 times your bet
|
2 Pair 2 times your bet
|
||||||
|
Jacks or Better 1 times your bet
|
||||||
|
```
|
||||||
|
|
||||||
The program allows you to go into debt. However I'm sure you would
|
The program allows you to go into debt. However I'm sure you would
|
||||||
never control-C kill the program just because you got behind, right?
|
never control-C kill the program just because you got behind, right?
|
||||||
@@ -69,16 +74,16 @@ to leave even when you are ahead. :-)
|
|||||||
Can you figure out a winning betting "strategy"? Then can you modify
|
Can you figure out a winning betting "strategy"? Then can you modify
|
||||||
the program so this "strategy" no longer works?
|
the program so this "strategy" no longer works?
|
||||||
|
|
||||||
Notice the clever use of setjmp() and longjmp() calls. Can you keep
|
Notice the clever use of `setjmp()` and `longjmp()` calls. Can you keep track
|
||||||
track of what state is being saved and restored?
|
of what state is being saved and restored?
|
||||||
|
|
||||||
## Author's remarks
|
## Author's remarks:
|
||||||
|
|
||||||
This program plays draw poker. What is unusual about it is that it
|
This program plays draw poker. What is unusual about it is that it
|
||||||
is written as a single statement -- count the semicolons! (OK, there
|
is written as a single statement -- count the semicolons! (OK, there
|
||||||
are really three statements if you count the variable declarations.) To
|
are really three statements if you count the variable declarations.) To
|
||||||
keep things simple, I have avoided the C preprocessor and tricky
|
keep things simple, I have avoided the C preprocessor and tricky
|
||||||
statements such as "if", "for", "do", "while", "switch", and "goto".
|
statements such as `if`, `for`, `do`, `while`, `switch`, and `goto`.
|
||||||
|
|
||||||
## Copyright and CC BY-SA 4.0 License:
|
## Copyright and CC BY-SA 4.0 License:
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user