App that gives a pokerhand and evaluates it. Live test on https://pokerhand-21022022.azurewebsites.net/
Start dev with npm start
- ./App.js is entrypoint and node server.
- ./client/ contains src code
- Index.html is single page html.
- Css is style sheet. Should be modulariszed, and possibly done in sass
- Scripts is main script module.
- /modules/ contains js modules
- cardBuilder builds card
- deckBuilder creates a shuffeled deck
- handBuilder creates an analyzable hand
- handAnalyzer finds value of hand
- /docs/ contains notes and appendices
- Readme.md This readme
- other base project files
- [8] Straight flush
- [7] Four of a kind
- [6] Full house
- [5] Flush
- [4] Straight
- [3] Three of a kind
- [2] Two pair
- [1] Pair
- [0] High card
- [14] Ace
- [13] King
- [12] Queen
- [11] Jack
- [10] 10
- [9] 9
- [8] 8
- [7] 7
- [6] 6
- [5] 5
- [4] 4
- [3] 3
- [2] 2
- [1] Ace as part of ace to five straight
In this list royal flush has been ommited, since it is can be seen as a straight flush with high card Ace.
Suite does not have an impact on the hand but high card does.
We are assuming play with one standard card deck without any joker cards.
In this app we have given the hand a value from 0 to 8, where 8 is the best hand, and 0 is high card, and with a secondary evaluation of high card of the hand. Eg. ['4', '11'] is a straight with high card Jack.
Check for:
- Flush
- Straight a. Special case ace low to five straight
- Straight flush
- If both straight and flush is true
- Four of a kind
- Three of a kind
- Pair
- Full House
- If both three of a kind and separate pair of a kind
- Two pairs
- If two separate instances of pair
- Find high card
See more assumtions and ideas in ./docs/Refleksjoner.txt
Note that we have created the structure for comparing hands based on hand value and high card value, as handValue is an array of [hand, highCard]. High card value is however not used in current version of app.
Should have unit tests. As of now uses manual hand tests in ./docs/testers.md