This post originated from an RSS feed registered with Java Buzz
by Mike Shoemaker.
Original Post: Too Little Time To Shuffle
Feed Title: Unruly Rambling (java category)
Feed URL: http://www.shoesobjects.com/blog/feed.xml?flavor=rss20&category=java
Feed Description: My thoughts on software, technology, and life in general
As Christmas grows near, my Organizational Behavior course is coming to an end. I have enjoyed the class tremendously but I haven't had the opportunity to tinker around with new technology or complete any fun programming projects. I did say fun so work doesn't count. Not having this needed outlet puts a serious damper on my energy level as well as professional motivation. Now that things are starting to slow down a bit, what will I do?
For the past several months I've had poker on my mind and have considered writing a game in Java. My friends and I play a card game call Beret ad nauseum. Sometimes we play 20+ rounds in an evening which equates to 4 hours or so. Beret is a trick based card game similar to spades(I've never played spades but I've heard people compare the two). A typical Beret hand is played like this. The dealer deals 5 cards to each player. After dealing, the dealer is allowed to flip up one of his cards to determine the trump suite. This card is visible to all players. At this point players decide if they are in or out. They call this out one by one moving clockwise around the table. A player can say in, out, or check. Once a single player is in, the check option is no longer available. Players that drop are out for the duration of this particular game which could be many hands. Players that remain in are allowed to draw up to five of their cards by discarding a like number. Once the draw is complete, the player to the left of the dealer starts the game by leading a card. The next player must throw a card of the same suite if he has one, otherwise he can "throw off" another suit or "trump" the played suite. The highest card of the led suite wins the trick. If someone trumps the led suite, the trump card beats all cards in any other suite. Any player not winning a single trick must match the pot. Any player winning three tricks wins the pot. If no one gets 3 tricks to win the game another game is dealt and lather, rinse, and repeat cycle continues. It's an addicting game that is a lot of fun to play.
My first attempt will be a command line version of the game. Not sure of the chances of actually completing it, but I would really like to. With a little luck and inspiration, maybe I'll be able to recruit someone to work on a rudimentary user interface down the road. At any rate, I better search for my The Art of Computer Programming books by Donald Kunth to brush up on a shuffle algorithm. If I find any typos I promise to share the $2.56 finder fee.