0% found this document useful (0 votes)
7 views2 pages

Code

The document describes an interactive text-based game where the player chooses between visiting a bank or a marketplace to obtain food and money. The player can either ask for money, attempt to rob, or buy food, with different outcomes based on their choices. The game continues until the player successfully feeds themselves or fails, ending their journey.

Uploaded by

henry.f.cutler
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views2 pages

Code

The document describes an interactive text-based game where the player chooses between visiting a bank or a marketplace to obtain food and money. The player can either ask for money, attempt to rob, or buy food, with different outcomes based on their choices. The game continues until the player successfully feeds themselves or fails, ending their journey.

Uploaded by

henry.f.cutler
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

looper=0

bank_robbed=0
money=0
building_choice = int(input("You stumble into the village, possessionless and without a cent to
your name. Your stomach audibly growls. In front of you is an aging bank, and a small
marketplace. Do you want to go to the bank (1) or the market (2)?\n"))
while looper==0 or 1: #Continues until success or death
if looper==1: #For looper purposes, allows building choice again
building_choice = int(input("Once again, you are in the main square. Do you want to go to
the bank (1) or the market (2)?\n"))
else: #Starts loop above
looper=looper+1

if building_choice == 1: #Walk into Bank


if bank_robbed ==1: #Checks if Bank has been robbed
print("The teller has left. The room is now empty, and it seems like he took all the
remaining money with him.\n")
else:
bank_approach = int(input("You walk into the decrepit building. In front of you is a teller
at a desk. Do you wish to ask the teller for money (1) or attempt to rob the teller using
intimidation (2)?\n"))
if bank_approach == 1: #Ask teller for money
print("He looks at you sadly. \"I can't give you anything for free. If you are not a patron,
I'm going to have to ask you to leave.\" You walk out of the bank.\n")
else: #Rob teller
print("You close your hands into the fist, waving threateningly at the teller. Startled, he
quickly produces a stack of bills. \"Don't hurt me. I have a family!\" You grab the money and
walk out of the bank.\n")
bank_robbed=bank_robbed+1
money=money+1
else: #Walk into Marketplace
marketplace_approach = int(input("Smells of fresh fruit waft over to you, and your stomach
audibly growls once more. This draws the attention of a local employee standing in front of a
cart containing verious delicacies. \"You seem hungry, mate,\" he says good naturedly. \"Do you
wish to make a purchase?\" Do you either buy some food (1) or attempt to rob the man (2)?\n"))
if marketplace_approach == 1 and money == 1: #Pay with money
print("You slide over your recently acquired stack of bills. He counts them carefully, then
gestures to the cart. You snatch the first thing you lay eyes on, shoveling it down. It's the most
delicious thing you've ever tasted.\n")
looper=looper+1
elif marketplace_approach == 1: #Pay without money
print("You point to what you want, but after not procuring any money, the man
scoffs. \"You need payment to pay. Come back once you have some funds.\"\n")
else: #Rob shopkeep
print("You hold up your fists threateningly, but the shopkeep immediately pulls a knife
from his belt. \"Don't cross me, thief,\" He says, ushering you out of the store. He watches you
out the window, making sure you stay away.\n")

if looper== 2: #Successful option


print ("You've succesfully fed yourself for a day. Well done!")
else: #Death
print ("You fall to the ground. Your journey is over.")

You might also like