Hello! Nice game!
One enhancement you could do is deal two cards to the player by default. There's no way you can bust with two cards and it's a waste having to hit hit before deciding :)
Also be aware that the Ace can either be a 1 (one) or an 11 (eleven). That's why you can win with (A,10), (A,J), (A,Q) and (A,K).
[Edit1]: Wait, I see that you do take this into account, then why didn't it make my hand win?
[Edit2]: OK, so I did a bit of debugging, and when the sum should total 21 the Ace is always regarded as a 1.
Fix: Line 215 that test is:
if (v+11<21) then |
and it should be
if (v+11<=21) then |
Also bonus:
Yeah, I noticed I forgot the = in <= when checking for the ace values. As for dealing two cards to start, I could do that easily enough, yeah. I just was enjoying dealing them out manually, personally.
Edit I've gone ahead and updated it with the fix (that I had on my local copy) for aces not being counted when equaling exactly 21. I also added the first two cards dealt out automatically.
Awesomeness! Sorry about the double card dealing. Didn't know it was your preference :D I was just used to seeing it everywhere.
The game is super awesome and already its got the quality of a finished cart. :D Good luck, man! :) I'll enjoy playing this game.
Hey, just stumbled upon an issue and after playing the decks I started getting negative numbers for the decksize... and diving deeper I saw that the deck would never diminish in length. The problem stems on line 195:
del(deck,selected) |
This should be changed in:
del(deck,drawn) |
As the documentation states:
del t v Delete the first instance of value v in table t [...] |
I can see why that would cause issues.
I wrote this up instead of sleeping at a reasonable hour. I'll fix that.
Haha, don't be bothered by it... I used to/still do that.
Weird creations happen when you do it and it's awesome that sometimes awesome things emerge! :D
Cool project, love it! :)
Good luck! And I hope you're not bothered by it. I love to help, but I see no way of messaging an individual on pico8 :/
Simple but fun.
Some enhancements you could add:
-
Show the players' total in hand, and the dealer's shown total.
- Have the player auto-win if they are dealt 21 -- unless the dealer has 21 as well, then it would be a push (right now you need to manually select 'stay' if you have 21 to start)
I've incorporated your suggestions, enargy.
In testing before posting about this, the dealer pushed me at 21.
Remaining cards in the deck, to give the player an idea of how far along it is.
Ah. Got it. For card-counters.
Edit : No, wait. I still don't get it.
How does it start with two cards dealt and 190 cards in the deck? That seems like there's 16 cards missing.
@apLundell I was intrigued by your question and checked the code. You are right, there are exactly 16 cards missing: all the 10s. The make_deck method doesn't add them to the deck.
[Please log in to post a comment]