Monday, April 28, 2014

Day 23

Explored some Python at Gork Learning. Worked on, Hour of Code: The Dark Tunnel – adventure game! Learned to use the print and input functions to print out an action the player has chosen to do after they type it in.

The code I used:
print("What action would you like to do? ")
action = input("> ")
print("You", action, “around.”)

The interactions looked like this:
What action would you like to do?
> look
You look around

What action would you like to do?
> jump
You jump around

What action would you like to do?
> run
You run around

No comments:

Post a Comment