
I’ve been working on JupyterHub Notebooks recently – a collaborative document format which can run Python code in small code windows. It’s excellent for teaching and developing skills in programming.
To this end I have been working on draft 1 of an adventure where you need to solve a series of puzzles using various Python skills such as conditional statements, iteration, arrays and the like. At the moment it needs some work because I think it starts with something quite complex, and I would like to begin with puzzles which start at the basics of coding and then build up culminating in the challenge of creating a little game.

The code is:
message = ".ebordraw em ni xob eht dniF .87 eb rebmun ykcul em dna 8171 eb htrib ym fo raey ehT"
# decode the message in the line below
decoded_message = message[::-1]
print("The decoded message is", decoded_message)
That’s a bit hard to start with, so I’m working on other clues with something more basic. I also have little sections which have the answer hidden – if it’s text the answer is encoded in an md5 string and if it’s a number there is a complex calculation and these tell you if you are on the right track.
At the end, as I said, there is an opportunity to build a little game. It could go anyway, but it would give you the opportunity to see how far a student has got with his/her programming skills.

Code (this would be my solution:
import random
turns = 0
injuries = 0
for turns in range(1,10):
walk_direction=input(f"Step {turns} Current injuries {injuries}: Turn Left or Right?").lower()
print(f"You turn to the {walk_direction}")
injury = random.randint(0,1)
if injury==1:
injuries = injuries + 1
print(f"Oh, no a trap causes you an injury. You now have {injuries} injuries on your body!")
if injuries>2:
print(f"You have died from an excessive amount of injuries.")
break
if injuries<3:
print("You have survived the dangerous path through the cave of the skull!")
This is an animated GIF of it running:

I think the method could be applied to a number of genres: spy stories, crime detection and the like. I just need to get the puzzles a little more refined. It’s a good start.