A Card Solitaire

PSU CS 410/510 Games Homework 1
Due before class Thursday April 18


``Aces Up'', known under a variety of other names (I know it as ``Aces High''), is a particularly simple and tough card Solitaire game. Randy Rasa at Solitaire Central has generously made rules to this game (under the name ``Idiot's Delight'') available online. (Dave Brown and I have put together a summary of these rules for those who are confused.)

A Solitaire instance is said to be winnable if a winning position can be achieved by making the right choice whenever there is a choice. Rasa suggests that the basic version of Aces Up is winnable around 1 time in 20 with perfect play. The only choice of action in the game is which card to move to an empty pile in the tableau, so the branching factor is very low: it should be easy to test this claim.

Write a program capable of evaluating the winnability of Aces Up instances. To create an instance, shuffle a stack. Now simulate repeated deals and moves until there are no more cards to deal and no more moves are possible. For search purposes, consider the game state before each deal and before each filling move to be a node in the search space.

Your program should be able to test at least 100 instances per second. Construct 1000 random instances, and report the number that are winnable. Is this more or fewer than you expected? You can abandon an instance as soon as you have found that it is winnable.

Instrument your code to estimate the branching factor of Aces Up. How low is it? Specifically, what percentage of the game tree nodes you examine have a branching factor greater than 1?


Homework should be submitted by e-mail to <cs510games@cs.pdx.edu>. The words "cs510games hw1" should appear somewhere in the subject line. The homework submission should be a MIME message containing your source code, a writeup in ASCII answering all questions posed by the assignment, and the results of program runs. Please follow all accepted coding and software engineering practices for your programming language. Remember, if I can't understand your submission, I can't give you credit for it.

I'd like you to do this assignment by yourself. If you do work with anyone else, you must credit them in your submission.