The “Pyrate” Game:
A python script for playing “The Pirate Game”
For use with worksheets by Paul Collins.
Getting Started
Requires python to be installed on your computer. Simply extract the file from the compressed folder and double click to run. The script can also be run through python IDLE.
Playing the Game
Press enter to start when prompted. The script will generate a random coordinate each turn. Coordinates will not be repeated during the game. If required, you can choose the next coordinate by pressing 1 and enter when prompted. The script will check the coordinate you have entered to prevent duplicates, and the turn number will be updated accordingly.
Pirate-themed ASCII art will be displayed randomly throughout the game. Press enter after the Game Over prompt to end the game.
Automatically checked python coding challenges for strings, numbers, booleans and lists. For use as formative or summative assessment in your lessons.
To use the test script, simple run test.py in IDLE or the command line interface of your choice. The tests will fail at first. To get them to pass, complete the return statements in the files found in the python-introduction.
The answers are included in a separate folder and instructions are available on a handout.
for example:
def say_hello(string):
return
Should be:
def say_hello(string):
return 'Hello, ' + string + '!'
Automatically checked python coding challenges.
To use test script simple run test.py in IDLE or the command line interface of your choice. The tests will fail at first. To get them to pass, complete the return statements in src/strings.py.
The answers are included in a separate folder, with the surrounding test framework so you can see what the test look like when they pass.
for example:
def say_hello(string):
return
Should be:
def say_hello(string):
return 'Hello, ' + string + '!'