GNOME Bugzilla – Bug 325038
Add "Putt Putt" (an easy Golf variant)
Last modified: 2021-06-02 11:31:27 UTC
The Golf game is far too difficult for my liking and it doesn't seem much like fun to me. Putt Putt is much easier than Golf, because it wraps around from Ace to King. In my not so humble opinion it is more fun! ;) Golf includes a restriction preventing the user from putting any cards on the King. (You can place 2, Ace, 2, but not if you place Queen, King you are stopped. I learned this restriction is intentional (albeit weird) not a bug as I had first thought.) I have played around with the code and done some work towards abstraction (but more would be needed if you really wanted to change things like the tableau). I think in some cases it makes the code more readable and less ambiguous (assumingly I've correctly substituted stock for 0, and waste for 1 in all the right places). It might take a while to review these changes for correctness and be sure if you actually want to include them but I have been very careful and I think most of my changes should be fairly clean clear if you diff against aisleriot from gnome-games 2.10 (I think there is a two deck variation of Golf but I dont plan on giving it a try anytime soon, other games I'm more interested in first.) I have also experimented with a (partially) extended slot so the waste cards spread out to the right and use more of the available space (and putting behind an if statement seemed more useful than commenting it out). It is what Goodsol does and I think it looks fairly nice. Unfortunately I'm submitting these files despite the fact that Putt Putt is incomplete. There is a variable wrap-ace-king and related functionas which are needed to implement the distinctive wrap around which makes Putt Putt so much easier. If you set wrap-ace-king to #f false Golf runs as normal, if you set it to true so far it only removes the restriction on placing any more cards after a King. There are two small sections labelled FIXME and various notes at the end of golf.scm (to be deleted later) which include the code which should more or less do what is needed to get Putt Putt working but I cannot quite seem to get it right. I hope the changes to golf.scm are of some interest, and maybe someone would be interested to help me out and see where I've gone wrong with the final piece needed to make Putt Putt work. (maybe add the gnome-love keyword?) Attachments to follow (crappy dialup connection not withstanding) ...
Created attachment 56416 [details] my modified version of golf.scm
Created attachment 56417 [details] golf variation putt putt, nothing to see here interesting code is all in golf.scm
Alan: To keep the duplication down, what if we just added a "Play Kings On Aces" option instead of making it a different game?
I have distilled what I can from the first patch in the way of cleanups - especially the use of symbols rather than hard-coded numbers. I haven't had a chance to look at why your code to do the wrapping isn't working. One important note: don't remove the droppable functions. They are very important for highlighting where cards cna be dropped (I think you are using an older aisleriot, so you won't notice this). I think Richard is right that Putt Putt will work better as an option. Although it leaves us without a gorgeously cute name.
Comment on the scheme troubles with getting the suit to wrap properly: Both conditionals in the footnotes of patch #1 should work so I suspect the logic problem is further up (BTW the second form is the preferred one since it doesn't expose the implementation details of a slot). I think it breaks because the condition _after_ the (if ...) in button-released will be false even if your condition in the if is true. Everything in the outer (and ...) has to be true for the cards to be moved. So you will need to rearrange the logic.
> Alan: To keep the duplication down, what if we just added a "Play Kings On Aces" option instead of making it a different game? It is a seperate game, it should be presented to the user as such. If you can change the implementation so that even though the code is shared the games list presented to the user includes both Golf and Putt Putt (but with the wrapping option preset in putt putt) I'd be happy with that. I am trying to increase the variety of games in Aisleriot. There are many many other games already with redundant functionality and only tiny variations which coould be consolidated if you want to do the necessary refactoring. It would e unfair to block my contribution when there are already so many other games which are extremely similar to each other. (If I can make time to work on Aisleriot again i would like to expand the Help glossary, consolidate some of the redundant descriptions and better interlink the various pages. Mainly because this should be a lot simpler and more straight forward than trying to restructure, consolidate and reuse the code.)
Re-assigning to default owner.
Alan, if you're still around and wouldn't mind, could you write a help file for Putt Putt?
Bleh, since the original wasn't complete, and I like this style of golf more, I just made my own. But I agree with it simply being a variation of Golf (as in, an option), so I've implemented it in that form. Code to come.
Created attachment 176383 [details] Original golf with wrapping option (Ace<->King & King-> Queen) Feel free to rename the option (currently "Allow Ace<->King & King->Queen") as it's kind of long and clunky. I just wasn't sure what to call it.
Comment on attachment 176383 [details] Original golf with wrapping option (Ace<->King & King-> Queen) Since it's simply a golf variation, the code should include golf and just modify some bits, like attachment 56417 [details]. That said, if nobody's writing the help, this won't ever happen.
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/aisleriot/-/issues/66.