GNOME Bugzilla – Bug 320722
Add "3-deck Klondike"
Last modified: 2011-12-08 22:23:23 UTC
Gargantua is a two-deck version of Klondike, so some of the Klondike tweaks are just changes to allow Gargantua to open with (load "klondike.scm"). While I was mucking about I separated the "Three card deal" and "Unlimited redeal" options. (One card deal with unlimited redeals is the variation I'm most familiar with.) I also added a "No Redeal" option (one card deal with no redeal is how the game is described in Morehead and Mott-Smith's "The Complete Book of Solitare and Patience Games"). One slight hiccup is that I could find no way for checking one redeal option to uncheck the other. I could set the internal variables correctly but the change wouldn't be reflected on the menu. So for the moment it's possible to check both redeal options, but Unlimited overrides No in this case.
Created attachment 54325 [details] [review] Patch to klondike.scm and klondike.xml
Created attachment 54326 [details] Gargantua scm file
Created attachment 54327 [details] Gargantua xml file
You missed a spot. ;) (and (or (and (or deal-three - (< FLIP-COUNTER 2)) + (< FLIP-COUNTER max-redeal)) (not (empty-slot? waste))) (not (empty-slot? stock))) (list 0 (_"Deal a new card from the deck"))) Now that deal-three has nothing to do with this, that section of code doesn't seem to make sense. I think you just missed replacing it with the appropriate redeal option in that situation. And this gives me an excuse to say that I am happy to see the redeal and 3-card deal options separated, though I wonder at the necessity for yet another redeal option (is there another name we could use for that variation?).
Gargantua appears to be very similar to Jumbo. I didn't actually read the rules so I can't say how similar (and I'm having some other problems with it I need to investigate further), but you should probably check to see if you've duplicated a game.
The other problems I was having (double-clicking any card but an ace causes a crash) seem to be because by sol.scm is out of date and doesn't have (add-to-value).
Yeah, looks like I duplicated a game again. Argh. <i>Now that deal-three has nothing to do with this, that section of code doesn't seem to make sense. I think you just missed replacing it with the appropriate redeal option in that situation.</i> Yep, that's what happened. It only causes problems when the stock is empty so I never noticed anything amiss. Quick fix: - (and (or (and (or deal-three + (and (or (and (or unlimited-redeal
Since I have now ignored this bug for pretty much exactly a month, I'd better comment on it (sorry guys). I'm OK with putting an extra deal method in the options, but if we have to have funny things like one option over-rides another then it means it is time for me to implement radio button in the option code. Zach: if you have time could you post a modified version of the klondike patch that you think is correct with all the various modifications. I can do it myself - but it will probably take longer. Anyway, I should be properly back-on-deck and a bit more responsive to bugs than I have been for the past month and a bit.
> Yeah, looks like I duplicated a game again. Argh. Adding a link from the Klondike documentation to other Klondike variations including Jumbo might help prevent this sort of thing (at least that is where I'd start). I've been trying to get a clear idea of what games exist already but there is no easy way to do it I can think of.
Created attachment 55798 [details] [review] Klondike scm/xml patch with mutually exclusive options Well, this is what I had tried initially. Fiddling around with the redeal options for a while will confuse things currently though (you can get two redeals with Unlimited still checked for example.)
I'm afraid to say I won't be committing this in time for 2.14. I want to implement the mutually exclusive buttons with proper radio-button behaviour and I haven't figured out what the best way to implement it on the scheme end is. Ideally it would just be flagged in get-options and the rest of the scheme code wouldn't have to worry about ensuring it was mutually exclusive or anything like that. Finding a clean scheme syntax that is easy to parse on the C side is the problem.
Created attachment 61019 [details] klondike_three_decks.scm I'm hoping this patch gets in 2.15, even if the new options aren't exposed to the user. This is because it allowed me to clone Klondike Three Decks in a matter of minutes. And it'll probably help with what Alan's trying to do in bug 324759. Having said all of that, perhaps Klondike Three Decks should be kept out of aisleriot forever. The game is too slow for anyone's good.
The support for radio-buttons (i.e. mutually exclusive options) will hit CVS soon. (It's written and works, but I wrote some other code at the airport that isn't working quite right yet) Hopefully I can get the rest of the stuff in this bug integrated in a day or two.
I've applied the "mutually exclusive" options patch with some major changes. The biggest one was dropping the "unlimited redeals" mode. It isn't significantly easier than the standard 2 redeals mode (90% of the time you have either won or lost by the end of two redeals) and so I dropped it in the name of simplicity. The "Klondike" menu now contains three radio buttons: three card deals, one card deals and no redeals. There are still some subtle bugs, like the redeals counter not updating when you change modes, but nothing too important. I also made some changes to the code. The apply-options function was made simpler because the menu code handles the mutually exclusive options. The search-foundation was changed from an explicitly recursive function to an or-map (the motivation for this was mostly "because I could" - I've currently got a thing about the map/reduce style of code). I still haven't seriously looked at the the three-deck klondike yet (but I have downloaded the file).
Retitling for the remaining issue.
Re-assigning to default owner.
Klondike Three Decks can't be added until someone writes a help file.
(In reply to comment #12) > Having said all of that, perhaps Klondike Three Decks should be kept out of > aisleriot forever. The game is too slow for anyone's good. I have to agree; it's boring. -> I'm going to veto this. Sorry :-) (BTW the code ist buggy; I'd have won my first game, but the game already said 'won' when there were still cards on the tableau and more cards to deal. Usually we either auto-play all the cards to the foundations, or wait for the user to do so.)