SkillAgentSearch skills...

Lsol

A polymorphic solitaire engine in Lua and LÖVE

Install / Use

/learn @oddstream/Lsol
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

Minimal Polymorphic Solitaire in Lua and LÖVE

Towards a polymorphic solitaire engine in Lua+LÖVE.

Screenshot

Play it by downloading/installing the LÖVE runtime and the lsol.love file from this repo, then running 'love lsol.love'. It's tested on Linux, Windows and Android via the Google Play Store.

Variants

It currently knows how to play around 100 variants, including:

♥ Accordian ♥ Agnes Bernauer ♥ Agnes Sorel ♥ Algerian ♥ Alhambra ♥ American Toad ♥ American Westcliff ♥ Assembly ♥ Athena ♥ Australian ♥ Baker's Dozen ♥ Baker's Dozen (Wide) ♥ Baker's Game ♥ Baker's Game Relaxed ♥ Beleaguered Castle ♥ Bisley ♥ Black Hole ♥ Blockade ♥ Busy Aces ♥ Canfield ♥ Chinese Freecell ♥ Classic Westcliff ♥ Crimean ♥ Cruel ♥ Double Freecell ♥ Duchess ♥ Easthaven ♥ Eight Off ♥ Eight Off Relaxed ♥ Flat Castle ♥ Forty Thieves ♥ Forty and Eight ♥ Freecell ♥ Gargantua ♥ Gate ♥ Giant ♥ Good Thirteen ♥ Josephine ♥ Klondike ♥ Klondike (Turn Three) ♥ La Belle Lucie ♥ Limited ♥ Little Spider ♥ Lucas ♥ Martha ♥ Miss Milligan ♥ Mount Olympus ♥ Penguin ♥ Pyramid ♥ Pyramid Relaxed ♥ Rainbow Canfield ♥ Red and Black ♥ Rosamund ♥ Royal Cotillion ♥ Russian ♥ Scorpion ♥ Sea Haven Towers ♥ Simple Simon ♥ Somerset ♥ Spider ♥ Spider One Suit ♥ Spider Two Suits ♥ Spiderette ♥ Spiderette One Suit ♥ Spiderette Two Suits ♥ Storehouse Canfield ♥ The Fan ♥ Thoughtful ♥ Three Shuffles and a Draw ♥ Trefoil ♥ Tri Peaks ♥ Tri Peaks Open ♥ Ukrainian ♥ Usk ♥ Usk Relaxed ♥ Wasp ♥ Yukon ♥ Yukon Cells ♥ Yukon Relaxed

Variants are added when the whim takes me, or when some aspect of the engine needs testing/extending, or when someone makes a case for something interesting.

Some variants have been tried and discarded as being a bit silly, or just too hard:

  • Giant
  • King Albert
  • Raglan

Some games I've added reluctantly:

  • Pyramid
  • Tri Peaks

Some will never make it here because they are just poor games:

  • Golf

Screenshot

Other features

  • Permissive card moves. If you want to move a card from here to there, go ahead and do it. If that move is not allowed by the current rules, the game will put the cards back and explain why that move is not allowed.
  • Unlimited undo, without penalty. Also, you can restart a deal without penalty.
  • Bookmarking positions (really good for puzzle-style games like Penguin, Freecell or Simple Simon).
  • Scalable cards; when running on a desktop, just resize the window to make the cards fit the baize.
  • Simple or regular card designs.
  • One-tap interface. Tapping on a card or cards tries to move them to a foundation, or to a suitable tableau pile. An empty tableau with a constraint is not considered suitable, as empty tableaux are precious.
  • Cards in red and black (best for games like Klondike or Yukon where cards are sorted into alternating colors), or in four colors (for games where cards are sorted by suit, like Australian or Spider).
  • Every game has a link to it's Wikipedia page.
  • Statistics (including percent complete and streaks; percent is good for games that are not often won, and streaks are good for games that are).
  • Cards spin and flutter when you complete a game, so you feel rewarded and happy.
  • Automatic saving of game in progress.
  • A dragable baize; if cards spill out of view to the bottom or right of the screen, just drag the baize to move them into view.

Deliberate minimalism

A lot a features have been tried and discarded, in order to keep the game (and player) focused. Weniger aber besser, as Dieter Rams taught us. Design is all about saying "no", as Steve Jobs preached. Just because a feature can be implemented, does not mean it should be.

Screenshot

FAQ

What makes this different from the other solitaire implementations?

This solitaire is all about Flow.

Anything that distracts from your interaction with the flow of the game has been either been tried and removed or not included.

Crucially, the games can be played by single-clicking the card you wish to move, and the software figures out where you want the card to go (mostly to the foundation if possible, and if not, the biggest tableau). If you don't like where the card goes, just try clicking it again or dragging it.

Also, I'm trying to make games authentic, by taking the rules from reputable sources and implementing them exactly.

Why are the graphics so basic?

Anything that distracts from your interaction with the flow of the game, or the ability to scan a deck of cards, has either been tried and removed, or not included. This includes: fancy card designs (front and back), keeping an arbitrary score, distracting graphics on the screen.

The user interface tries to stick to the Material Design guidelines, and so is minimal and tactile.

I looked at a lot of the other solitaire websites and apps out there, and think how distracting some of them are. Features seem to have been added because the developers thought they were cool; they never seem to have stopped to consider that just because they could implement a feature, that they should.

Sometimes the cards are really huge or really tiny

If you're running the app on a desktop, resize the window; the cards will scale automatically.

If you're runnning on a mobile device, try rotating the device. (Solitaire apps are better suited to the larger and squarer screens of tablets, rather than phones.)

The rules for a variation are wrong

There's no ISO or ANSI or FIDE-like governing body for solitaire; so there's no standard set of rules. Other implementations vary in how they interpret each variant. For example, some variants of American Toad build the tableau down by suit, some by alternate color. So, rather than just making this stuff up, I've tried to find a well researched set of rules for each variant and stick to them, leaning heavily on Wikipedia, Jan Wolter (RIP, and thanks for all the fish), David Parlett and Thomas Warfield. Where possible, I've implemented the games from the book "The Complete Book of Solitaire and Patience Games" by Albert Morehead and Geoffrey Mott-Smith.

Keyboard shortcuts?

  • U - undo
  • N - new deal (resign current game, if started)
  • R - restart deal
  • B - bookmark current position (LCtrl or LShift + B to go back to the bookmarked position)
  • C - collect cards to the foundations

What about scores?

Nope, the software doesn't keep an arbitary score. Too confusing. Just the number of wins, number of moves, the average 'completeness percentage' and your winning streak (streaks are great).

A game isn't counted until you move a card. Thereafter, if you ask for a new deal or switch to a different variant, that counts as a loss.

You can 'cheat' the score system by restarting a deal and then asking for a new deal.

'Completeness percentage' is calculated from the number of unsorted pairs of cards in all the piles.

Odd features

You can restart a deal without penalty; it's not cheating, because you could just set a bookmark at the start of a game and return to that position.

You cannot move cards from a foundation pile. Most sources I've read explicity ban moves from the foundations, so I've implemented a blanket ban. There's always undo, if you've got into a bad situation.

Movable cards are not highlighted unless you ask for help by tapping the lightbulb icon. For the longest time, I thought that highlighting movable cards was a neat feature, but I now realize that this feature ruins the essence of most games. In trying to replicate and assist the feeling of playing with real cards, this feature is a step too far.

What's with the discard piles?

Some games, like Spider or Simple Simon, have discard piles instead of foundations. These are optional piles for you to place completed sets of cards into, if you wish to clear some space in the tableaux.

Most other solitaire implementations just have foundation piles that fulfill this role.

What about a timer?

The timer doesn't start until you make a first move, and (should) pause when the app is minimized or is in the background. The elasped time for the current game is reported in the center of the status bar (next to the number of moves made) and doesn't update until after you've moved (i.e. it doesn't update every second - that seems a bit stressful). As the timer was not added until version 29, the app can't report average time taken in the statistics, because there were games completed without being timed.

What's with the settings?

Simple cards

Use a set of card faces that have minimal graphics, just ordinal and suit. Can be easier to 'scan', especially on small devices.

Colorful cards

Normally, cards are either red or black. This setting makes the cards either just black, red/black or four-colored, depending on the variant being played. In variants where the tableaux build in suit (like Forty Thieves, Penguin or Eight Off) this can be a real help.

Gradient shading

By default, the baize and card backgrounds have a shading effect, where the center is lighter than the edges. You can turn this off if you find it annoying or distracting. There is no performance penalty or benefit either way.

Compress piles

With this on, piles of cards that a long and would overshoot the screen (usually the bottom of the screen, but also the right edge) are compressed dynamically (up to a point) so that all the cards can be seen. However, this can make the cards hard to read.

In any ca

Related Skills

View on GitHub
GitHub Stars17
CategoryDevelopment
Updated1mo ago
Forks5

Languages

Lua

Security Score

80/100

Audited on Feb 15, 2026

No findings