Warning: preg_match(): Compilation failed: group name must start with a non-digit at offset 8 in /home/e5m7uo8vro0d/public_html/mediawiki/includes/MagicWord.php on line 860

Warning: preg_match(): Compilation failed: group name must start with a non-digit at offset 8 in /home/e5m7uo8vro0d/public_html/mediawiki/includes/MagicWord.php on line 860

Warning: preg_match_all(): Compilation failed: group name must start with a non-digit at offset 4 in /home/e5m7uo8vro0d/public_html/mediawiki/includes/MagicWord.php on line 834

Warning: Invalid argument supplied for foreach() in /home/e5m7uo8vro0d/public_html/mediawiki/includes/MagicWord.php on line 835

Warning: preg_replace(): Compilation failed: group name must start with a non-digit at offset 4 in /home/e5m7uo8vro0d/public_html/mediawiki/includes/MagicWord.php on line 839

Warning: preg_match_all(): Compilation failed: group name must start with a non-digit at offset 4 in /home/e5m7uo8vro0d/public_html/mediawiki/includes/MagicWord.php on line 834

Warning: Invalid argument supplied for foreach() in /home/e5m7uo8vro0d/public_html/mediawiki/includes/MagicWord.php on line 835

Warning: preg_replace(): Compilation failed: group name must start with a non-digit at offset 4 in /home/e5m7uo8vro0d/public_html/mediawiki/includes/MagicWord.php on line 839

Warning: preg_match_all(): Compilation failed: group name must start with a non-digit at offset 4 in /home/e5m7uo8vro0d/public_html/mediawiki/includes/MagicWord.php on line 834

Warning: Invalid argument supplied for foreach() in /home/e5m7uo8vro0d/public_html/mediawiki/includes/MagicWord.php on line 835

Warning: preg_replace(): Compilation failed: group name must start with a non-digit at offset 4 in /home/e5m7uo8vro0d/public_html/mediawiki/includes/MagicWord.php on line 839

Warning: preg_match_all(): Compilation failed: group name must start with a non-digit at offset 4 in /home/e5m7uo8vro0d/public_html/mediawiki/includes/MagicWord.php on line 834

Warning: Invalid argument supplied for foreach() in /home/e5m7uo8vro0d/public_html/mediawiki/includes/MagicWord.php on line 835

Warning: preg_replace(): Compilation failed: group name must start with a non-digit at offset 4 in /home/e5m7uo8vro0d/public_html/mediawiki/includes/MagicWord.php on line 839

Warning: preg_match(): Compilation failed: group name must start with a non-digit at offset 8 in /home/e5m7uo8vro0d/public_html/mediawiki/includes/MagicWord.php on line 860

Warning: preg_match(): Compilation failed: group name must start with a non-digit at offset 8 in /home/e5m7uo8vro0d/public_html/mediawiki/includes/MagicWord.php on line 860

Warning: preg_match(): Compilation failed: group name must start with a non-digit at offset 8 in /home/e5m7uo8vro0d/public_html/mediawiki/includes/MagicWord.php on line 860

Warning: preg_match(): Compilation failed: group name must start with a non-digit at offset 8 in /home/e5m7uo8vro0d/public_html/mediawiki/includes/MagicWord.php on line 860

Warning: preg_match(): Compilation failed: group name must start with a non-digit at offset 8 in /home/e5m7uo8vro0d/public_html/mediawiki/includes/MagicWord.php on line 860
Nim Project - Huben's Wiki

Nim Project

From Huben's Wiki
Jump to: navigation, search
(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....

Revision as of 14:44, 11 May 2012

Personal tools
translate