コード例 #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()
コード例 #2
0
ファイル: Brit.py プロジェクト: khizarasim/kacs_go_max
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':
        g = symbol
    elif cmd == '8':
        h = symbol
    elif cmd == '9':
        i = symbol
    flag = utils.diagnols(a, b, c, d, e, f, g, h, i)
    if counter == 9:
        break
utils.print_table(a, b, c, d, e, f, g, h, i)
utils.decider(flag)
input('press key to end the program')