• Visitors can check out the Forum FAQ by clicking this link. You have to register before you can post: click the REGISTER link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. View our Forum Privacy Policy.
  • Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!

Solitaire solver

Collapse
X
  •  
  • Filter
  • Time
  • Show
Clear All
new posts

    Solitaire solver

    Has anyone ever seen a 'smart' solitaire (or 'patience' as I call it) game?

    I was wondering why no one had written a game that tells you at the start if the game is solvable (or is it soluable?), and warns you if you make a wrong move.

    For me it would be interesting to know the proportion of patience games that will not play to a 52 card victory, and the proportion that will yield >$0, based on Vegas rules.

    I started to write one in Excel VBA, but only got as far as shuffling the deck and dealing out the cards. I was working on the rules for moving cards when I lost interest.

    Any ideas / thoughts?
    "take me to your leader"

    #2
    I think this is actually a rather hard program to write because the combinations of moves is huge. Using something like prolog is probably the best way to approach it, but then you would have to mangle your head to be able to program in it! Basically prolog would traverse the decision tree and let you know if it managed to sort it all. Painful to program, but probably less so than other languages, no idea how long it would take to run for a full deck though.

    Comment


      #3
      stick it up on rent-a-coder an some Indian chappie will code it in 10 minutes for a $1.

      HTH

      Comment


        #4
        I was planning to use recursion, thus avoiding the issue with 'number of combinations' - like route-finding software really.

        Sending it to India - would that be solving it with 'excursion'?
        "take me to your leader"

        Comment

        Working...
        X