Free solitaire source for Linux
Assuming you for some curious reason want to create your own variant of solitaire, it may be easier to start from a working source. This is a C-source of Klondyke ans Spider that I wrote as an application of GRAPH. It can be downloaded for free and modified as you want, from by blog. It is not well tested and surely has some bugs, but it works rather OK.