吾爱破解 - LCG - LSG |安卓破解|病毒分析|www.52pojie.cn

 找回密码
 注册[Register]

QQ登录

只需一步,快速开始

查看: 1179|回复: 1
收起左侧

[会员申请] 申请会员ID:kill999

[复制链接]
吾爱游客  发表于 2023-9-8 11:31
1、申 请 I D :kill999
2、个人邮箱:1214609339@qq.com
3、原创技术文章:用python写了一个简单的猜拳游戏,以下是源码

import random
import datetime
import os
xlm = 0  #初始化xlm
while xlm <= 3 :  #xlm>3便不在循环
person = int(input("石头(1),剪刀(2),布(3)")) #输入123即可选择石头剪刀布
computer = random.randint(1,3) #电脑随机数范围未1-3
if person == 1:        #判断并打印出石头剪刀布
    print ("养鱼人:石头")
elif person == 2:
    print("养鱼人:剪刀")
elif person == 3:
    print("养鱼人:布")
elif person >3:
    print("超出范围了")
if computer == 1:
    print("电脑:石头")
elif computer == 2:
    print("电脑:剪刀")
else:
    print("电脑:布")
if person == computer: #判断输赢的条件
    print ("平分秋色")
elif person == 1 and computer == 2 or person == 2 and computer == 3 or person == 3 and computer == 1:
    print("恭喜你!你赢了")
    #break
elif person == 1 and computer == 3 or person == 2 and computer == 1 or person ==3 and computer == 2:
    print("很遗憾!你输了")
    #xlm +=1
else:
    print("你想飞啊")
    xlm +=1
time1 = datetime.datetime.now() #获取现在的时间
print (time1) #打印时间

发帖前要善用论坛搜索功能,那里可能会有你要找的答案或者已经有人发布过相同内容了,请勿重复发帖。

Hmily 发表于 2023-9-11 11:10
抱歉,未能达到申请要求,申请不通过,可以关注论坛官方微信(吾爱破解论坛),等待开放注册通知。

本版积分规则

快速回复 收藏帖子 返回列表 搜索

RSS订阅|小黑屋|处罚记录|联系我们|吾爱破解 - LCG - LSG ( 京ICP备16042023号 | 京公网安备 11010502030087号 )

GMT+8, 2024-4-29 11:10

Powered by Discuz!

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表