
-----------------------------------
venom
Thu Oct 26, 2006 8:22 am

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

-----------------------------------
wtd
Thu Oct 26, 2006 8:42 am


-----------------------------------
Theoretically yes.  However, conditional statements exist to make your life easier.

-----------------------------------
raptors892004
Thu Oct 26, 2006 2:24 pm


-----------------------------------
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
Thu Oct 26, 2006 2:37 pm


-----------------------------------
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).
