python 控制台 测前世游戏

import random


# 前世
class PastLife:
    def __init__(self, name, profession, life, causeOfDeath):
        self.name = name
        self.profession = profession
        self.life = life
        self.causeOfDeath = causeOfDeath

    def __str__(self):
        return "您的前世是" + self.profession + self.name + "活了" + str(
            self.life) + "岁.您前世死于" + self.causeOfDeath


# 今生
class ThisLife:
    def __init__(self, name, sex):
        self.name = name
        self.sex = sex

    # 穿越
    def passThrough(self):
        i = random.randint(0, 3)
        if i == 0:
            pastLife = PastLife("孙尚香", "郡主", 64, "自尽")
        elif i == 1:
            pastLife = PastLife("张飞", "车骑将军", 53, "谋杀")
        elif i == 2:
            pastLife = PastLife("诸葛亮", "孔明先生", 60, "气死")
        else:
            pastLife = PastLife("荀彧", "大聪明", 57, "老死")
        return pastLife


def main():
    thisLife = ThisLife(input("请输入你的姓名:"), input("请输入您的性别(男或女):"))
    p = thisLife.passThrough()
    print("天灵灵!地灵灵!太上老君急急如律令......", p)


main()
暂无评论

发送评论 编辑评论


				
|´・ω・)ノ
ヾ(≧∇≦*)ゝ
(☆ω☆)
(╯‵□′)╯︵┴─┴
 ̄﹃ ̄
(/ω\)
∠( ᐛ 」∠)_
(๑•̀ㅁ•́ฅ)
→_→
୧(๑•̀⌄•́๑)૭
٩(ˊᗜˋ*)و
(ノ°ο°)ノ
(´இ皿இ`)
⌇●﹏●⌇
(ฅ´ω`ฅ)
(╯°A°)╯︵○○○
φ( ̄∇ ̄o)
ヾ(´・ ・`。)ノ"
( ง ᵒ̌皿ᵒ̌)ง⁼³₌₃
(ó﹏ò。)
Σ(っ °Д °;)っ
( ,,´・ω・)ノ"(´っω・`。)
╮(╯▽╰)╭
o(*////▽////*)q
>﹏<
( ๑´•ω•) "(ㆆᴗㆆ)
😂
😀
😅
😊
🙂
🙃
😌
😍
😘
😜
😝
😏
😒
🙄
😳
😡
😔
😫
😱
😭
💩
👻
🙌
🖕
👍
👫
👬
👭
🌚
🌝
🙈
💊
😶
🙏
🍦
🍉
😣
Source: github.com/k4yt3x/flowerhd
颜文字
Emoji
小恐龙
花!
上一篇
下一篇