逻辑上,根据德摩根定律,
result != 2 || result != -2
是相同的
!(result == 2 && result == -2)
这永远是一个真实的表达。
条件可能应该是
!(result == complete || result == gameOver)
当应用与上述相同的法律时,
result != complete && result != gameOver
(使用常量-尽管我更喜欢像GAMEOVER这样的大写符号-代替魔术数字也使代码更易于阅读。)

逻辑上,根据德摩根定律,
result != 2 || result != -2
是相同的
!(result == 2 && result == -2)
这永远是一个真实的表达。
条件可能应该是
!(result == complete || result == gameOver)
当应用与上述相同的法律时,
result != complete && result != gameOver
(使用常量-尽管我更喜欢像GAMEOVER这样的大写符号-代替魔术数字也使代码更易于阅读。)