Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Create Sorted Move List //
- MoveMaxHeap xheap(p->numMoves());
- for (int i = 0; i < p->numMoves(); i++) {
- p->getRowCol(i, r, c);
- MoveNode* node = new MoveNode(r, c, OMirza::POINT_BOARD[r][c]);
- xheap.Insert(node);
- }
- // Take top x amount, discard the rest
- MoveNode* TopMoves[TOP_NUMBER_OF_MOVES] = {0};
- int heapSize = xheap.Size();
- heapSize = (heapSize > TOP_NUMBER_OF_MOVES) ? TOP_NUMBER_OF_MOVES : heapSize;
- for (int i = 0; i < heapSize; i++) {
- TopMoves[i] = xheap.Pop();
- }
- // END: Create Sorted Move List
Advertisement
Add Comment
Please, Sign In to add comment