| « Linux & Zeno's Paradox | It's December, then.. » |
Sun, Dec 14, 2008
![[Icon]](rsc/img/chain_link.gif)
I've got too much free time on my hands lately, and I can only fill so much of it by reading library books.
So I dragged out my trusty K&R book and here we go again with playing around learning C.
I wanted to write something actually useful and complex to get back into the habit of writing code. So I'm writing a card game. Solitaire. The 'Klondike' version, I believe.
So far, it's going pretty well. It creates a deck of 52 cards, shuffles them, deals them, and prints an appropriate display:
| * || _ | | _ | | _ | | _ | | _ |
| 3D| | | | | | | | | | | | |
| 5C| | | | | | | | | | |
| 7D| | | | | | | | |
| 9H| | | | | | |
| 8H| | | | |
| 4C| | |
| KS|
That's the card stack top left, the aces stacks top right, and the tableau stacks beneath. The visible cards are the three of diamonds, five of clubs, seven of diamonds, nine of hearts, eight of hearts, four of clubs, and king of spades.
I'll use bash colour codes to make them red & black, and add the interface to actually PLAY the game later. But I'm quite impressed with how well it's gone so far, since I'd forgotten pretty much everything until I checked my notes this morning to remind me...
![[Links]](http://geekblog.oneandoneis2.org/skins/112/rsc/img/chain_link.gif)
Facebook Syndication Error
04/02/12
![]()
I last listened to:
Johann Pachelbel - Canon in D major
Most recent photo:
Submersible houseboat