Avast, you corny-faced gollumpus! Ye are barrelman for this watch. D’ye ken what I mean, ye addle pated blunderbuss?! Ah, land lubber ye be! OK, then, you are the lookout in the crow’s nest — the little bucket attached to the top of a mast of a sailing ship. Your job is to keep a lookout for interesting or dangerous things, like a ship to plunder or an iceberg to avoid. When you see something like a "narwhal," you are supposed to cry out, "Ahoy, Captain, a narwhal off the larboard bow!" If you see an octopus, you’ll shout "Ahoy, Captain, an octopus off the larboard bow!" (We’ll assume everything is "off the larboard bow" for this exercise. It’s a great place for things to be.) |
From this point on, I will describe a coding challenge that you should write on your own. I will discuss key ideas you’ll need to solve the problems as well as how to use the provided tests to help you know when your program is correct. You should have a copy of the Git repository locally (see the setup instructions). You should write your program in the chapter’s directory, like this program should be written in the 02_crowsnest
directory where the tests for the program live.
In this chapter, we’re going to start off working with strings. By the end, you will be able to:
- Create a program that accepts a positional argument and produces usage documentation
- Create a new output string depending on the inputs to the program
- Run a test suite