Re: sol and sol "game over" test





On Sun, Nov 9, 2008 at 1:28 PM, Vincent Povirk <madewokherd+8cd9 gmail com> wrote:
> It would be nice to
> have a button to automatically move as many cards as possible from the
> tableau (bottom area) to the foundation (top area).

Double-click on a foundation.

I just tried that. I think what you meant is a to double-click a foundation card that can be moved up. But this isn't what I meant. Let's say for example the ace of hearts is showing and as happened, and the two of hearts is the foundation card that is revealed when the ace is moved. As currently coded, the two of hearts stays down in the foundation. Anyone who has any clue as to how to play this game probably understands that there *never* is any advantage to not moving an ace or a two up from where ever it is revealed.

But more generally, as cards move up they expose or reveal other cards which can move up as well. So for my taste, there should be a command to just do all of this busy work. This bookkeeping doesn't add anything. Although sometimes this may move cards up that you didn't want to move (but that is generally *not* the case), they can be moved back down.




We would need more than a proof to change the game-won test in
Klondike. There are other games where it's trivial to detect that the
game can be won just by plopping cards, but we generally don't count
it until all the cards are on foundations. I think it'd be rude if we
did.

To each his own. If the goal is to solve the game or puzzle given, then this end-game is mind-numbingly tedious. Coupled this with that time indicator and the end game devolves into how fast you can point and click.

Interesting you think it "rude". I think not doing stuff mentioned above makes for a worse impression of the program by enforcing a dumber game. Consider two chess programs. One program will tell you when a check mate is pending and another that just waits for the check mate to happen before it announces the game is over. Which program would you rather use? For me, it would be the one that warns of check mates.





There is a way to do your test without repeating yourself:

(define (all-cards-revealed cards)
 (if (= cards '())
   #t
   (and (is-visible? (car cards)) (all-cards-revealed (cdr cards)))))

(define (slots-revealed slots)
 (if (= slots '())
   #t
   (and (all-cards-revealed (get-cards (car slots))) (slots-revealed
(cdr slots)))))

(slots-revealed tableau)


The way you wrote it would break for other games that import
klondike.scm but use different slot numbers and configurations for the
tableau piles. In fact, even if the test is ok for klondike, it
probably isn't ok for these other games.


I don't think trying to cull unwinnable games is a good precedent,
especially by looking at cards that aren't revealed at the start of
the game.

Again I guess a matter of taste. But if this represents more than one person's view, that's cool - it saves me the effort of trying to make a patch should I code a test like this in. :-)




Vincent Povirk



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]