Computer Science Canada changing spots on a 2-d array (ready to program java 1.7.1) |
Author: | Jmack [ Thu Jan 14, 2016 9:41 am ] |
Post subject: | changing spots on a 2-d array (ready to program java 1.7.1) |
I'm creating a RTP java version of battleship. everything in the game is finished except for the last thing that is needed which is a way to update the player and AI board after a person shoots at a spot. basically the board is made up of 0's as just plain water an di want them to be able to change to either *=shot but no hit or X = shot and hit. this is the code for the 2d array for (int i = 0 ; i < field.length ; i++) { int[] sub = field [i]; for (int x = 0 ; x < sub.length ; x++) { c.print (sub [x] + " "); } c.println (); } and her is version of the game so far |