Python Arena

Projects

Larger programs, built one milestone at a time. Each milestone starts from your own code of the one before it, so at the end you have one whole program that you wrote.

  • A command calculator (After module 18: More strings and lists): A calculator you talk to in commands such as add 3 4 or sum 1 2 3. A function for each operation, a line taken apart with split, clear messages for bad input instead of a crash, a history of what you calculated, and ans for the last answer.
  • The Game of Life (After module 19: More lists): A grid of cells that live and die by four simple rules, kept in a list of lists. Print the grid, count each cell's neighbors, work out the next generation, type in a starting pattern, and watch it change until it dies out or settles down.
  • A text adventure (After module 23: Reading files): A small game you play by typing. Walk through the rooms of an old clockmaker's house, pick things up, open a locked door and start the great clock again, with the whole world read from a file into dictionaries.
  • A library loan desk (After module 38: Objects as attributes): The loan desk of a small neighborhood library, built from classes. Books and members, a search, loans that know their book and their member, due days and late returns, a limit per member, and a desk that takes commands.