onepair1: See if you have a pair.

Description Usage Arguments Value Author(s) Examples

View source: R/onepair1.R

Description

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

Usage

1

Arguments

x

Value

returns 15*15*15*pair + 15*15*next + 15*next + next if you have a pair, 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){
## 15*15*15*pair + 15*15*next + 15*next + next
a1 = unique(x)
a2 = length(a1)
if(a2 == length(x)) return(0)
a3 = rep(0,a2)
for(i in 1:a2) a3[i] = sum(x == a1[i])
a4 = max(a1[a3>1.5])
a5 = sort(c(x[x != a4],rep(0,3)),decreasing=T)
15*15*15*a4 + 225*a5[1] + 15*a5[2] + a5[3]
  }

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