Recent

Author Topic: Game: Klondike Solitaire  (Read 1851 times)

JSN

  • Jr. Member
  • **
  • Posts: 65
Game: Klondike Solitaire
« on: December 21, 2020, 07:42:02 pm »
Apologies if I have missed a topic that addresses this issue.

I am a retired programmer, I started out coding (in DOS) before the term Software Engineer was coined.

I am developing a Klondike Solitaire Game for personal use. I have the "guts" of the game worked out. What I am seeking is an engine for the game logic: Knowing which cards can be dropped on which cards and moving from one pile to another pile.

Is something like that "out there" on the Internet somewhere?

I have tried several searches, and all I have found are EXEs of the game (with advertising and other annoyances), not the source code for a card gaming engine. Any computing language would be acceptable, I can translate.

Thank you and Happy Holidays and please stay safe.

Namasté.

winni

  • Hero Member
  • *****
  • Posts: 3197
Re: Game: Klondike Solitaire
« Reply #1 on: December 21, 2020, 08:53:21 pm »
Hi!

Why do you need an engine for Klondike?

Code: Pascal  [Select][+][-]
  1. Allowed := (CardFrom.color <> CardTo.Color) and  (CardFrom.value = pred (CardTo.Value);
  2.  

Winni

JSN

  • Jr. Member
  • **
  • Posts: 65
Re: Game: Klondike Solitaire
« Reply #2 on: December 21, 2020, 10:55:59 pm »
Because I over complicate the simplicity of your elegant solution? :)

Thank you for your reply. Namasté.

winni

  • Hero Member
  • *****
  • Posts: 3197
Re: Game: Klondike Solitaire
« Reply #3 on: December 22, 2020, 12:05:32 am »
Hi!

Start thinking about the data structures. That will  lead you to elegant and simple solutions. As N. Wirth allways tried to teach.

From another card game from my Delphi 1 days:

Code: Pascal  [Select][+][-]
  1. TYPE
  2. TCardSuit = (CDiamond, CHeart, CSpade, CSword);
  3. TCardColor = (CRed, CBlack);
  4. TCardValue = (C2, C3, C4, C5, C6, C7, C8, C9, C10, Cjack, Cqueen, Cking, Cace);
  5. TSuiteColor = array[TCardColor] of set of TCardSuit;
  6.  
  7. TOneCard = Record
  8.            suite : TCardSuite;
  9.            value : TCardValue;
  10.            color : TCardColor;
  11.            end;                      
  12.  

Winni

JSN

  • Jr. Member
  • **
  • Posts: 65
Re: Game: Klondike Solitaire
« Reply #4 on: December 22, 2020, 12:12:37 am »
Good to see someone knows who Niklaus Wirth is. Over the years, I have been surprised how many don't even know about Pascal, Babbage, or Turing. So many brilliant pioneers.

I have the basic data structure needed. I guess I was looking at the game itself as being more complicated than it needs to be.

Thank you.

winni

  • Hero Member
  • *****
  • Posts: 3197
Re: Game: Klondike Solitaire
« Reply #5 on: December 22, 2020, 12:22:19 am »
Hi!

Off topic but nice: Turing is back in the nothern german newspapers.
In the Bay Of  Gelting some divers found an Enigma. Surrounded by shells.

Will take some time to refurbish.

Winni

JSN

  • Jr. Member
  • **
  • Posts: 65
Re: Game: Klondike Solitaire
« Reply #6 on: December 22, 2020, 12:31:34 am »
Turing was a very interesting genius. I have seen a couple excellent movies about him. Tragic that he was dealt such a bad hand. I keep hoping society will one day catch up with technological advances.

 

TinyPortal © 2005-2018