shlomif / PySolFC

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

Selection of cardset for memory-type games #289

Closed hajo4 closed 1 year ago

hajo4 commented 1 year ago

Memory-type games, such as Memory-24, only allow to select french cardsets.

I think there should be no problem to allow other types of cardsets, eg. Tarok, Hanafuda, Matrix etc. (as long as the set has enough cards).

Also, it might be a good idea to make the selection of the cardset for memory stick only to memory-type games (like for Mahjongg).

Alucard648 commented 1 year ago

All cardset types except Tarok can be used for Memory -type games.

joeraz commented 1 year ago

This was allowed in older versions, but was disabled because for most games, using the wrong type of cardset would make the game practically unplayable - see my comment at https://github.com/shlomif/PySolFC/issues/16#issuecomment-887096303 for more detail.

Memory 24, 30, and 40 are definitely exceptions to this rule, and can reasonably be played with any type of cardset. However, I still need to figure out how I can re-enable it for those games without enabling it for other games where it would be a breaking issue.

joeraz commented 1 year ago

I think I got this configured - still testing, but if anyone wants to try it out, the code is in my branch https://github.com/joeraz/PySolFC/tree/feature/matching-cardsets - this creates a new type of Matching cardset, and games that use this for their category can use any other cardset type, or special Matching cardsets that are designed for this sort of game.

MatchingCardset

You can download the Matching cardsets I used for testing here - matchingcardsets.zip - once I'm satisfied enough to merge this upstream, I'll add those to the cardsets repo.

I'd also like to see if I can get it to randomize which cards are used at the start of the game, for some variety.

Concentration and Memory Sequence are unchanged because suits or ranks do matter for those games.

joeraz commented 1 year ago

Everything seems to be working - merged into main branch.