twopair1: See if you have two pairs.

Description Usage Arguments Value Author(s) Examples

View source: R/twopair1.R

Description

Sees if you have two pairs, and if so, finds the strength of your hand. Used by handeval().

Usage

1

Arguments

x

Value

225 * your higher pair + 15 * the lower pair + the number of your kicker, if you have two pairs, or 0 otherwise.

Author(s)

Frederic Paik Schoenberg

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
##---- 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){
## 225*highpair + 15*lowpair + next
a1 = mycount1(x)
a2 = a1$v
a3 = a1$ct
a4 = sum(a3>1.5)
if(a4<1.5) return(0)
a5 = sort(a2[a3>1.5],decreasing=T)
a6 = max(c(0,a2[(a2 != a5[1]) & (a2 != a5[2])]))
225*a5[1] + 15*a5[2] + a6
  }    ## end of twopair1

Example output

function (x) 
{
    a1 = mycount1(x)
    a2 = a1$v
    a3 = a1$ct
    a4 = sum(a3 > 1.5)
    if (a4 < 1.5) 
        return(0)
    a5 = sort(a2[a3 > 1.5], decreasing = T)
    a6 = max(c(0, a2[(a2 != a5[1]) & (a2 != a5[2])]))
    225 * a5[1] + 15 * a5[2] + a6
}

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