Ejemplo n.º 1
0
 def a1(self, event):
     if self.counter < 10 and not self.a1flag:
         self.a.set(utils.turn_finder(self.counter))
         self.counter += 1
         self.a1flag = True
     self.flag = utils.diagnols(self.a.get(), self.b.get(), self.c.get(),
                                self.d.get(), self.e.get(), self.f.get(),
                                self.g.get(), self.h.get(), self.i.get())
     if self.counter == 9 and not self.flag:
         self.draw_game()
     elif self.flag:
         self.end_game()
Ejemplo n.º 2
0
flag = False
a = '1'
b = '2'
c = '3'
d = '4'
e = '5'
f = '6'
g = '7'
h = '8'
i = '9'
symbol = ''
counter = 0
while not flag:
    counter += 1
    symbol = utils.turn_finder(counter)
    utils.print_table(a, b, c, d, e, f, g, h, i)
    cmd = input('>>>')
    if cmd == '1':
        a = symbol
    elif cmd == '2':
        b = symbol
    elif cmd == '3':
        c = symbol
    elif cmd == '4':
        d = symbol
    elif cmd == '5':
        e = symbol
    elif cmd == '6':
        f = symbol
    elif cmd == '7':