Determine the player with the highest flush.
dotFlush(cards, score)
:
the 7 card hand as matrix[nPlayers, 14] | |
col1: rank of card 1 in {2, ... , 14} | |
col2: suit of card 1 in {1, 2, 3, 4} | |
col3: rank of card 2 | |
col4: suit of card 2 | |
. | |
. | |
. | |
col13: rank of card 7 |
:
the score of the hand in absolute terms as vector[nPlayers] | |
9 = Straight Flush | |
8 = Four of a Kind | |
7 = Full House | |
6 = Flush | |
5 = Straight | |
4 = Three of a Kind | |
3 = Two Pair | |
2 = One Pair |
winner : absolute position of the winner as vector
# NOT RUN {
cards <- c(2,1,3,3,5,2,6,3,7,3,13,3,14,3,2,3,3,4,5,1,6,3,7,3,13,3,14,3)
cards <- matrix(cards,2,14,byrow=TRUE); cards
score <- showdown(cards); score
dotFlush(cards,score)
cards <- c(2,1,3,3,5,3,6,3,7,3,13,3,14,3,2,3,3,4,5,3,6,3,7,3,13,3,14,3)
cards <- matrix(cards,2,14,byrow=TRUE);cards
score <- showdown(cards); score
dotFlush(cards,score)
# }
Run the code above in your browser using DataLab