+ 7
How do you run a function inside an if statement?Would you write it like this: if(xTurn){ xMove(); }
2 Answers
+ 8
It depends on what Xturn is, but yeah. xTurn has to be something that can be expressed as a Boolean value. If true, than the function xMove would be called. Be careful, though. X isn't an object. You are calling xMove();, not x.Move();
+ 4
xMove has to be true or false
if (xTurn == true){
xMove();
}