GNOME Bugzilla – Bug 637030
New game: Eliminator
Last modified: 2011-08-30 17:10:39 UTC
Created attachment 176245 [details] Eliminator game for AisleRiot and help file. Tableau: Four piles. Deal 13 cards to each. (This is all of the cards.) Foundation: Four to six empty slots that you build in either direction. Rules: Any card can be placed as the first card in the foundation. Foundation piles can be built up or down from the top card's value, disregarding suit. Kings can be placed on Aces and vise-versa. === This is my first time writing scheme and also my first game for AisleRiot, though I think it turned out nicely. :3 I've played it quite a bit; and it's a pretty simple game; so I don't think there are any bugs left. Included is the game code and help file (but not the ammendment to the main help as that'd probably have to be a patch and yadda, yadda; it's two lines.)
Thanks! Is this the same game as these rules here: http://www.solitairecity.com/Eliminator.shtml ? If you have other links to the rules for this game, can you please also post them? The scheme file is missing a GPL3+ copyright header.
Yes that's the rules I used. Though it didn't have information on scoring so I made that up. Also, I wasn't sure what license to use, I haven't ever done one for inclusion in other software before. I usually just go with MIT if that's possible, if not, whatever. It can be GPL3+ if needed. Want me to reupload with one?
Not necessary; it's enough that you declare here that you're ok with GPL3+'ing these files. A new patch can wait until after the scheme code has been reviewed.
Here are my initial comments from reading the code: If it's not too much trouble, could you define all your functions using (define) and at the top level? I know this is a functional programming language, and functional programmers like to define things inline, but that sort of thing confuses me. Consequently, I have no idea what game-continuable does. (>= slot-id (car tableau)) I think (member slot-id tableau) would be clearer. Personally, I would do something like this instead of compose: (define (any lst) (if (or (is-null? (cdr lst)) (car lst)) (car lst) (any (cdr lst)))) (define (all lst) (if (or (is-null? (cdr lst)) (not (car lst))) (car lst) (all (cdr lst)))) It should be possible to create a layout without the extra foundations when they are unused. This will change the slot-id's of the piles, but I think you should be able to cope with this if (new-game) sets tableau and foundation to the correct values. I think you should consider providing real hints (which just have to be possible moves, not necessarily good ones). In any case, you should write the hint text as (_"string") so it can be localized. Overall, this is very clean and at least looks correct to me. Very nice. Hopefully, I will soon have time to actually play this and run it through card-monkey (bug 569936).
OK, card-monkey found an actual bug. Double-clicking on any card that will not go to the foundation reports an invalid move (so it doesn't add a move to the undo history) but subtracts 1 from the score.
I agree with the member part..I did that before learning about member. ^^; That system would make it a lot easier to remove the face down cards as well. As for compose I assume you mean compound? I suppose I could make it more specific like that, I'm just used to modular programming. :x (Even if it's just cut-and-paste in this case because it has to be one file.) As for hints, I only didn't add them because it seemed like it would make it far too easy! It would basically use the same function as the second half of game-continuable, but I don't know, it seems like it would defeat the purpose of trying to prevent double-click spamming. And the double-clicking thing seems like proper functionality to me. It would be silly to let the user undo a punishment like that, right? Uploading all adjustments except that double-click score thing, for further commenting.
Created attachment 176268 [details] Elimiantor (AilseRiot game) update 1
Comment on attachment 176268 [details] Elimiantor (AilseRiot game) update 1 Fix: Removed face-down cards and the extra slots they covered. Addition: Hints Update: any/all procedures instead of compound
If you change the state and return false, that's broken behavior. We want the games to be consistent. We don't want to add artificial difficulty by making things behave in a way that the user won't expect. Even if double-clicking lots is a good strategy (and it sounds to me like it isn't), we should allow that. Your get-hint function can assume that it isn't called if game-continuable returns false, so there's no need to say "No moves.".
Ah, alright then. I'd like to leave the "No moves." in for hack conditions or errors however...it's better than letting the game segfault if it ever goes to that condition for some reason.
Created attachment 176314 [details] Eliminator (AisleRiot game) update 2 Update: Removed score detriment for double-clicking unusable cards.
Vincent: if/when you're satisfied with the code and docs quality, feel free to commit this :)
Committed as c7eec70650c2e53980616ccd750a051ff4c1452e.
Thanks! @Wa: would you mind telling your full name, for the credits? :)
Oh sorry, I didn't get an email. :( My name is Sapphire Becker. Thanks for the commit!
Thanks! I updated the credits accordingly.