|
||
|
|||||||
| Script Languages Perl/PHP/Python/Ruby so on and so forth. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 (permalink) |
|
God of Pandora
Join Date: Jun 2003
Location: Gainesville GA
Age: 31
Posts: 2,000
|
I am working on a small poker program for my site in PHP.
I have many of the hands scripted and ready, but pairs, full houses and trips are being a pain. The problem area is in the pairs, sometimes it shows up that its a pair on the site, and other times not (even if there is definatly a pair... see attatched image). this is the problem area (sorry for not putting it in code box, it wont let me do so without deleting the $c1n and such) // Pair else if ($c1n == $c2n | $c1n == $c3n | $c1n == $c4n | $c1n == $c5n) { echo ("<br><b><h2>Pair - No Prize</h2>"); } else if ($c2n == $c3n | $c2n == $c4n | $c2n == $c5n) { echo ("<br><b><h2>Pair - No Prize</h2>"); } else if ($c3n == $c4n | $c3n == $c5n) { echo ("<br><b><h2>Pair - No Prize</h2>"); } else if ($c4n == $c5n) { echo ("<br><b><h2>Pair - No Prize</h2>"); } echo ("<br>CN - c1n = $c1n, c2n = $c2n, c3n = $c3n, c4n = $c4n, c5n = $c5n<br>CS - c1s = $c1s, c2s = $c2s, c3s = $c3s, c4s = $c4s, c5s = $c5s<br>Cards - C1 = $c1, c2 = $c2, c3 = $c3, c4 = $c4, c5 = $c5"); As you can see in the image, there is a pair of Queens. The debugging info below the cards "CN - c1n = 13, c2n = 12, c3n = 2, c4n = 11, c5n = 12" show that c2n and c5n are both 12 (queen) the code above "else if ($c2n == $c3n | $c2n == $c4n | $c2n == $c5n)" more specifically "$c2n == $c5n" shows that the statement should be true right? if so the echo code should be displayed... yet its not. Now, keep in mind that I am new to PHP. I thank my C# background for allowing me to get this far, but maybe I screwed it up somewhere where php is different than C# Any help you can give me as to why this is happening and/or how to fix it will be appreciated.
__________________
The Den of KillerBeeZ...Kender's Komments, uncensored commentary from the Kender. Plus anything else the Kender might have in his pouches.
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|