SIGN UP MEMBER LOGIN:    
ARTICLE

FreeCell Game using Windows Forms

Posted by M Chandramouli Articles | Games Programming C# November 14, 2002
FreeCell is an implementation of the FreeCell card game using Windows Forms.
Reader Level:
Download Files:
 

FreeCell is an implementation of the FreeCell card game using Windows Forms. The card graphics is accessed using "cards.dll" (some code from the net whose source I have lost). The objective of the game is to move all the cards in sequence to their final destination. There are four free cells. In the area where cards are dealt, cards can be placed in descending order and with alternate colors. A click on a column chooses the card and a click on another column places the card on the other column. A double click on a card moves it to a final cell if possible or to a free cell if it cannot move to any final cell.

The code is pretty self explanatory. The Board class contains most of the logic. The main components of that are the DealArea, FinalCells and FreeCells. The FreeCells are numbered 0-3, the DealArea columns are numbered 8-15 and the FinalCells are numbered 4-7.

The program allows you to save and load deals from a file.

Login to add your contents and source code to this article
share this article :
post comment
 
6 Months Free & No Setup Fees ASP.NET Hosting!
Become a Sponsor
PREMIUM SPONSORS
  • The leading .NET charting control now features PDF, Flash and Silverlight export, visualization of large datasets and more. Deliver true charting functionality to your BI, Scorecard, Presentation or Scientific apps. Download evaluation now.
    ceTE software specializes in components for dynamic PDF generation and manipulation. The DynamicPDF™ product line allows you to dynamically generate PDF documents, merge PDF documents and new content to existing PDF documents from within your applications. Visit DynamicPDF here
Nevron Gauge for SharePoint
Become a Sponsor