Fresh out of my first degree back in 2003 I committed myself to yet another Tetris clone project. I think it came out pretty well, I was hoping to get a similar look to Minesweeper which I played constantly.
I learnt basic Win32 which I hold as invaluable for creating windows applications, certainly at the time. www.winprog.org/tutorial/ was my go to site for learning my way around the API. I recall working hard to remove GDI Leaks from poorly released device contexts and looked to add features from the tutorial like menus and modal dialogs for their options.
Although written in C++ the code is not object orientated, just linear functions, which was fine for the game. Honestly however, at the time I don't think I really understood OO.
At some point while working on my Tetris clone I was reminded of my father writing a program to render the famous Mandelbrot fractal set on a 1984 Tatung Einstein
. With my new found skills with the win32 api I decided to knock up a program to do the same. Over time I have added and experimented with this application, adding to the visual of the interface with status bars, rendering tricks and improved on my C++ skills with the use of threads.
Itís great fun playing with the zoom feature. However the frustration of coming to the limits of floating point precision when dealing with smaller and smaller ranges of the set led me to experiment the writing of an arbitrary precision number class.
An attempt to implement an arbitrary precision datatype, a number not limited by storage sizes. Plenty of these exist out there but to have a play around with implmenting one was fun. Got to grips with OO programming a bit more as well as C++ fantastic operator overloading. I read a lot against operator overloading which is understandable but for a class like this it just makes sense and forced me to consider all possible uses of the operators and accomodate them.
The hope was to implement a decimal version, I soon discovered the problems with performing the calculations efficiently with the class. With multiplication I managed to apply fast fourier transforms to speed up the process however the maths was going beyond me at that point and was relying more on external sources than my own implementation. Division was basically just long division albiet with carrying over from a WORD to fit in a DWORD instead of decimals, which was very inefficient.
My Masters dissertation project implements in C++ the Finger Tree data structure proposed by Hinze & Patterson (2006)
. I'd love to come back to this one some day, I encountered problems with memory management and the way templates types are compiled, however I think there are ways around the problems I had.