Может кто-нибудь проверить мой код
Кажется, я не могу понять, почему мой код не работает, этот код был написан на python, и я пытался сделать текстовую приключенческую игру minecraft, всякий раз, когда я открываю программу, она немедленно выходит, если вы знаете проблему, не могли бы вы помочь, но если вы этого не делаете, то не могли бы вы сказать мне, что делать, чтобы я мог хотя бы увидеть сообщение об ошибке, которое я получаю. Спасибо. вот код для проекта, над которым я пытаюсь работать.
print ('Welcome to the homepage of your program!') print () print('Would you like to enter your information') print ('Please enter yes or no') yesorno = input() if yesorno == 'yes': print() print("Please enter your name") # This is how you would run script from another python file # exec(open('Your Python File.py').read()) # the file that you are going to open has to be in the same directory # as the file that we are coding right now (or the file that you are coding) # You can also open up text files as well I think name = input() print() print('It is nice to meet you', name) print() print('Please enter your age') age = input() print('You will be', int(age) + 1, 'next year') print() if yesorno == 'no': print ('Then please continue with the rest of the program') print ('Would you like to play a text adventure game? or would you like to learn to code?') answer = input() if answer == 'text adventure game': print ('Which text adventure game would you like to play') print ('The current games that we have are Minecraft') whichgame = input() if whichgame == 'Minecraft': print ('You spawn in a welcoming world with mobs, caves, and lots of animals') print ('What is the first thing that you want to do?') print ('Your options are mine trees, get food, get wool, go exploring') whattodonext = input() if whattodonext = 'Enter a cave': print ('There was a bunch of skeletens and zombies in the cave, you are dead, sorry!') elif whattodonext = 'get food': print ('You see a cow, a chicken, a sheep, and a pig, which one would you like to kill first') print ('Please enter cow, chicken, sheep, or pig') killfirst = input() if killfirst == 'cow': print ('Congratulations, You have got some food!') elif killfirst == 'chicken': print ('Yay you have got one piece of chicken!') elif killfirst == 'sheep': print ('You have got some wool and food! That is a great start') elif killfirst == 'pig': print ('Sorry! The pig that you were trying to kill has fallen into a ditch') elif whattodonext == 'mine trees': print ('How many trees do you want to mine') print ('You can mine up to 10 trees, please enter a number') numberoftrees = input() if numberoftrees == '1': # type code inside here print ('You have four pieces of oak wood') print() print ('Would you like to create a crafting table') createacraftingtable = input() if createacraftingtable == 'yes': print ('You are going to need more wood to create something with this crafting table') elif numberoftrees == '2': # type code inside here elif numberoftrees == '3': # type code inside here elif numberoftrees == '4': # type code inside here elif numberoftrees == '5': # type code inside here elif numberoftrees == '6': # type code inside here elif numberoftrees == '7': # type code inside here elif numberoftrees == '8': # type code inside here elif numberoftrees == '9': # type code insider here elif numberoftrees == '10': # type code inside here elif whichgame == 'I do not want to play a game': print ('Then please feel free to exit out of this program and try again some other time')
Что я уже пробовал:
Я пробовал отлаживать свой код, но никак не мог понять, что же не так с моей программой, поэтому прошу всех вас, ребята, о помощи. Я был бы очень признателен за некоторую помощь или обратную связь по этому вопросу.