April 7, 2011

Four Aces Solitaire Game

For my web programming class, we were asked to create the game Four Aces Solitaire using javascript.

Here was my attempt at creating the game.  Go ahead, see if you can beat it.

The only part that I haven't been able to test was the message saying that you won the game.  I've beat the game only a few times before, but didn't think about when the game is over because I was too worried about the game play itself.  Once I got the game working properly, I haven't actually been able to beat it since.  So let me know if you can.

To play:

The game starts with 4 cards.  To get rid of a card, there has to be a higher card of the same suit on the rightmost of the "pile."  Ace is obviously the highest, so at the end of the game, you should only be left with the 4 aces on the screen.

If there is a blank row, you can click on any card and move that card, and all cards to the right of it, to the new row.

If there are no more moves, click "Deal" to distribute another 4 cards until you've got through the deck.  Once you reach 0 deals remaining, and run out of moves, then you lose.  Start a new game and try again!

Let me know how it plays and if there are any issues with it...  or at least see if you can win.

 Go on...  give it a try!