Original Post
I'm just writing some functions that require alot of logical operations. Some of the code has started to take up a huge amount of columns and starting a new line looks just as bad. So, I'm wondering how you guys would format the following code:
if ((pm.x1 == pm.x2) && ((pm.y1 + iMove) == pm.y2)) {
isValid = true;
} else if ((pm.x1 == pm.x2) && ((pm.y1 + (2 * iMove)) == pm.y2) && (pm.y1 == 1)) {
isValid = true;
} else if (((pm.x1 == pm.x2 + 1)||(pm.x1 == pm.x2 - 1)) && ((pm.y1 + iMove) == pm.y2)
&& (ppbuBoard[pm.x2][pm.y2].iPlayer == iEnemy)) {
isValid = true;
} else {
isValid = false;
}