![]() I wanted to use the PictureBox control as the base objectįor the disks and poles, but needed more, so I extended the PictureBox control. The GameForm contains all the graphical components and servers as the driver for the application. The MoveCalculator would returnĪ list of moves and the GameState would make them. GameState, so the Move class was introduced. I wanted the MoveCalculator to return something useful to the ![]() GameForm would drive the front end, with the help of a few controls. The GameState class would handle the game mechanics and the ![]() MoveCalculator class with the sole purpose of working on the solution. I wanted a clear separation between the UI and the backend. ** The term pole is used to describe the pegs, containing the disks. * The term disk is used throughout the article to describe the movable parts of the puzzle. The application must have a 'Show Me' feature where the application will show the user the solution, step by step, for the selected number of disks.įor more about the puzzle see: Tower of Hanoi.You cannot place a bigger disk on a smaller disk.The application should allow only valid moves – as defined by these rules:.There will always be three poles** present. The user should be able to choose if they would like to use 3,4,5,6 disks* in the puzzle.A graphical representation, using Windows forms, of the puzzle.The application is written in C# and the UI is done using Windows Forms. This article contains a recursive solution for the Towers of Hanoi problem.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |