Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Poker How to?

Kain Cleaver
Registered User
Join date: 24 Jan 2006
Posts: 178
09-05-2008 20:40
ok. im looking to make a poker dice game (not gambling related)

ive got the overall mechanics down.. but i cant seem to come up with a way for the script to determine the hand's overall rank..

there are tons of combinations and its obvious i cant use IF statements for them all...

my list actually only consists of numbers 1 - 6

so say i have the list of 5 dice.. how to i get them organized from lowest to highest ?

say the final outcome was 4 2 3 2 2

how do i get that to organize to look like 2 2 2 3 4?

im sure it would be easier to work things out if it ws organized like that

can someone help me with this?
Andy Grant
Registered User
Join date: 20 May 2005
Posts: 140
09-05-2008 21:14
I don't see how that could be a very huge "IF bible"... ie:
if (num1 >> num2) do_this();
else if (num2 >> num1) do_this_instead();
else do_something_completely_different();

Something in that direction should do it, unless i completely misunderstood what you said.
Osgeld Barmy
Registered User
Join date: 22 Mar 2005
Posts: 3,336
09-05-2008 21:26
http://cheesefactory.us/lslwm/llListSort.htm
Kain Cleaver
Registered User
Join date: 24 Jan 2006
Posts: 178
09-05-2008 22:00
From: Andy Grant
I don't see how that could be a very huge "IF bible"... ie:
if (num1 >> num2) do_this();
else if (num2 >> num1) do_this_instead();
else do_something_completely_different();

Something in that direction should do it, unless i completely misunderstood what you said.


ok i got the sorting thing thank you very much :)

btw andy to answer your question.. think about how poker is, you have several main hands.

high card
pair
2 pair
3 of a kind
full house
flush
straight
straight flush
4 of a kind
and 5 of a kind
(flush and straight flush wont be making an appearance in my poker dice game because its not possible to get eather)

ok.. so those are pretty basic.. but now.. break up those with ranking of number and suit..

high card could be any 1 of my 6 dice.
a pair... could be double of any of the 6 dice..
ect.. there are tons of combinations..
so say 2 people each get a pair.. now i need to find out who has the better pair.. if they both have the same pair.. then i need to figure out who has the highest card on that hand..

sorting them by smallest to biggest helps because you can see them all in a line..
without sorting.. the combination of possibilitys grows even more.

sorry if this sounds confusing.. i wish there was a full mod poker game i could look at to see how they do it with 52 cards.. it blows my mind.. im only working with 6