Tic Tac Toe game

10 次查看(过去 30 天)
Hi, I was wondering why my tic tac toe code is not displaying 'you lose' when the computer wins? Also, can you help with how i would write code for when its a draw? Also, how do i make it so that the computer does not pick the same points multiple times?

采纳的回答

Walter Roberson
Walter Roberson 2021-4-19
if A&&B==0
does not mean if A is 0 and B is 0, it means
if A is true
if B==0
do body
end
end
MATLAB does not have any distributive tests like you thought. A&&B==0 is ((A)&&(B==0)) which is ((A~=0)&&(B==0))

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Strategy & Logic 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by