Valid XHTML 1.1

Top Trumps
University: Further Programming, First Year (2008).


Pool Simulation
Prolog Programming
Graphical Techniques
Top Trumps
Guessing Game & Monte Carlo Pi
10 Second Video


Top Trumps was a first year programming project developed in Visual Studio 2008 using Windows Forms and DirectSound. The brief was to produce a top trumps style program using either the command console or Windows Forms, the latter being required for the highest grades. A number of specific requirements were made in the brief that had to be satisfied such as the number of statistics for each card, high scores, etc.

Upon starting this project I had no experience with Windows Forms so my first step was to familiarise myself with the technology. It did not take long to understand the basic principles and within a week I was confident enough to begin work on the project proper. The initial stage was to produce a design for the program and get that implemented. Once the face of the program was in place I turned to other important factors. What theme for the cards? What should the statistics be? Where does the motivation for play come from? Does there need to be audio or sound effects?


The main screen once a new game is started.

I settled on an appropriate theme and while it wasn’t required I also decided including audio would provide a benefit to the experience when playing the game. DirectSound was used to provide the audio (and has since been updated to Irrklang because DirectSound works differently in Vista and Windows 7) and the player is provided the option to enable or disable the music.

The biggest challenge I encountered was programming the high score table. I decided that the high scores should be saved between sessions and this required reading/writing to a file. Researching and implementing a way of reading/writing to a file was straight forward enough but during testing I encountered an irritating problem where occasionally when submitting a new score the high score table would become corrupted, with data being stored/recalled in the wrong place. I tracked this issue down to an erroneous addition in the algorithm I had written for writing new high scores to file.


The high score table after a successful game.


You can download the executable in Rar (4.17 MB) or Zip (4.23 MB) format.
Requires Microsoft .NET Framework 4
Top Trumps: RAR ZIP


Return to Top