<reponame>light-technology/holite<gh_stars>0
# -*- coding: utf-8 -*-

class tic_tac_toe():
    def board():
        board = {'1': None, '2': None, '3': None, '4': None, '5': None, '6': None, '7': None, '8': None, '9': None}
        return board
    def tic_tac_toe(bool):
        if bool == True:
            return "⭕"
        elif bool == False:
            return "❌"
        elif bool == None:
            return "☐"
    def print_board(board):
        return tic_tac_toe(board['1'])+tic_tac_toe(board['2'])+tic_tac_toe(board['3'])+"\n"+tic_tac_toe(board['4'])+tic_tac_toe(board['5'])+tic_tac_toe(board['6'])+"\n"+tic_tac_toe(board['7'])+tic_tac_toe(board['8'])+tic_tac_toe(board['9'])
    def check_ans(board):
        for x in board:
            if board[x] == None:
                break
        else:
            return '平手'
        if board['1'] == board['2'] == board['3'] != None or board['4'] == board['5'] == board['6'] != None or board['7'] == board['8'] == board['9'] != None or board['1'] == board['4'] == board['7'] != None or board['2'] == board['5'] == board['8'] != None or board['3'] == board['6'] == board['9'] != None or board['1'] == board['5'] == board['9'] != None or board['3'] == board['5'] == board['7'] != None:
            return '你贏了'
        else:
            return False
# -*- coding: utf-8 -*-

class tic_tac_toe():
    def board():
        board = {'1': None, '2': None, '3': None, '4': None, '5': None, '6': None, '7': None, '8': None, '9': None}
        return board
    def tic_tac_toe(bool):
        if bool == True:
            return "⭕"
        elif bool == False:
            return "❌"
        elif bool == None:
            return "☐"
    def print_board(board):
        return tic_tac_toe(board['1'])+tic_tac_toe(board['2'])+tic_tac_toe(board['3'])+"\n"+tic_tac_toe(board['4'])+tic_tac_toe(board['5'])+tic_tac_toe(board['6'])+"\n"+tic_tac_toe(board['7'])+tic_tac_toe(board['8'])+tic_tac_toe(board['9'])
    def check_ans(board):
        for x in board:
            if board[x] == None:
                break
        else:
            return '平手'
        if board['1'] == board['2'] == board['3'] != None or board['4'] == board['5'] == board['6'] != None or board['7'] == board['8'] == board['9'] != None or board['1'] == board['4'] == board['7'] != None or board['2'] == board['5'] == board['8'] != None or board['3'] == board['6'] == board['9'] != None or board['1'] == board['5'] == board['9'] != None or board['3'] == board['5'] == board['7'] != None:
            return '你贏了'
        else:
            return False
# -*- coding: utf-8 -*-