2015-11-04 102 views
-2
import random 
import time 

print ('WELCOME TO MYSTREY MADNESS warning this is my first game their will be bugs') 
time.sleep (2) 
print ('you will be asked to pick a route and the game will pick a random outcome') 
time.sleep (2) 
print ('pick one of the two options that will appear in a moment type 1 or 2 next to the one that you wnat to pick') 
time.sleep (2) 
guess_1 = int(input('you are at the beach you are bored type 1 to go to the rock pools type 2 to go to the cave') 
    if guess_1 == 1 
     ("you went to the rock pools what do you do now?") 
    else guess_1 == 2, 
     print('you go to the cave and look into the darkness what do you do now?'), 

我對我唯一的輸入嘗試了原始輸入,但它仍然給我一個錯誤消息。解析時意外的EOF?

+1

您的語法有很多基本錯誤。你可能想重新閱讀你正在經歷的教程。 –

回答

1

正如Morgan所說,你的代碼有一些語法錯誤。您應該關閉一些括號並在一些行的末尾刪除昏迷。 此代碼應該很好:

import random 
import time 

print ('WELCOME TO MYSTREY MADNESS warning this is my first game their will be bugs') 
time.sleep (2) 
print ('you will be asked to pick a route and the game will pick a random outcome') 
time.sleep (2) 
print ('pick one of the two options that will appear in a moment type 1 or 2 next to the one that you wnat to pick') 
time.sleep (2) 
guess_1 = int(input('you are at the beach you are bored type 1 to go to the rock pools type 2 to go to the cave')) 
if (guess_1 == 1): 
    print("you went to the rock pools what do you do now?") 
elif (guess_1 == 2): 
    print('you go to the cave and look into the darkness what do you do now?') 
+1

請刪除'if(guess_1 == 1):'中的圓括號。他們是多餘的。 '如果guess_1 == 1:'就夠了。 – Matthias