hobbes Posted September 27, 2008 Posted September 27, 2008 Re: [mccode] Black Jack card images. http://www.jfitz.com/cards/ Quote
Zero-Affect Posted September 27, 2008 Posted September 27, 2008 Re: [mccode] Black Jack card images. http://www.jfitz.com/cards/ was thinking about making one of these lol Quote
hobbes Posted September 27, 2008 Posted September 27, 2008 Re: [mccode] Black Jack I'm trying to get this script to work on v2, and for some reason I get: Parse error: syntax error, unexpected '}' in /blackjack.php on line 214 from if ($r['bj'] == 1) { print"<td>Hit</td><td>Stand</td>" } else { print " Bet"; } Although that if statement needs to be closed. I've wanted this script for quite some time and would love to get any help that I can get to have this running. <?php require "globals.php"; global $c; $is=mysql_query("SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE u.userid=$userid",$c) or die(mysql_error()); $ir=mysql_fetch_array($is); check_level(); $fm=money_formatter($ir['money']); $lv=date('F j, Y, g:i a',$ir['laston']); print "<h3>Black Jack</h3>"; if ($r['bj'] != '') { for($i = 1; $i < 25; $i++) { $card[$i] = $r['card' . $i]; } } if (isset($_GET['start'])) { if ($r['bj'] != 1) { $i = 1; while ($i < 24) { $t = 0; $card[$i] = rand(1,48); for($a = 1; $a < 25; $a++) { if ($card[$i] != $card[$a]) { $t++; } } if ($t == 23) { $i++; } } $r['total_cards'] = 2; $r['bj'] = 1; for($i = 1; $i < 25; $i++) { $r['card' . $i] = $card[$i]; } } } if ($r['bj'] == 1) { if (isset($_GET['hit'])) { $r['total_cards'] = $r['total_cards'] + 1; } $total_cards = $r['total_cards']; for($i = 1; $i < ($total_cards + 1); $i++) { if ($card[$i] == 13 OR $card[$i] == 26 OR $card[$i] == 39 OR $card[$i] == 52){ $value = '11'; } else if ($card[$i] == 12 OR $card[$i] == 25 OR $card[$i] == 38 OR $card[$i] == 51){$value = '10'; } else if ($card[$i] == 11 OR $card[$i] == 24 OR $card[$i] == 37 OR $card[$i] == 50){$value = '10'; } else if ($card[$i] == 10 OR $card[$i] == 23 OR $card[$i] == 36 OR $card[$i] == 49){$value = '10'; } else if ($card[$i] == 9 OR $card[$i] == 22 OR $card[$i] == 35 OR $card[$i] == 48){$value = '10'; } else if ($card[$i] == 8 OR $card[$i] == 21 OR $card[$i] == 34 OR $card[$i] == 47){$value = '9'; } else if ($card[$i] == 7 OR $card[$i] == 20 OR $card[$i] == 33 OR $card[$i] == 46){$value = '8'; } else if ($card[$i] == 6 OR $card[$i] == 19 OR $card[$i] == 32 OR $card[$i] == 45){$value = '7'; } else if ($card[$i] == 5 OR $card[$i] == 18 OR $card[$i] == 31 OR $card[$i] == 44){$value = '6'; } else if ($card[$i] == 4 OR $card[$i] == 17 OR $card[$i] == 30 OR $card[$i] == 43){$value = '5'; } else if ($card[$i] == 3 OR $card[$i] == 16 OR $card[$i] == 29 OR $card[$i] == 42){$value = '4'; } else if ($card[$i] == 2 OR $card[$i] == 15 OR $card[$i] == 28 OR $card[$i] == 41){$value = '3'; } else if ($card[$i] == 1 OR $card[$i] == 14 OR $card[$i] == 27 OR $card[$i] == 40){$value = '2'; } $total_value = $total_value + $value; } echo $total_value; if ($total_value > 21) { for($i = 1; $i < ($total_cards + 1); $i++) { if ($card[$i] == 8 OR $card[$i] == 16 OR $card[$i] == 24 OR $card[$i] == 32) { $ace = $ace + 1; } } while ($total_value > 21 AND $ace > 0) { $ace = $ace - 1; $total_value = $total_value - 10; } } if ($total_cards == 2 AND $total_value == 21) { $r['bj'] = 6; } if ($total_value > 21) { $r['bj'] = 2; } if (isset($_GET['stand'])) { while ($comp_total_value < 17) { $ace = 0; $comp_total_cards = $comp_total_cards + 1; $i = $comp_total_cards + 12; if ($card[$i] == 13 OR $card[$i] == 26 OR $card[$i] == 39 OR $card[$i] == 52){ $value = '11'; } else if ($card[$i] == 12 OR $card[$i] == 25 OR $card[$i] == 38 OR $card[$i] == 51){$value = '10'; } else if ($card[$i] == 11 OR $card[$i] == 24 OR $card[$i] == 37 OR $card[$i] == 50){$value = '10'; } else if ($card[$i] == 10 OR $card[$i] == 23 OR $card[$i] == 36 OR $card[$i] == 49){$value = '10'; } else if ($card[$i] == 9 OR $card[$i] == 22 OR $card[$i] == 35 OR $card[$i] == 48){$value = '10'; } else if ($card[$i] == 8 OR $card[$i] == 21 OR $card[$i] == 34 OR $card[$i] == 47){$value = '9'; } else if ($card[$i] == 7 OR $card[$i] == 20 OR $card[$i] == 33 OR $card[$i] == 46){$value = '8'; } else if ($card[$i] == 6 OR $card[$i] == 19 OR $card[$i] == 32 OR $card[$i] == 45){$value = '7'; } else if ($card[$i] == 5 OR $card[$i] == 18 OR $card[$i] == 31 OR $card[$i] == 44){$value = '6'; } else if ($card[$i] == 4 OR $card[$i] == 17 OR $card[$i] == 30 OR $card[$i] == 43){$value = '5'; } else if ($card[$i] == 3 OR $card[$i] == 16 OR $card[$i] == 29 OR $card[$i] == 42){$value = '4'; } else if ($card[$i] == 2 OR $card[$i] == 15 OR $card[$i] == 28 OR $card[$i] == 41){$value = '3'; } else if ($card[$i] == 1 OR $card[$i] == 14 OR $card[$i] == 27 OR $card[$i] == 40){$value = '2'; } $comp_total_value = $comp_total_value + $value; if ($comp_total_value > 21) { for($i = 13; $i < ($comp_total_cards + 13); $i++) { if ($card[$i] == 8 OR $card[$i] == 16 OR $card[$i] == 24 OR $card[$i] == 32) { $ace = $ace + 1; } } while ($comp_total_value > 21 AND $ace > 0) { $ace = $ace - 1; $comp_total_value = $comp_total_value - 10; } } } echo "Player: $total_value Bank: $comp_total_value"; if ($total_value == $comp_total_value){ $r['bj'] = 5; } if ($total_value < $comp_total_value ){ $r['bj'] = 4; } if ($total_value > $comp_total_value OR $comp_total_value > 21){ $r['bj'] = 3; } //win } else { $comp_total_cards = 1; } echo "<table><tr><td>Player </td> <td> Dealer</td></tr>"; if ($r['total_cards'] > $comp_total_cards) { $rows = $r['total_cards']; } else { $rows = $comp_total_cards; } for($i = 1; $i < ($rows + 1); $i++) { $c = $i + 12; echo "<tr><td>"; if ($r['total_cards'] >= $i) { display_card( $card[$i] ); } echo "</td><td>"; if (isset($_GET['stand'])) { if ($comp_total_cards >= $i) { display_card( $card[$c] ); } } else { $p++; if($p == 1) { display_card( $card['13'] ); } else if ($p == 2) { if ($r['bj'] == 6) { display_card( $card['14'] ); } else { echo ""; } } } echo "</td></tr>"; } echo "</table>"; } echo "<table><tr>"; if ($r['bj'] == 1) { print"<td>Hit</td><td>Stand</td>" } else { print " Bet"; } function display_card( $card ) { //Type if ($card < 14){ $type = "s"; } else if ($card < 27){ $type = "c"; } else if ($card < 40){ $type = "h"; } else { $type = "d"; } //Numer if ($card == 13 OR $card == 26 OR $card == 39 OR $card == 52){$card = '14'; } else if ($card == 12 OR $card == 25 OR $card == 38 OR $card == 51){$card = '13'; } else if ($card == 11 OR $card == 24 OR $card == 37 OR $card == 50){$card = '12'; } else if ($card == 10 OR $card == 23 OR $card == 36 OR $card == 49){$card = '11'; } else if ($card == 9 OR $card == 22 OR $card == 35 OR $card == 48){$card = '10'; } else if ($card == 8 OR $card == 21 OR $card == 34 OR $card == 47){$card = '9'; } else if ($card == 7 OR $card == 20 OR $card == 33 OR $card == 46){$card = '8'; } else if ($card == 6 OR $card == 19 OR $card == 32 OR $card == 45){$card = '7'; } else if ($card == 5 OR $card == 18 OR $card == 31 OR $card == 44){$card = '6'; } else if ($card == 4 OR $card == 17 OR $card == 30 OR $card == 43){$card = '5'; } else if ($card == 3 OR $card == 16 OR $card == 29 OR $card == 42){$card = '4'; } else if ($card == 2 OR $card == 15 OR $card == 28 OR $card == 41){$card = '3'; } else if ($card == 1 OR $card == 14 OR $card == 27 OR $card == 40){$card = '2'; } echo ""; } if ($r['bj'] == 2) { echo " You lose"; } else if ($r['bj'] == 3) { echo " You Win!!"; } else if ($r['bj'] == 4) { echo " You lose"; } else if ($r['bj'] == 5) { //lose echo " Push!"; } else if ($r['bj'] == 6) { echo " Black Jack!!"; } $h->endpage(); ?> If there are any mistakes (which I am sure there are a few), I would love to hear them so I can get back on track and fix any corrections that are needed. Quote
POG1 Posted September 27, 2008 Posted September 27, 2008 Re: [mccode] Black Jack I'm trying to get this script to work on v2, and for some reason I get: Parse error: syntax error, unexpected '}' in /blackjack.php on line 214 from You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Quote
Zero-Affect Posted September 27, 2008 Posted September 27, 2008 Re: [mccode] Black Jack i don't like this script i took a quick look through it and i say nothing showing the images and nothing involving them not being the same card Quote
hobbes Posted September 27, 2008 Posted September 27, 2008 Re: [mccode] Black Jack thanks pog, i was half asleep when i was working on it, can't believe i missed the ';'. zero; i'm going to see what i can do to improve this script, once it's done, i'll post a revised version. Quote
Haunted Dawg Posted September 28, 2008 Posted September 28, 2008 Re: [mccode] Black Jack I created my own blackjack script, you will be seeing it on paddy's new game. It was essentialy coded for his game and if i had to sell it would go for $30+ but i wont be selling. Quote
mdshare Posted September 28, 2008 Posted September 28, 2008 Re: [mccode] Black Jack Exactly which isn't so simple to follow correct blackjack rules. And how many decks are used again ? 6 ... Quote
Guest Anonymous Posted September 28, 2008 Posted September 28, 2008 Re: [mccode] Black Jack Well the 4 major casino rule-sets I looked at used 6, so yep, I implemented 6. Actually having selectable rule sets could be interesting ... LostOne!! Challenge! :D (Or should we go for something with a little more meat to it...) Quote
Haunted Dawg Posted September 28, 2008 Posted September 28, 2008 Re: [mccode] Black Jack I have not finished my script yet, i will add more idea's to it as they come to my mind and if it is in the blackjack game. I do not play blackjack. Quote
dj_rive Posted January 7, 2009 Posted January 7, 2009 Re: [mccode v1] Black Jack Does anyone have a working Black Jack for V2? Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.