Add "Putt Putt" (an easy Golf variant)
Submitted by Alan Horkan
Link to original bug (#325038)
Description
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) ...
Version: git master