level = 1 pay = 1 gold = 50 explored = 0 north == 0 south = 0 east = 0 west = 0 places = { 1 : 'North', 2 : 'South', 3 : 'East', 4 : 'West' } jobs = { 1 : 'Smith', 2 : 'Clother', 3 : 'Hotel', } inv = { 1 : 'Leather Helmet' , 2 : 'Leather Jacket' , 3 : 'Leather Pants(not the most comfortable!)' , 4 : 'Leather Boots' , 15 : 'Gold: ' + str(gold) } def Monster() : print 'Monster Battle!' def Job() : print 'This is the menu for jobs here are the commands: ' print 'Find New job (FNJ) or Work.' jobres1 = raw_input('What will you do? ') if jobres1.lower() == 'fnj' or jobres1.lower() == 'find new job' or jobres1.lower() == 'find job' : print 'Were do you want to work?' for yo in jobs : print 'Avalible places to work: ' + jobs[yo] jobchoice = raw_input('Were do you want to work?') if jobchoice.lower() == 'smith' : print 'You now work at the blacksmith!' print 'The pay is 10 gold a work day!' pay = 10 MainInput() elif jobchoice.lower() == 'clother' : print 'You now work at the clother!' print 'The pay is 10 gold a work day!' pay = 10 MainInput() elif jobchoice.lower() == 'hotel' : print 'You now work at the hotel!' print 'The pay is 10 gold a work day!' pay = 10 MainInput() elif jobchoice.lower() == 'farm' and level == 2: print 'You now work at a farm!' print 'The pay is 20 gold a work day!' pay = 20 MainInput() elif jobchoice.lower() == 'market' and level == 3 : print 'You now work at the market!' print 'The pay is 30 gold a work day!' pay = 30 MainInput() elif jobchoice.lower() == 'butler' and level == 4 or jobchoice.lower() == 'lord\'s butler' and level == 4 : print 'You are now the lord\'s butler!' print 'The pay is 40 gold a work day!' pay = 40 MainInput() elif jobchoice.lower() == 'lord' and level == 5 : print 'You now own the lands!' print 'You win!' res1 = raw_input('Continue? Y/N') if res1.lower() == 'y' or 'yes' : MainInput() else : print 'Bye! Thanks for playing!' else : print 'Sorry invalid job choice!' MainInput() elif jobres1.lower() == 'work' : gold = gold + pay print 'You have worked a hard day and earned ' + str(pay) + ' gold!' print 'Sorry invalid choice!' MainInput() def Inventory() : for A in inv : print inv[A] MainInput() def Hotel() : print 'Welcome ' + name + ' To the Granandale hotel!' stay = raw_input('How many days do you want to stay? type the amount of letters as the number!') total = len(stay) * 10 print 'Your stay will cost ' + str(total) + ' Gold coins.' pay = raw_input('Will you stay? yes/no') if pay.lower() == 'yes' or pay.lower == 'y': print 'Thanks for your stay!' gold = gold - total else : print "Alright then. OH hey don't come back ever again." MainInput() def Explore(): print 'Places you are able to go: ' for n in places : print places[n] side = raw_input('What direction will you go?') if side.lower() == 'north' or side.lower() == 'north side' : print 'Not much to see except the church which has high arches for it\'s entrance and a massive chapel.' north == 1 MainInput() elif side.lower() == 'south' or side.lower() == 'south side': print 'It looks like it\'s the towns shopping district. it is full with people moving from stall to stall.' south == 1 MainInput() elif side.lower() == 'east' or side.lower() == 'east side': print 'It seems like the residential housing. There is only houses in rows.' east == 1 MainInput() elif side.lower() == 'west' or side.lower() == 'west side': print 'Looks like the Lord of land\'s castle along with some farms.' west == 1 MainInput() elif side.lower() == 'woods' : Monster() else : print 'Invalid choice' MainInput() def MainInput() : print 'here are the acceptable commands: ' print "Inventory, Explore, Hotel, Job, Smith, Clother, Quit" if level == 2 : jobs[4] = 'Farm' elif level == 3 : jobs[5] = 'Market' elif level == 4 : jobs[6] = 'Lord\'s Butler' elif level == 5 : jobs[7] = 'The Lord Himself' else : jobs[1] = 'Smith' print str(north) + ' ' + str(south) + ' ' + str(east) + ' ' + str(west) if north == 1 : print 'Finnaly there you are!' print 'I have gotten the permit!' print 'You are now allowed to go into the woods!' print 'but beware a monster lurks there.' places[5] = 'Woods' else : print 'Still waiting on the permit sorry!' res1 = raw_input('what do you want to do?') if res1.lower() == 'inventory' : Inventory() elif res1.lower() == 'explore' : Explore() elif res1.lower() == 'hotel' : Hotel() elif res1.lower() == 'job' : Job() elif res1.lower() == 'smith' : Smith() elif res1.lower() == 'clother' : Clother() elif res1.lower() == 'quit' : print 'Bye!' else : print 'Invalid command!' MainInput() name = raw_input('What is thy name?') print 'Welcome ' + name + ' to Granandale!' print 'We are known for our Cookies!' print 'You are welcome to go anywere in town!' print "just don't go outside until we give you special permission as a adventurer!" MainInput()
Run
Reset
Share
Import
Link
Embed
Language▼
English
中文
Python Fiddle
Python Cloud IDE
Follow @python_fiddle
Browser Version Not Supported
Due to Python Fiddle's reliance on advanced JavaScript techniques, older browsers might have problems running it correctly. Please download the latest version of your favourite browser.
Chrome 10+
Firefox 4+
Safari 5+
IE 10+
Let me try anyway!
url:
Go
Python Snippet
Stackoverflow Question