SIGN UP MEMBER LOGIN:    
ARTICLE

Marble Solitaire Solution Display in GDI+

Posted by des_kenny Articles | GDI+ & Graphics February 13, 2002
The application finds and displays solutions to a game of solitaire. The application was written using Visual Studio.NET Version 7.0.9254. The test suite was written using NUnit, which is a .NET port of JUnit.
Reader Level:
Download Files:
 



Overview

The application finds and displays solutions to a game of solitaire. The application was written using Visual Studio.NET Version 7.0.9254. The test suite was written using NUnit, which is a .NET port of JUnit. 

Description

To compile and run the application, just open the visual studio project and press F5. A test suite was also written using NUnit. The test batch file relies on NUnit been installed at "C:\Program Files\NUnit\bin\NUnitGui.exe". This test suite is available from
http://sourceforge.net/project/showfiles.php?group_id=10749 

For further details see http://nunit.sourceforge.net 

Source Code 

  • Solution.cs.          Recursively finds the solution, given a start position
  • Move.cs              Simple wrapper class used to represent and parse a move.
  • Mover.cs             Determines the valid moves, given a board state.
  • Board.cs             Represents the solitaire board.
  • Form1.cs             GUI which displays the controls and solution graphically.
  • Log.cs                Log file creation utility
  • AllTest.cs            ITest, all the tests defined
  • BoardTest.cs       Tests for the board functionality
  • LogTest.cs          Tests logging functionality
  • SolutionTest.cs    Tests the solution finder.

The images used are contained in a resource file MyResources.resources 

There is a bug in the program where if you reset several time and hit solve, the program sometimes crashes. I think this is due to a bug in Hashtable, if anyone knows how to fix it, send it on ;-)

Login to add your contents and source code to this article
share this article :
post comment
 

Good morning. I'm trying to run this application under visula studio 2008 and i've got some problems with nunit :
The type or name spacename   'Test Case' could not be found
The type or name spacename   'ITest' could not be found
Please, could you tell me the way to solve this errors
Thank you very much for your attention
Best Regards
Diego

Posted by diego diego Feb 09, 2010
6 Months Free & No Setup Fees ASP.NET Hosting!
Become a Sponsor
PREMIUM SPONSORS
  • Finally – a virtual platform that delivers next-generation Windows Server 2008 Hyper-V virtualization technology from a managed hosting partner you can truly depend on. Visit www.maximumasp.com/max for a FREE 30 day trial. Hurry offer ends soon. Climb aboard the MaxV platform and take advantage of High Availability, Intelligent Monitoring, Recurrent Backups, and Scalability – with no hassle or hidden fees. As a managed hosting partner focused solely on Microsoft technologies since 2000, MaximumASP is uniquely qualified to provide the superior support that our business is built on. Unparalleled expertise with Microsoft technologies lead to working directly with Microsoft as first to offer IIS 7 and SQL 2008 betas in a hosted environment; partnering in the Go Live Program for Hyper-V; and product co-launches built on WS 2008 with Hyper-V technology.
    Get 2 Months Free of ASP.NET Hosting for Only $4.95/month! Receive FREE MS SQL and MySQL Databases Including ASP.NET 4/3.5, MVC 3.0, Silverlight 4, Windows 2008/IIS 7.0 Plus FREE IIS 7 Modules. Host UNLIMITED ASP.NET Web Sites - Click Here!
Team Foundation Server Hosting
Become a Sponsor