Learn R Programming

holdem (version 1.2)

strflsh1: See if you have a straight flush.

Description

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

Usage

strflsh1(x, y)

Arguments

x

y

Value

returns the highest card of your straight flush if you have one, or 0 otherwise.

Examples

Run this code
# NOT RUN {
##---- 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,y){
a1 = mycount1(y)
if(max(a1$ct)<4.5) return(0)
a2 = c(1:length(a1$ct))[a1$ct > 4.5]
a3 = a1$v[a2] ## this is the suit
a4 = sort(x[y == a3],decreasing=T)
straight1(a4)
  } ## end of strflush1
# }

Run the code above in your browser using DataLab