Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 changing spots on a 2-d array (ready to program java 1.7.1)
Index -> Programming, Java -> Java Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Jmack




PostPosted: 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



Battle_of_the_ships.java
 Description:
game file

Download
 Filename:  Battle_of_the_ships.java
 Filesize:  9.88 KB
 Downloaded:  225 Time(s)

Sponsor
Sponsor
Sponsor
sponsor
Display posts from previous:   
   Index -> Programming, Java -> Java Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 1 Posts ]
Jump to:   


Style:  
Search: