views:

38

answers:

3

I am looking forward to write a card solitaire game, including AI (if this simple can be called so) playing algorithm. No multiplayer facilities needed. I suppose there are some wheels I need not to invent myself in this project (as deck/cards/table object model, deck shuffling algorithms, etc, and, especially, cards visualisation stuff). Can you recommend a piece of code to look at? The simpler-the better.

I am using Linux. I code Scala, Java, JavaFX, JavaScript, PHP, C#, I also wouldn't mind using Erlang, Haskell, Prolog, Python, or Ruby.

+1  A: 

I've written some fishing card game with C++/DirectX, you can check it here in my blog. (C++ source included.) It's more advanced than solitaire, but still there are common things as in most card games - deck/table/card classes , shuffling algorithm, AI, rendering, etc.

As i understood C++ isn't in your favorable language list and DirectX is not the way to go in Linux, but still source may be useful...

Good luck.

0x69
Thank you anyway. I can probably at least borrow some algorithms. And a little flashback (10 years ago I used to code C (Win32 API) and C++ (MFC)) can probably be a thing I'll enjoy.
Ivan
+1  A: 

I've open sourced my experiment with solitaire poker in Java along with a basic card display widget. You can find them here:

Arnold Spence
A: 

Done some googling mysef and found this: http://sourceforge.net/projects/makao-fx/
Going to take a look. More answers are still welcome.

Ivan