dotStraight: dotStraight

Description Usage Arguments Value See Also Examples

View source: R/poker.R

Description

Determine the player with the highest straight.

Usage

1
dotStraight(cards, score)

Arguments

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
col14: suit 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
1 = High Card

Value

winner : absolute position of the winner as vector

See Also

dotStraightRanker

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
cards <- c(7,1,4,2,4,1,4,3,10,1,11,2,2,2,2,3,3,3,3,3,3,1,1,1,5,5,5)
cards <- c(cards,4,4,4,6,6,6,2,2,2,14,14,14,2,2,2)
cards <- matrix(cards,nrow=3,ncol=14); cards
score <- showdown(cards); score
dotStraight(cards, score)

cards <- c(2,1,4,2,4,1,4,3,10,1,11,2,2,2,2,3,3,3,3,3,3,1,1,1,5,5,5)
cards <- c(cards,4,4,4,6,6,6,2,2,2,14,14,14,2,2,2)
cards <- matrix(cards,nrow=3,ncol=14); cards
score <- showdown(cards); score
dotStraight(cards, score)

greenspb/poker documentation built on May 6, 2019, 9:50 p.m.