Can somebody write me some pseudo-code for a 2D array Java Nim Project?

Can somebody write me some pseudo-code for a 2D array Java Nim Project?

“Project: Create the true game of Nim using a 2D array. The array should be 3×7. Initialize the appropriate cells to house stones and let users play the actual game. Here are the rules: On a players turn, they choose a row and can take as a many stones as they want, as long as the stones are adjacent(I cannot take the first and last stones), they cannot take multiple stones from different rows, and the last person to take a stone is the loser.” Can somebody give me steps in pseudocode or maybe even some “excerpts” from a program they have? Thanks.

Tags: , , , , , ,

Under Forum

2 Comments for Can somebody write me some pseudo-code for a 2D array Java Nim Project?

  • 1. Dan  |  February 15th, 2011 at 9:33 am

    You know you can get expelled from school for cheating??

  • 2. The pop top guy  |  February 15th, 2011 at 9:43 am

    if you want an n*m array,with indices that start from zero, allocate a vector with n*m elements. e.g. for a 3 by 7 array, that would be 21 elements numbered 0…20. To access element (i, j) in that array (e.g. in a getter or setter routine, you could first check to make sure i & j are each within bounds. That is i>=0 and i=0 and j

Leave a Comment for Can somebody write me some pseudo-code for a 2D array Java Nim Project?

You must be logged in to post a comment.

Trackback this post  |  Subscribe to the comments via RSS Feed


Categories