main.py
#!/usr/bin/python
#_*_coding:utf-8_*_
'''
I create a psychological game , here's 5 parts of the game :
Body_Health,Love,Inter_Communication,Internet and Study.
Creater : lippor
Time:Mon Mar 20
命名規(guī)則:
class:小寫(xiě)_組合
def:小寫(xiě)_組合
doc:小寫(xiě)_組合
parameter:首字母大寫(xiě)_組合
module:首字母大寫(xiě)_組合
'''
import random
import os
import sys
import re
import time
#導(dǎo)入各個(gè)游戲模塊
import Body_Health
import Love
import Inter_Communication
import Internet
import Study
# 不能使用Tab鍵在字典KEY前面進(jìn)行縮進(jìn)蝗羊。
Part = {
1:'Body_Health:\n\tThis is the capital of our revolution.',
2:"Love:\n\tlove is the world's most warm seek.",
3:'Inter_Communication:\n\twithout you, I will accomplish nothing.',
4:'Internet:\n\tthe spider is not terrible, terrible is unable to find the direction of the spider.',
5:'Study:\n\twe can not give up the pursuit of excellence in life.'
}
# the main def
#游戲開(kāi)始主函數(shù):
def Game_Start():
print """
Welcome to take part in this wonderful psychological game !
At the begging,you need make a choice from the follow five parts in Random Mode :
Body_Health,Love,Inter_Communication,Internet and Study.
Are you ready ? (Y & N)
"""
Begin_Chioce = raw_input('> ')
Game_Chioce(Begin_Chioce)
#游戲模塊選擇函數(shù):
def Game_Chioce(Begin_Chioce):
if Begin_Chioce == 'Y':
#print "You are very lucky,you choose the part:", random.randint(1, 6)
#print "You are very lucky,you choose the part:", int(random.randint(1, 6))
#Choose = Part[int(random.randint(1, 6))]
Choose = Part[2]
print "You are very lucky,you choose the part:%s"%Choose
if Choose == Part[1]:
#調(diào)用模塊中的類(lèi)的時(shí)候,需要先加上模塊的名稱(chēng)作前綴。
#B = Body_Health.body_health()
Body_Health.start()
print "Do you want to go on this interesting game? Y or N"
Go_On = raw_input('> ')
if Go_On == 'Y':
Game_Start()
else:
print "Thanks for your playing! Welcome to play this game again ! Bye~"
#Body_Health.body_healt.start()
elif Choose == Part[2]:
#print "ll"
#L = Love.love()
Love.start()
elif Choose == Part[3]:
print "ll"
#inter_communication.start()
elif Choose == Part[4]:
print "ll"
#internet.start()
elif Choose == Part[5]:
print "ll"
#study.start()
else:
print "the system has an error *^*"
Game_Start()