Skip to content

Instantly share code, notes, and snippets.

@jarodl
Created January 31, 2011 20:50
Show Gist options
  • Save jarodl/804782 to your computer and use it in GitHub Desktop.
Save jarodl/804782 to your computer and use it in GitHub Desktop.
// Function: getCopyAndMakeNextMove
//
// Desc: Creates a copy of the current object then performs the makeNextMove
// function on it, advancing it to its next state.
//
// Pre: None.
//
// Post: A new object is returned and the next move is taken from the stack.
Board getCopyAndMakeNextMove()
{
Board nextState = Board(*this);
nextState.makeNextMove();
moves.pop();
return nextState;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment