optimal11.ash - Automatically and optimally play Crimbo11
Optimal11 by dractyl (#1889124)
Inspiring thread: http://forums.kingdomofloathing.com:8080/vb/showthread.php?t=178758
I basically wanted to have script that would automate the desperate scramble for crimbux using the good information developed in the above mentioned thread.
This is my first ash script, so I'm sure I've done a ton wrong. That said, I've been programming a long time, so you should find it well commented and easy to follow. It's based on a lookup table, so the main routines are very clean.
Sample output:
Note:
- Auxiliary routines (basically 6 lines) stolen from Alhifar (#1189456) and RoyalTonberry (#1161513)
- If there is an issue there, I will happily rewrite them
- Strategy unabashedly lifted from "empty inferences" spading
Enjoy!
--
The current version is 4.1
Change log
New in 2.0:
- Corrected a cosmetic problem where doubledown was falsely declared
- Added improved statistics
- Corrected bug where the program would fail if the user did not specify the number of rounds
- Cleaned up code
- Cleaned up output
- Added detection for insufficient crimbux at the start and during each round
New in 3.0 - contribution by mysyzygy
- Re-ordered entries in the actions map so they're in the same order as the optimal play table in the wiki and are easier to proofread
- Added missing 1334 entry when dealer has Ace
- Added missing 1113 entry when dealer has Ace
New in 4.0
- Minor code refactoring
- Added crimbux/adv to final output
- Detects insufficient funds when doubling down
- Added Bale-style round syntax (-40 means "use all but 40 rounds")
- Counts card totals
4.1 was released under the same name as v4, correcting a bug where totals were incorrectly calculated under some conditions. Hand totals are only used for display purposes so this is strictly a cosmetic bug. Six people downloaded the affected version.
Optimal11 by dractyl (#1889124)
Inspiring thread: http://forums.kingdomofloathing.com:8080/vb/showthread.php?t=178758
I basically wanted to have script that would automate the desperate scramble for crimbux using the good information developed in the above mentioned thread.
This is my first ash script, so I'm sure I've done a ton wrong. That said, I've been programming a long time, so you should find it well commented and easy to follow. It's based on a lookup table, so the main routines are very clean.
Sample output:
Visiting the Crimbo Cartel in Crimbo Town
Round 1 of 3
[3304] Crimbo 11 Table
You bet 11 Crimbux
Opponent has 2 (2). You have 42 (6).
Doubling down...
You bet an additional 11 Crimbux
You acquire Crimbuck (44)
Opponent has 3225 (12). You have 423 (9).
You won!
You have won 22 delicious crimbux over 1 rounds (22.0 per adv.)
Round 2 of 3
[3305] Crimbo 11 Table
You bet 11 Crimbux
Opponent has 3 (3). You have k4 (9).
Standing...
Opponent has 33k (11). You have k4 (9).
You lost.
You have won 11 delicious crimbux over 2 rounds (5.5 per adv.)
Round 3 of 3
[3306] Crimbo 11 Table
You bet 11 Crimbux
You acquire Crimbuck (55)
Opponent has 2 (2). You have ka (11).
You won!
You have won 55 delicious crimbux over 3 rounds (18.33 per adv.)
--- Final statistics ---
Rounds: 3
Rounds Won: 2 (66.67%)
- by natural 11: 1 (33.33%)
- by double down: 1 (33.33%)
Rounds Lost: 1 (33.33%)
- by double down: 0 (0.0%)
Rounds Drawn: 0 (0.0%)
- by double down: 0 (0.0%)
Starting Crimbux: 7660
Crimbux won: 55
Crimbux/adv: 18.33
Ending Crimbux: 7715
Script completed.
Note:
- Auxiliary routines (basically 6 lines) stolen from Alhifar (#1189456) and RoyalTonberry (#1161513)
- If there is an issue there, I will happily rewrite them
- Strategy unabashedly lifted from "empty inferences" spading
Enjoy!
--
The current version is 4.1
Change log
New in 2.0:
- Corrected a cosmetic problem where doubledown was falsely declared
- Added improved statistics
- Corrected bug where the program would fail if the user did not specify the number of rounds
- Cleaned up code
- Cleaned up output
- Added detection for insufficient crimbux at the start and during each round
New in 3.0 - contribution by mysyzygy
- Re-ordered entries in the actions map so they're in the same order as the optimal play table in the wiki and are easier to proofread
- Added missing 1334 entry when dealer has Ace
- Added missing 1113 entry when dealer has Ace
New in 4.0
- Minor code refactoring
- Added crimbux/adv to final output
- Detects insufficient funds when doubling down
- Added Bale-style round syntax (-40 means "use all but 40 rounds")
- Counts card totals
4.1 was released under the same name as v4, correcting a bug where totals were incorrectly calculated under some conditions. Hand totals are only used for display purposes so this is strictly a cosmetic bug. Six people downloaded the affected version.
Attachments
Last edited: