Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /nfs/c01/h06/mnt/10927/domains/dragonprime.net/html/Sources/Load.php(225) : runtime-created function on line 3

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /nfs/c01/h06/mnt/10927/domains/dragonprime.net/html/Sources/Load.php(225) : runtime-created function on line 3
Blackjack for pqcasino
DragonPrime - LoGD Resource Community
Welcome Guest
  • Good morning, Guest.
    Please log in, or register.
  • September 17, 2019, 01:41:51 AM
Home Forums News Downloads Login Register Advanced Search
* * *
DragonPrime Menu
Login
 
 
Resource Pages
Search

Pages: [1] 2   Go Down
  Print  
Author Topic: Blackjack for pqcasino  (Read 8899 times)
0 Members and 1 Guest are viewing this topic.
lonnyl
Guest
« on: October 15, 2004, 06:34:09 AM »

BlackJack Conversion for the Casino frontend...

Card images are included in the casino module so I am not re-distributing them here...

http://www.pqcomp.com/modules/mydownloads/visit.php?cid=3&lid=35
« Last Edit: January 30, 2005, 08:53:16 AM by lonnyl » Logged
Arune
Member
Mod God
*****
Offline Offline

Posts: 718


Arune Vai - khatfield


View Profile WWW
« Reply #1 on: October 19, 2004, 02:36:29 PM »

One of my users has petitioned:
Quote
If I go over 21 in Blackjack I lose. However, if the dealer goes over - he wins. I had 19 points and he had 25 and took my gold. I'm not asking for it to be replaced. Just letting you know about the bug...

Just figured I'd give you a heads up Lonny.
Logged
lonnyl
Guest
« Reply #2 on: October 19, 2004, 02:49:46 PM »

will have to look at that hadn't heard that from any of my players..... except for the fact that they loose alot of gold playing...
Logged
lonnyl
Guest
« Reply #3 on: October 19, 2004, 03:14:11 PM »

looked through the code and can't find anywhere that this would happen.... will have to play it for a while and see if I can duplicate it.....
Logged
Arune
Member
Mod God
*****
Offline Offline

Posts: 718


Arune Vai - khatfield


View Profile WWW
« Reply #4 on: October 19, 2004, 03:18:15 PM »

I actually haven't found it myself either. I will look some more, unless its just maybe glitching on one certain hand or something /shrug.

No worries, if I find more I will let you know Smiley
Logged
SaucyWench
Mod God
*****
Offline Offline

Posts: 2238


I'm a good girl.


View Profile WWW
« Reply #5 on: October 19, 2004, 04:19:06 PM »

I have a dumb question...

line 149 says this:

      if ($mybet < 1) $mybet=$mybet;

Why? Also a small typo, loose (should be lose).

I'm afraid I can't shed any light on why the other problem happened... perhaps try plotting through the code with your cards at 23, and his at 25, to see what would happen hypothetically.
Logged

SaucyWench
Owner of GemDust.com and Darton City proudly hosted by LunarPages
AndyMC
Guest
« Reply #6 on: October 19, 2004, 05:55:54 PM »

One request I've gotten is for the total value of your hand and the dealer's hand to be displayed, you know, for those lazy black jack players out there who can't add very fast Smiley  I guess it's kind of a pain for myself too, as the card images don't have numbers on them, so occasionally I find myself having to count how many spots are on the card cuz I don't recognize it right away.
Logged
SaucyWench
Mod God
*****
Offline Offline

Posts: 2238


I'm a good girl.


View Profile WWW
« Reply #7 on: October 19, 2004, 05:59:54 PM »

Andy's comment has just tipped me off - I am willing to bet that the petitioning player was looking at a hand of 25 for the dealer which included an ace (which means, the hand was actually 15).

Unless I'm mistaken though, the dealer is supposed to hit on 15? Maybe the player just miscounted.
Logged

SaucyWench
Owner of GemDust.com and Darton City proudly hosted by LunarPages
Tholgare
Guest
« Reply #8 on: October 19, 2004, 06:46:10 PM »

if you used the same code that was in the darkhorse tavern blackjack module, it really will let the dealer win with a 25.  I had it happen several times and ended up removing the module.  I'd looked at that code and couldn't figure out why it might be doing it.  If you wrote this one all from scratch, maybe it's just some really common mistake to make with writing a blackjack game.  Good luck tracking it down.
Logged
Booger
Captain of the Guard
***
Offline Offline

Posts: 126


I'm a llama!


View Profile
« Reply #9 on: October 20, 2004, 03:37:12 AM »

Shouldn't these be the other way? If I start with 4 aces it would only reduce the value by 20...

Code:
if ($ucardvalue > 21 and $ace > 0){
    $ucardvalue-=10;
    $ace--;
}
if ($ucardvalue > 21 and $ace > 1){
    $ucardvalue-=10;
    $ace--;
}
if ($ucardvalue > 21 and $ace > 2){
    $ucardvalue-=10;
    $ace--;
}
if ($ucardvalue > 21 and $ace > 3){
    $ucardvalue-=10;
    $ace--;
}

I can't see why it would let the dealer with with 25 either tho.
Logged
Excalibur
Member
Mod God
*****
Offline Offline

Posts: 573


I'm a newbie, plz forgive me!


View Profile WWW
« Reply #10 on: October 20, 2004, 05:28:29 AM »

Shouldn't these be the other way? If I start with 4 aces it would only reduce the value by 20...

I can't see why it would let the dealer with with 25 either tho.
I was thinking the same. I'd code it this way:
Code:
for ($i = 0; $i < 4, $i++) {
   if ($ucardvalue > 21 and $ace > 0){
      $ucardvalue-=10;
      $ace--;
   }
}

Rgds Excalibur
Logged

Spock: Random chance seems to have operated in our favor.
McCoy: In plain, non-Vulcan English, we've been lucky.
Spock: I believe I said that, Doctor.
lonnyl
Guest
« Reply #11 on: October 20, 2004, 06:10:57 AM »

Thanks Excal for the code suggestion.... I am implementing it right now.

This module was a direct conversion of the old one (no improvements) so yes, any bugs that may have been in the old one are here in this one.

I will be doing something with numbers, as I seem to have a great number of visually impaired players using jaws and other programs that are similar....   One of the things I am going to tray and work on is gettting the modules I have jaws compatible.... so the cards will have to have cardnames and numbers in text displayed under the card (so it is read by jaws)...  I also am going to see if I can so something with adding a 20% to the odor, hunger and bladder meters....  that way those meters will be read as well..... we are doing an informal poll on our games (97 & 98) too see who is using what software and what is not working for them....   I will be updating and posting when the 98 modules are jaws compatible.... (many of them are) when I get the ok from some of our jaws users.
Logged
lonnyl
Guest
« Reply #12 on: October 20, 2004, 06:30:51 AM »

Ok... Updated to 1.1... thanks to Excal and saucy... what you have pointed out has been fixed... I still haven't placed a text display of the card values in, as I haven't figured out what works best (still experimenting).   The Card images are without numbers on purpose as in days of past cards did not have numbers (one of those things I did to make it more authentic).  Played and Played and Played (about 50 or so rounds) could not reproduce the dealer winning on bust.   So if there is a bug it is most likely still there....

Logged
SaucyWench
Mod God
*****
Offline Offline

Posts: 2238


I'm a good girl.


View Profile WWW
« Reply #13 on: October 20, 2004, 09:40:11 AM »

Shouldn't these be the other way? If I start with 4 aces it would only reduce the value by 20...

Code:
if ($ucardvalue > 21 and $ace > 0){
    $ucardvalue-=10;
    $ace--;
}
if ($ucardvalue > 21 and $ace > 1){
    $ucardvalue-=10;
    $ace--;
}
if ($ucardvalue > 21 and $ace > 2){
    $ucardvalue-=10;
    $ace--;
}
if ($ucardvalue > 21 and $ace > 3){
    $ucardvalue-=10;
    $ace--;
}

I thought that too... If the player has four aces and a picture card (the highest total possible, 54) then the first item is true and the total ends up as 44. The second item would also be true and go down to 34. But the $ace--; parts are NOT correct. They should be removed so that all four would apply in a case like this, so that it would continue as 24, and finally 14.

If you need the $ace--; bit for something else, then yes they would need to go in reverse order. Having said all this, it does seem a cumbersome way to code it.
« Last Edit: October 20, 2004, 09:48:50 AM by SaucyWench » Logged

SaucyWench
Owner of GemDust.com and Darton City proudly hosted by LunarPages
WebPixie
Guest
« Reply #14 on: October 28, 2004, 06:43:30 PM »

I added the hand totals as plain text in this if anyone wants a copy. It shows your hand total and the dealers total when he shows his hand. MUCH easier to play now :lol: I got sick of counting spades and hearts  Tongue

Should I upload it?
Logged
Pages: [1] 2   Go Up
  Print  
 
Jump to:  


*
DragonPrime Notices
Play LoGD on Dragonprime

Support Us
No funds raised yet this year
Your help is greatly appreciated!
Recent Topics
DragonPrime LoGD
Who's Online
82 Guests, 0 Users
Home Forums News Downloads Login Register Advanced Search