Legend of the Python Pirate

NOTE: At a later stage I will also release the Pi-Kitchen recipe which allows the “lighthouses” (4 Raspberry Pi’s each with Pi-Stops flashing different Pirate Codes) to be installed directly from NOOBS (including automatically running on the following power-up).

If you do not have the extra lighthouses, you can still use the workshop by using the version of the map which has the signals and codes already filled in (see section below – Workshop without lighthouses).

The Legend of the Python Pirate workshop for the @Bristol Digi-makers event on Saturday November 29th 2014.

PythonPiratePaper

The legend of the Python Pirate – Write the python code to control the light-houses, read the hidden codes, locate the gold and uncover the secret of the Python Pirate.

 

The workshop is suitable for beginners, with additional challenges as they progress.  Participants will need to read instructions and type in the provided Python code.


 

The story goes:

Following a recent discovery on-board the ‘SS Great Britain’ ship (located near the @Bristol science centre), various papers were found that indicate there is a hidden treasure belonging to the Python Pirate.  You will use the Raspberry Pi to type in the code to unravel the mystery of the ancient lighthouses which will lead you to the treasure.

 


 

Python Pirate Workshop Setup - 3 small treasure chests, 1 large (with gold coins), Combination Padlock, 4 Raspberry Pi with Pi-Stops (plus PSU/SDCards), Maps and Worksheets

Python Pirate Workshop Setup – 3 small treasure chests, 1 large (with gold coins), Combination Padlock, 4 Raspberry Pi with Pi-Stops (plus PSU/SDCards), Maps and Worksheets

 

Participants will write a program to decode messages from lighthouses located around the room, replicating the signal locally on their own lighthouse (using a Pi-Stop LED add-on board for the Raspberry Pi).  Once they have decoded the messages, they will be able to use the code to open the treasure chest and find the Python Pirate’s treasure within.  Their python program can then be extended so they can write and send their own messages.

Download the workshop sheet (PDF) and the map (as appropriate for if you have the lighthouses or not).

The workshop would take around 2 – 4 hours depending on the age group, as it consists of 3 programs (which fit together) each approximately a page each.  The workshop can be shortened by providing the code up-front and focusing on the testing aspect of each.

Preparation and Equipment (for participants):

You will need a Pi-Stop or similar LED type hardware.

Pi-Stops can be purchased from:

4tronix.co.uk

More details of the Pi-Stop is available here:

GitHub – Discover – Pi-Stop

Workshop with lighthouses and treasure chests:

You will need:

4 Raspberry Pi, with a Pi-Stop fitted sending N, S, E and W signals [once they are running you do not need a screen/keyboard attached – a Pi-Kitchen setup will be made available later which allows automated installation of NOOBS which will auto-run the required script on power up]

1 Large treasure chest filled with “treasure” and locked with a 3-digit combination padlock (a 4-digit lock can be used, just provide an extra code at the first lighthouse).

3 Small treasure chests with numbers from the padlock inside.

The original workshop makes reference to four lighthouses, which are set-up around the room at North, South, East and West positions.  They each use a version of the final code to display a cycling signal of “N”, “E”, “S” or “W” which will direct the participants to the next lighthouse in the series.

e.g. Starting at the North Lighthouse, if it has “S” then the participants will go to the South Lighthouse (where they will find a treasure-chest with the first code number inside).  They will then watch the signal of the South Lighthouse to find out where to go to next…etc.

Treasure Map (PDF) – Version of the map without codes and signals (ready to be filled in as participants visit each lighthouse.

Workshop without lighthouses:

Treasure Map Signals (PDF) – Version of the map with signals (which would be displayed by the 4 lighthouses) and codes already filled in (which would have been inside each of the small treasure chests located next to the lighthouse).

This allows the workshop to be completed without any additional equipment (just Raspberry Pi, Pi-Stop and Map).

Hint for the final Lock Code: It is related to part of Pi.

JUMPSTART CODE

It is intended that the code is typed in by the participants of the workshop, however this can take younger programmers quite a while. If time is not an issue, it is highly recommended that you do type code yourself, not only do you learn more effectively if you do, but testing, debugging and correcting code is a vital skill to gain.

Therefore, you may wish to make use of the provided source files, for reference (fully commented versions are linked below):

PART1: piratecode.py

PART2: lighthouse.py

PART3: pythonpirate.py

PART4: morsecode.py

 

SOURCE MATERIALS:

As usual, everything is available on GitHub – Python Pirate Workshop, so you can download, modify and adjust it to suit your own needs.

 

Let me know how you get on, any suggestions/comments are welcome.

Comments
  1. Gillian Miles says:

    This looks fantastic would like to try with my Year 6 Class after half term when their topic is Pirates. Please could you let me know when a Pi-Kitchen setup will be made available later which allows automated installation of NOOBS which will auto-run the required script on power up might be available.
    Thank you
    Gillian

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s