Upon pre-submission review, I realize this question might be incredibly silly.
if (this.gameOver(gpos) > 0) {
//do stuff
return this.gameOver(gpos);
}
Compare
if (this.gameOver()) {
//do stuff
return this.gameOver(gpos);
}
I was in doubt as to whether or not the first example would call this.gameOver(gpos); twice or just once at the beginning. Obviously, it does call it twice (right?), but is there any way (without an intermediate variable) to have it check the condition AND be in the return statement at the same time?