1 min readSep 7, 2017
UNIT 1 XO Game วิธีเล่นให้ชนะ เมื่อแปลงเป็น Code
if (c1 == c2 == c3 == “O”) { Debug.Log(“O win”); }
if (c4 == c5 == c6 == “O”) { Debug.Log(“O win”); }
if (c7 == c8 == c9 == “O”) { Debug.Log(“O win”); }
if (c1 == c4 == c7 == “O”) { Debug.Log(“O win”); }
if (c2 == c5 == c8 == “O”) { Debug.Log(“O win”); }
if (c3 == c6 == c9 == “O”) { Debug.Log(“O win”); }
if (c1 == c5 == c9 == “O”) { Debug.Log(“O win”); }
if (c3 == c5 == c7 == “O”) { Debug.Log(“O win”); }