Learn R Programming

poker (version 0.8.8)

dotStraightFlush: dotStraightFlush

Description

Determine the player with the highest straight flush.

Usage

dotStraightFlush(nPlayers, cards, score)

Arguments

nPlayers

number of hands as integer in {2, ... , 9}

cards

:

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
score

:

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

Value

winner : absolute position of the winner as vector

See Also

dotTransformToNumber and dotStraightFlushRanker

Examples

Run this code
# NOT RUN {
cards <- c(8,13,5,1,1,4,6,2,2,2,3,4,14,14,14,2,2,2,9,9,9,1,1,1,10,10,10)
cards <- c(cards,1,1,1,11,11,11,1,1,1,12,12,12,1,1,1)
cards <- matrix(cards,nrow=3,ncol=14); cards
score <- showdown(cards); score
nPlayers <- nrow(cards); nPlayers
dotStraightFlush(nPlayers,cards,score)

cards <- c(1,1,3,4,2,2,3,4,8,8,1,1,9,9,1,1,10,10,1,1,11,11,1,1,12,12,1,1)
cards <- matrix(cards,nrow=2,ncol=14); cards
score <- showdown(cards); score
nPlayers <- nrow(cards); nPlayers
dotStraightFlush(nPlayers,cards,score)
# }

Run the code above in your browser using DataLab