Commit cd2e70b3 authored by Reece's avatar Reece

Optimization

Changed a few bits of code it was easier to read.
parent 11e542ca
{
"python.pythonPath": "D:\\Program Files (x86)\\Python\\Python 3.8.2\\python.exe"
}
\ No newline at end of file
......@@ -4,93 +4,62 @@
yes_no = ["yes", "no"]
cash = ["easy", "normal", "hard"]
insurance = ["high","low","none"]
firstcontract = ["1","2","3"]
directions = ["left","right","forward"]
route = ["route 1","route 2"]
insurance = ["high", "low", "none"]
firstcontract = ["1", "2", "3"]
directions = ["left", "right", "forward", "reverse"]
route = ["route 1", "route 2"]
###############################################################################################
#integers#
###############################################################################################
bankbal = 0
insurancevalue = 0
contract1 = 0
contract2 = 0
contract3 = 0
contractpicked = 0
################################################################################################
#routes#
################################################################################################
route1 = 0
route2 = 0
# intro
#playername
playername = input("What is your name captain?\n")
print("Good morning Captain " + playername + "\n\nWhat is your ships name?")
#shipname
shipname = input("")
print("Excellent name Captain. SS." +shipname+ " it is.\n")
if shipname == "titanic":
if shipname.lower() == "titanic":
print("\033[1;32;40mWell this can only go well, look at what happened last time somebody called a ship The Titanic\n")
else:
print("Excellent name Captain. SS." +shipname+ " it is.\n")
###############################################################################################
#difficulty setting#
###############################################################################################
response1 = ""
while response1 not in cash:
response1 = input("\033[0;37;0m Now Captain " + playername + ", The matter of money needs to be discussed.\n£2,000,000 Easy\n£1,000,000 Normal\n£500,000 Hard\nHow much would you like to borrow to get you started?\n\neasy/normal/hard\n")
if response1 == "easy":
print("Very well Captain " + playername + " We will loan you the money. Naturally at the end of the month we expect the cash back but any profit you make you are welcome to keep.\n")
while response1.lower() not in cash:
response1 = input("Now Captain " + playername + ", The matter of money needs to be discussed.\n£2,000,000 Easy\n£1,000,000 Normal\n£500,000 Hard\nHow much would you like to borrow to get you started?\n\neasy/normal/hard\n")
if response1.lower() == "easy":
bankbal= 2000000
print("Your current bank balance is £",bankbal)
elif response1 == "normal":
print("Very well Captain " + playername + " We will loan you the money. Naturally at the end of the month we expect the cash back but any profit you make you are welcome to keep.\n")
elif response1.lower() == "normal":
bankbal = 1000000
print("Your current bank balance is £",bankbal)
elif response1 == "hard":
print("\nVery well Captain " + playername + " We will loan you the money. Naturally at the end of the month we expect the cash back but any profit you make you are welcome to keep.\n")
elif response1.lower() == "hard":
bankbal = 500000
print("Your current bank balance is £",bankbal)
else:
print("Captain " +playername+ " Im not sure what you said there please try again.\n")
else: print("Captain " +playername+ ", I'm not sure what you said there please try again.\n")
print("Very well Captain " + playername + " We will loan you the money. Naturally at the end of the month we expect the cash back but any profit you make you are welcome to keep.\n")
print("Your current bank balance is £",bankbal)
#############################################################################################
#insurance#
#############################################################################################
response2 = ""
while response2 not in insurance:
response2 = input("\nThe sea can be a cruel mistress. As your adivisor I strongly urge you to get some insuance, but of course thats your choice captain. We have 2 types available, take a look....\n\nHIGH VALUE INSURANCE\n-Cargo over the value of £1,000,000 is covered\n-Loss of any cargo is covered\n-Short to long distances covered\n~Price £200,000~\n\nLOW VALUE INSURANCE\n-Cargo UP TO £1,000,000 covered\n-Loss of cargo is not covered\n-If you transport cargo over £1,000,000 the insurance will be void\n~Price £50,000~\n\nPlease pick your insurance high/low/none\n")
while response2.lower() not in insurance:
response2 = input("\nThe sea can be a cruel mistress. As your adivisor I strongly urge you to get some insurance, but of course thats your choice captain. We have 2 types available, take a look....\n\nHIGH VALUE INSURANCE\n-Cargo over the value of £1,000,000 is covered\n-Loss of any cargo is covered\n-Short to long distances covered\n~Price £200,000~\n\nLOW VALUE INSURANCE\n-Cargo UP TO £1,000,000 covered\n-Loss of cargo is not covered\n-If you transport cargo over £1,000,000 the insurance will be void\n~Price £50,000~\n\nPlease pick your insurance high/low/none\n")
if response2 == "high":
insurancevalue = 2
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment