CECS 524 Ruby Programming Exercise Due Monday October 1 Program a solitaire game like the one that comes with Windows (no graphics however) except that the remaining deck is played one card at a time rather than three, and may only be traversed once. The deck consists of 52 cards of 13 values, 1-13, and four suits 1-4. 1 and 3 are the red suits and 2 and 4 are the black suits. The deck must be shuffled. Initially deal seven piles of size 1, 2, 3, 4, 5, 6, 7. The top card of each is face up and the remainder are face down. There are four suit piles, one for each suit, which are initially empty. They must be filled in order, 1,2,3,...13. At each stage you may 1. Move the face-up cards from one layout pile to another, provided the bottom face-up card of the pile to be moved has value one higher than the top card value on the moving pile and the suits are opposite colors. 2. Move the top-card to the suit pile, provided it is either has value 1 or value one greater than the card on that suit pile. 3. Move the face_up cards from one pile to an empty pile, provided the bottom face_up card is a 13. 4. Play the top-card of the discard pile onto one of the seven piles or the suit piles if it is a legal move as defined above. When none of the first four choices are possible then 5. Play the top card of the remaining deck. If it cannot be played on one of the seven piles or the suit piles, then place it face-up on the top of the discard pile. When there are no possible plays the game is over. Report the total number of cards on the suit piles. Play 1000 games and display a table of the frequencies of each result from 0 to 52. Display the initial seven piles and the final seven piles for one game. For example the initial piles might be 94u 131d 82d 113d 91d 121d 54d 63u 43d 13d 132d 12d 62d 23u 93d 72d 22d 133d 64u 74d 101d 104d 123u 112d 11d 53u 122d 14u where the card number is followed by the suit number and the up or down status.