Phnom_Penh said:If(replay.!equals("Y") && replay.!equals("N"))
I think you also do need the .equals part and the == doesn't work with Strings.
Phnom_Penh said:If(replay.!equals("Y") && replay.!equals("N"))
Not that I've actually written any Java code in the last 5 years, but I think you might want to check the correct syntax for an "if" statement.jcb33 said:Im currently trying to scan grid 2 for any number over 0, and each time it finds a number over 0 to add one to the "Uncovered" score but Im not doing very well
This:for(int x=0;x<7;x++){
for(int y=0;y<8;y++){
if(grid2[x][y]>0);
uncovered++;
}
}
In C: int i, b[56]; for(i=0;i<56;i++)printf("%c%s"," " *£"[b<3 ? b : 0],i%8==0?"\n":"");vonhelmet said:You're making the array too complicated. There's no need to make one 56 length array. Can you imagine the work in parsing that to generate the output?
Who'd say no to an offer like thatcrystaline said:Please can I hire one of you as my java buddy![]()
Welshy said:Who'd say no to an offer like that![]()
tags? Use theCode:tags and it'll keep your indentation so code is easier to read.
That's what I did :\.Rossmac said:I think you also do need the .equals part and the == doesn't work with Strings.
Phnom_Penh said:I *think* you can still compare strings using ==, just not =.
Added ; But now I cant launch the program at allRossmac said:your call to method play() must be followed by a semi-colon to make it a legal statement.
ie.
play();
Rossmac said:Nice ninja edit Una![]()
jcb33 said:Added ; But now I cant launch the program at all
That could be usefull save the fact that i want the game to replay, not terminate if the user selects replayUna said:Best way to do is is to have a game loop.
while (!gameOver)
{
// Do some stuff
}
Then when its game over you just set gameOver to true and your program terminates.
and obviously your missing a semicolon on play();
![]()
It does not bring up an error just sits there staring at me, not loadingUna said:![]()
Whats the error?
jcb33 said:That could be usefull save the fact that i want the game to replay, not terminate if the user selects replay
Una said:Yeah then you have a switch/if statement somelogic inside your loop.
Different methods to display different bits of text....
One method that restarts the game etc...
When you want to replay you just call your play method again.