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

Method long2board

src/main/java/icybee/solver/Card.java:118–134  ·  view source on GitHub ↗
(long board_long)

Source from the content-addressed store, hash-verified

116 }
117
118 public static int[] long2board(long board_long) {
119 List<Integer> board = new ArrayList<>();
120 for(int i = 0;i < 52;i ++){
121 if((board_long & 1) == 1){
122 board.add(i);
123 }
124 board_long = board_long >> 1;
125 }
126 if (board.size() < 1 || board.size() > 7){
127 throw new RuntimeException(String.format("board length not correct, board length %d, boards %s",board.size(),board.toString()));
128 }
129 int[] retval = new int[board.size()];
130 for(int i = 0;i < board.size();i ++){
131 retval[i] = board.get(i);
132 }
133 return retval;
134 }
135
136 public static Card[] long2boardCards(long board_long) throws BoardNotFoundException{
137 int[] board = long2board(board_long);

Callers 6

long2boardCardsMethod · 0.95
getRiverCombosMethod · 0.95
get_rankMethod · 0.95
chanceUtilityMethod · 0.95
chanceUtilityMethod · 0.95
chanceBestReponseMethod · 0.95

Calls 1

toStringMethod · 0.45

Tested by

no test coverage detected