Author

Topic: Introducing Blackjack (Read 1523 times)

legendary
Activity: 1218
Merit: 1000
May 19, 2011, 08:16:58 PM
#10
The shuffle is doing by merging 2 arrays -> srand to microtime + rand -> shuffle.

Here's the function: (translation: Cartas = Cards, naipes = Suits, baralho = Deck - that's what the vars mean)

Code:
      function start_deck(){
          $cartas = array("A","2","3","4","5","6","7","8","9","10","J","Q","K");
          $naipes = array("c","s","d","h");
          $baralho = array();
          foreach($cartas as $c){
              foreach($naipes as $n){
                  $baralho[] = $c . $n;
              }
          }
          srand(microtime() * 100000 + rand());
          shuffle($baralho);
          $this->deck = $baralho;
          $this->pointer = 0;
          mysql_query("UPDATE blackjack SET baralho = '".implode(",",$baralho)."' WHERE id = " . $this->game_id);        
      }

I'm just scratching my head over a hand here... I just log hands to check the system, so I don't know the user. It went:
pocket: 8,2 (hit) - 10
3rd card: A - 11/21
then... 4th  card: K  Huh
If he already had 21 why hit again? Or did the system took a while to respond and he hit again? Or wasn't aware of the game's goal... Really got me confuse.
newbie
Activity: 35
Merit: 0
May 19, 2011, 08:11:05 PM
#9
Cool, love me some Blackjack.

Broke even on my first try though, which is disappointing. Though not as much as losing I guess.

Great job. Smiley

Game seems a little volatile though, sometimes freezes up after my bets are in. Should I just wait forever for it to come back? I think I might be losing money when this happens.

Anyway, happens on the mBT one. Once when I had two blackjacks, once when I had a 21.
legendary
Activity: 3920
Merit: 2349
Eadem mutata resurgo
May 19, 2011, 08:09:59 PM
#8

Nice, very nice .. like the ambiance, maybe a selection of music, that lounge thing gets old (especially when you losing Sad)

Just out of curiosity how does the randomness (shuffling) on cards dealt get done in the s/ware ... could that part of the code be on display to assuage any doubts about "dealer bias"?
legendary
Activity: 1218
Merit: 1000
May 19, 2011, 05:28:59 PM
#7
Blackjack is now also available at mBTCasino.com (Stakes 1 to 100 mBTC  [means 0,001 to 0,1 BTC])
member
Activity: 93
Merit: 10
May 19, 2011, 09:01:12 AM
#6
Going to play a few rounds when I get home today.

A blackjack game that isn't a scam? My kind of game.
legendary
Activity: 1218
Merit: 1000
May 19, 2011, 08:18:59 AM
#5
love the graphics Grin

And how about the sweet voice of our lovely dealer and the ambiance music?  Smiley
legendary
Activity: 1218
Merit: 1000
May 19, 2011, 05:11:39 AM
#4
@moa

3 places per table, but it's single player.
(Lolz... we're looking for gals now... thinking about Dominique Strauss-Khan for advice on who to hire  Grin )



come on! stop using flash :-/
there is the HTML5 :-|
grrrrrrrr....

HTML5 sucks (period).
If you want to crash browsers (and computers along) you're plainly free to do so... meanwhile let anyone use whatever they want. I'm not a *that* flash fan, but it's still the best thing around for this kind of things.  Tongue

P.S. - BTW... what would HTML5 do there?! You mean probably JS and Ajax... (my dice game is 100% JS-made for an instance) HTML5 just adds the "self-embedded" multimedia and sucks specially because the browsers' built-in plugins for this purpose are way worse than Adobe's plug-in, exception maybe to Safari. Still recall the "SVG demo of Firefox 4" - «Press here to see what your browser can do now»... well, in a regular nVidia 6150SE IGC what it did was hang and crash.
full member
Activity: 237
Merit: 102
1 Pedro 3:15-16 (DHH)
May 18, 2011, 10:06:15 PM
#3
come on! stop using flash :-/
there is the HTML5 :-|
grrrrrrrr....
legendary
Activity: 3920
Merit: 2349
Eadem mutata resurgo
May 18, 2011, 09:58:09 PM
#2

Like the multi-player table look ... how many players max at a table?

(Aside: will you have cute, excitable woman plants at the table like most casinos seem to manage to have around?)
legendary
Activity: 1218
Merit: 1000
May 18, 2011, 09:05:13 PM
#1
As I said in off-topic I was doing final tests on a Blackjack game for BTC.
With that done and looking fine, I decided to add it to my "Bitcoin casino", yet for today I'll not enable it's real play features (even if they're already there and ready), expect to get it real quite soon anyway. Play for real bitcoins is enabled now.

You may find it here: http://www.bityacht.com/index.php?p=slots
next to Keno.

Due to the quality of the BJ, I decided to not let it open to guest players, guests still may play on old games. So you need to login or register - registration resumes to user and password.

If you don't know how to play Blackjack you may consult the rules at Wikipedia, it's quite a straight forward and easy to learn game anyway.

The following rules applies on mine:
  • Dealer ALWAYS deals to 17 unless all players busted - this means that even if your hand is 12 and the dealer has 13 the dealer still have to pull cards until have a hand over 17 or bust
  • Blackjacks are just the "natural" ones, A+10 point cards deal, making a Blackjack after a split counts as a normal 21
  • Splits can be done with same value cards, despite they've the same face or not

Any questions or doubts else, just ask.

Screenshot:



Relying on the success of this HD-mode (game "natural" screen is HD720p - 1280x720) I'll work on more casino games.
Jump to: