Skip to content

A simple application to determine the type of hand in poker dealt to a player

License

Notifications You must be signed in to change notification settings

shikharsubedi/poker-hand

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

poker-hand

Build Status Test Coverage Maintainability

A simple application to determine the type of hand in poker dealt to a player https://en.wikipedia.org/wiki/List_of_poker_hands

Usage

This requires ES6 javascript and node 8 to run. There are no external dependencies. There are some dev dependencies

Example

const checkHand = require('./src/poker-hand')
console.log(checkHand(['11-S', '10-S', '9-S', '8-S', '7-S'])) // straight flush

Suite Notation:

S : Spades
H : Hearts
D : Diamond
C : Clubs

A single card:

A single card is denoted by the string '11-S' . This is a Jack of Spades

The following poker hands are correctly detected by this application

  1. Straight flush :e.g. ['11-S', '10-S', '9-S', '8-S', '7-S']
  2. Four of a kind : e.g. ['11-S', '11-D', '11-H', '11-C', '10-S']
  3. full house :
  4. flush :
  5. straight
  6. three of a kind :
  7. two pair :
  8. one pair :
  9. high card :

Inspiration

This project is inspired by the book Refactoring Javascript I want to compare my implementation to the one in the book Also I have plans to work on a project to compare two poker hands and find out the winner.

About

A simple application to determine the type of hand in poker dealt to a player

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published