Page 1 of 6

Blackjack Bots (Game over)

PostPosted: Mon Sep 28, 2020 11:15 am
by StrangerCoug
The year is 2079: the 100th anniversary of the first MIT Blackjack Team. The newly built Kilobit Casino in Las Vegas, Nevada, wishing to capitalize on their legend, has invited students from engineering colleges all over the world to build a robot that can play casino blackjack and is running a tournament in which only these robots are eligible to play. Do well, and the colleges the robots are playing for win big cash prizes.

30 hands. Millions on the line. Whose blackjack bot will reign supreme?

PROGRAMMING RULES
  1. Bots must be programmed and given a name prior to the start of the game. At a minimum, you must program the bot how to bet and how to play in any possible circumstance, to include whether and, if so, when to take insurance. In the event that, due to mod error, I fail to catch an ambiguous situation, then:
    1. If there is not a conclusive decision on whether to take insurance, the bot will not take insurance.
    2. If there is not a conclusive decision on how to bet, then the bot will bet the minimum.
    3. If there is not a conclusive decision on how to play the hand, it automatically forfeits its bet with no refunds given.
    If it's possible for your bot to make an illegal bet and I fail to catch it in your program, the bet will be rounded to the nearest legal bet, with half rounded to even.
  2. Kilobit Casino will allow bots that count cards, but you must manually program how your card counting system works into the bot—casino security is suspicious of bots with Internet access and cannot accept bots that name a counting system but do not describe it. For the same security reasons, hyperlinks and image links are not allowed in the programming of your bot.
  3. You may look up betting and playing strategies while programming your bot, but you may not collaborate with other players while doing so.
  4. Just like you yourself are not allowed to cheat, you are not allowed to program your bot to cheat either. Things you can't base your bot's actions on include things like the dealer's hole card, cards in the shoe, and the programming of other robots (it can remember another bot's past actions, though).
  5. Bots have computer vision and therefore knows everything about the outside world that a normal human blackjack player would if a human were playing for it. You also have access to a math library that can do anything Wolfram Alpha can.
  6. Bots do not have an internal RNG and therefore cannot resolve actions directly at random. It has ALMOST perfect memory, so it CAN act based on cards it has seen before, for example. (When reshuffles occur, it automatically "forgets" which cards have already been dealt from the current shoe since that information has obviously become outdated, though reshuffles do not erase a bot's memory of what cards it has actually seen.)
  7. Your bots can be as complex as you like within the above rules, but keep in mind that overly complex bots are more prone to mod error when its program is executed. (See rule 12 in the next section for how this will be addressed.) If you have any questions about what is and isn't allowed, feel free to ask in thread.

TOURNAMENT RULES
  1. There are 30 hands in the tournament. After hands 10, 18, and 24, the bot with the lowest score will be eliminated. If there is a tie for lowest score, each bot that is not safe will be dealt one card, and the low card will be eliminated. If there is a tie for the lowest card and the suits differ, then the ranking of suits from highest to lowest will be spades, then hearts, then diamonds, then clubs. If the tie is still unbroken, the players still involved in the tie will be redealt another card, reshuffling if necessary to ensure there are enough cards to deal to each bot still unsafe, and the process repeats as necessary until all ties are broken. After hand 30, the bot with the highest chip total wins; if there is a tie, the tiebreaker procedure above will describe which bot gets second place, and the high card will win the tournament.
  2. Your bot will be given $1,000,000 to start with. Whenever the amount of money your bot has falls below the amount of the minimum bet, it will be granted a rebuy of just enough money to make the minimum bet. There are unlimited rebuys.
  3. Bets must be between $5,000 and $1,000,000 in multiples of $1,000.
  4. There are six decks in the shoe. When the dealer is ¾ of the way through the shoe, it will announce a reshuffle after the current hand.
  5. Your bot is trying to get closer to 21 than the dealer without going over. Tens and face cards are worth 10, an ace may be treated as 1 or 11, and all other cards are worth face value. Your bot will be dealt two cards, both face up. The bot at the top of the player list bets and plays first in the hand 1, the bot second from the top goes first in hand 2, and so on in rotation. When it comes to your bot's turn, it may do one of five things:
    • Hit: Your bot will be dealt another card.
    • Stand: The turn advances to the next bot. If your bot is last to play, the turn goes to the dealer.
    • Double down: Your bot's bet is doubled (unless it is programmed to increase its bet to less than double) and your bot is dealt one last card. After it gets its card, the turn goes to the next bot—your bot cannot hit its doubled hand, nor can it redouble. It may double down on any number, however.
    • Split: Double your bot's bet and treat each card as the first card of two separate hands and it will be dealt another card. The doubled bet is split equally among the two hands, so one hand played for $25,000 becomes two hands played for $25,000 each. Your bot may only split two cards of the same value, and it is not allowed to split a hand more than three times.
    • Surrender: Take half your bot's bet back, give up the other half, and fold the hand.
    Please note that once your bot hits its hand, it can only hit again or stand. (Exception: Your bot may hit, double, or resplit a split hand unless it splits two aces.) If your bot has 21, it is assumed that it will stand.
  6. The dealer must hit with 16 or less and stand on all 17s.
  7. If it comes your bot's turn and its two cards already total 21, it automatically wins. This is a blackjack. (Note that a two-card 21 after a split is not a blackjack, however.) Blackjack pays 3 to 2, so e.g. $10,000 becomes $25,000.
  8. If your bot's hand goes over 21 points, it loses the hand and its bet.
  9. As far as resolving bets is concerned, your bot's only opponent is the dealer. It doesn't matter if the bot next to yours has a higher hand than your bot—if your bot's hand's higher than the dealer's, it wins. If your bot ties, it gets its bet back but no extra money.
  10. If the dealer has an ace face up, the dealer will ask if your bot wants to pay insurance. Insurance costs half your bot's bet. After everybody has decided whether or not to pay insurance, the dealer will announce whether or not the dealer has a blackjack.
    • If the dealer does have a blackjack, your bot loses its bet for the hand (unless it also has a blackjack, in which case it pushes). If it has paid insurance, that pays 2 to 1, so it usually nets to getting its money back.
    • If the dealer doesn't have blackjack, your bot lose your its insurance money.
  11. The dealer will not ask for insurance if it has an upcard of 10 or a face card, but will still announce whether or not it has blackjack.
  12. Kilobit Casino recognizes that things like radio interference, robot malfunctions, human error, and the like means that bots sometimes do things they're not supposed to. Therefore, after every elimination, there is a 24-hour break to verify that everything happened correctly. During this time, if there is a mod error in the execution of your bot's program, PM me what the error was and what should have happened and Kilobit Casino will replay all hands from when the error occured to when the game stopped for break. (They're nice enough people to restart the 24 hours after the replay, too.) When hands are replayed, all bot's memories of the way the hands were originally played are overwritten with the events of the replay. Because fixing an error has the potential to change which bot gets eliminated, eliminations are not final until the end of the break. If the mod error resulted in more cards being dealt than should have been, the deck will be reshuffled upon resumption of the game. Once the game resumes, mod errors stand, so I must be notified of any V/LA's.

PLAYERS
  1. Ircher
  2. inspiratieloos
  3. Nancy Drew 39
  4. Aronis
  5. Sirius9121

* Awaiting bot.
Submitted bot needs correction or clarification; see your PM box.

PostPosted: Mon Sep 28, 2020 4:12 pm
by Ircher
/in

PostPosted: Mon Sep 28, 2020 9:59 pm
by the worst
ego
very curious about this but also not smart

PostPosted: Tue Sep 29, 2020 11:38 am
by inspiratieloos
My high school graduation project was actually based on games of chance, I think I still have the blackjack calculations somewhere on my hard drive.

I always had a vague idea to redo it while keeping card counts in mind instead of assuming an infinite deck.

PostPosted: Tue Sep 29, 2020 11:50 am
by Mizzytastic
For clarification is this actual computer programming or building a set of instructions for you to follow like a program?

PostPosted: Tue Sep 29, 2020 11:55 am
by Snakes
Does the bot have to place its bet before or after it gets its cards?

PostPosted: Tue Sep 29, 2020 12:32 pm
by inspiratieloos
In post 4, Mizzytastic wrote:For clarification is this actual computer programming or building a set of instructions for you to follow like a program?

Generally in these games it's just instructions. Otherwise he'd probably have given us a language to use.

PostPosted: Tue Sep 29, 2020 1:11 pm
by StrangerCoug
In post 4, Mizzytastic wrote:For clarification is this actual computer programming or building a set of instructions for you to follow like a program?

The latter.

In post 5, Snakes wrote:Does the bot have to place its bet before or after it gets its cards?

Before.

PostPosted: Tue Sep 29, 2020 8:15 pm
by Nancy Drew 39
I’d be interested but what exactly is reqired to program the bot?

/in

(in case I figure this out) :lol:

PostPosted: Wed Sep 30, 2020 1:03 am
by inspiratieloos
It's mostly just common sense, describe what you want the bot to do in any given situation.

PostPosted: Wed Sep 30, 2020 6:00 pm
by Aronis
/in

PostPosted: Wed Sep 30, 2020 11:29 pm
by Nancy Drew 39
In post 8, Nancy Drew 39 wrote:I’d be interested but what exactly is reqired to program the bot?

/in

(in case I figure this out) :lol:


My /in was counted right? Just in case it wasn’t . . .

/in

PostPosted: Thu Oct 01, 2020 12:12 am
by Sirius9121
in

PostPosted: Thu Oct 01, 2020 12:35 am
by Sirius9121
Can we double after split?

PostPosted: Thu Oct 01, 2020 8:15 am
by StrangerCoug
In post 11, Nancy Drew 39 wrote:My /in was counted right?

Yes.

In post 13, Sirius9121 wrote:Can we double after split?

Yes, so long as you're not splitting aces (in which case each hand gets one more card and then automatically stands).

PostPosted: Thu Oct 01, 2020 10:39 am
by StrangerCoug
Oh, I forgot to mention that the game is now full and I just need bots from Nancy and Sirius. I will allow them until I sign out of work tomorrow (which will be in (expired on 2020-10-02 16:30:00)) to submit. Anyone who wants /in to replace may do so in the meantime.

PostPosted: Fri Oct 02, 2020 4:54 pm
by StrangerCoug
I will allow Nancy Drew 39 some extra help, but everyone else's bot is now locked in and cannot be changed. I hope to be able to start this coming weekend.

PostPosted: Fri Oct 02, 2020 5:40 pm
by inspiratieloos
I tried to make a more advanced version of my bot, unfortunately haven't quite figured out how to have it respond appropriately to the dealer having a 10 or A.

PostPosted: Sat Oct 03, 2020 6:21 pm
by StrangerCoug
I will allow Nancy Drew 39 another (expired on 2020-10-04 16:54:46) before I open her spot up for a replacement to ensure that the game starts in a timely manner. Replacements should have a bot ready to go when they sign up; if Nancy Drew finishes her bot before I receive the replacement's bot, she will remain in the game.

PostPosted: Sat Oct 03, 2020 8:36 pm
by StrangerCoug
Locking in Nancy's bot. The game will likely start some time tomorrow.

PostPosted: Sun Oct 04, 2020 4:05 pm
by StrangerCoug
In Kilobit Casino, the fans gather round the blackjack tournament table as five of the best student engineers enter with their specially made blackjack robots. While televised blackjack tournaments were no new thing, this would be the first of its kind, as never before had robots been players in an officially sanctioned tournament of this caliber. Not only the spectators in Kilobit Casino, but also the millions of blackjack fans around the world watching from the comfort of their homes on their TVs, cheered on the players as the bots took their seats.

In seat 1, programmed by Ircher, is Minimalist Bot!
In seat 2, programmed by inspiratieloos, is Zen Count/Basic!
In seat 3, programmed by Nancy Drew 39, is ND bot!
In seat 4, programmed by Aronis, is R2-D21!
In seat 5, programmed by Sirius9121, is Apple Siri!

Each of the robots received their $1,000,000, and the cards were loaded into the shoe to be dealt in this very special showdown.

A COUPLE OF MOD NOTES BEFORE WE BEGIN
  • The rules didn't specify what the turn order is, so I went with the signup order. If there is a next time, I will probably randomize it to eliminate any perceived bias from signup order.
  • Sirius9121 did not name his bot and I forgot to prompt him for one, so as a placeholder name, it is the same as his username. If he wishes to rename it, he may do so and it will be retroactive to the beginning of the game, but once chosen, it is final. (Update: He's now named it.) If I run this again, I'll make a rule addressing this.
  • I will do my best to post at least two hands a day during each round; maybe more if I'm bored with nothing to do :P

Good luck!

PostPosted: Sun Oct 04, 2020 5:22 pm
by StrangerCoug
HAND 1/30
Minimalist Bot is first to bet and bets $25,000 of its $1,000,000. Following that, Zen Count/Basic bets $5,000, then ND bot also bets $5,000, then R2-D21 bets $300,000, and finally Apple Siri bets $84,000.

BotHandTotalBetStack
Minimalist BotImageImage
Soft 21
BLACKJACK!
$25,000
$975,000
Zen Count/BasicImageImage
15
$5,000
$995,000
ND botImageImage
16
$5,000
$995,000
R2-D21ImageImage
18
$300,000
$700,000
Apple SiriImageImage
17
$84,000
$916,000
DealerImageImage
8


Cheers penetrate the room as Minimalist Bot, who would be first to act, gets dealt a blackjack, marking an amazing start to the tournament! Next to act is Zen Count/Basic, who hits its hard 15 and gets dealt a Queen, quickly turning those cheers into groans and awws. Nevertheless, ND bot also hits and picks up a deuce, then stands at a hard 18. R2-D21, on the other hand, chooses to split its nines. To the first nine, R2-D21 gets an eight, giving it a hard 17 and a stand. The second nine also gets paired with an eight for a 17, so the bot standing again is unsurprising to anyone. Apple Siri hits its 16 and picks up a five, giving it a nice 21 to stand on.

Next comes the dealer's play...
BotHandTotalBetStack
Minimalist BotImageImage
Soft 21
BLACKJACK!
$25,000
$975,000
Zen Count/BasicImageImageImage
25
OVER!
$5,000
$995,000
ND botImageImageImage
18
$5,000
$995,000
R2-D21
Hand 1
ImageImage
17
$300,000
$400,000
R2-D21
Hand 2
ImageImage
17
$300,000
Apple SiriImageImageImage
21
$84,000
$916,000
DealerImageImageImage
19

The dealer bot flips its downcard to show that it is a five, making a 13. It has to hit, so it ends up with another six to give it 19.

Minimalist Bot wins $37,500.
Zen Count/Basic loses $5,000.
ND bot loses $5,000.
R2-D21 loses $600,000.

Apple Siri wins $84,000.


A big loss for R2-D21, which as a result is already in last place with 60% of its stack gone and $400,000 left to its name. Tied for third place after hand 1 are Zen Count/Basic and ND bot with $995,000 left, with Minimalist Bot not far ahead of them with $1,037,500. Apple Siri leads the pack with $1,084,000. How will the bots fare after the next hand?

PostPosted: Sun Oct 04, 2020 7:16 pm
by StrangerCoug
HAND 2/30
Zen Count/Basic is first to bet and act this time. It bets $5,000 again, followed by ND bot who also bets $5,000, R2-D21 who bets $120,000, Apple Siri who bets $144,000, and ending with Minimalist Bot, who bets $25,000.

BotHandTotalBetStack
Minimalist BotImageImage
Soft 19
$25,000
$1,012,500
Zen Count/BasicImageImage
9
$5,000
$990,000
ND botImageImage
8
$5,000
$990,000
R2-D21ImageImage
10
$120,000
$280,000
Apple SiriImageImage
15
$144,000
$940,000
DealerImageImage
4


Zen Count/Basic begins by doubling down on his nine, and a ten gives him 19. Next, ND bot hits its eight and comes up with a seven, choosing then to stand on hard 15. R2-D21, still reeling from its big loss the last hand, opts to double down on its 10 and finds itself adding a nine to its hand, giving it 19 just like the other bot who doubled so far. Siri stands pat on its 15, as does Minimalist on its 19.

How will the bots fare against the dealer?
BotHandTotalBetStack
Minimalist BotImageImage
Soft 19
$25,000
$1,012,500
Zen Count/BasicImageImageImage
19
$10,000
$985,000
ND botImageImageImage
15
$5,000
$990,000
R2-D21ImageImageImage
19
$240,000
$160,000
Apple SiriImageImage
15
$144,000
$940,000
DealerImageImageImageImage
Soft 20

The dealer's downcard comes up an ace, starting it with a soft 15. It also gets an ace on its next hit, and hits again for a four, giving it 20. Unfortunately, none of the player bots have enough to beat it.

Zen Count/Basic loses $10,000.
ND bot loses $5,000.
R2-D21 loses $240,000.
Apple Siri loses $140,000.
Minimalist Bot loses $25,000.

The tie for third breaks with a drop by Zen Count/Basic to fourth. Apple Siri, who is left with $940,000, falls behind Minimalist Bot with $1,012,500, which is still more than six times the stack of the last place bot, R2-D21, already down to $160,000. Will hand 3 be better for our bots?

PostPosted: Sun Oct 04, 2020 8:44 pm
by Ircher
I feel bad for R2-D21. It will be a miracle if they win this. I will go ahead and say that my bot is really simple hence its name. You could probably guess the algorithm after watching it play a few rounds.

PostPosted: Sun Oct 04, 2020 9:15 pm
by StrangerCoug
I've been informed by Nancy Drew 39 that ND bot's name should not start with a leading period; all reference to the bot have been edited to delete it.