My #100daysOfCode Challenge - Python 100 projects in 100 days - Journal Entry - Day 3
Anthony Beckford🚀
Posted on November 14, 2020
Day 3 - Treasure Island
print('''
| | | |
______|__________.="";=._________|_______________|____
| | ,-",="" `"=.| |
|_________________|"=._o`"-. "=.______________|___________________
"=.o`"=. `"=. |
|
______|_______________:=._o "=.."_.-="'"=._____________|____
| | .--" , ; `"=.o." ,-"""-. ". |
|______________|." ,. .
, `"-."-._ ". '|___________________
| |o"=._
, "; .". , "-."-.; ; |
______|_____| ;-.o
"=.; ." '
."` . "-._ /__________|____
| | |o; "-.o
"=. '` " ,.--o; |
|_______________|| ; (#) -.o
"=.`_.--"_o.-; ;|__________________
_///|o;._ " `".o|o_.--" ;o;_///_
/___///"=.o--. ; | ; ; ;/_///
__/___//__/"=._o--. ;o|o; .;o;_///_
/___////"=._o.; | ;.--"o.--"/___///
__/___////"=.o|o_.--""/__///_
/___//////////__ /
''')
question1 = input('You\'re at a cross road. Where do you want to go? Type "left" or "right" ')
question1_lowercase = question1.lower()
if question1_lowercase == "left":
question2 = input('You come to a lake. There is an island in the middle of the lake. Type "wait" to wait for a boat. Type "swim" to swim across ')
question2_lowercase = question2.lower()
if question2_lowercase == "wait":
question3 = input('You arrive at the island unharmed. There is a house with 3 doors. One red, one yellow and one blue. Which door do you choose? Type "red", "yellow" or "blue" ')
question3_lowercase = question3.lower()
if question3_lowercase == "yellow":
print("You Win!")
else:
print("Game Over.")
else:
print("Game Over.")
else:
print("Game Over.")
https://www.draw.io/?lightbox=1&highlight=0000ff&edit=_blank&layers=1&nav=1&title=Treasure%20Island%20Conditional.drawio#Uhttps%3A%2F%2Fdrive.google.com%2Fuc%3Fid%3D1oDe4ehjWZipYRsVfeAx2HyB7LCQ8_Fvi%26export%3Ddownload
Key Takeaways:
- Learned about Conditional Statements
- Logical Operators
- Code Blocks and Scope
Posted on November 14, 2020
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.
Related
November 14, 2020