18 points total
getNumbers()
method correctly takes a String
value and an int
value as parameters. (The String
value is meant to be the current player's name and the int
value is meant to be the current number of coins in the pile.)getNumbers()
method correctly returns a value of the type int
.int
value returned by the getNumbers()
method is a proper number of coins chosen by the user.getNumbers()
method correctly loops if the user does not respond with a value of 1 or 2.getNumbers()
method correctly loops if the user responds with a value greater than the current number of coins in the pile. nextTurn()
method correctly takes a String
value and an int
value as parameters. (The String
value is meant to be the current player's name and the int
value is meant to be the current number of coins in the pile.)nextTurn()
method correctly returns a value of the type int
.int
value returned by the nextTurn()
method is the current number of coins left in the pile.nextTurn()
method correctly informs the user that it's his/her turn (using the String
parameter of the method).nextTurn()
method properly makes use of the getNumber()
method to get the user to select a valid number of coins.nextTurn()
method correctly informs the user that he/she has won.playNim()
method correctly tells the players some description of how to play Nim (this could be brief). playNim()
method correctly asks for and takes in a String
for each of 2 players to represent their names. playNim()
method correctly asks the players for the number of coins they would like to start the Nim pile with. playNim()
method properly loops, letting the players take turns taking coins from the pile (making use of the nextTurn()
method), until the pile is empty. (Note: This means the second player should not be allowed another turn if the first player has already won the game.) playNim()
method) as often as the user responds with the string "yes".