import os
import random
password1 = 0
while True :
os.system("cls")
print("\t\t英雄商城登录界面")
print("~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*")
print("\t\t1.用户登录\n")
print("\t\t2.用户注册\n")
print("\t\t3.退出系统\n")
print("~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*")
chioce = int(input("请输入您的选择:"))
if chioce == 1 :
if password1 == 0 :
print("\t\t您还没有账号!请注册后登录。")
os.system("pause")
else :
while True :
new_name = input("输入您的用户名称:")
new_password = int(input("请输入您的密码:"))
if new_name == name1 and new_password == password1 :
os.system("cls")
print("\t\t登录成功......")
os.system("pause")
while True :
os.system("cls")
print("\t\t英雄商城首页")
print("~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*")
print("\t\t1.进入英雄超市\n")
print("\t\t2.休闲小游戏\n")
print("\t\t3.返回上一层\n")
print("~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*")
chioce2 = int(input("请输入您的选择:"))
if chioce2 == 1 :
while True :
print("\t\t英雄联盟新款皮肤1折起,只需要支付28元人民币!")
quantity = int(input("请输入需要购买的数量:"))
price = quantity * 28
print("\t\t总共需要支付金额为:",price)
print("是否支付 是/否:",end = "")
chioce3 = input()
if chioce3 == '是' :
while True :
money = int(input("请支付商品所需要的金额:"))
if money == price :
print("\t\t支付成功!谢谢您的支持!")
os.system("pause")
os.system("cls")
break
else :
print("\t\t支付金额错误!请重新支付。")
break
else :
os.system("cls")
break
if chioce2 == 2 :
while True :
os.system("cls")
chaos_word = ''
chioce4 = ''
words = ['answer','difficult','python','hello','look','orange']
print("\t\t欢迎来到猜词游戏!")
choice = input("是否进行游戏 是/否 :")
if choice == '是' :
choice_word = random.choice(words)
length_word = len(choice_word)
k = random.sample(choice_word,length_word)
for i in range(length_word) :
chaos_word += k[i]
print("乱序单词为:"+chaos_word)
word = input("请输入您猜测的英文单词:")
if word == choice_word :
print("恭喜你猜对了!")
chioce4 = input("还想继续吗? Yes/No:")
if chioce4 == 'No' :
break
else :
print("偶~!猜错了,正确答案是:"+choice_word)
chioce4 = input("还想继续吗? Yes/No:")
if chioce4 == 'No' :
break
else :
print("\t\t欢迎下次光临!")
os.system("pause")
break
if chioce2 == 3 :
break
break
if chioce == 2 :
while True :
phone_number = int(input("请您输入您要注册的电话号码:"))
if 10000000000 < phone_number < 99999999999 :
while True :
Verification_code = int(input("请输入验证码:"))
if 100000 < Verification_code < 999999 :
while True :
name1 = input("请设置用户名称:")
name2 = input("请在输入一遍名称:")
password1 = int(input("请设置密码:"))
password2 = int(input("请再次输入密码:"))
if password1 == password2 and name1 == name2:
print("\t\t注册成功!请重新登录。")
os.system("pause")
break
else :
print("\t密码输入不一致,请重新输入!")
break
else :
print("\t验证码错误!请重新输入。")
break
else :
print("\t该手机号已注册或您输入的手机号有误!请重新输入。")
if chioce == 3 :
print("\t\tGame over !\n")
break
if chioce != 1 and chioce != 2 and chioce != 3 :
print("\t\t你选择错误,呜呜呜~~~~")
os.system("pause")
os.system("cls")