Nim Project
From Huben's Wiki
(Created page with "== Text based Nim game == This project will use several things we've encountered in other assignments in the past. * [http://en.wikipedia.org/wiki/Nim Read the wikipedia article ...") |
(→Text based Nim game) |
||
Line 1: | Line 1: | ||
== Text based Nim game == | == Text based Nim game == | ||
This project will use several things we've encountered in other assignments in the past. | This project will use several things we've encountered in other assignments in the past. | ||
+ | |||
+ | To get a grade, you must complete the bulleted items following it. | ||
+ | |||
+ | ===D:=== | ||
* [http://en.wikipedia.org/wiki/Nim Read the wikipedia article on Nim], and find a version to play. | * [http://en.wikipedia.org/wiki/Nim Read the wikipedia article on Nim], and find a version to play. | ||
* Create a class Nim, with a main(). | * Create a class Nim, with a main(). | ||
Line 11: | Line 15: | ||
</pre> | </pre> | ||
* The main() should create an instance of Nim and display the stones using the toString() method without directly calling toString(). | * The main() should create an instance of Nim and display the stones using the toString() method without directly calling toString(). | ||
+ | ===C-:=== | ||
* Use a Scanner in a loop to input a row letter and number of stones to remove. | * Use a Scanner in a loop to input a row letter and number of stones to remove. | ||
* The loop should only exit when a valid move has been selected.test for valid moves | * The loop should only exit when a valid move has been selected.test for valid moves | ||
Line 19: | Line 24: | ||
** ignore case | ** ignore case | ||
** ignore anything extra | ** ignore anything extra | ||
+ | ===C+=== | ||
* Create and use a method to make the valid move. | * Create and use a method to make the valid move. | ||
+ | ===B-:=== | ||
* Create and use a method to detect a win. | * Create and use a method to detect a win. | ||
+ | ===B:=== | ||
* Get names of players, and alternate players. | * Get names of players, and alternate players. | ||
+ | ===A-:=== | ||
* Allow a computer player that makes random moves. | * Allow a computer player that makes random moves. | ||
+ | ===A:=== | ||
* Create a computer player that plays a perfect game. | * Create a computer player that plays a perfect game. | ||
+ | ===A+:=== | ||
* Allow users to select misere or regular version. | * Allow users to select misere or regular version. | ||
+ | |||
== Graphical Nim == | == Graphical Nim == | ||
* to be formatted soon.... | * to be formatted soon.... |