shlomif / PySolFC

A comprehensive, feature-rich, open source, and portable, collection of Solitaire games.
http://pysolfc.sourceforge.net/
GNU General Public License v3.0
445 stars 97 forks source link

create a DIFFICULTY LEVEL to be used by the user #355

Open DiNasset22 opened 6 months ago

DiNasset22 commented 6 months ago

As you know there are a lot of cards set-ups which do not conduct to a solution. It could be nice to have different levels of difficulty when starting, like EASY, MEDIUM, DIFFICULT (standard). For instance, when the user asks for NOT DIFFICULT (EASY or MEDIUM) the algorithm could avoid_

joeraz commented 6 months ago

This sounds good on paper, but would be very difficult to implement.

What actually makes a game layout easier or more difficult may vary considerably from game to game. For example, some games build the foundations down from king, in which case, putting aces in the last position on a pile may actually make the game easier. And there are other games that start the foundation from an arbitrary rank or has some that build up and others that build down, so where the aces are placed don't really have a clear effect on the game's difficulty.

DiNasset22 commented 6 months ago

Understand. In my suggestions I was referring to the game "Quaranta Ladroni" (in Italian words), which is the one I use.

On Fri, Dec 22, 2023 at 6:06 PM Joe R. @.***> wrote:

This sounds good on paper, but would be very difficult to implement.

What actually makes a game layout easier or more difficult may vary considerably from game to game. For example, some games build the foundations down from king, in which case, putting aces in the last position on a pile may actually make the game easier. And there are other games that start the foundation from an arbitrary rank or has some that build up and others that build down, so where the aces are placed don't really have a clear effect on the game's difficulty.

— Reply to this email directly, view it on GitHub https://github.com/shlomif/PySolFC/issues/355#issuecomment-1867903970, or unsubscribe https://github.com/notifications/unsubscribe-auth/A2JX5EO7P4Z3E5BTBXR3O4LYKW42HAVCNFSM6AAAAABA546VWWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNRXHEYDGOJXGA . You are receiving this because you authored the thread.Message ID: @.***>

joeraz commented 6 months ago

That would be Forty Thieves, which builds down on the tableau and up from ace on the foundations (will make note of this name for the translation files). This is probably the most common structure of a builder game, but it's not universal.

DiNasset22 commented 6 months ago

Yes, that is. So suggestions as those I made can be valid for a lot of solitaires. Another general solution (which in this case I believe is used already in some of the solitaires is allowing the move of sequences, instead of a single card. That could be of some help in easing the solution.

On Mon, Dec 25, 2023 at 5:08 AM Joe R. @.***> wrote:

That would be Forty Thieves, which builds down on the tableau and up from ace on the foundations (will make note of this name for the translation files). This is probably the most common structure of a builder game, but it's not universal.

— Reply to this email directly, view it on GitHub https://github.com/shlomif/PySolFC/issues/355#issuecomment-1868715355, or unsubscribe https://github.com/notifications/unsubscribe-auth/A2JX5EPPBF2LVH4AWZPYP7DYLD34DAVCNFSM6AAAAABA546VWWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNRYG4YTKMZVGU . You are receiving this because you authored the thread.Message ID: @.***>

joeraz commented 6 months ago

Yeah, but that would simultaneously have a different effect on a bunch of other games. And even among games with the "build down on the tableau and up on the foundations" structure, the logic would need to vary a bit based on the different numbers of rows/cards per row.

Moving sequences versus single cards is part of the game rules - making it a variation could mess with statistics and saved games. We do often do this by having the version where sequences can be moved as a separate game - i.e. "Relaxed FreeCell" for "FreeCell", or "Josephine" for "Forty Thieves".

DiNasset22 commented 6 months ago

What I was trying to explain it was the idea to find a way of avoiding frustration in the users:

On Tue, Dec 26, 2023 at 1:07 AM Joe R. @.***> wrote:

Yeah, but that would simultaneously have a different effect on a bunch of other games. And even among games with the "build down on the tableau and up on the foundations" structure, the logic would need to vary a bit based on the different numbers of rows/cards per row.

Moving sequences versus single cards is part of the game rules - making it a variation could mess with statistics and saved games. We do often do this by having the version where sequences can be moved as a separate game - i.e. "Relaxed FreeCell" for "FreeCell", or "Josephine" for "Forty Thieves".

— Reply to this email directly, view it on GitHub https://github.com/shlomif/PySolFC/issues/355#issuecomment-1869160528, or unsubscribe https://github.com/notifications/unsubscribe-auth/A2JX5EJ4KOCIIBEFXI3LBULYLIINRAVCNFSM6AAAAABA546VWWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNRZGE3DANJSHA . You are receiving this because you authored the thread.Message ID: @.***>

joeraz commented 6 months ago

One option I've had requested multiple times is an option to only give solvable deals. The problem is figuring out which games are solvable. There are two potential ways to do this, but neither would be easy to implement:

If anyone wants to try to add that option, pull requests are always welcome.

But I definitely don't want to go half measures on something like this - like you say, this is about avoiding frustration, and it will do the opposite if the solution only works for some games and not others.

I'll leave this open for further comments or suggestions.