猫史档案馆


Kimi_hjh

Kimi_hjh

Lv.1

我可以接受失败但绝不能接受未奋斗过的自己(现在在神岛玩交朋友加QQ:2514644742)

获赞:94收藏:16浏览:951作品收藏:37

签名: 代码岛: 地图:《迷雾逃杀》《黑夜障碍赛车》《山谷冰川湖泊》 模组:《战士头盔》 名字:唯爱_耿直的阿尔法贺嘉豪(记得关注哦!)

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

【Python作品分享】@9_谁先算到20【作品秀】 中回复

imgsrc="https://static.codemao.cn/emotion/thunder_monkey/%E6%91%87%E6%A4%85%E5%AD%90240.gif"alt="emotion_雷电猴_摇椅子"

2022-02-24T19:58:16 点赞:1

【Python作品分享】家灵cAZd 建议后的作品【作业帖】 中回复

我试了一下你的这个,我玩完后,显示的是“玩家赢了”同时和“电脑赢了”有点问题imgsrc="http://img.t.sinajs.cn/t4/appstyle/expression/ext/normal/e9/sk_thumb.gif"alt="emotion_思考"imgsrc="http://img.t.sinajs.cn/t4/appstyle/expression/ext/normal/e9/sk_thumb.gif"alt="emotion_思考"imgsrc="http://img.t.sinajs.cn/t4/appstyle/expression/ext/normal/e9/sk_thumb.gif"alt="emotion_思考" importtime importturtle importrandom __Pen=turtle.Pen() time.sleep(1) a=0 mypen=turtle.Pen() length=200 mypen.pensize(40) mypen.pencolor('lightsalmon') mypen.forward(length) mypen.pensize(30) mypen.pencolor('white') mypen.backward(length) #出数总和 total=0 while(total<20): #玩家输入整数 myscreen=turtle.Screen() try: player_num=int(turtle.textinput('谁先达到20!','请输入1~3范围的整数:')) if(player_num>3): print('请输入1~3范围的整数!') else: print('玩家出的信息',player_num) mypen.pencolor('mistyrose') mypen.forward((player_num*10)) total=(total+player_num) print("总和:",total) if(total==20): print('玩家赢了!') elif(total>20): print('玩家输了!') else: #电脑随机出整数 com_num=random.randint(1,3) print('电脑出的数',com_num) mypen.pencolor('salmon') mypen.forward((com_num*10)) total=(total+com_num) print('总和:',total) if(total==20): print('电脑赢了!') elif(total>20): print('电脑输了!') else: print('-----------------') exceptValueError: print('请输入整数!') mypen.hideturtle() turtle.done()

2022-02-28T19:40:01 点赞:1

【Python作品分享】家灵cAZd 建议后的作品【作业帖】 中回复

            elif play[0] == play[1] == play[2] == 'X':
                print('你输了')
                d = 1
            elif play[3] == play[4] == play[5] == 'O':
                print('你赢了')
                d = 1
            elif play[3] == play[4] == play[5] == 'X':
                print('你输了')
                d = 1
            elif play[6] == play[7] == play[8] == 'O':
                print('你赢了')
                d = 1
            elif play[6] == play[7] == play[8] == 'X':
                print('你输了')
                d = 1
            elif play[0] == play[3] == play[6] == 'O':
                print('你赢了')
                d = 1
            elif play[0] == play[3] == play[6] == 'X':
                print('你输了')
                d = 1
            elif play[1] == play[4] == play[7] == 'O':
                print('你赢了')
                d = 1
            elif play[1] == play[4] == play[7] == 'X':
                print('你输了')
                d = 1
            elif play[2] == play[5] == play[8] == 'O':
                print('你赢了')
                d = 1
            elif play[2] == play[5] == play[8] == 'X':
                print('你输了')
                d = 1
            elif play[0] == play[4] == play[8] == 'O':
                print('你赢了')
                d = 1
            elif play[0] == play[4] == play[8] == 'X':
                print('你输了')
                d = 1
            elif play[2] == play[4] == play[6] == 'O':
                print('你赢了')
                d = 1
            elif play[2] == play[4] == play[6] == 'X':
                print('你输了')
                d = 1

我觉得这里可以简化

2022-02-28T19:42:40 点赞:1

【Python作品分享】家灵cAZd 建议后的作品【作业帖】 中回复

import turtle
import random

myscreen = turtle.Screen()
mypen = turtle.Pen()
mypen.hideturtle()
mypen.penup()
mypen.goto(-112.5 , 0)
mypen.pendown()
count = 0
p_win = 0
c_win = 0
flag = False
while count < 10 :
player = int(myscreen.textinput("剪刀1-石头2-布3","请输入猜拳对应的数字:"))
computer = random.randint(1 , 3)
if player == 1:
print("玩家出了,剪刀")
elif player == 2:
print("玩家出了,石头")
elif player == 3:
print("玩家出了,布")
else :
print("玩家输入数字超出范围")
flag = True

if computer == 1:
print("计算机出了,剪刀")
elif computer == 2:
print("计算机出了,石头")
else:
print("计算机出了,布")

#判断胜负
if player == computer or flag:
print("此局平局或废局")
mypen.pencolor("gray")
mypen.dot(20)
flag = False
elif player == 1 and computer == 3 or player == 2 and computer == 1 or player == 3 and computer == 2:
print("此局玩家胜")
p_win = p_win + 1
mypen.pencolor("darkgreen")
mypen.dot(20)
elif player == 3 and computer == 1 or player == 1 and computer == 2 or player == 2 and computer == 3:
print("此局计算机胜")
c_win = c_win + 1
mypen.pencolor("red3")
mypen.dot(20)
mypen.penup()
mypen.forward(25)
mypen.pendown()
count = count + 1
print("--------------")

print("玩家的胜局数为:" , p_win)
print("计算机的胜局数为:", c_win)

turtle.done()

2022-03-02T18:48:51 点赞:0

吉吉喵,我答题完成了皮肤 中回复

我要宇宙人的皮肤

 

2022-04-07T19:17:30 点赞:0

【神岛创作节】一起来二创叠buff,比赛进入倒计时~ 中回复

center_image吉吉喵我答完了,我要宇航员皮肤

2022-04-07T19:20:22 点赞:0

关于神奇代码岛接入实名认证的公告 中回复

center_image吉吉喵现在可以领了吗?

 

 

2022-04-20T06:13:50 点赞:0

【神岛创作节】一起来二创叠buff,比赛进入倒计时~ 中回复

center_image吉吉喵皮肤!

 

 

 

2022-04-20T06:16:28 点赞:0

【Python作品分享】家灵cAZd 建议后的作品【作业帖】 中回复

是这样吗?

2022-04-24T05:52:34 点赞:0

【Python作品分享】家灵cAZd 建议后的作品【作业帖】 中回复

center_image

2022-04-24T05:54:44 点赞:0

【Python作品分享】家灵cAZd 建议后的作品【作业帖】 中回复

center_image

2022-04-24T05:57:34 点赞:0

【Python作品分享】家灵cAZd 建议后的作品【作业帖】 中回复

center_image还是不行,还有好多这样的

 

2022-04-28T20:23:08 点赞:0

你们的素材在哪里找的??????? 中回复

界面的最上面,论坛旁边的素材就有

或者,你进入编辑器里添加新的角色里面有素材库,有好多的素材

你可以看看

2022-08-15T10:50:03 点赞:0