We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1d60192 commit abb03baCopy full SHA for abb03ba
kattis/TicTacToe2/tictactoe2.vn.py
@@ -52,9 +52,16 @@
52
# Anything else is impossible
53
else:
54
print("no")
55
-
56
- # wins[X] -> A, wins[O] -> B, grid.count(X)-grid.count(O)==i -> Ci
+
+ # A = wins[X]
57
+ # B = wins[O]
58
+ # C0 = grid.count(X) - grid.count(O) == 0
59
+ # C1 = grid.count(X) - grid.count(O) == 1
60
+ # (original form, then simplified with sympy.simplify_logic)
61
62
+ # yes = (C0 | C1) & (C0 | ~B) & (C1 | ~A) & (~A | ~B)
63
+ # valid turn count (0 or 1)
64
+ # winner must match turn count (2 expressions)
65
+ # X and O cannot both win
66
- # yes = (A.¬B.C1)+(¬A.B.C0)+(¬A.¬B.(C0+C1))
- # Fun fact: We could try to simplify this.
- # We'll probably find a simpler equation for no.
67
+ # Well, that was fun.
0 commit comments