Poetry Slam Turtlehack

by elliott

11 Feb 2016

Pair up. Merge and review your partner’s poetry slam turtle.

Choose one of your programs to collaborate on. You can use code from both but you’ll need to pick just one to start from. Make sure you both understand the code you start with.

Pair program

Working in a pair programming style, implement the following features:

  • After the user is done entering their poem and it is written to the screen, the program keeps going, asking for another poem. Make sure the old poem is cleared when the next begins.
  • When printing a long poem, the turtle prints out all of the lines that will fit nicely on the screen, waits a bit (or until the user presses enter, your choice), clears the screen, then starts over at the top. It repeats this until the poem is finished.
  • When printing a long line, the turtle prints all the characters that will fit on the screen, then prints the remaining characters on a new line. It then resumes printing lines.

You’ll note that the properties of Python’s lists and strings, which we just learned about, come in super handy in this exercise :boom:

Additional features you can go for if you finish early:
  • The program asks the user how the poem should be justified, and the user can choose "left", "center" or "right"
  • The program has one or more default poems that the user can choose to have written instead of entering their own.
  • Allow the user to select a 'mode' that formats their text using string methods. For instance, capitalizing, uncapitalizing, randomly cap/upcapitalizing each letter, etc.
  • Something else cool you think you can implement before midnight tonight.

Submit a pull request with the embedded program and a short account of how you worked together and who did what. True to pair programming style, you should each have taken the lead at various points. Don’t worry about a reflection just yet- save that for your mid-semester reflection.

To indicate multiple authors on your post, use the following in your YAML header:

author: 
- elliott
- touchwick

The above code would indicate that the post was by Ian and me. If you have a trio, add another line with the third author’s name.

Elliott Hauser is a PhD Student in information science at UNC Chapel Hill. He's hacking education as one of the cofounders of Trinket.io. Find Elliott Hauser on Twitter, Github, and on the web.