Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Int Key -> Deck Cards #1

Open
achabra14 opened this issue Oct 8, 2024 · 2 comments
Open

Int Key -> Deck Cards #1

achabra14 opened this issue Oct 8, 2024 · 2 comments

Comments

@achabra14
Copy link

achabra14 commented Oct 8, 2024

For the hand evaluator, it's not documented and not really clear which card is represented by which integer.
Is it 2c -> 0, 3c -> 1 , 4c -> 2, ... Ks -> 50, As -> 51 ?

@achabra14
Copy link
Author

Ok I think I figured it out it's 2c -> 0, 2h -> 1, 2s -> 2 , ... Ah -> 50, As -> 51. Would be nice if you threw that into the documentation. Anyway nice job looks great so far!

@oscar6echo
Copy link
Owner

The mapping card to int is return by the config endpoint.
Extract from README Command section:

curl http://localhost:3000/config
# {"face":["2","3","4","5","6","7","8","9","T","J","Q","K","A"],"suit":["C","D","H","S"],"card_no":{"2C":0,"QS":43,"5S":15,"9C":28,"8D":25,"5D":13,"JD":37,"QC":40,"2D":1,"7C":20,"TC":32,"6C":16,"9D":29,"3C":4,"5H":14,"4D":9,"7S":23,"8C":24,"QD":41,"KC":44,"KH":46,"6H":18,"3S":7,"QH":42,"4S":11,"TS":35,"KD":45,"AD":49,"AH":50,"TH":34,"2H":2,"7D":21,"6D":17,"9H":30,"AS":51,"TD":33,"5C":12,"8S":27,"9S":31,"4H":10,"7H":22,"3H":6,"JC":36,"JS":39,"6S":19,"AC":48,"JH":38,"8H":26,"4C":8,"2S":3,"KS":47,"3D":5},"card_sy":{"18":"6H","50":"AH","13":"5D","1":"2D","36":"JC","15":"5S","23":"7S","35":"TS","24":"8C","17":"6D","32":"TC","38":"JH","30":"9H","26":"8H","37":"JD","10":"4H","29":"9D","28":"9C","12":"5C","46":"KH","5":"3D","2":"2H","43":"QS","19":"6S","21":"7D","22":"7H","27":"8S","42":"QH","47":"KS","0":"2C","8":"4C","14":"5H","16":"6C","33":"TD","34":"TH","3":"2S","4":"3C","39":"JS","41":"QD","44":"KC","11":"4S","25":"8D","7":"3S","40":"QC","6":"3H","9":"4D","31":"9S","45":"KD","48":"AC","20":"7C","49":"AD","51":"AS"}}%

And the Config struct code has the mapping convention in comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants