I've called this day 20. It isn't. At least not consecutively, but I have been occupied with other non patience related things.
I crashed into this project with some sort of idea of evolutionary design. There are some trendy buzz words covering this type of coding.
At it's heart, Patience is a simple game, with a simple mechanic. The devil of course is in the details and I'm starting to doubt the wisdom of crashing into coding something without any proper planning.
I wanted to write data driven code which would allow me to code multiple different games of patience without too many changes.
Some of my initial ideas have worked. Some have been to say the least sub-optimal.
The initial data structures that I chose were sufficiently good to display most the types of Patiences that I'm likely to code.
So that was a win.
They were not good enough to allow a game to be played.
I have had to re-jig everything leaving the code in a bit of a mess. I might/might not tidy this up at a later stage.
I'm calling this a lose.
The cunning structure that I have used for the different games has worked well. It is a massive win.
Back in the day (and I've programmed for years), there was less emphasis on the fancy structures and design patterns that we are subjected to nowadays. Progress isn't a bad thing. It isn't always entirely good either, and it can close your eyes to different solutions.
For example, as an outline, I've used globals, a main file and an individual file for each different game.
It works, and was successfully used in some parts of the games programming world for years.
I'll explain this in some detail soon.
I'd prefer to be writing this in C# or C++, or some language which lends itself to a more graceful structure. I would then use a more graceful class based, object orientated design.
But, for these games of Patience, there is no need. Not really.