Week 4

Frank, Ian and Glen's Letters

The command line, a package that draws letters, and a random choice when the person does not pick a font.

You type

No extra words, or a flag plus a font name. Then a line of text.

The tool
The words after the file name 0 figlet.py 1 a flag 2 a font
What comes out

That line drawn in a font, or the program stops when the words are wrong.

The question, more slowly

The question is: draw a line of text in a FIGlet font. With no extra command-line words, you choose a font at random from the package's list. With two extra words, the first is the flag the spec names and the second is a font that exists. Any other count, a wrong flag, or a font that is not in the list, and the program stops with the message the tests expect.

The spec shows how to build the object, list the fonts, set one, and render a string. You decide which path runs, then you prompt for the text to draw. The random choice happens only on the zero-argument path.

People treat the font name as the text to draw, or they accept one extra word. Count the words after the file name before you look at what they say.

Before you code

Write a tiny program that prints the one word after the file name and stops when the count is wrong. No fonts.