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
(Graphical Nim)
Line 2: Line 2:
 
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.
+
You may get any help you want, as long as you DOCUMENT it.  Put the provenance of the help in your code as a comment at the top.  For example:
 +
<pre>
 +
// Fred helped me with the toString() method.
 +
// I found code for a nim sum online at xxxx and adapted it for my program.
 +
</pre>
 +
This will prevent problems of plagiarism.  Please don't give each other code: write your own when you understand what is involved.  Ask me if you are unsure or stuck: nobody needs to suffer for being stuck.
 +
 
 +
To get a grade, you must complete the bulleted items following it.  Please make sure I give you a D before you go on to do more and get a higher grade.  I should grade your program at least twice as you progress.
  
 
===D:===
 
===D:===
Line 18: Line 25:
 
* Use a Scanner in a loop to input a row LETTER (either upper or lower case) and number of stones to remove.  (Page 26 of text.)
 
* Use a Scanner in a loop to input a row LETTER (either upper or lower case) and number of stones to remove.  (Page 26 of text.)
 
* The loop should only exit when a valid move has been selected.
 
* The loop should only exit when a valid move has been selected.
 +
* When a move is invalid, the loop should tell you why it is invalid.
 +
* When a move is valid, the loop should tell you "Removing x from pile Y."
 
* Use Scanner.nextLine() instead of nextInt(): it is more robust.
 
* Use Scanner.nextLine() instead of nextInt(): it is more robust.
 +
* the easy way is to just look at the first character, if it exists, for row or stones
 +
* it would be nicer if we could type b2 at one input to take two from row B.
 
* tests for valid row should reject:
 
* tests for valid row should reject:
 
** a simple return without typing anything
 
** a simple return without typing anything
Line 30: Line 41:
 
** more stones than in the row
 
** more stones than in the row
 
** anything not a number
 
** anything not a number
* the easy way is to just look at the first character, if it exists, for row or stones
+
 
* it would be nicer if we could type b2 at one input to take two from row B.
+
  
 
===C+===
 
===C+===

Revision as of 21:52, 24 May 2013

Personal tools
translate