2017-08-26 7 views
3

"B"や "C"のオプションがうまくいかない理由はかなり混乱しています。 3つのオプションのいずれかを選択してストーリーをナビゲートすることができます。機能する唯一のオプションは "A"です。それはおそらく私が見落としてきた最も小さなものです。BとCは動作しません(Python3)

Click to See the Code Window

プログラムを実行する(Fuctions.pyから、SplashScreens()):

... 
print(SplashScreen.Splash_Screen19) 
cls() 
Story_1_to_4(Text.Story_1,2,3,4) 

これを実行...(Functions.pyに位置){{= Trueを介し} }キー= Falseの

def Story_1_to_4(Story_Num, Path1, Path2, Path3): 
global Through 
global Key 
if Path1 == 3 and Path2 == 4 and Path3 == 10: 
    Key = True 
while Through == True: 
    Choice = input(Story_Num) 
    if Choice == "A": 
     Choice = Path1 
     Through = False 
    elif Choice == "B": 
     Choice = Path2 
     Through == False 
    elif Choice == "C": 
     Choice = Path3 
     Through == False 
    else: 
     cls() 
     print(Text.Invalid_Syntax) 
     time.sleep(2) 
     cls() 
ResetThrough() 
Decision(Choice) 

Story_1:(Text.pyから)

Image of the Variable Story_1

そして意思決定がある...(Functions.pyに位置)Aについては

def Decision(Choice): 
cls() 
if Choice == 1: 
    Story_1_to_4(Text.Story_1,2,3,4) 
elif Choice == 2: 
    Story_1_to_4(Text.Story_2,3,4,10) 
elif Choice == 3: 
    Story_1_to_4(Text.Story_3,5,6,4) 
elif Choice == 4: 
    Story_1_to_4(Text.Story_4,7,8,9) 
elif Choice == 5: 
    Story_Ending(Text.Story_5) 
elif Choice == 6: 
    Story_Ending(Text.Story_6) 
elif Choice == 7 and Key == True: 
    Story_Ending(Text.Story_7_With_Key) 
elif Choice == 7 and Key == False: 
    Story_Ending(Text.Story_7_Without_Key) 
elif Choice == 8: 
    Story_Ending(Text.Story_8) 
elif Choice == 9: 
    Story_Ending(Text.Story_9) 
elif Choice == 10: 
    Story_Ending(Text.Story_10) 
+1

実行可能コードへのリンクありがとうございます。もしここにすべての質問だけがそれを持っていれば、はるかに簡単になります。 –

+1

問題はありません@AlexHall私はそれが問題を解決するのに便利だろうと思った –

答えて

2

、あなたはThrough = Falseを設定します。 BとCの場合、式を評価するだけでThroughを割り当てないThrough == Falseを書きました。

関連する問題