Web Paint-by-Number Forum
Topic #346: Web Sol
By Jan Wolter (jan)

#1: Jan Wolter (jan) on Aug 16, 2012

So in the course of trying to get a bunch of old half-completed projects pushed out the door, I've also been doing some work on one that is unrelated to webpbn, my solitaire program, which is now available here:


This is kind of a stupid project, because there isn't exactly a shortage of programs that let you play solitaire on your computer. For me it was kind of an experiment in building a fairly elaborate application 100% in Javascript. Unlike webpbn, websol's server does nothing. Well, nothing except send your browser some text files and image files when it asks for them. There is no database on the server, and no computation on the server. And why should you care about that? No reason I can think of, but I think it's cool.

So it supports several dozen different solitaire games, and lets you change the rules, modifying the rules of standard games to fit your personal tastes, or mixing and matching the rules to make entire new games. You can save your rules modifications, but not to any public database - they are only saved within your browser.

It also does fancier animation than most of the other Javascript games I have written, with some ability to have multiple cards flying around at once, which comes in hand for the "boom" that occurs after you win a game. That can be a bit of a browser performance test, especially in solitaire games with multiple decks of cards.

I suspect that it still has some flakiness hiding in it. The business about letting you mix and match rules means that there are all sorts of cases where the rules can interact in weird ways and the logic to do things like automoves and detect when you have no legal moves left gets crazy complex. I do have a weakness for adding one more feature after another until the complexity gets overwhelming. Oh well.
#2: David Bouldin (dbouldin) on Aug 16, 2012
Very cool, Jan!

- three misspellings (existence, solitaire, arithmetic) in your "Malarkey" tab
- "Usage" tab gives me a 404 (Chrome, Win7)
- is there a way to make a tableau card move to an available empty cell with a double-click rather than drag?
- Is there a way to sort the games list by type (with variations) so the Forty Thieves, Freecell, etc. games are grouped together? I do like that there is the list of "Similar Games" in some of the rules sections.
#3: Jan Wolter (jan) on Aug 16, 2012
I just noticed that it completely does not work in IE.
#4: David Bouldin (dbouldin) on Aug 16, 2012
It works in my IE 9.0.8112.16421 with Javascript 3.4; HTML 3.2; FSA 3.3.

(and in my Chrome 21.0.1180.79 and in my Firefox 14.0.1 if that helps at all)
#5: Jan Wolter (jan) on Aug 16, 2012
Yeah, it turns out that my IE 9 had decided, entirely on it's own, that every page under unixpapa.com had to be rendered in IE 7 compatibility mode. I had to do some serious beating on it to convince it otherwise, but I finally succeeded and then it worked correctly. I keep running into this problem - IE 9 is capable of being a good functional browser, but it is really reluctant to do so, and takes every possible opportunity to drop back into buggy mode if it can.
#6: Jan Wolter (jan) on Aug 16, 2012
Fixed the spelling arrows and the missing usage page. Thanks for pointing these issues out.

I do have plans for alternate movement modes, but right now all moves are pretty much by dragging, except for deals from the deck which are by a click. Probably an area that needs work.

Categorizing games is hard - there are so many cross-breeds. I should probably add in more "similar games" links.
#7: Teresa K (fasstar) on Aug 16, 2012
It's fun to have some new card games to play. Well, new to me anyway. Thanks, Jan.
#8: Tom O'Connell (sensei69) on Aug 17, 2012
Wow.... free cell was fun to play...thx Jan
#9: Byrdie (byrdie) on Aug 19, 2012
Great ... another time sink. I just spent several hours there and haven't tried it all. I've bookmarked it and will go back.

Very nicely done.
#10: Jan Wolter (jan) on Aug 19, 2012
You'll have a way to go before you waste as much time with it as I have.
#11: Billie Patterson (bpat) on Aug 19, 2012
Is there a place you'd like for us to post bugs that we find?

I just played a game of Baker's, and all four foundation piles are filled with Kings on top, but the 7 of spades is still left on the tableau.

Also, this is just a personal quirk of mine, but I HATE to be asked if I really want to quit and start a new game.
#12: Jan Wolter (jan) on Aug 19, 2012
Ugh. That glitch is still there. I think it happens sometimes when you undo and redo a lot. A card gets left behind. Danged hard to debug. I'll keep looking.

I had meant to have it ask that only if there was an active game. Though sometimes when a game ends by going stagnant instead of being won or by running out of moves, then the software isn't smart enough to detect that you are done.

I'm not fond of "really quit" screens either, but I'm even less fond of accidentally losing games I was in the middle of when I hit the wrong button.

This is probably as good a bug report place as any.
#13: Billie Patterson (bpat) on Aug 19, 2012
I was just playing Double Free Cell (seed = 91135), and there are only 100 cards on the screen. I know one five of diamonds is missing, because I needed it, but didn't look for the other one.
#14: Jan Wolter (jan) on Aug 20, 2012
Oops. There is a 10x10 layout, but at the beginning of the game an Ace is supposed to be dealt to each foundation pile. As it as four random cards are missing. Wonder how I missed that.

Yeah, double freecell is currently unplayable.
#15: Jan Wolter (jan) on Aug 20, 2012
OK double freecell is fixed. Also repaired "Repair" which was only dealing one deck of cards although it is a two-deck game. Obviously when I added these I didn't test them out very well.
#16: Billie Patterson (bpat) on Aug 20, 2012
If you win triple Klondike, it won't autoplay the cards all the way to the end, even if they're pretty evenly distributed on the tableau. It stopped six or seven times when it had obvious good plays.
#17: Tom O'Connell (sensei69) on Aug 20, 2012
free cell the same with not autoplay for obvious plays
#18: Billie Patterson (bpat) on Aug 20, 2012
Playing Flower Garden, seed = 9734. Foundation piles have mixed suits in them. I'm looking at the three of diamonds, the five of diamonds, the six of hearts and the seven of spades. There are also only 51 cards to play with.
#19: Jan Wolter (jan) on Aug 22, 2012
Flower Garden is badly broken in the current release. I fixed it in the development version, but there are other things I need to fix in the development version before I put that on the main site.

Yeah, the weird stops in the automoves need to be diagnosed, but they aren't that high a priority. You can easily do some manual moves and get them restarted. They are more complex than they appear. If there are two sevens of diamonds in the tableau and only one six of diamond in the foundation, then neither should be moved, because the choice of which to move should be left to the user. If a user undoes an automove, then it should not automove right back again. In some games, you don't want to automove one suit too far ahead of the others. Things like this make the logic pretty complex. If it pauses prematurely sometimes, that's at least better than making inappropriate automoves.

A bigger bug is that occasionally illegal automoves will be made, like the 8 of diamonds gets put on the 6 of diamonds, leaving you with the 7 of diamonds left over at the end of the game. I think this happens with some combination of cancelling automoves (if you click on any card during an automove it will stop executing them ... I hate games that go catatonic while they are automoving) and undoing automove. This is hard to debug because it is hard to reproduce.

I am also adding more features and games and doing some reorganization of the games list. So this thing is very much a work in progress.
#20: Byrdie (byrdie) on Aug 26, 2012
One interesting thing I've seen in a couple different games (sorry, didn't make note of which ones) is the game automoving aces to the foundation. In a couple different instances the game moved the ace one pile to the right of the next open pile. Interestingly enough it then placed the next ace on top of it. In one instance it had also placed some successive cards on the misplaced ace. This caused some interesting problems further in the game where subsequent cards would not play on the covered pile.

The solution was to undo play to the point of the misplaced card and then manually make the moves to get play to continue correctly.
#21: Jan Wolter (jan) on Aug 27, 2012
Weird. I haven't seen that glitch.

I'm working on a new version, which will have it's own domain name, even more games, google ads, and, hopefully, fewer bugs. The ads will be readily dismissable, but I want to see if I can actually earn some money from all this free software I keep writing.
#22: Tom O'Connell (sensei69) on Aug 27, 2012
great idea Jan.... i wish you luck :)
#23: David Bouldin (dbouldin) on Aug 27, 2012
i'll even click through the ads for you!
#24: Jan Wolter (jan) on Aug 29, 2012
Don't overdo it. Weird behavior patterns will get me on Google's black list. They really don't like being scammed. It's actually against their rules for me to encourage people to click on the ads on my pages.
#25: David Bouldin (dbouldin) on Aug 29, 2012
nothing weird, i promise.
#26: Joe (infrapinklizzard) on Aug 29, 2012
Also, most ads are paid per view, and per purchase. Click-throughs don't count for much anymore unless you buy something on the site.
#27: Tom O'Connell (sensei69) on Aug 29, 2012
I'll honor your request, Jan
#28: Jan Wolter (jan) on Sep 7, 2012
So I've been working on this thing and the new version is now up.

I probably should have bought the "websol.com" domain name when I started the project, but it's gone now, so I bought a different one. It's now called http://politaire.com

I think I fixed all the bugs people reported to me and there are lots more games. I expect to keep expanding it for a while, but the thing is already a monster of complexity hiding behind a thin veneer of simplicity.
#29: Tom O'Connell (sensei69) on Sep 7, 2012
thanks Jan
#30: Jan Wolter (jan) on May 20, 2013
The http://politaire.com web site has been much improved since I last posted about it here, with support for some 370 different solitaire games and a mind-boggling number of option settings.

But I'm having a bit of a problem that reminded me of the discussion here - Google Ads has black-listed me.

It turns out that they have the very interesting policy of not telling you what you did wrong, because that would allow people to figure out exactly what the rules are and thus scam the rules. This makes appealing the decision extremely tricky.

So I'm trying to figure out what could have gone on, and I'm wondering if any of the webpbn users who also use politaire would have any clues.

One possibility that has occurred to me is that the the little "X" that closes the ad frame might be too close to the ad. This might cause some users on tablets and phones to accidentally click the ad sometimes when they just wanted to close it. That might be detected by Google as excessive insincere ad clicking.

Anyway, if any one has any bright ideas, I'd appreciate hearing about them.
#31: Byrdie (byrdie) on Sep 25, 2021
Hi Valerie. Don't know if you'll see this (hoping so). I still visit the Politaire site that Jan built quite regularly. The last couple days it's been doing something I've not seen before - asking for a user name and password. I don't think it's ever required one. I completed the fields in the dialog box just for S&Gs and a message popped up in the field where the ads usually (used to?) appear saying "This server could not verify that you are authorized to access the document requested. Either you supplied the wrong credentials (e.g. bad password), or your browser doesn't understand how to supply the credentials required." Makes me wonder if the site has been hacked. It's allowing me to play anyway and still has the history on the game that I'm playing. Just wondering ...
#32: Bill Eisenmann (Bullet) on Sep 27, 2021
Byrdie, I just opened it and got the same message. How did you play without signing in?
#33: Byrdie (byrdie) on Sep 27, 2021
Just chose cancel and it let the game play - at least at home it does that. At work I couldn't even get to the screen that allows you to choose your game.

Just went in today and it no longer asks for a sign in.
#34: Valerie Mates (valerie) on Sep 27, 2021
Jan and I shared a webserver account where we put various websites and programs. The account is at least twenty years old and has several websites hosted there, including Jan's unixpapa.com, my unixmama.com, my recipe site, Politaire, Jan's Great Green Room website, baby pictures of our now-adult kids, and on and on, years of random accumulated stuff.

Last week I got e-mail from someone who'd noticed that if he did web search for the phrase "Javascript madness" and followed a link from there to Jan's Javascript Madness page, he was instead redirected to a scam pharmacy website. After tracing what was going on and discussing it with my website host, we figured out that the site had been vandalized in July. The vandal left behind a bunch of back doors that were scattered here and there around the various sites. All of the sites were temporarily password-protected for cleanup. I've been carefully checking through each site and then removing its password to put it back online again. I put Politaire back online a few hours ago. A lot of the other sites are still offline.


(WebPBN is hosted on a different server and was not affected.)
#35: Joe (infrapinklizzard) on Sep 27, 2021
@ Birdie & Bill. The reason it still worked for Birdie was because it was cached on his computer. Jan stated that that site was designed to run fully clientside. So as long as Birdie didn't flush his cache, the browser just used the cached JavaScript when the connection to the site failed.
This is academic though, since Valerie fixed it.
#36: Bill Eisenmann (Bullet) on Sep 28, 2021
Yay! Free Cell is back - Thank you Valerie!
#37: Valerie Mates (valerie) on Sep 28, 2021
Replying to Joe's comment #35: And, the problem with the site running fully on the user's computer is that it messed with Google's perception of how Jan was displaying ads on the site, which led to him (and me) getting banned forever from Google's ad program. Here's Jan's description of what happened: https://unixpapa.com/adsense.html

I just re-read the whole thing. I'm amused that it quotes from this discussion, and that as I read it I could tell that anonymized USER-C is Joe. I missed at identifying USER-A and USER-B though. I was thinking one was Adam/Monkeyboy.

I noticed that in the years since Jan wrote that page, the page of Google rules that he links to has changed from saying that you *will* not get a second appeal to saying that you *may* not get a second appeal. So maybe I should try sending in an appeal again.

#38: Valerie Mates (valerie) on Sep 28, 2021
Bill - You're welcome! The game there that resonates the most for me is the incredibly addictive ThirtySix solitaire.
#39: Valerie Mates (valerie) on Sep 28, 2021
Also, even years later, I am still very impressed that Jan wrote one piece of code that knows how to play 535 different Solitaire games.
#40: JoDeen Mozena (ozymoe) on Sep 28, 2021
Valerie, Jan has impressed me in numerous ways over the years. I still miss him and think of him, you and your family often. You also are one of my heroes. I'm going through a very hard process at the moment...you give me inspiration and hope. Thank you, Valerie. You never know how far your smallest actions resonate, for instance, the things you do for us on this site. The fabric of yours is inextricably interwoven with kindness and care. Sending love and strength to you.
#41: Valerie Mates (valerie) on Sep 28, 2021
JoDeen, I don't know what the challenge you are going through is, but Big Hugs to you!!
#42: Byrdie (byrdie) on Sep 28, 2021
Thank you Valerie and Joe. I knew the part about it been run from cache on my computer and completely forgot about it. Explains why it would work at home but not at work. There's one game I'm more likely to play than all others but I do enjoy going to the site to mindlessly play away while I've got YouTube playing on my other terminal. So happy it hasn't gone away or been corrupted. Thanks again! (and my hugs to JoDeen as well!)

Goto next topic

You must register and log in to be able to participate in this discussion.