French 2-deck Solitaire

Hello everybody!

After many years thinking about programming this on other libraries, I finally programmed a French solitaire using P5js.

It is slightly different from Klondike, since it uses two decks, you can place ANY card (not only kings) on empty foundations and dealing rules are not the same.

(If someone gives me the name of this kind of solitaire, I would be grateful to know).

Works is still on progress: it can’t detect a victory or a defeat, and you can’t undo your moves. But it is playable and enjoyable.

You can see it at:

It took me 24 hours split over three days.
Yours,
José G Moya Y.

9 Likes

:rofl:

great job!!

1 Like

Very neat well done :+1:

1 Like

Thank you for your comments!

Please notice there was a bug with dealing. I fixed it 12 hours after my post. But, another 12 hours later, I discovered that my fix had not been properly saved and a syntax error was thrown.

I hope it works now.

I’m thinking about:
A) Adding an undo option [unlimited? 3 moves in advance? Until you reveal or deal?]

B) Adding a fullscreen button (adding the button itself is easy. The tough part is I have to reload the cards from the SVG).

this is very satisfying

4 Likes

@micuat :champagne: You won, congrats!

I still have to do a winning routine. Classic windows solitaire style (cards bumping over the floor) would be easy…

Atentamente,
José G. Moya Y.

P.D. Escribo desde un móvil. Disculpe posibles erratas.

Thanks, it was very fun =)
But now, seeing @micuat’s answer, I’m not sure if you are suppose to end like he did or like I did :crazy_face:

5 Likes

Well, there is no “winning check” (it is easy to implement, but it would require a tutorial and a “losing check”).

From your ending position it is easy to move every ace to foundations, then every two, three… and so on. So you have won. Congrats! :medal_sports::trophy::black_joker:

(I won my two first games, then I lose every game).

Atentamente,
José G. Moya Y.

P.D. Escribo desde un móvil. Disculpe posibles erratas.

Hi everyone again!

I’ve added a fullscreen mode and a winning detection routine.
I also changed a rule, following the suggestion of my sister, an expert on this kind of solitaire:
When you deal and have an empty pile, you deal just one card on the pile.
But when you deal and have face down cards, you shouldn’t deal.

Really great work.

Is there a new sketch, or is it the same one posted above? In the sketch above, there is a fullscreen button, finishing the game does not appear to trigger the winning detection routine – at least, nothing happens when the decks are loaded, and the cards remain draggable.

Hummm… Winning routine is triggered only if all cards are on the decks, but maybe it is broken somewhere.
Fullscreen does not work --at least not how I wanted it. Playing in my smartphone with fullscreen renders cards at same size as when playing in the small browser with headings.