Tic Tac Toe game
8 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Dylan Leadbetter
el 19 de Abr. de 2021
Editada: Dylan Leadbetter
el 19 de Abr. de 2021
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?
0 comentarios
Respuesta aceptada
Walter Roberson
el 19 de Abr. de 2021
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 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Strategy & Logic en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!