什么是最好的方式来看(在2人中)赢得的Tic Tac Toe游戏?现在我正在使用类似于以下内容的东西:
if (btnOne.Text == "X" && btnTwo.Text == "X" && btnThree.Text == "X")
{
MessageBox.Show("X has won!", "X won!");
return;
}
else
// I'm not going to write the rest but it's really just a bunch
// if statements.
Run Code Online (Sandbox Code Playgroud)
那么如何摆脱多重if?
cha*_*rit 11
一些东西:
rowSum == 3 || columnSum == 3 || diagnolSum == 3
Run Code Online (Sandbox Code Playgroud)
..?