MCPcopy Create free account
hub / github.com/bupticybee/TexasHoldemSolverJava / strCard2int

Method strCard2int

src/main/java/icybee/solver/Card.java:32–39  ·  view source on GitHub ↗
(String card)

Source from the content-addressed store, hash-verified

30 }
31
32 public static int strCard2int(String card){
33 char rank = card.charAt(0);
34 char suit = card.charAt(1);
35 if(card.length() != 2){
36 throw new CardsNotFoundException(String.format("card %s not found",card));
37 }
38 return (rankToInt(rank) - 2) * 4 + suitToInt(suit);
39 }
40
41 public static String intCard2Str(int card)
42 {

Callers 15

cfrSolverTestMethod · 0.95
cfrTurnSolverTestMethod · 0.95
cfrFlopSolverTestMethod · 0.95
cfrFlopSolverPcsTestMethod · 0.95
cfrSolverTestMethod · 0.95
cfrTurnSolverTestMethod · 0.95
cfrFlopSolverTestMethod · 0.95
cfrFlopSolverPcsTestMethod · 0.95

Calls 2

rankToIntMethod · 0.95
suitToIntMethod · 0.95

Tested by 12

cfrSolverTestMethod · 0.76
cfrTurnSolverTestMethod · 0.76
cfrFlopSolverTestMethod · 0.76
cfrFlopSolverPcsTestMethod · 0.76
cfrSolverTestMethod · 0.76
cfrTurnSolverTestMethod · 0.76
cfrFlopSolverTestMethod · 0.76
cfrFlopSolverPcsTestMethod · 0.76