Friday, November 20, 2009

Programming Challenge 2 - Falling

After the success of Programming Challenge 1 I finally present Programming Challenge 2. The intent of this challenge is to create a program that uses multi-threading.

Here is the Challenge:

Write a winform ASCII game that with these properties:

  • It has a game grid that is 5x5.
  • The player should be represented as a plus sign “+” located in the second row from the top.
  • The player is able to move the + from side to side.
  • A row of 4 minus signs “-” and one blank space, should be randomly generated at the bottom of the 5x5 grid, and move up (giving the perception that the user is falling down).
  • Every 1/4 of a second, the row of minuses should move up one row until it disappears off the top of the grid and another 1/4 second late, a new one will appear at the bottom.
  • Play continues until the + sign attempts to occupy the same space as a minus sign. When this happens, the minus sign should be replaced by an “X”. This can happen by either:
    • falling down on top of a minus.
    • Or moving right or left into a minus. After play ends, display a score to the player which is the number of minus rows successfully avoided.

Should look something like this when completed:

And with an end game that looks like this:



Good luck and happy falling!

* Legal Notice * These Programming Challenges

shall not be reproduced in any form without my express written consent.

No comments: