(long board_long)
| 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); |
no test coverage detected