//for this game to work if d is even the values of the third
// and second last arrays must be switched
if(even==true)
{
int temp = board[d-1][d-2];
board [d-1][d-2] = board[d-1][d-3];
board [d-1][d-3] = temp;

}
}

EDIT: Here is the pastebin for the full code http://pastebin.com/yS8DDEqZ
Note Cs50 is a custom libary that was implemented by the class im taking, it
defines a string a helper functions which get user input GetInt() etc.