
Lv.1
回到社区
签名:
在 【kitten4.0反馈】遇到问题不要怕,技术喵来帮你忙! 中回复
我玩一个K4有云变量的作品,结果退出之后,回去一看,私有云变量的数据秒变乱码?偶尔出BUG,但出BUG之后刷新也没用。
2021-07-17T17:04:03 点赞: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
在 【kitten4.0反馈】遇到问题不要怕,技术喵来帮你忙! 中回复
BUG(100%出现):每次当注释超过屏幕时,屏幕就会向左移,慢慢地左边的东西看不见了,右边的全是空格,搞得我只好保存了再重新加载!!!求修复。
2021-07-26T20:13:27 点赞:0
在 【惊奇发现】KITTEN4.8.3函数递归次数的上限! 中回复
函数代码:
定义函数 递归(参数){
设置变量 (名称自定义) 为 参数
如果 (自定义名称变量>0){
递归 (自定义名称变量)-1}}
2021-07-26T21:13:22 点赞: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
在 造个五子棋记得帮忙! 中回复
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 += 12021-07-31T12:14:39 点赞: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 += 12021-07-31T13:15:10 点赞: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 += 12021-08-01T09:21:32 点赞: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 += 12021-08-01T09:34:27 点赞:0