Writing a more complex Use-Case document for not one, but two games were more problematic than I first thought. Even though the two had a well-defined/known game-play, I did find myself lost within the various Use-Cases. Instead of being more organized and calculated, there were too many loose ends and ambiguous inconsistent references to game-play elements.
In this challange, I will deal with the task of writing two games at once. The games will share some of the design, modules and behavior but will act as a seperate project altogether. The shared components will have to be general and reuseable and in the same time implement as much of the game-specific functionality as possible.
Both of these classic games are pretty much comprised of the same mechanics: a deck of shuffled cards which has to be re-organized into 4 stacks of ascending-same-suit cards. In the course of the games cards are needed to be arranged also in ascending order, however in a stack of alternatly-changing red/black order.
I first planned these speed challanges as a concentrated 3-4 hours of work in which I’d finish what I can. I started it a week ago and due to work/real life considerations, this was not possible. However, I did find 30 minutes at the end of each day to finish this mini-project – and I think it was well worth the time.
Since most of the design was documented and well-defined by the Use-Cases, I decided to go in a Copy/Paste approach: I would take the Use-Case directly into the development environment and translate each line into code.
For my first speed challange I decided to take a small and well defined application so that i’d be able to examine how well using Use Cases contributes to my productivity as a programmer. Took me an hour to lay out a list of MineSweeper’s Use Cases that defines the mechanics of the application.
I tired to be more productive without being over perfectionist, following a defined format for each Use Case so I won’t get over-zealous with the design and sticking to the standard.
Here’s what I came up with:
Had to implement a 9-bit serial port protocol under c#. Normally, the 8 bit information transfer is supported by the .NET SerialPort class, whereas the extra bit is used for parity check.
To send a 9 bit through the serial port is pretty easy: Send the first 8 bits normally with either a Mark(=1)/Space(=0) parity setting for the extra 9th bit.
The hell I went through involves SENDING each 9 bits, and this is where my story starts…