Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from random import randint #I did this for you, Jonas
- print"Lobster Pots: Python Edition"
- Days = 7
- Lobsters = 0
- Pots = 0
- Money = 100
- while Days > 0:
- Boundary = randint(6,11)
- FirstRoll = randint(1,6)
- LobsterPrice = randint(15,29)
- PotPrice = randint(24,36)
- print"You currently have", Days, "days left, $", Money, ",", Pots,"pots, and", Lobsters,"lobsters."
- print"Weather report:"
- print"The weatherman has rolled a", FirstRoll, ". A", Boundary, "is needed for a storm today."
- print"Market report:"
- print"Today, lobsters are selling for $", LobsterPrice, "and pots are selling for $", PotPrice, "."
- if Lobsters > 0:
- print"How many lobsters would you like to sell?"
- LobstersSelling = int(raw_input("> "))
- if LobstersSelling <= Lobsters:
- print"You sell", LobstersSelling, "lobsters for $", LobstersSelling * LobsterPrice, "."
- Money += LobsterPrice * LobstersSelling
- Lobsters -= LobstersSelling
- else:
- print"Selling all of your lobsters..."
- Money += LobsterPrice * Lobsters
- Lobsters = 0
- if Money >= PotPrice:
- print"How many pots would you like to buy? (You have $", Money, ", so you can afford ", Money / PotPrice, ")"
- PotsBuying = int(raw_input("> "))
- MoneySpent = PotsBuying * PotPrice
- if MoneySpent <= Money:
- print"You buy", PotsBuying, "pots for $", MoneySpent, "."
- Money -= MoneySpent
- Pots += PotsBuying
- else:
- print "You don't have enough money."
- if Money < 24 and Lobsters == 0 and Pots == 0:
- Days = 0
- continue
- if Pots > 0:
- print"How many pots would you like to put inshore? (You have", Pots, "pots)"
- Inshore = int(raw_input("> "))
- if Inshore > Pots:
- print"Putting all of your pots inshore..."
- Inshore = Pots
- Outshore = 0
- else:
- Outshore = Pots - Inshore
- print"Putting ", Inshore, "pots inshore and ", Outshore, "pots outshore."
- SecondRoll = randint(1,6)
- Total = FirstRoll + SecondRoll
- print"The weatherman rolled a", SecondRoll, "! ",
- if Total >= Boundary:
- print"It was stormy!"
- if Outshore > 0:
- print"You lost", Outshore, "pots, but you still gained", Inshore,"lobsters for your inshore pots."
- Pots -= Outshore
- Lobsters += Inshore
- else:
- print"Luckily you put all of your pots inshore, and gained ", Inshore, " lobsters."
- Lobsters += Inshore
- else:
- print"The weather was fine!"
- LobstersGained = (Outshore * 2) + Inshore
- print"You gained", LobstersGained, "lobsters!"
- Lobsters += LobstersGained
- print " "
- Days-=1
- print"You sold all your pots for $10 and all your lobsters for $15."
- print"You finished with $", Money + (Pots * 10) + (Lobsters * 15), ". Thanks for playing!"
Advertisement
Add Comment
Please, Sign In to add comment