猫史档案馆


KIHIO

KIHIO

Lv.1

回到社区

获赞:148收藏:32浏览:5581作品收藏:75

签名:

回复帖子评论
上一页2 页 / 共 6下一页

发现kitten4画板BUG!!! 中回复

编码错误

2021-07-11T15:17:50 点赞:0

【教程贴】教你如何把作品质量提高 中回复

我不能做出有声作品,因为电脑无声,所以声音不能调试,敬请谅解

2021-07-16T18:16:15 点赞:0

【kitten4.0反馈】遇到问题不要怕,技术喵来帮你忙! 中回复

我玩一个K4有云变量的作品,结果退出之后,回去一看,私有云变量的数据秒变乱码?偶尔出BUG,但出BUG之后刷新也没用。

2021-07-17T17:04:03 点赞:0

【kitten4.0反馈】遇到问题不要怕,技术喵来帮你忙! 中回复

上次保存是在今天,但编程猫上显示的时间为昨天

2021-07-23T08:17:35 点赞:0

【kitten4.0反馈】遇到问题不要怕,技术喵来帮你忙! 中回复

偶尔出BUG:保存后 再打开 个别代码注释就稀奇古怪地消失了 我没删注释

我不能截图 无链接

2021-07-23T16:43:21 点赞:0

【数学题】一个四位数顺序颠倒比原数大8802,求原数 中回复

首先列方程 1000a+100b+10c+d+8802=1000d+100c+10b+a

两式相减,得 999d+90c-90b-999a=8802

因为八九七十二,得 d=9,a=1

也就是 7992+90c-90b=8802

因此 c-b=9

也就是 c=9,b=0

1099(解析简化)

2021-07-24T11:31:26 点赞:0

哎,现在的人数学都学不好 中回复

2折?

2021-07-24T12:05:56 点赞:0

掌心精品教程-关于图层那些你不知道的事 中回复

2021年7月,未来4.8.3版本

2021-07-25T09:42:04 点赞:0

【教程】如何将自己在k3上的作品在Mac OS上制作成独立应用程序 中回复

WIN 10用户略过

2021-07-26T15:49:29 点赞:2

【kitten4.0反馈】遇到问题不要怕,技术喵来帮你忙! 中回复

BUG(100%出现):每次当注释超过屏幕时,屏幕就会向左移,慢慢地左边的东西看不见了,右边的全是空格,搞得我只好保存了再重新加载!!!求修复。

2021-07-26T20:13:27 点赞:0

【惊奇发现】KITTEN4.8.3函数递归次数的上限! 中回复

函数代码:

 

定义函数 递归(参数){

设置变量 (名称自定义) 为 参数

如果 (自定义名称变量>0){

递归 (自定义名称变量)-1}}

2021-07-26T21:13:22 点赞:0

如何做排行榜 中回复

云变量积木盒里有排行榜积木可以用在私有云变量上

2021-07-26T21:40:24 点赞:0

发现了一个奇(超)奇(级)怪(棒)怪(棒)的 bug ! 中回复

已经修复了吧AWA

2021-07-26T21:44:17 点赞:0

工作室3.5版,正式出炉! 中回复

工7

2021-07-29T14:57:15 点赞:0

工作室3.5版,正式出炉! 中回复

工6工5工4工3.5工3工xpxp工mo

2021-07-29T14:58:29 点赞:0

世界未解之谜3 中回复

控制积木盒

2021-07-29T21:01:43 点赞:0

kitten4云变量 中回复

128个字符(相当于128个英文字母、数字和标点符号,喵个中文汉字和标点符号)

2021-07-29T21:08:40 点赞:0

福利!c++五子棋代码!(原创) 中回复

我来分享一个PYTHON的(BUG已修复)

def jd(x):
    try:
        x = float(x)
    except ValueError:
        return 0
    if x-(float(int(x))) > 0:
        return 0
    x = int(x)
    if x < 1 or x > 10:
        return 0
    return x


def sy(a, b, c, a2, b2, c2, s):
    x = 0
    while x <= a2:
        y = 0
        while y <= b2:
            n = 0
            lxh = 0
            lxb = 0
            while n <= c2:
                if s[x+y+n] == '黑':
                    lxh += 1
                else:
                    lxh = 0
                if s[x+y+n] == '白':
                    lxb += 1
                else:
                    lxb = 0
                n += c
            if lxb == 5:
                return 0
            if lxh == 5:
                return 2
            y += b
        x += a
    return 1


def xsy(xx, xs, yx, ys, js, js2, s):
    x = xx
    while x <= xs:
        y = yx
        while y <= yx:
            lxb = 0
            lxh = 0
            n = 0
            while n <= 4:
                if s[(y+n*js2)*10+x+n*js] == '黑':
                    lxh += 1
                else:
                    lxh = 0
                if s[(y+n*js2)*10+x+n*js] == '白':
                    lxb += 1
                else:
                    lxb = 0
                n += 1
            if lxb == 5:
                return 0
            if lxh == 5:
                return 2
            y += 1
        x += 1
    return 1


print("棋盘为10*10。")
s = []
a = 0
while a < 100:
    s.append('无')
    a += 1
print("你告诉我黑棋还是白棋先下?(输入A代表黑,输入B代表白):")
while True:
    hb = input()
    if hb != 'A' and hb != 'B':
        print("输入错误,请重试:")
    else:
        break
b = 0
while True:
    f = 0
    fh = 0
    hqs = 0
    bqs = 0
    if sy(10, 1, 1, 90, 5, 4, s) == 2:
        hqs = 1
    if sy(1, 10, 10, 9, 50, 40, s) == 2:
        hqs = 1
    if sy(10, 1, 1, 90, 5, 4, s) == 0:
        bqs = 1
    if sy(1, 10, 10, 9, 50, 40, s) == 0:
        bqs = 1
    if xsy(0, 5, 0, 5, 1, 1, s) == 2:
        hqs = 1
    if xsy(4, 9, 4, 9, -1, -1, s) == 2:
        hqs = 1
    if xsy(0, 5, 0, 5, 1, 1, s) == 0:
        bqs = 1
    if xsy(4, 9, 4, 9, -1, -1, s) == 0:
        bqs = 1
    if xsy(0, 5, 4, 9, 1, -1, s) == 2:
        hqs = 1
    if xsy(0, 5, 4, 9, 1, -1, s) == 0:
        bqs = 1
    if xsy(4, 9, 0, 5, -1, 1, s) == 2:
        hqs = 1
    if xsy(4, 9, 0, 5, -1, 1, s) == 0:
        bqs = 1
    while f < 100:
        k = 0
        bs = ' '
        while k < 10:
            if k == 0:
                bs = s[f+k]
            else:
                bs = bs+' '+s[f+k]
            k += 1
        print(bs)
        f += 10
    if hqs == 1:
        print("黑棋赢!")
        break
    if bqs == 1:
        print("白棋赢!")
        break
    if hb == 'A':
        if b % 2 == 0:
            jhb = 'A'
        else:
            jhb = 'B'
    else:
        if b % 2 == 0:
            jhb = 'B'
        else:
            jhb = 'A'
    if jhb == 'A':
        print("黑棋的x坐标(从左到右,1~10):")
        while True:
            x = input()
            if jd(x) == 0:
                print("输入错误,请重试:")
            else:
                x = jd(x)
                break
        print("黑棋的y坐标(从上到下,1~10):")
        while True:
            y = input()
            if jd(y) == 0:
                print("输入错误,请重试:")
            else:
                y = jd(y)
                break
        if (s[(y-1)*10+x-1] == '黑') or (s[(y-1)*10+x-1] == '白'):
            print("禁止重叠,下次做决策看棋盘现状。")
            fh = 1
        else:
            s[(y-1)*10+x-1] = '黑'
    else:
        print("白棋的x坐标(从左到右,1~10):")
        while True:
            x = input()
            if jd(x) == 0:
                print("输入错误,请重试:")
            else:
                x = jd(x)
                break
        print("白棋的y坐标(从上到下,1~10):")
        while True:
            y = input()
            if jd(y) == 0:
                print("输入错误,请重试:")
            else:
                y = jd(y)
                break
        if (s[(y-1)*10+x-1] == '黑') or (s[(y-1)*10+x-1] == '白'):
            print("禁止重叠,下次做决策看棋盘现状。")
            fh = 1
        else:
            s[(y-1)*10+x-1] = '白'
    if fh == 0:
        b += 1

 

2021-07-31T12:06:39 点赞:0

【Python作品分享】五子棋 中回复

没法运行

2021-07-31T12:11:50 点赞:0

造个五子棋记得帮忙! 中回复

def jd(x):
    try:
        x = float(x)
    except ValueError:
        return 0
    if x-(float(int(x))) > 0:
        return 0
    x = int(x)
    if x < 1 or x > 10:
        return 0
    return x


def sy(a, b, c, a2, b2, c2, s):
    x = 0
    while x <= a2:
        y = 0
        while y <= b2:
            n = 0
            lxh = 0
            lxb = 0
            while n <= c2:
                if s[x+y+n] == '黑':
                    lxh += 1
                else:
                    lxh = 0
                if s[x+y+n] == '白':
                    lxb += 1
                else:
                    lxb = 0
                n += c
            if lxb == 5:
                return 0
            if lxh == 5:
                return 2
            y += b
        x += a
    return 1


def xsy(xx, xs, yx, ys, js, js2, s):
    x = xx
    while x <= xs:
        y = yx
        while y <= yx:
            lxb = 0
            lxh = 0
            n = 0
            while n <= 4:
                if s[(y+n*js2)*10+x+n*js] == '黑':
                    lxh += 1
                else:
                    lxh = 0
                if s[(y+n*js2)*10+x+n*js] == '白':
                    lxb += 1
                else:
                    lxb = 0
                n += 1
            if lxb == 5:
                return 0
            if lxh == 5:
                return 2
            y += 1
        x += 1
    return 1


print("棋盘为10*10。")
s = []
a = 0
while a < 100:
    s.append('无')
    a += 1
print("你告诉我黑棋还是白棋先下?(输入A代表黑,输入B代表白):")
while True:
    hb = input()
    if hb != 'A' and hb != 'B':
        print("输入错误,请重试:")
    else:
        break
b = 0
while True:
    f = 0
    fh = 0
    hqs = 0
    bqs = 0
    if sy(10, 1, 1, 90, 5, 4, s) == 2:
        hqs = 1
    if sy(1, 10, 10, 9, 50, 40, s) == 2:
        hqs = 1
    if sy(10, 1, 1, 90, 5, 4, s) == 0:
        bqs = 1
    if sy(1, 10, 10, 9, 50, 40, s) == 0:
        bqs = 1
    if xsy(0, 5, 0, 5, 1, 1, s) == 2:
        hqs = 1
    if xsy(4, 9, 4, 9, -1, -1, s) == 2:
        hqs = 1
    if xsy(0, 5, 0, 5, 1, 1, s) == 0:
        bqs = 1
    if xsy(4, 9, 4, 9, -1, -1, s) == 0:
        bqs = 1
    if xsy(0, 5, 4, 9, 1, -1, s) == 2:
        hqs = 1
    if xsy(0, 5, 4, 9, 1, -1, s) == 0:
        bqs = 1
    if xsy(4, 9, 0, 5, -1, 1, s) == 2:
        hqs = 1
    if xsy(4, 9, 0, 5, -1, 1, s) == 0:
        bqs = 1
    while f < 100:
        k = 0
        bs = ' '
        while k < 10:
            if k == 0:
                bs = s[f+k]
            else:
                bs = bs+' '+s[f+k]
            k += 1
        print(bs)
        f += 10
    if hqs == 1:
        print("黑棋赢!")
        break
    if bqs == 1:
        print("白棋赢!")
        break
    if hb == 'A':
        if b % 2 == 0:
            jhb = 'A'
        else:
            jhb = 'B'
    else:
        if b % 2 == 0:
            jhb = 'B'
        else:
            jhb = 'A'
    if jhb == 'A':
        print("黑棋的x坐标(从左到右,1~10):")
        while True:
            x = input()
            if jd(x) == 0:
                print("输入错误,请重试:")
            else:
                x = jd(x)
                break
        print("黑棋的y坐标(从上到下,1~10):")
        while True:
            y = input()
            if jd(y) == 0:
                print("输入错误,请重试:")
            else:
                y = jd(y)
                break
        if (s[(y-1)*10+x-1] == '黑') or (s[(y-1)*10+x-1] == '白'):
            print("禁止重叠,下次做决策看棋盘现状。")
            fh = 1
        else:
            s[(y-1)*10+x-1] = '黑'
    else:
        print("白棋的x坐标(从左到右,1~10):")
        while True:
            x = input()
            if jd(x) == 0:
                print("输入错误,请重试:")
            else:
                x = jd(x)
                break
        print("白棋的y坐标(从上到下,1~10):")
        while True:
            y = input()
            if jd(y) == 0:
                print("输入错误,请重试:")
            else:
                y = jd(y)
                break
        if (s[(y-1)*10+x-1] == '黑') or (s[(y-1)*10+x-1] == '白'):
            print("禁止重叠,下次做决策看棋盘现状。")
            fh = 1
        else:
            s[(y-1)*10+x-1] = '白'
    if fh == 0:
        b += 1

2021-07-31T12:14:39 点赞:0

【Python作品分享】下棋游戏(BUG修复*1)【作品秀】 中回复

注意:此棋为五子棋。

2021-07-31T13:12:09 点赞:0

福利!c++五子棋代码!(原创) 中回复

你试试我这个PYTHON的?

def jd(x):
    try:
        x = float(x)
    except ValueError:
        return 0
    if x-(float(int(x))) > 0:
        return 0
    x = int(x)
    if x < 1 or x > 10:
        return 0
    return x


def sy(a, b, c, a2, b2, c2, s):
    x = 0
    while x <= a2:
        y = 0
        while y <= b2:
            n = 0
            lxh = 0
            lxb = 0
            while n <= c2:
                if s[x+y+n] == '黑':
                    lxh += 1
                else:
                    lxh = 0
                if s[x+y+n] == '白':
                    lxb += 1
                else:
                    lxb = 0
                n += c
            if lxb == 5:
                return 0
            if lxh == 5:
                return 2
            y += b
        x += a
    return 1


def xsy(xx, xs, yx, ys, js, js2, s):
    x = xx
    while x <= xs:
        y = yx
        while y <= yx:
            lxb = 0
            lxh = 0
            n = 0
            while n <= 4:
                if s[(y+n*js2)*10+x+n*js] == '黑':
                    lxh += 1
                else:
                    lxh = 0
                if s[(y+n*js2)*10+x+n*js] == '白':
                    lxb += 1
                else:
                    lxb = 0
                n += 1
            if lxb == 5:
                return 0
            if lxh == 5:
                return 2
            y += 1
        x += 1
    return 1


print("棋盘为10*10。")
s = []
a = 0
while a < 100:
    s.append('无')
    a += 1
print("你告诉我黑棋还是白棋先下?(输入A代表黑,输入B代表白):")
while True:
    hb = input()
    if hb != 'A' and hb != 'B':
        print("输入错误,请重试:")
    else:
        break
b = 0
while True:
    f = 0
    fh = 0
    hqs = 0
    bqs = 0
    if sy(10, 1, 1, 90, 5, 4, s) == 2:
        hqs = 1
    if sy(1, 10, 10, 9, 50, 40, s) == 2:
        hqs = 1
    if sy(10, 1, 1, 90, 5, 4, s) == 0:
        bqs = 1
    if sy(1, 10, 10, 9, 50, 40, s) == 0:
        bqs = 1
    if xsy(0, 5, 0, 5, 1, 1, s) == 2:
        hqs = 1
    if xsy(4, 9, 4, 9, -1, -1, s) == 2:
        hqs = 1
    if xsy(0, 5, 0, 5, 1, 1, s) == 0:
        bqs = 1
    if xsy(4, 9, 4, 9, -1, -1, s) == 0:
        bqs = 1
    if xsy(0, 5, 4, 9, 1, -1, s) == 2:
        hqs = 1
    if xsy(0, 5, 4, 9, 1, -1, s) == 0:
        bqs = 1
    if xsy(4, 9, 0, 5, -1, 1, s) == 2:
        hqs = 1
    if xsy(4, 9, 0, 5, -1, 1, s) == 0:
        bqs = 1
    while f < 100:
        k = 0
        bs = ' '
        while k < 10:
            if k == 0:
                bs = s[f+k]
            else:
                bs = bs+' '+s[f+k]
            k += 1
        print(bs)
        f += 10
    if hqs == 1:
        print("黑棋赢!")
        break
    if bqs == 1:
        print("白棋赢!")
        break
    if hb == 'A':
        if b % 2 == 0:
            jhb = 'A'
        else:
            jhb = 'B'
    else:
        if b % 2 == 0:
            jhb = 'B'
        else:
            jhb = 'A'
    if jhb == 'A':
        print("黑棋的x坐标(从左到右,1~10):")
        while True:
            x = input()
            if jd(x) == 0:
                print("输入错误,请重试:")
            else:
                x = jd(x)
                break
        print("黑棋的y坐标(从上到下,1~10):")
        while True:
            y = input()
            if jd(y) == 0:
                print("输入错误,请重试:")
            else:
                y = jd(y)
                break
        if (s[(y-1)*10+x-1] == '黑') or (s[(y-1)*10+x-1] == '白'):
            print("禁止重叠,下次做决策看棋盘现状。")
            fh = 1
        else:
            s[(y-1)*10+x-1] = '黑'
    else:
        print("白棋的x坐标(从左到右,1~10):")
        while True:
            x = input()
            if jd(x) == 0:
                print("输入错误,请重试:")
            else:
                x = jd(x)
                break
        print("白棋的y坐标(从上到下,1~10):")
        while True:
            y = input()
            if jd(y) == 0:
                print("输入错误,请重试:")
            else:
                y = jd(y)
                break
        if (s[(y-1)*10+x-1] == '黑') or (s[(y-1)*10+x-1] == '白'):
            print("禁止重叠,下次做决策看棋盘现状。")
            fh = 1
        else:
            s[(y-1)*10+x-1] = '白'
    if fh == 0:
        b += 1

2021-07-31T13:15:10 点赞:0

出事了!!!编程猫代码岛惊现凶 杀案! 中回复

代码岛 正在把问题反馈给 点猫公司

代码岛:我复活啦!!!

2021-07-31T18:41:24 点赞:0

【Python作品分享】24点查询器 中回复

五子棋程序:

def jd(x):
    try:
        x = float(x)
    except ValueError:
        return 0
    if x-(float(int(x))) > 0:
        return 0
    x = int(x)
    if x < 1 or x > 10:
        return 0
    return x


def sy(a, b, c, a2, b2, c2, s):
    x = 0
    while x <= a2:
        y = 0
        while y <= b2:
            n = 0
            lxh = 0
            lxb = 0
            while n <= c2:
                if s[x+y+n] == '黑':
                    lxh += 1
                else:
                    lxh = 0
                if s[x+y+n] == '白':
                    lxb += 1
                else:
                    lxb = 0
                n += c
            if lxb == 5:
                return 0
            if lxh == 5:
                return 2
            y += b
        x += a
    return 1


def xsy(xx, xs, yx, ys, js, js2, s):
    x = xx
    while x <= xs:
        y = yx
        while y <= yx:
            lxb = 0
            lxh = 0
            n = 0
            while n <= 4:
                if s[(y+n*js2)*10+x+n*js] == '黑':
                    lxh += 1
                else:
                    lxh = 0
                if s[(y+n*js2)*10+x+n*js] == '白':
                    lxb += 1
                else:
                    lxb = 0
                n += 1
            if lxb == 5:
                return 0
            if lxh == 5:
                return 2
            y += 1
        x += 1
    return 1


print("棋盘为10*10。")
s = []
a = 0
while a < 100:
    s.append('无')
    a += 1
print("你告诉我黑棋还是白棋先下?(输入A代表黑,输入B代表白):")
while True:
    hb = input()
    if hb != 'A' and hb != 'B':
        print("输入错误,请重试:")
    else:
        break
b = 0
while True:
    f = 0
    fh = 0
    hqs = 0
    bqs = 0
    if sy(10, 1, 1, 90, 5, 4, s) == 2:
        hqs = 1
    if sy(1, 10, 10, 9, 50, 40, s) == 2:
        hqs = 1
    if sy(10, 1, 1, 90, 5, 4, s) == 0:
        bqs = 1
    if sy(1, 10, 10, 9, 50, 40, s) == 0:
        bqs = 1
    if xsy(0, 5, 0, 5, 1, 1, s) == 2:
        hqs = 1
    if xsy(4, 9, 4, 9, -1, -1, s) == 2:
        hqs = 1
    if xsy(0, 5, 0, 5, 1, 1, s) == 0:
        bqs = 1
    if xsy(4, 9, 4, 9, -1, -1, s) == 0:
        bqs = 1
    if xsy(0, 5, 4, 9, 1, -1, s) == 2:
        hqs = 1
    if xsy(0, 5, 4, 9, 1, -1, s) == 0:
        bqs = 1
    if xsy(4, 9, 0, 5, -1, 1, s) == 2:
        hqs = 1
    if xsy(4, 9, 0, 5, -1, 1, s) == 0:
        bqs = 1
    while f < 100:
        k = 0
        bs = ' '
        while k < 10:
            if k == 0:
                bs = s[f+k]
            else:
                bs = bs+' '+s[f+k]
            k += 1
        print(bs)
        f += 10
    if hqs == 1:
        print("黑棋赢!")
        break
    if bqs == 1:
        print("白棋赢!")
        break
    if hb == 'A':
        if b % 2 == 0:
            jhb = 'A'
        else:
            jhb = 'B'
    else:
        if b % 2 == 0:
            jhb = 'B'
        else:
            jhb = 'A'
    if jhb == 'A':
        print("黑棋的x坐标(从左到右,1~10):")
        while True:
            x = input()
            if jd(x) == 0:
                print("输入错误,请重试:")
            else:
                x = jd(x)
                break
        print("黑棋的y坐标(从上到下,1~10):")
        while True:
            y = input()
            if jd(y) == 0:
                print("输入错误,请重试:")
            else:
                y = jd(y)
                break
        if (s[(y-1)*10+x-1] == '黑') or (s[(y-1)*10+x-1] == '白'):
            print("禁止重叠,下次做决策看棋盘现状。")
            fh = 1
        else:
            s[(y-1)*10+x-1] = '黑'
    else:
        print("白棋的x坐标(从左到右,1~10):")
        while True:
            x = input()
            if jd(x) == 0:
                print("输入错误,请重试:")
            else:
                x = jd(x)
                break
        print("白棋的y坐标(从上到下,1~10):")
        while True:
            y = input()
            if jd(y) == 0:
                print("输入错误,请重试:")
            else:
                y = jd(y)
                break
        if (s[(y-1)*10+x-1] == '黑') or (s[(y-1)*10+x-1] == '白'):
            print("禁止重叠,下次做决策看棋盘现状。")
            fh = 1
        else:
            s[(y-1)*10+x-1] = '白'
    if fh == 0:
        b += 1

2021-08-01T09:21:32 点赞:0

【Python作品分享】0.999... = 1【作品秀】 中回复

这只是利用PYTHON的精度限制

2021-08-01T09:29:31 点赞:0

【Python作品分享】新的作品 中回复

新的作品(×)水作品(√)

2021-08-01T09:30:51 点赞:0

python五子棋游戏代码 中回复

def jd(x):
    try:
        x = float(x)
    except ValueError:
        return 0
    if x-(float(int(x))) > 0:
        return 0
    x = int(x)
    if x < 1 or x > 10:
        return 0
    return x


def sy(a, b, c, a2, b2, c2, s):
    x = 0
    while x <= a2:
        y = 0
        while y <= b2:
            n = 0
            lxh = 0
            lxb = 0
            while n <= c2:
                if s[x+y+n] == '黑':
                    lxh += 1
                else:
                    lxh = 0
                if s[x+y+n] == '白':
                    lxb += 1
                else:
                    lxb = 0
                n += c
            if lxb == 5:
                return 0
            if lxh == 5:
                return 2
            y += b
        x += a
    return 1


def xsy(xx, xs, yx, ys, js, js2, s):
    x = xx
    while x <= xs:
        y = yx
        while y <= yx:
            lxb = 0
            lxh = 0
            n = 0
            while n <= 4:
                if s[(y+n*js2)*10+x+n*js] == '黑':
                    lxh += 1
                else:
                    lxh = 0
                if s[(y+n*js2)*10+x+n*js] == '白':
                    lxb += 1
                else:
                    lxb = 0
                n += 1
            if lxb == 5:
                return 0
            if lxh == 5:
                return 2
            y += 1
        x += 1
    return 1


print("棋盘为10*10。")
s = []
a = 0
while a < 100:
    s.append('无')
    a += 1
print("你告诉我黑棋还是白棋先下?(输入A代表黑,输入B代表白):")
while True:
    hb = input()
    if hb != 'A' and hb != 'B':
        print("输入错误,请重试:")
    else:
        break
b = 0
while True:
    f = 0
    fh = 0
    hqs = 0
    bqs = 0
    if sy(10, 1, 1, 90, 5, 4, s) == 2:
        hqs = 1
    if sy(1, 10, 10, 9, 50, 40, s) == 2:
        hqs = 1
    if sy(10, 1, 1, 90, 5, 4, s) == 0:
        bqs = 1
    if sy(1, 10, 10, 9, 50, 40, s) == 0:
        bqs = 1
    if xsy(0, 5, 0, 5, 1, 1, s) == 2:
        hqs = 1
    if xsy(4, 9, 4, 9, -1, -1, s) == 2:
        hqs = 1
    if xsy(0, 5, 0, 5, 1, 1, s) == 0:
        bqs = 1
    if xsy(4, 9, 4, 9, -1, -1, s) == 0:
        bqs = 1
    if xsy(0, 5, 4, 9, 1, -1, s) == 2:
        hqs = 1
    if xsy(0, 5, 4, 9, 1, -1, s) == 0:
        bqs = 1
    if xsy(4, 9, 0, 5, -1, 1, s) == 2:
        hqs = 1
    if xsy(4, 9, 0, 5, -1, 1, s) == 0:
        bqs = 1
    while f < 100:
        k = 0
        bs = ' '
        while k < 10:
            if k == 0:
                bs = s[f+k]
            else:
                bs = bs+' '+s[f+k]
            k += 1
        print(bs)
        f += 10
    if hqs == 1:
        print("黑棋赢!")
        break
    if bqs == 1:
        print("白棋赢!")
        break
    if hb == 'A':
        if b % 2 == 0:
            jhb = 'A'
        else:
            jhb = 'B'
    else:
        if b % 2 == 0:
            jhb = 'B'
        else:
            jhb = 'A'
    if jhb == 'A':
        print("黑棋的x坐标(从左到右,1~10):")
        while True:
            x = input()
            if jd(x) == 0:
                print("输入错误,请重试:")
            else:
                x = jd(x)
                break
        print("黑棋的y坐标(从上到下,1~10):")
        while True:
            y = input()
            if jd(y) == 0:
                print("输入错误,请重试:")
            else:
                y = jd(y)
                break
        if (s[(y-1)*10+x-1] == '黑') or (s[(y-1)*10+x-1] == '白'):
            print("禁止重叠,下次做决策看棋盘现状。")
            fh = 1
        else:
            s[(y-1)*10+x-1] = '黑'
    else:
        print("白棋的x坐标(从左到右,1~10):")
        while True:
            x = input()
            if jd(x) == 0:
                print("输入错误,请重试:")
            else:
                x = jd(x)
                break
        print("白棋的y坐标(从上到下,1~10):")
        while True:
            y = input()
            if jd(y) == 0:
                print("输入错误,请重试:")
            else:
                y = jd(y)
                break
        if (s[(y-1)*10+x-1] == '黑') or (s[(y-1)*10+x-1] == '白'):
            print("禁止重叠,下次做决策看棋盘现状。")
            fh = 1
        else:
            s[(y-1)*10+x-1] = '白'
    if fh == 0:
        b += 1

2021-08-01T09:34:27 点赞:0

【KITTEN公告栏】编程猫社区规则,请知悉并遵守。 中回复

复制官方“推广”的吧

2021-08-01T15:26:35 点赞:0

封号要多久才能解封? 中回复

视情况而定,一般为1天/7天/30天/90天/永远不解封

2021-08-01T15:36:02 点赞:0

有谁比我还穷? 中回复

我刚来几天,还很穷

2021-08-01T15:43:57 点赞:0