poker game logic(again)

i think that this will be the last thread that i will start on the subject of poker.

if you have not looked at the other poker game logic threads, it might help.

if figured out ways to check for repeaded cards(2,3,4,2&2,2&3) and how to do the flush. I am only having trouble figuring out if ther is one of the straights(cards in ascending order).

you can check the suit and the rank of each card and there are 5. how do you figure if they are in a particular order?

THANX!

[511 byte] By [apasechnik1a] at [2007-9-28 9:57:25]
# 1

Sort the card array by face value of card. then

boolean straight()

{

if( ((a[0]+1) == a[1]) && ((a[1]+1) == a[2]) && ... etc. )

return true;

}

You will have to account for ace-2-3-4-5 too though. or 10-j-q-k-ace depending on the value you assign an ace.

SethMussa at 2007-7-11 23:30:19 > top of Java-index,Other Topics,Java Game Development...