Reader Level:
ARTICLE

C# Video Poker

Posted by Olga Fansler Articles | Games Programming C# April 14, 2003
This Video Poker game is an imitation of a casino Video Poker machine. It is written using Windows Forms.
  • 0
  • 0
  • 59731
Download Files:
 

Basic Video Poker Game

This Video Poker game is an imitation of a casino Video Poker machine. It was written using Windows Forms.The cards are drawn on the screen using "cards.dll". (Thank you to  M.Chandramouli, author of FreeCell game that was submitted to C# Corner 11/14/02). A winning hand is accompanied by a sound from "winmm.dll". sndPlaySound function plays a waveform sound specified by a filename. Two different sound files are played depending on the amount of credits won by the player. The description of this function is included in comments in Sound.cs file.

How to Play

Press "PLAY" button to see your initial hand.

Examine the hand to decide which cards you want to save or discard. Do this by checking the appropriate "HOLD" checkboxes, which are lined up with the cards on the screen.

You may hold or discard any number of cards you wish. When you are ready, press "DRAW" and every card that is not held will be replaced with a new card. This is your final hand. If it matches any payout combinations, the machine will register the appropriate number of credits.

Once the initial hand is dealt by the machine, there are two different methods employed for dealing out the replacement cards for the draw. In the method used by most early machines, ten cards are actually dealt out. The first five are the initial hand, while the second five are lined up and hidden behind the first five. The second five cards are the potential draw cards, one for each of the initial five cards of the hand.This application is using the algorithm for drawing cards based on this earlier method.

Then, for every card that the player discards, the card that was hidden behindit is exposed. For each card that is held, the backup card remains hidden.

In the second method, only five cards are initially dealt out. The replacement draw cards are sequentially dealt out from the deck for each discarded card only when the player presses the "DRAW" button. This method, which is more similar to the way table poker is dealt, is used in the new machines. The two methods are simply programming variations, from a probability standpoint, they are identical.

COMMENT USING

Trending up