# straight1: See if you have a straight. In holdem: Texas Holdem Simulator

## Description

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

## Usage

 `1` ```straight1(x) ```

## Arguments

 `x`

## Value

returns the highest card of your straight, or 0 if you don't have one.

## Author(s)

Frederic Paik Schoenberg

## Examples

 ``` 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17``` ```##---- 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){ a1 = sort(unique(x)) if (length(a1)<4.5) return(0) a3 = 0 n = length(a1) if(a1[n] == 14) a1 = c(1,a1) ## count ace as both 1 and 14 a2 = length(a1) for(j in c(5:a2)){ ## j will be the potential highest card of straight if( sum(15^c(1:5) * a1[(j-4):j]) == sum(15^c(1:5) * ((a1[j]-4):a1[j]))) a3 = a1[j] } a3 } ## end of straight1 ```

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