![]() ![]() Private readonly IAdjacentCalculator _adjacentCalculator Public class MineSweeperService : IMineSweeperService The MineSweeperService is the main coordinator, that calls the AdjacentCalculator class methods for calculating all cells of Grid Panel. TestTool.AssertOutputs(actualGridPanel, expectedGrid) Public GridPanel( int maxRows, int maxColumns) Row and Column properties represent the panel's horizontal and vertical coordinates. The smallest unit in the Minesweeper game is the Locations that can be clicked, and have only two properties. In order to separate my concerns and have a better app structure, I'm also going to add Unit Tests Project, in order to have tests for better refactoring and bug fixing in my app. You can create a new project by going to File -> New -> Project.įor application solution structure, I'm going to separate files in folders like: Models, Constants, Services and Utilities. We start our program by adding a new console project. For a brief overview of Clean Coding, you can just type few words in Google like: "10 basic rules of clean coding". It's good if you know the basics of clean coding and object oriented programming. In text file, we consider that asterisks are mines, and dots are empty cells on board. The sample text file for this app will look like this: The simple object-oriented and clean-coded Minesweeper Game console application presented in this article will accept a text file. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |