Page 1 of 1

Blackjack Dealer

Posted: Mon Aug 22, 2016 11:39 am
by patrikpatrik
Hello folks,

I thought I'd write a lua blackjack script just for fun. :D It took about 2 weeks to do and I think this version is better than the perl one I did. I went from 2000 lines of code there to 700 here which is a milestone for me to say the least.

The blackjack dealer is across gigglegibber in thundering steppes. His name is Phil and you can't miss him; His head is barely overlooking the poker table. He will shuffle a complete deck of 52 cards before each game. The first card is always 'burned' then deals and plays according to house edge rules.

He accepts anywhere from 1 gold, 10 gold, 50 gold, or 10 platinum and will pay out in scale. He will determine both dealer and player's current value and use logic for aces at any point during the hand.

Dealer does the following:
Must draw to 17.
Regular wins are paid out 1:1.
If a push occurs, you get your money back.
Dealer reveals hand upon bust etc..
In case of blackjack vs blackjack, it's a push.
Blackjack pays out 3 to 2.

Some things haven't been implemented yet
Splitting
Doubling down
Surrendering
Insurance upon dealer's ace showing

One downside is that uploading this to the eqemu2 server the suit symbols aren't showing up properly. It's giving ascii values instead but it's showing up fine on my test server. I think it has to do with submitting a script over php/html so I changed the symbols out to letter abbreviations instead but other than that it seems to be functioning. This is the 8th revision and could use more testing. If you have time, please try him out!

[update] added animations upon winning, losing, pushing, busting, and blackjack

Re: Blackjack Dealer

Posted: Tue Aug 23, 2016 6:25 am
by Scribble
Looks like you're having fun!

Re: Blackjack Dealer

Posted: Tue Aug 23, 2016 10:19 am
by patrikpatrik
More to come :)