Results 1 to 2 of 2
Thread: while loop help
- 03-02-2009, 06:44 PM #1
Member
- Join Date
- Feb 2009
- Posts
- 16
- Rep Power
- 0
while loop help
hi , i created the game battleship but im supposed to end it after the 17th hit 5 hits for ship A 4 for ship B 3 for ship P 3 for ship D and 2 for ship S. What i did was to create a while loop
while i< 17
//my board is here
if (gameBoard.guessPosition(row, column)== true) {
i++;
}
but i realized that if i do that then if the user hits the same ship 17 times the game ends too. I dont know how to make it end after all of the ships have been hit. Any help will be appreciated. Thanks
- 03-02-2009, 06:49 PM #2
Senior Member
- Join Date
- Jun 2008
- Posts
- 2,366
- Rep Power
- 7
Similar Threads
-
Help w/ loop
By iWonder in forum New To JavaReplies: 17Last Post: 11-20-2008, 12:39 AM -
While loop
By sjhentges in forum New To JavaReplies: 11Last Post: 11-04-2008, 04:26 PM -
Need help with While Loop
By mrdestroy in forum New To JavaReplies: 14Last Post: 10-20-2008, 02:29 PM -
do...while loop
By eva in forum New To JavaReplies: 16Last Post: 01-31-2008, 06:44 AM -
can you help me with this for loop?
By java_fun2007 in forum New To JavaReplies: 6Last Post: 12-22-2007, 10:20 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks