ichabod801 / t_games

A collection of command-line interface games written in Python.
GNU General Public License v3.0
21 stars 4 forks source link

Extra Odds bets in OverSemiPoliteBot in Craps #537

Closed ichabod801 closed 4 years ago

ichabod801 commented 4 years ago

I was checking the money and bets near the end of the game because no one seemed to be doing anything, and I was wondering if someone had dropped out without me noticing. This is what I saw:

What kind of bet would you like to make? & self.scores
{<OverSemiPoliteBot Quiana>: 0, <Tester Buckaroo>: 2, <Randy Shirley>: 0}
...
What kind of bet would you like to make? & self.bets
{<OverSemiPoliteBot Quiana>: [<OddsBet on 10 for 1 bucks>, <OddsBet on 8 for 1 bucks>, 
<OddsBet on 8 for 1 bucks>, <PassBet on 8 for 1 bucks>, <OddsBet on 8 for 1 bucks>, 
<DontComeBet on 6 for 1 bucks>], <Tester Buckaroo>: [<PassBet on 8 for 1 bucks>, 
<OddsBet on 8 for 5 bucks>], <Randy Shirley>: [<HardWayBet on 8 for 1 bucks>]}

How can their be four odds bets with one pass and one don't come bet? How can their be an odds bet on 10 when there is no bet on 10?

Child of issue #500

ichabod801 commented 4 years ago

I don't know. I am not seeing anything like this playing for a half hour against two OverBots, who should be using the same code with different bet names.

ichabod801 commented 4 years ago

Maybe run a bot tournament with a check for abandoned odds bets?

ichabod801 commented 4 years ago

Got it, and it was a pain to find. An odds bet can have a payout of zero. If you bet one, and the odds are less than even, then line 1152 (self.payout = int(wager * multiplier / divisor)) can set the payout to zero. Then, when the bet is resolved, if it wins or loses it returns 0. That is taken as not resolving, and the bet sticks around.

ichabod801 commented 4 years ago

Added a fix, it seems to work. Had to modify the bots, because they started betting the minimum on everything, instead of the max. Just realized I should modify the bots more, so they use the parameters to ask_int, instead of searching the text. The fix is in Craps, not in the wager, so it should work for any proposition bets with similar issues.

ichabod801 commented 4 years ago

I'm still getting odds bets with no payout, now from OverBots.

ichabod801 commented 4 years ago

Got it. Just because the low parameter was set didn't mean the bot had to abide by it. So I forced the bot to abide by it.