four1: Sees if you have 4 of a kind

Description Usage Arguments Value Author(s) Examples

View source: R/four1.R

Description

Sees if you have 4 of a kind.

Usage

1
four1(x)

Arguments

x

Numbers of your cards and the board cards.

Value

15*number of the foursome + the number of your next highest other card. For instance, if your best 5 card hand is 8888K, then it will return 15*8 + 13 = 133. Returns 0 if you don't have 4 of a kind.

Author(s)

Frederic Paik Schoenberg

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
x = c(8,8,8,8,13,12,2)
four1(x)
x = c(8,8,8,3,13,12,2)
four1(x)
##---- Should be DIRECTLY executable !! ----
##-- ==>  Define data, use random,
##--	or do  help(data=index)  for the standard data sets.

## The function is currently defined as
function(x){
## 15*number of the foursome + next
a1 = mycount1(x)
a2 = a1$v
a3 = a1$ct
a4 = sum(a3 > 3.5)
if(a4 < 0.5) return(0)
a5 = sort(a2[a3>3.5],decreasing=T)
a6 = sort(c(0,x[(x != a5[1])]),decreasing=T)
15*a5[1] + a6[1]
  }    ## end of four1

holdem documentation built on May 2, 2019, 9:21 a.m.