基本信息
源码名称:Python三子棋游戏
源码大小:2.31KB
文件格式:.py
开发语言:Python
更新时间:2021-09-09
   友情提示:(无需注册或充值,赞助后即可获取资源下载链接)

     嘿,亲!知识可是无价之宝呢,但咱这精心整理的资料也耗费了不少心血呀。小小地破费一下,绝对物超所值哦!如有下载和支付问题,请联系我们QQ(微信同号):813200300

本次赞助数额为: 2 元 
   源码介绍
由python编写的三子棋游戏

#main program begins here
while True:
    i=0
    while (i<3):
        print(mark[board[i * 3]], mark[board[i * 3 1]], mark[board[i * 3 2]])
        i =1

    if checkcircle():
        print("Player1 wins!")
        break
    elif checkcross():
        print("Player2 wins!")
        break
    elif checkfull():
        print("It's a draw.")
        break


    while True:
        while True:
            y = int(input("line:"))
            if 1 <= y <= 3:
                break
            else:
                print("The input should between 1 and 3")
        while True:
            x = int(input("column:"))
            if 1 <= x <= 3:
                break
            else:
                print("The input should between 1 and 3")
        if board[y*3-4 x] == 1 or board[y*3-4 x] == 2:
            print("No place at this position.")
        else:
            break
    if j > 1:
        j = 0
    if j == 0:
        circlebd(y, x)
    elif j == 1:
        crossbd(y, x)
    j =1