hand: hand

Description Usage Arguments Value See Also Examples

View source: R/poker.R

Description

Assemble the 7 card hands.

Usage

1
hand(players, board)

Arguments

players

:

the hole cards as matrix[nPlayers, 4]
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
board

the board cards as vector[5] in {1, 2, ..., 52}

Value

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

See Also

dotTransformToRank and dotTransformToSuit

Examples

1
2
hand(matrix(1:18,9,2,byrow=TRUE),19:23)
hand(matrix(c(1:9,14:22),9,2),48:52)

Example output

      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]    2    1    3    1    7    2    8    2    9     2    10     2    11
 [2,]    4    1    5    1    7    2    8    2    9     2    10     2    11
 [3,]    6    1    7    1    7    2    8    2    9     2    10     2    11
 [4,]    8    1    9    1    7    2    8    2    9     2    10     2    11
 [5,]   10    1   11    1    7    2    8    2    9     2    10     2    11
 [6,]   12    1   13    1    7    2    8    2    9     2    10     2    11
 [7,]   14    1    2    2    7    2    8    2    9     2    10     2    11
 [8,]    3    2    4    2    7    2    8    2    9     2    10     2    11
 [9,]    5    2    6    2    7    2    8    2    9     2    10     2    11
      [,14]
 [1,]     2
 [2,]     2
 [3,]     2
 [4,]     2
 [5,]     2
 [6,]     2
 [7,]     2
 [8,]     2
 [9,]     2
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
 [1,]    2    1    2    2   10    4   11    4   12     4    13     4    14
 [2,]    3    1    3    2   10    4   11    4   12     4    13     4    14
 [3,]    4    1    4    2   10    4   11    4   12     4    13     4    14
 [4,]    5    1    5    2   10    4   11    4   12     4    13     4    14
 [5,]    6    1    6    2   10    4   11    4   12     4    13     4    14
 [6,]    7    1    7    2   10    4   11    4   12     4    13     4    14
 [7,]    8    1    8    2   10    4   11    4   12     4    13     4    14
 [8,]    9    1    9    2   10    4   11    4   12     4    13     4    14
 [9,]   10    1   10    2   10    4   11    4   12     4    13     4    14
      [,14]
 [1,]     4
 [2,]     4
 [3,]     4
 [4,]     4
 [5,]     4
 [6,]     4
 [7,]     4
 [8,]     4
 [9,]     4

poker documentation built on May 2, 2019, 3:45 a.m.

Related to hand in poker...