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 355381 - Athena: The rules are not clear - you can do some really odd things...
Athena: The rules are not clear - you can do some really odd things...
Status: RESOLVED FIXED
Product: gnome-games-superseded
Classification: Deprecated
Component: general
unspecified
Other All
: Normal normal
: gnome-2-26
Assigned To: gnome-games-aisleriot-maint
GNOME Games maintainers
ghop[2007-20]
: 603830 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2006-09-11 06:14 UTC by Max TenEyck Woodbury
Modified: 2012-01-31 23:13 UTC
See Also:
GNOME target: ---
GNOME version: 2.21/2.22


Attachments
Fixes athena's rules to make it impossible to drag cards that have not been stacked properly. (1.26 KB, patch)
2007-12-13 02:04 UTC, Patrick Hulin
reviewed Details | Review
Updated patch (884 bytes, patch)
2008-01-12 14:02 UTC, Patrick Hulin
none Details | Review

Description Max TenEyck Woodbury 2006-09-11 06:14:46 UTC
Please describe the problem:
You can move ANY face up card even if there is an unflipped card or an out of sequence card on top of the card being moved.

Steps to reproduce:
1. Start new games until you find a card in the second row that can be moved on top of a card in the fourth row.
2. Use the mouse to perform the movement.
3. 


Actual results:
The face up card from the second row, the face down card from the third row and the face up card from the fourth row are all move on top of the face up card in the fourth row.

Expected results:
Frankly, I'm not sure.  The rules do not mention this sutuation.  My intuition tells me this should not be allowed but there is nothing in the rules that covers this.

Does this happen every time?
Yep

Other information:
The authority for all the game rules should be cited and the Athena rules should be reviewed to see if this situation is explained.

It is possible that this is the correct behavior.
Comment 1 Vincent Povirk 2006-09-30 01:26:48 UTC
Hmm, I somehow missed this one. I'm not sure what was meant either, but I would guess all face-up cards can be moved as that's the way Klondike works and it makes the initial deal make more sense.

CCing Alan Horkan, author of this game (if bugzilla lets me).
Comment 2 Patrick Hulin 2007-12-13 02:04:18 UTC
Created attachment 100858 [details] [review]
Fixes athena's rules to make it impossible to drag cards that have not been stacked properly.

Here's a patch.
Comment 3 Christian Persch 2007-12-21 14:06:07 UTC
Vincent, could you review this patch? Thanks!
Comment 4 Vincent Povirk 2007-12-21 18:31:57 UTC
It looks to me like the patch will do what it's supposed to.

It makes me a little uncomfortable that it replaces a "rules" portion of klondike.scm with a new function in athena.scm. I'd prefer to see it changed in klondike.scm (with an option if other games expect this behavior; I think agnes might). I'd also prefer the use of names like stack, tableau, and foundation over hard-coded slot ids.

No comment on whether changing the game rules rather than the help is the right way to fix this.
Comment 5 Christian Persch 2008-01-06 19:14:41 UTC
Vincent, thanks for the review!

Actually now I'm not sure if this isn't a bug in the engine instead of the games. Should the drag code check whether all cards are face-up before checking with the game routines if the drag is allowed? Do _any_ of our games legitimately allow moving face-down cards?
Comment 6 Vincent Povirk 2008-01-06 21:01:18 UTC
If you're asking if aisleriot should allow this on the C end, I would say it should. It's the game's responsibility to determine what is a legal move, and I see no reason for the engine not to support this.
Comment 7 Christian Persch 2008-01-06 21:22:09 UTC
Vincent: The code currently checks that the card that was clicked is face-up; so we should also remove that check and let the engine deal with it, correct?

(In reply to comment #4)
> No comment on whether changing the game rules rather than the help is the right
> way to fix this.

I think the game should be fixed. I looked up Athena rules on a few sites on google, and none mentioned that one might displace the stack including a face-down card; I don't think a sequence including a face-down card is a sequence built down by alternating colours.


Patrick: could you adapt your patch according to comment 4? Thanks!

Comment 8 Vincent Povirk 2008-01-06 21:26:42 UTC
(In reply to comment #7)
> Vincent: The code currently checks that the card that was clicked is face-up;
> so we should also remove that check and let the engine deal with it, correct?

Yes, but I see no reason to make such a change until a game requires it (and until we know how it affects the existing games).
Comment 9 Patrick Hulin 2008-01-12 14:02:38 UTC
Created attachment 102658 [details] [review]
Updated patch
Comment 10 Vincent Povirk 2008-01-12 19:35:26 UTC
*sigh* I know I'm being a pain here (sorry), but this patch also affects Aunt Mary and Saratoga (also written by Alan Horkan, who still hasn't responded to this bug), which may or may not be a good thing. I think Aunt Mary, at least, is clear: "Groups of cards can be moved." It does not specify that they must be builds (and, given that it's "rarely solveable" already, I don't think we want to make it any worse).

The normal way to deal with a situation where there are slight variations to the rules like this is to have an option in klondike.scm that says something like (define check-builds #f) that another game could set to #t to change the behavior. I suppose overriding functions in athena.scm, though a bit more ugly/confusing, would also be acceptable (from a maintenance point of view, rules that hard-code slot ids are much worse imo).

I also just remembered that the get-hint code needs to be updated so that hints match what is currently possible.

I now think that the help should be changed and not the rules because it's pretty clear to me that this was intentional at least in Aunt Mary. Given that all of the games that do this were written by the same person, I think he must have been aware of this behavior. So I must assume it was intentional in all three games.
Comment 11 Alan Horkan 2008-01-13 01:00:24 UTC
(In reply to comment #10)
> *sigh* I know I'm being a pain here (sorry), but this patch also affects Aunt
> Mary and Saratoga (also written by Alan Horkan, who still hasn't responded to
> this bug), which may or may not be a good thing. I think Aunt Mary, at least,

I may have set my bugzilla mail thresholds too low or overlooked the CC when I was a little bit busier with other distractions.  I don't think I got any recent mail about this one (someone poked me on livejournal though, thanks).  

As for rules any clarification I was working off of the rules provided by Pretty Good Solitaire (goodsol).  

Totally not in the right headspace at the moment to be programming much of anything, let alone debugging lisp.  Horribly out of practice and the code is once again unfamiliar to me.  Will try and refamiliarise myself but I doubt I'll be of much use.  
The way I was hoping the codebase would go was that the individual game files would contain less and less generic logic and be mostly a true false list of which rules apply and perhaps some layout code, making it easier to provide a much larger selection of game variations. My preference would be for us to have a many more games but if these need to be removed until fixed properly I'll not make a fuss.  

Comment 12 Christian Persch 2008-01-17 22:15:58 UTC
Vincent: actually I think the patch is correct. I checked with goodsol for the klondike variants we have (that include klondike.scm directly):
http://www.goodsol.com/pgshelp/athena.htm http://www.goodsol.com/pgshelp/saratoga.htm
http://www.goodsol.com/pgshelp/gold_rush.htm (which seems to be our 'gold mine' game)
and for all it says "Move groups of cards if they are in sequence down by Alternate color.". So I think we should make this change.

(NB: the supposed difficulty of out current 'aunt mary' game is greatly overstate; e.g. I have a 85% win quota for it.)
Comment 13 Christian Persch 2008-03-25 12:02:16 UTC
Re-assigning to default owner.
Comment 14 Vincent Povirk 2009-06-15 03:01:31 UTC
Should be fixed by 0a175ed6f4ff8ad6d120b17d4744248e90f92867.
Comment 15 Christian Persch 2010-01-05 19:51:40 UTC
*** Bug 603830 has been marked as a duplicate of this bug. ***
Comment 16 Robert Ancell 2012-01-31 23:13:59 UTC
This bug is being reassigned to the "general" component so we can close the aisleriot bugzilla component.  Apologies for the mass email!