Advertisement

looking for solitaire algorithm

Started by May 05, 2001 12:25 AM
1 comment, last by urusei9 23 years, 9 months ago
Hi, I would like to find some solitaire card games algorithms some where on the web, or per haps do you have some. I would be happy to have some please. Anyone has that? Ataru-San
I doubt solitare is a particularly tough game to code All it takes is some thinking...

The cards are randomly placed in the appropriate piles, ensuring that only one of each card is stored in the game (we don''t want multiple cards). You write some code to show this to the user (aka the fun part ).

To move cards, you need to check whether the card below is of the opposite color, and a higher number. You also need to have code to make sure that cards placed in the "bins" (where you put the completed piles of each suit) are of the same suit and in ascending order. There''s not much more to it than than (other than making the cool cascading card animation at the end of the game).

If you''re looking for some code (the easy way out), I think there''s a solitare clone with the Gnome project, which is all GPL''d for your use. Failing that, I think KDE has one... but it''s been a while since I''ve played it under linux (Majhong is a FAR better game ).

Hope this can help

Simon Wilson,
XEOS Digital Development
XEOS Digital Development - Supporting the independant and OpenSource game developers!
Advertisement
Thanks

This topic is closed to new replies.

Advertisement