
Lv.1
回到社区
签名:
在 太香了啊,一天瞬间的5万多晶石,15个源码蛋👍 中回复
我还在前期,结果两天陆陆续续两个精灵等级都升到了可以进化成二阶的地步,我正在忙碌着准备积木为它们进化(其中一个已经进化了)
2021-08-02T21:20:22 点赞:0
在 【kitten4.0反馈】遇到问题不要怕,技术喵来帮你忙! 中回复
我不想反馈K4BUG,想反馈海龟BUG。为了你看到,发进这个帖子。
那就是,为啥在判断语句里有括号的东西转积木会说有非法字符???
我有一个2048的程序,因为这个BUG无法转化为积木了。
求修复233
2021-08-03T12:31:34 点赞:0
在 【Python作品分享】答题模拟器【作品秀】 中回复
https://shequ.codemao.cn/community/389756
我还能用PYTHON实现2048!!!
2021-08-03T12:56:25 点赞:1
在 【Python作品分享】minecraft1.6.7【作品秀】 中回复
其实你的程序有严重BUG,来看看我无BUG的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:你输入的整数不合理")
break

2021-08-03T13:05:51 点赞:0
在 【kitten4.0反馈】遇到问题不要怕,技术喵来帮你忙! 中回复
下面是我搞的图片,我执行代码(其中一串,但其实两串都包含)的时候发现能打印HI,强烈建议修复BUG
2021-08-07T18:14:19 点赞:0
在 【社区功能反馈】用心倾听,用头发发电!(2026更新版) 中回复
源码精灵:
探险结束后,拿奖励时不会切换界面,只会给经验,只有退出后再重来或者再点击一次才行。(百分百出现)
2021-08-07T21:38:26 点赞:0
在 【小游戏】闭着眼在键盘上打字,你能打出什么? 中回复
二付金额为妇女违法和很不方便好好计划三十多年三季度报东经北纬火热蜂王浆咖啡文化发布和微博和成本部分未缴费金额为
2021-08-08T18:01:09 点赞:0