Exercise 50: Your First Work Assignment

I'm now going to give you a work assignment, similar to what you might get as a professional programmer. The assignment will be to convert the list of features I give you into a complete little game that I may buy. Your job is to take my vague descriptions of things I want and make something I can use.

The purpose of this exercise is to see if you have grasped the concepts you have learned so far. We only have 2 exercises after this, but this will be your last actual assigned piece of coding.

Review What You Know

At this point you should know how to do the following:

  • Create classes and structure rooms from them.
  • Throw and raise exceptions.
  • Use functions, variables, dictionaries, lists, and tuples.
  • Turn a user's input into a list of tuples using a lexicon scanner.
  • Turn the list of tuples into a Sentence you can analyze using a parser.

Make sure you know how to do these things as you will be using them to complete this assignment.

Implementing A Feature List

Typically when you work on software you will be given a list vague and inconsistent features they want. This sucks, I won't lie to you. Typically people have no ability to think clearly about the things they want, and even less ability to describe them.

As a programmer, it is your job to take the vague things they tell you and work with them to create something they want. In fact, sometimes you will have a problem articulating what you want.

The best way to implement a feature list like this is to follow this pattern:

  1. Dump everything out of the person's head without criticizing or judging the ideas.
  2. As you dump, write these down in a spread sheet or on index cards.
  3. Take a break, collect all the features and go back through to prioritize them into MUST (have) or NICE (to have).
  4. Sort the list so that you can see what is MUST vs. what is NICE to have.
  5. Pick a piece of the MUST work, and start working on it.
  6. After about a week, show the person the software, get their feedback, and repeat this process again based on your new feedback.

This pattern can be found in one form or another in different "methodologies" programmers use to organize their work.

I'm going to give you a list of features that I want in my game, and I've already prioritized them so this is just the MUST requirements. Your job is to spend one week working on the list and getting it done.

The Feature List

  • I want a game that is set on an alien space ship.
  • The game should have a human hero who has to escape from the clutches of an alien race who has enslaved him.
  • The game will be a text adventure game, like that bear and broadsword game you did. I like games like that.
  • Oh, lasers. Totally gotta have lasers.
  • But not too powerful lasers. It should be hard to finish the game.
  • But not too hard to finish the game, just right to keep players interested. You know, like World of Warcraft. I hear people make tons of money off WoW.
  • The ship should have about 10 rooms at first, then we want to expand them.
  • I'd like to be able to change the description of the rooms without changing the code. Can you do that?
  • My friend says farms are big now, so have a scene where there's a farm and stuff.
  • The aliens should be some kind of Mafia aliens. Mafia stuff is huge now too.
  • I should be able to move around with real sentences like "go north", "open door", etc.
  • It's alright if the way the rooms are laid out is in code, but players will need a printed map. Can you keep track of the map?
  • There needs to be a story behind this, and maybe a love interest.
  • Probably a couple of geek culture references. But no Star Trek! Ok, first season is cool but nothing after that.
  • I want to be able to install it on my computer with python so can you make it install from a setup.py? That'll make it easy to package later.

Tips On Working The List

  1. Make your map, characters, and story first on paper.
  2. Write unit tests so you do not have to constantly check things by hand.
  3. Design your game engine so it's easy to test.
  4. Actually play your game once in a while.
  5. When in doubt, ask for help and show people your code.

Good luck, see you in a week to review your game.