ver 0.045 Poker Hand Scoring Program -- Almost Done
This program ( scorePoker_0_045.htm) ranks poker hands based on Hoyle's page at http://www.hoylegaming.com/rules/showrule.aspx?RuleID=222 .
It identifies the vairous hand combinations (straight flush,four of kind.full house, etc.) correctly. It gives a value for the card combinations to sort them.
NOTE program developed and tested only in Google Chrome browser version Version 39.0.2171.95 m
Running the program
This program is at scorePoker_0_045.htm.
The poker hands may be entered in the field to the right of the Enter hand label (A in the picture) in the format of 7S 10D 7H 9C 9S .
"D","H","C","S" are the suffix of each card and stand for diamonds, hearts, clubs, and spades resspetively.
The prefixes 10,J,Q,K,A and 1 to 9 are the prefix for each representation of the cards. Alphabetic characters may be of either upper or lower case. Note: pressing the Tab key or otherwise moving out of this field
has the program process the hand.
Pushing the nextStored button (C in the picture) will input a sample test hand. Repeatedly pressing it will cycle through the (30+ in this version) hands shown below at stored sample data.
A number may be put into the field right the item label (D in the picture) to select one of the sample hands.
Pushing the Random_Hand button (E in the picture) will generate a random hand. Samples are shown below at randomly generated sample data .
Results: scoring information is put in the field labeled B.
- Strict_score and score are the same except for three of a kind. Hoyles rules doesn't give value to the other two cards for three of a kinds wheres for the other hand combinations the extra cards are considered. Strict_score
follows the Hoyle's rule wheres score considers the other two cards in a three of a kind hand.
- second Score - tiebreaker - considers the lowest 2 cards in some cases used so that Strict_score and score can stay under 15000.
Fields for entering first and last name are labeled G and H in the picture.
Summary of running:
- program at scorePoker_0_045.htm
- first and last name are labeled G and H in the picture. (Fill these first)
- Entering Hands
- enter at field to the right of the Enter hand label (A in the picture). Leave field (press tab key) to get program to process.
- nextStored button (C in the picture) gives a sample hand
- Random_Hand button (E in the picture)
- Results in score field B.
fixes and modifications
- move field labeled F out. It has program developement and debugging information
- put in fields so key key2 may be entered
- put in dummy first and last fields in HDS.add( so that easier to import to spreadsheet
- put in yr,mon,day,hr,min fld ?
- have program store, sort, and retrieve entered hands
- Javascript won't save to file -- but can save in memory - kept as long as program is running - can copy out of text area.
- possible could have send to .php program on servers to save -- rusty at doing this
Note on Hoyle's 3 of Kind Scoring
At http://www.hoylegaming.com/rules/showrule.aspx?RuleID=222 the Hoyles rules for scoring poker state "
Three of a Kind. Three cards of the same rank, such as three 8s, form three of a kind. The highest-ranking three cards wins against another three of a kind hand. Three aces are the highest; three 2s are the lowest. Three of a kind beats two pair or any lower hand.
".
Other combinations there like four of a kind, two pair, and pair make mention of using the cards in these hands that are not part of the combination to rand the hands if the the combinations match.
The program's Strict_score for three of a kind just considers the rank of the three of a kind. The program's score for three of a kind just takes into account values for the other two cards in the hand.
Sample data:
field descriptions -- likely to change some in newer version
HDS.add(key,key2,strict_score,score,tie_breaker_score,"First Name","Last Name","Hand","result");
- key option to add numeric field to sort on -- sample data vs. real perhaps ... not yet implemented
- key2 option to add numeric field to sort on -- sample data vs. real perhaps ... not yet implemented
- strict score exactly by Hoyle
- score seperating hands a little more ... stuff perhaps not mentioned by Hoyle
- tie_breaker_score (second score) if two hands have the same score and strict score
- First Name
- Last Name
- Result eventually to be straight flush,four of kind,four of kind, etc.
-
- add strict tie breaker?
stored sample data
Press Next_Stored button to generate
HDS.add(0,0,12553,12553,0,"highest straight flush","sample ","Ah kh qh jh 10h","straight flush with with high card AH");
HDS.add(0,0,12553,12553,0,"generated !!!! highest straight flush","sample ","10H JH QH KH AH ","straight flush with with high card AH");
HDS.add(0,0,12553,12553,0,"generated !!!! highest straight flush","sample ","10H JH QH KH AH ","straight flush with with high card AH");
HDS.add(0,0,1131,1131,52,"low runt","sample","2c 4s 5s 6c 7c","runt");
HDS.add(0,0,2496,2496,234,"high runt","sample","Ad kh qh js 9d","runt");
HDS.add(0,0,3921,3921,6,"mid pair","sample","jh 8d 7s 9s 8h","pair");
HDS.add(0,0,2824,2824,2,"low pair","sample","5d 2h 2d 4d 3s","pair");
HDS.add(0,0,4964,4964,10,"high pair","sample","jd qs ad ks ah ","pair");
HDS.add(0,0,6751,6751,0,"mid two pair","sample","jh 8d 7s js 8h","two pair");
HDS.add(0,0,5319,5319,0,"low two pair","sample","5d 2h 2d 3d 3s","two pair");
HDS.add(0,0,7328,7328,0,"high two pair","sample","kd qs ad ks ah ","two pair");
HDS.add(0,0,7517,7558,0,"lowest 3 of a kind","sample","2d 3s 2h 4c 2c","three of a kind");
HDS.add(0,0,9545,9712,0,"highest 3 of a kind","sample","As ad aC ks qh","three of a kind");
HDS.add(0,0,9740,9740,0,"mid lowest straight","sample","6d 9h 5h 7c 8s","straight with with high card 9H");
HDS.add(0,0,9737,9737,0,"second lowest straight?","sample","6d 4h 5h 2c 3s","straight with with high card 6D");
HDS.add(0,0,9736,9736,0,"lowest straight","sample","ad 4h 5h 2c 3s","straight with with high card 5H");
HDS.add(0,0,9745,9745,0,"higest straight","sample","Ad ks jc qh 10c","straight with with high card AD");
HDS.add(0,0,11356,11356,55,"mid flush","sample","10s 4s 5s 6s 7s","flush with high card 10S");
HDS.add(0,0,10835,10835,40,"lowest flush","sample","2d 4d 5d 6d 7d","flush with high card 7D");
HDS.add(0,0,12102,12102,125,"highest flush","sample","Ah qh jh 10h 9h","flush with high card AH");
HDS.add(0,0,12222,12222,0,"mid full house","sample","7d 9s 7s 9c 7h","full house");
HDS.add(0,0,12151,12151,0,"lowest full house","sample","2h 2s 3d 2c 3s","full house");
HDS.add(0,0,12317,12317,0,"highest full house","sample","Ah ad as kh kd","full house");
HDS.add(0,0,2392,2392,65,"too many cards","sample","ad 3s 6h 4d js qd ","runt");
HDS.add(0,0,12426,12426,0,"mid four of kind","sample","7h jc 7s 7c 7d","Four of a kind");
HDS.add(0,0,12353,12353,0,"lowest four of kind","sample","2h 3c 2c 2d 2s","Four of a kind");
HDS.add(0,0,12519,12519,0,"highest four of kind","sample","Ah Ad aC As Kh","Four of a kind");
HDS.add(0,0,12548,12548,0,"mid straight flush","sample ","6h 7h 5h 9h 8h","straight flush with with high card 9H");
HDS.add(0,0,12544,12544,0,"lowest straight flush","sample ","Ah 2h 5h 4h 3h","straight flush with with high card 5H");
HDS.add(0,0,12553,12553,0,"highest straight flush","sample ","Ah kh qh jh 10h","straight flush with with high card AH");
randomly generated sample data
generate by pressing Random Hand button to generate
HDS.add(0,0,2933,2933,6,"Random","34","KH 7S 2S 9D 2D ","pair");
HDS.add(0,0,2080,2080,130,"Random","33","9S 8D QD 4C 10C ","runt");
HDS.add(0,0,3625,3625,3,"Random","32","AS QD 6H 6S 4H ","pair");
HDS.add(0,0,4117,4117,1,"Random","31","10D 2S KS 9H 9S ","pair");
HDS.add(0,0,2418,2418,117,"Random","30","10C 9C 4D 7S AH ","runt");
HDS.add(0,0,2894,2894,6,"Random","29","2S 2C 10H 9D 7H ","pair");
HDS.add(0,0,1651,1651,52,"Random","28","2S 5C 7D 10C 4H ","runt");
HDS.add(0,0,1703,1703,91,"Random","27","7S 10D 9C 6H 3D ","runt");
HDS.add(0,0,1508,1508,52,"Random","26","6H 9D 4S 8D 2C ","runt");
HDS.add(0,0,2249,2249,65,"Random","25","4S QS 7H KD 3S ","runt");
HDS.add(0,0,3077,3077,6,"Random","24","3S 7D JD 10S 3C ","pair");
HDS.add(0,0,2418,2418,39,"Random","23","7C QC 2C 3H AC ","runt");
HDS.add(0,0,3793,3793,8,"Random","22","7H JH AC 9D 7D ","pair");
HDS.add(0,0,2405,2405,117,"Random","21","AS 7D JD 6C 5C ","runt");
HDS.add(0,0,3611,3611,3,"Random","20","6S 4H KS 6D JS ","pair");
HDS.add(0,0,4118,4118,9,"Random","19","KS 9D JC 10C 9C ","pair");
HDS.add(0,0,11734,11734,54,"Random","18","10S 3S 5S 7S QS ","flush with high card QS");
HDS.add(0,0,2470,2470,91,"Random","17","4C 5C 10C AH KS ","runt");
HDS.add(0,0,2301,2301,117,"Random","16","QD 7S 4S KH JC ","runt");
HDS.add(0,0,3076,3076,1,"Random","15","JS 9C 3S 3H 2C ","pair");
HDS.add(0,0,4724,4724,2,"Random","14","3H 8D KD KH 6H ","pair");
HDS.add(0,0,3204,3204,4,"Random","13","4C 5S 8C 7H 4H ","pair");
HDS.add(0,0,2054,2054,39,"Random","12","2H QD 7C 3S 10D ","runt");
HDS.add(0,0,4623,4623,5,"Random","11","6C QS 9D KS QH ","pair");
HDS.add(0,0,2444,2444,143,"Random","10","10S JC AH 5C 8H ","runt");
HDS.add(0,0,2946,2946,4,"Random","9","2D 9D 2C 5D AS ","pair");
HDS.add(0,0,2301,2301,130,"Random","8","JH 7D KS QC 5H ","runt");
HDS.add(0,0,2470,2470,143,"Random","7","6D 7C JC QH AC ","runt");
HDS.add(0,0,2496,2496,117,"Random","6","AS KH 9C 2D QD ","runt");
HDS.add(0,0,2457,2457,169,"Random","5","QD 9C 6S AD 10C ","runt");
HDS.add(0,0,4724,4724,3,"Random","4","KS 8S 4C KC 6C ","pair");
HDS.add(0,0,2470,2470,52,"Random","3","QC AS JH 4H 2H ","runt");
HDS.add(0,0,3372,3372,2,"Random","2","6H 3D 5S 5D 8D ","pair");
HDS.add(0,0,3272,3272,7,"Random","1","4D 4C 10D 8C KH ","pair");
hint on reading with spreadsheet
sample .txt file of previous section to read into excel, etc. Is partially comma seperated. If delimete on "(" & ")" all fields would go to seperate columns. Future version to put in dummy column so can
just use comma delimeter.
Prior versions