Board createBoard(Board board, BoardPieces pieces[boardLimit] ) { int i; board = (Board)malloc(sizeof(struct board)); board->id=0; board->permutIndex= permutationIndex(pieces); for(i=0;i<boardLimit;i++) { board->squares[i]=pieces[i]; } if(!checkRepeatedBoardPieces(board)) return board; return NULL; }
void Main() { print(permutationIndex(createVector({ 1, 4, 2, 2 }))); }
int boardPermutIndex(Board b) { return permutationIndex(b->squares); }