After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 325038 - Add "Putt Putt" (an easy Golf variant)
Add "Putt Putt" (an easy Golf variant)
Status: RESOLVED OBSOLETE
Product: aisleriot
Classification: Other
Component: games
git master
Other All
: Normal enhancement
: ---
Assigned To: aisleriot-maint
aisleriot-maint
Depends on:
Blocks:
 
 
Reported: 2005-12-27 03:07 UTC by Alan Horkan
Modified: 2021-06-02 11:31 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
my modified version of golf.scm (5.86 KB, text/plain)
2005-12-27 03:09 UTC, Alan Horkan
Details
golf variation putt putt, nothing to see here interesting code is all in golf.scm (261 bytes, text/plain)
2005-12-27 03:09 UTC, Alan Horkan
Details
Original golf with wrapping option (Ace<->King & King-> Queen) (4.86 KB, text/plain)
2010-12-14 00:01 UTC, Wa
Details

Description Alan Horkan 2005-12-27 03:07:17 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) ...
Comment 1 Alan Horkan 2005-12-27 03:09:05 UTC
Created attachment 56416 [details]
my modified version of golf.scm
Comment 2 Alan Horkan 2005-12-27 03:09:52 UTC
Created attachment 56417 [details]
golf variation putt putt, nothing to see here interesting code is all in golf.scm
Comment 3 Richard Hoelscher 2006-01-16 03:50:21 UTC
Alan: To keep the duplication down, what if we just added a "Play Kings On Aces" option instead of making it a different game?
Comment 4 Callum McKenzie 2006-01-16 07:52:48 UTC
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 5 Callum McKenzie 2006-01-17 07:58:52 UTC
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.
Comment 6 Alan Horkan 2006-04-13 14:58:35 UTC
> 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.) 
Comment 7 Christian Persch 2008-03-25 12:01:47 UTC
Re-assigning to default owner.
Comment 8 Vincent Povirk 2009-02-28 21:33:56 UTC
Alan, if you're still around and wouldn't mind, could you write a help file for Putt Putt?
Comment 9 Wa 2010-12-13 23:59:40 UTC
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.
Comment 10 Wa 2010-12-14 00:01:50 UTC
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 11 Christian Persch 2011-12-08 22:27:31 UTC
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.
Comment 12 GNOME Infrastructure Team 2021-06-02 11:31:27 UTC
-- 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.