GNOME Bugzilla – Bug 315525
New game: Spider three decks
Last modified: 2012-01-31 23:25:27 UTC
Version details: 2.10.1 Distribution/Version: Debian Unstable This is a new variant of spider. As I have only a gnome 2.10 system here, it's written for that version. I don't know scheme either, so maybe somebody should have a look at the code first. Everything works fine, only one bug I could not resolve: After dealing new cards the status bar is not updated.
Created attachment 51955 [details] Spider three decks (scm) Source code of the new game variant.
Created attachment 51956 [details] Spider three decks (help file) Help file for the new game variant.
I should be able just port the 2.12 changes from the two and four-suit versions of spider. I'll have a look at it later - since we've just released 2.12 a lot more bug reports are flowing in and things are busy.
You might want to consider rewriting this so that it loads spider.scm instead of copying all the same code from there. You would need to make more changes but see spider one suit as a very basic example: http://cvs.gnome.org/viewcvs/gnome-games/aisleriot/rules/spider_one_suit.scm?rev=1.4&view=markup I have a few personal preferences and bits of style I've picked up from other games when writing these new games you might consider using too (or I'll try and remember to patch myself when the game is committed). Rather than dealing the whole tableau in one line I break it up into seperate lines to improve the readability and maintainability of the code. Sometimes the spacing and indentation can show you at a glance what the deck will look like when it is done. Rather than repeating flip-card many times you can oftne use a single (map flip-top-card tableau) [must go for dinner. if you aren't interested in trying any of my suggestions that is fine and I'll try and do them myself later but I thought I'd suggest them just in case you wanted to try getting your code to work with Gnome games 2.14]
Loading spider.scm is definitely the way to go. This looks close enough to spider that most of the code can be maintained there. I would actually use spiderette.scm as an example, since the layout is different: http://cvs.gnome.org/viewcvs/gnome-games/aisleriot/rules/spiderette.scm?rev=1.10&view=markup And it'd probably help to add some sort of setting (not necessarily for the user) in spider.scm for allowing empty piles when redealing, rather than trying to hack it into this game by replacing functions.
(In reply to comment #4) > [must go for dinner. if you aren't interested in trying any of my suggestions > that is fine and I'll try and do them myself later but I thought I'd suggest > them just in case you wanted to try getting your code to work with Gnome games > 2.14] Alan, It would be great if you could try to implement this game in gnome games 2.14. Since I don't know anything about scheme I'm unable to improve my originally submitted version. By the way, there is another spider variant with four complete decks. Initially there are 14 piles, 6 with 5 cards each, 8 with 4 cards (including the flipped top card) and the stock with the remaining 146 cards.
Created attachment 64529 [details] [review] patch for spider.scm to add an "allow-empty-slots" option This patch creates a variable "allow-empty-slots" in Spider that's always false so that other games using spider.scm can change the rules to allow a deal when slots in the tableau are empty.
Created attachment 64533 [details] spider_three_decks.scm, using spider.scm
Now that the spider shuffle variations (1, 2, 4) have been integrated ,see Bug #393709, adding this fourth variation should be pretty easy, I would imagine. Anyone interested in updating the patch for Spider three decks?
The patch in comment 7 (needed because Spider Three Decks allows empty slots when dealing), the scm file in comment 8, and the help file from comment 2 should still be sufficient.
Very well, then Vincent, could you integrate all this in a patch? Could this be integrated into the new spider.scm? It has a menu option for selecting spider variant. Also, if this introduces a new translatable string, it will have to wait until aften gnome-games 2.18.0, unless someone else wants to announce the string change.
Given that this has a new layout and a rules change (empty slots being allowed), I don't think it would make sense to add it to spider.scm, either for making a clean implementation or for the user. And I think it probably will involve a new string. I'll get back to you with a patch because there were unanticipated problems (I have until 2.19 so it should be ok).
Created attachment 82776 [details] [review] patch to add Spider Three Decks I guess I'll stop sitting on this patch now, even though it can't be committed until the next unstable gnome-games branch. I'm mostly pretty happy with this. I wonder if the hinting code should be altered for this game to suggest moving a card on an empty slot only after all other options (including dealing more cards) are exhausted. As it is it works fine though. I also wonder if the "Strategy" section of the help should say something new.
Vincent, do you want to do any changes to this patch before I commit it?
No. I don't think changing the hinting code is a good idea because the situation where you have to leave slots blank is rare anyway, and I have no idea what else can be used for the <strategy> section in the help.
This patch was contained in the new-aisleriot git branch which now has been merged to svn. Do we need to do anything else here, or can this bug be closed?
I'm not sure if this is related, but adding spider with three decks has broken the base spider: there's no longer a spider and a spider (one suit), but instead, there's only Spider, which in fact plays the one suit variant of the game. Rather than open a new bug I've just added this comment, as I suspect the refactoring of spider.scm.
The spider variants were unified in bug 393709, not this one. You should be able to use the "Spider" toplevel menu to choose the variant; does that not work ? (It works for me.)
Yes, it didn't occur to me that "select game" wouldn't select the game, but only a set of variations, and choose the pointless version as a default. Several other people I asked (to try and see where the bug was coming from) had the same reaction. I suggest make the 4 suit one the default, then, and bring the other Spider games into the same menu, or allow the main Select Game to have hierarchical choices, so people discover it.
4-suit is the default. But I think I see where your problem comes from, bug 403961.
Let's close this bug which is about _adding_ 3-deck spider; if there are any problems with 3-deck spider, please open a new, specific bug.
This bug is being reassigned to the "general" component so we can close the aisleriot bugzilla component. Apologies for the mass email!