Author |
Message |
venom
|
Posted: Thu Oct 26, 2006 8:22 am Post subject: Battleship question |
|
|
currently im making a battle ship program and im wondering if your able to bypass the entire "if" statement of code
i havent personally reached that point but im close so im just wondering if that is possable
if not well ...c**p |
|
|
|
|
|
Sponsor Sponsor
|
|
|
wtd
|
Posted: Thu Oct 26, 2006 8:42 am Post subject: (No subject) |
|
|
Theoretically yes. However, conditional statements exist to make your life easier. |
|
|
|
|
|
raptors892004
|
Posted: Thu Oct 26, 2006 2:24 pm Post subject: (No subject) |
|
|
You could add another if statement so that if the first if statement is true it would go into the second if statement. If the first one is false however, the program could do something else.
You could also have another variable (usually boolean works fine) which can be set to true or false in other methods depending on whether you want the program to go into that if statement. |
|
|
|
|
|
raptors892004
|
Posted: Thu Oct 26, 2006 2:37 pm Post subject: (No subject) |
|
|
I would've edited my previous message but there is no edit function
For the boolean variable, you have to check whether its true or false in the if statement condition depending on what you want it to do. (e.g.: boolean var = false -> don't go into if statement). |
|
|
|
|
|
|