
Lv.1
回到社区
签名:
在 【kitten4.0反馈】遇到问题不要怕,技术喵来帮你忙! 中回复
BUG:
添加云列表的积木中如果外面套了一步执行那么最多添加59次,第60次就被忽略了,百分百出现,求修复
2021-08-13T18:13:45 点赞:1
在 【海龟编辑器】意见反馈信箱(长期有效) 中回复
代码如下,f[i]-len(ps)=8,jx初始值为0,为啥只执行4次?
while jx<f[i]-len(ps):
ps.append(0)
jx+=12021-08-13T21:26:26 点赞:0
在 【海龟编辑器】意见反馈信箱(长期有效) 中回复
能不能在无法转化成积木时注明一下哪一行有问题,不然在正常的程序发生无法转化积木的情况时不知道第几行,很影响体验
2021-08-13T21:38:51 点赞:0
在 【社区功能反馈】用心倾听,用头发发电!(2026更新版) 中回复
举报只要是自定义原因系统公告上有一段就会变成“存在‘’的情况”本来应该是“存在‘xxx’的情况”建议修复
2021-08-14T16:59:31 点赞:0
在 2048太好玩了 中回复
我居然用PYTHON写了一个2048
import random
h=[]
i=0
while i<16:
h.append(0)
i+=1
l=random.randint(0,15)
l2=random.randint(0,15)
while l2==l:
l2=random.randint(0,15)
h[l]=2
h[l2]=2
win=0
while True:
i=0
pzf=' '
while i<16:
if (i+1)%4==1:
pzf=str(h[i])
else:
pzf=pzf+str(h[i])
if (i+1)%4==0:
print(pzf)
else:
j=0
while j<5-(len(str(h[i]))):
pzf=pzf+' '
j+=1
i+=1
i=0
while i<16:
if h[i]==2048:
print("你组合出了2048!!!你赢了!!!")
win=1
break
i+=1
if win==1:
break
i=0
xh=1
while i<16:
if h[i]==0:
xh=0
break
i+=1
if xh==1:
js=0
i=0
while i<16:
if i%4!=3:
if h[i]==h[i+1]:
js+=1
i+=1
i=0
while i<4:
j=0
while j<=8:
if h[i+j]==h[i+j+4]:
js+=1
j+=4
i=i+1
if js==0:
print("没法拼接了,你输了……")
break
try:
x=float(input("你要做什么决策?(1上2下3左4右):"))
except ValueError:
print("ERROR:你的输入为字符串")
break
if x-(float(int(x)))>0:
print("ERROR:你的输入为小数")
break
x=int(x)
if x==1:
i=4
while i<16:
f=i
if h[i]!=0:
while f>=0:
if h[f]!=0 and f!=i:
if h[f]==h[i]:
h[f]+=h[i]
h[i]=0
else:
if f!=i-4:
h[f+4]=h[i]
h[i]=0
break
f-=4
if h[f+4]==0 and f<0:
h[f+4]=h[i]
h[i]=0
i+=1
i=0
g=0
while i<16:
if h[i]==0:
g=1
break
i+=1
if g==1:
l=random.randint(0,15)
while h[l]!=0:
l=random.randint(0,15)
js=random.randint(1,2)
h[l]=js*2
elif x==2:
i=11
while i>=0:
f=i
if h[i]!=0:
while f<=15:
if h[f]!=0 and f!=i:
if h[f]==h[i]:
h[f]+=h[i]
h[i]=0
else:
if f!=i+4:
h[f-4]=h[i]
h[i]=0
break
f+=4
if h[f-4]==0 and f>15:
h[f-4]=h[i]
h[i]=0
i-=1
i=0
g=0
while i<16:
if h[i]==0:
g=1
break
i+=1
if g==1:
l=random.randint(0,15)
while h[l]!=0:
l=random.randint(0,15)
js=random.randint(1,2)
h[l]=js*2
elif x==4:
i=15
while i>=0:
if i%4!=3:
f=i
if h[i]!=0:
while f<=((int(i/4))*4+3):
if h[f]!=0 and f!=i:
if h[f]==h[i]:
h[f]+=h[i]
h[i]=0
else:
if f!=i+1:
h[f-1]=h[i]
h[i]=0
break
f+=1
if h[f-1]==0 and f>((int(i/4))*4+3):
h[f-1]=h[i]
h[i]=0
i-=1
i=0
g=0
while i<16:
if h[i]==0:
g=1
break
i-=1
if g==1:
l=random.randint(0,15)
while h[l]!=0:
l=random.randint(0,15)
js=random.randint(1,2)
h[l]=js*2
elif x==3:
i=1
while i<16:
if i%4!=0:
f=i
if h[i]!=0:
while f>=((int(i/4))*4):
if h[f]!=0 and f!=i:
if h[f]==h[i]:
h[f]+=h[i]
h[i]=0
else:
if f!=i-1:
h[f+1]=h[i]
h[i]=0
break
f-=1
if h[f+1]==0 and f<((int(i/4))*4):
h[f+1]=h[i]
h[i]=0
i+=1
i=0
g=0
while i<16:
if h[i]==0:
g=1
break
i+=1
if g==1:
l=random.randint(0,15)
while h[l]!=0:
l=random.randint(0,15)
js=random.randint(1,2)
h[l]=js*2
else:
print("ERROR:你输入的整数不合理")
break2021-08-15T16:59:14 点赞:0
在 【Python作品分享】2048【作品秀】 中回复
修复BUG:
import random
h=[]
i=0
while i<16:
h.append(0)
i+=1
l=random.randint(0,15)
l2=random.randint(0,15)
while l2==l:
l2=random.randint(0,15)
h[l]=2
h[l2]=2
win=0
while True:
i=0
pzf=' '
while i<16:
if (i+1)%4==1:
pzf=str(h[i])
else:
pzf=pzf+str(h[i])
if (i+1)%4==0:
print(pzf)
else:
j=0
while j<5-(len(str(h[i]))):
pzf=pzf+' '
j+=1
i+=1
i=0
while i<16:
if h[i]==2048:
print("你组合出了2048!!!你赢了!!!")
win=1
break
i+=1
if win==1:
break
i=0
xh=1
while i<16:
if h[i]==0:
xh=0
break
i+=1
if xh==1:
js=0
i=0
while i<16:
if i%4!=3:
if h[i]==h[i+1]:
js+=1
i+=1
i=0
while i<4:
j=0
while j<=8:
if h[i+j]==h[i+j+4]:
js+=1
j+=4
i=i+1
if js==0:
print("没法拼接了,你输了……")
break
try:
x=float(input("你要做什么决策?(1上2下3左4右):"))
except ValueError:
print("ERROR:你的输入为字符串")
break
if x-(float(int(x)))>0:
print("ERROR:你的输入为小数")
break
x=int(x)
if x==1:
i=4
while i<16:
f=i
if h[i]!=0:
while f>=0:
if h[f]!=0 and f!=i:
if h[f]==h[i]:
h[f]+=h[i]
h[i]=0
else:
if f!=i-4:
h[f+4]=h[i]
h[i]=0
break
f-=4
if h[f+4]==0 and f<0:
h[f+4]=h[i]
h[i]=0
i+=1
i=0
g=0
while i<16:
if h[i]==0:
g=1
break
i+=1
if g==1:
l=random.randint(0,15)
while h[l]!=0:
l=random.randint(0,15)
js=random.randint(1,2)
h[l]=js*2
elif x==2:
i=11
while i>=0:
f=i
if h[i]!=0:
while f<=15:
if h[f]!=0 and f!=i:
if h[f]==h[i]:
h[f]+=h[i]
h[i]=0
else:
if f!=i+4:
h[f-4]=h[i]
h[i]=0
break
f+=4
if h[f-4]==0 and f>15:
h[f-4]=h[i]
h[i]=0
i-=1
i=0
g=0
while i<16:
if h[i]==0:
g=1
break
i+=1
if g==1:
l=random.randint(0,15)
while h[l]!=0:
l=random.randint(0,15)
js=random.randint(1,2)
h[l]=js*2
elif x==4:
i=15
while i>=0:
if i%4!=3:
f=i
if h[i]!=0:
while f<=((int(i/4))*4+3):
if h[f]!=0 and f!=i:
if h[f]==h[i]:
h[f]+=h[i]
h[i]=0
else:
if f!=i+1:
h[f-1]=h[i]
h[i]=0
break
f+=1
if h[f-1]==0 and f>((int(i/4))*4+3):
h[f-1]=h[i]
h[i]=0
i-=1
i=0
g=0
while i<16:
if h[i]==0:
g=1
break
i+=1
if g==1:
l=random.randint(0,15)
while h[l]!=0:
l=random.randint(0,15)
js=random.randint(1,2)
h[l]=js*2
elif x==3:
i=1
while i<16:
if i%4!=0:
f=i
if h[i]!=0:
while f>=((int(i/4))*4):
if h[f]!=0 and f!=i:
if h[f]==h[i]:
h[f]+=h[i]
h[i]=0
else:
if f!=i-1:
h[f+1]=h[i]
h[i]=0
break
f-=1
if h[f+1]==0 and f<((int(i/4))*4):
h[f+1]=h[i]
h[i]=0
i+=1
i=0
g=0
while i<16:
if h[i]==0:
g=1
break
i+=1
if g==1:
l=random.randint(0,15)
while h[l]!=0:
l=random.randint(0,15)
js=random.randint(1,2)
h[l]=js*2
else:
print("ERROR:你输入的整数不合理")
break2021-08-15T18:08:22 点赞:0
在 【秀源码精灵】我的精灵水平,谁富谁穷(数据每日一更新,请使用评论区内最新数据) 中回复
更新3:
天气宝宝 一阶 LV19 exp2146/2171
编程猫 二阶 LV25 exp5541/5577
涂鸦狐 二阶 LV23 exp3861/4281
皮皮熊 二阶 LV22 exp3232/3695
木叶龙 二阶 LV23 exp3858/4281
冰牙犬 二阶 LV10 exp507/541
共计收集精灵11个
源码晶石1060个
源码铃铛41个
注:由于本人有一次暂时下线,多日未更新,敬请谅解
2021-08-15T18:56:00 点赞:0
在 【kitten4.0反馈】遇到问题不要怕,技术喵来帮你忙! 中回复
画角色的缓存不正常,因为画角色时,如果在某个颜色的封闭空间内,别的颜色混进来,再由原来的颜色代替,此时如果在混进来的一部分画相同的颜色,混进来的部分的颜色会全部变回来
2021-08-16T17:43:44 点赞:0
在 【社区功能反馈】用心倾听,用头发发电!(2026更新版) 中回复
https://shequ.codemao.cn/community/392832 一个反馈帖
2021-08-16T18:53:48 点赞:0
在 【kitten4.0反馈】遇到问题不要怕,技术喵来帮你忙! 中回复
BUG反馈:
我们在使用画笔功能时,会发现一个角色文字印章是正常的,想移到印章图层下方ALSO正常,但是如果新建一个角色,将其移到能遮挡文字印章的角色的地方后移到文字印章角色的图层下方,再运行上面说的脚本(前后者都运行),就会发现文字印章的角色被遮住了,印章也不见了。
2021-08-22T11:44:28 点赞:0
在 【Python作品分享】进制转换 中回复
我也有一个2~16进制转化器:
def main():
try:
j1=float(input('请输入被转化数字的进制数:'))
except ValueError:
print('输入错误,程序已停止运行。')
return 0
try:
j2=float(input('请输入已转化数字的进制数:'))
except ValueError:
print('输入错误,程序已停止运行。')
return 0
if int(j1)!=j1 or int(j2)!=j2:
print('输入错误,程序已停止运行。')
return 0
j1=int(j1)
j2=int(j2)
if (j1>16 or j2<2) or (j1<2 or j2>16):
print('输入错误,程序已停止运行。')
return 0
n=input('请输入被转化数字:')
i=0
aa=['a','b','c','d','e','f']
bb=[10,11,12,13,14,15]
ts=[]
for i in range(0,len(n)):
s=0
try:
cs=int(n[i])
except ValueError:
s=1
if s==0:
ts.append(int(n[i]))
else:
j=0
fl=0
for j in range(0,6):
if aa[j]==n[i]:
fl=1
break
if fl==1:
ts.append(bb[j])
else:
print('输入错误,程序已停止运行。')
return 0
if ts[i]>=j1:
print('输入错误,程序已停止运行。')
return 0
s1=0
for i in range(0,len(ts)):
s1+=ts[i]*(j1**(len(ts)-1-i))
if s1==0:
s2yd=[0]
else:
s2yd=[]
while s1>0:
s2yd.append(s1%j2)
s1=int(s1/j2)
i=len(s2yd)-1
s2y=[]
while i>=0:
s2y.append(s2yd[i])
i-=1
s2=' '
for i in range(0,len(s2y)):
if s2y[i]<10:
if s2==' ':
s2=str(s2y[i])
else:
s2=s2+str(s2y[i])
else:
if s2==' ':
s2=aa[s2y[i]-10]
else:
s2=s2+aa[s2y[i]-10]
print('已转化数字:'+s2)
return 0
x=main()2021-10-04T21:04:12 点赞:0