Wednesday, March 15, 2017

Aces Up!

Four card solitaire described here:
https://en.wikipedia.org/wiki/Aces_Up

Video of someone playing a hand here:
https://www.youtube.com/watch?v=Y5c_nzx6p4k

The odds are long on winning a hand of this game of solitaire. With the wind storm last week, I lost power and then the power came back on but no cable, internet or land phone over the weekend. With no internet, I resorted to playing hands of solitaire and branched out into four card solitaire. I coded up a player and it boasts a winning rate of roughly one in 39 hands or a winning rate of 2.56%. The average number of cards remaining is about 14.3. This game is exceedingly simple and easy to code up. The only strategy involved is moving cards to empty spaces. The algorithm is as follows:

1.    Move a card lower than the same suit above it to the empty space.
2.    Move a card lower than a card on another pile with same suit to the empty space.
3.    Look back one into the piles and move a card below it that will result in creating another empty space.
4.    The ace strategy seems to work as moving any ace available to the empty spot that results in a discard is then made.
5.    Move any card that results in a discard.
6.    Move any ace to the empty spot.
7.    Move any card available to the empty spot.

That’s it. I’ll search for further refinement as I move forward.

No comments:

Post a Comment