diff --git a/.idea/.idea.IDoMinesweeper/.idea/workspace.xml b/.idea/.idea.IDoMinesweeper/.idea/workspace.xml index ce3b87e..c0390ce 100644 --- a/.idea/.idea.IDoMinesweeper/.idea/workspace.xml +++ b/.idea/.idea.IDoMinesweeper/.idea/workspace.xml @@ -3,8 +3,14 @@ <component name="ChangeListManager"> <list default="true" id="a128ca0c-796d-4da2-8db0-062a4837d105" name="Default Changelist" comment=""> <change beforePath="$PROJECT_DIR$/.idea/.idea.IDoMinesweeper/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/.idea.IDoMinesweeper/.idea/workspace.xml" afterDir="false" /> + <change beforePath="$PROJECT_DIR$/ConsoleUserInt/GameUI.cs" beforeDir="false" afterPath="$PROJECT_DIR$/ConsoleUserInt/GameUI.cs" afterDir="false" /> + <change beforePath="$PROJECT_DIR$/ConsoleUserInt/bin/Debug/netcoreapp3.0/ConsoleUserInt.dll" beforeDir="false" afterPath="$PROJECT_DIR$/ConsoleUserInt/bin/Debug/netcoreapp3.0/ConsoleUserInt.dll" afterDir="false" /> + <change beforePath="$PROJECT_DIR$/ConsoleUserInt/bin/Debug/netcoreapp3.0/ConsoleUserInt.pdb" beforeDir="false" afterPath="$PROJECT_DIR$/ConsoleUserInt/bin/Debug/netcoreapp3.0/ConsoleUserInt.pdb" afterDir="false" /> <change beforePath="$PROJECT_DIR$/ConsoleUserInt/bin/Debug/netcoreapp3.0/Game.dll" beforeDir="false" afterPath="$PROJECT_DIR$/ConsoleUserInt/bin/Debug/netcoreapp3.0/Game.dll" afterDir="false" /> <change beforePath="$PROJECT_DIR$/ConsoleUserInt/bin/Debug/netcoreapp3.0/Game.pdb" beforeDir="false" afterPath="$PROJECT_DIR$/ConsoleUserInt/bin/Debug/netcoreapp3.0/Game.pdb" afterDir="false" /> + <change beforePath="$PROJECT_DIR$/ConsoleUserInt/obj/Debug/netcoreapp3.0/ConsoleUserInt.csprojAssemblyReference.cache" beforeDir="false" afterPath="$PROJECT_DIR$/ConsoleUserInt/obj/Debug/netcoreapp3.0/ConsoleUserInt.csprojAssemblyReference.cache" afterDir="false" /> + <change beforePath="$PROJECT_DIR$/ConsoleUserInt/obj/Debug/netcoreapp3.0/ConsoleUserInt.dll" beforeDir="false" afterPath="$PROJECT_DIR$/ConsoleUserInt/obj/Debug/netcoreapp3.0/ConsoleUserInt.dll" afterDir="false" /> + <change beforePath="$PROJECT_DIR$/ConsoleUserInt/obj/Debug/netcoreapp3.0/ConsoleUserInt.pdb" beforeDir="false" afterPath="$PROJECT_DIR$/ConsoleUserInt/obj/Debug/netcoreapp3.0/ConsoleUserInt.pdb" afterDir="false" /> <change beforePath="$PROJECT_DIR$/Game/Engine.cs" beforeDir="false" afterPath="$PROJECT_DIR$/Game/Engine.cs" afterDir="false" /> <change beforePath="$PROJECT_DIR$/Game/bin/Debug/netcoreapp3.0/Game.dll" beforeDir="false" afterPath="$PROJECT_DIR$/Game/bin/Debug/netcoreapp3.0/Game.dll" afterDir="false" /> <change beforePath="$PROJECT_DIR$/Game/bin/Debug/netcoreapp3.0/Game.pdb" beforeDir="false" afterPath="$PROJECT_DIR$/Game/bin/Debug/netcoreapp3.0/Game.pdb" afterDir="false" /> @@ -12,6 +18,8 @@ <change beforePath="$PROJECT_DIR$/Game/obj/Debug/netcoreapp3.0/Game.dll" beforeDir="false" afterPath="$PROJECT_DIR$/Game/obj/Debug/netcoreapp3.0/Game.dll" afterDir="false" /> <change beforePath="$PROJECT_DIR$/Game/obj/Debug/netcoreapp3.0/Game.pdb" beforeDir="false" afterPath="$PROJECT_DIR$/Game/obj/Debug/netcoreapp3.0/Game.pdb" afterDir="false" /> <change beforePath="$PROJECT_DIR$/IDoMinesweeper/Program.cs" beforeDir="false" afterPath="$PROJECT_DIR$/IDoMinesweeper/Program.cs" afterDir="false" /> + <change beforePath="$PROJECT_DIR$/IDoMinesweeper/bin/Debug/netcoreapp3.0/ConsoleUserInt.dll" beforeDir="false" afterPath="$PROJECT_DIR$/IDoMinesweeper/bin/Debug/netcoreapp3.0/ConsoleUserInt.dll" afterDir="false" /> + <change beforePath="$PROJECT_DIR$/IDoMinesweeper/bin/Debug/netcoreapp3.0/ConsoleUserInt.pdb" beforeDir="false" afterPath="$PROJECT_DIR$/IDoMinesweeper/bin/Debug/netcoreapp3.0/ConsoleUserInt.pdb" afterDir="false" /> <change beforePath="$PROJECT_DIR$/IDoMinesweeper/bin/Debug/netcoreapp3.0/Game.dll" beforeDir="false" afterPath="$PROJECT_DIR$/IDoMinesweeper/bin/Debug/netcoreapp3.0/Game.dll" afterDir="false" /> <change beforePath="$PROJECT_DIR$/IDoMinesweeper/bin/Debug/netcoreapp3.0/Game.pdb" beforeDir="false" afterPath="$PROJECT_DIR$/IDoMinesweeper/bin/Debug/netcoreapp3.0/Game.pdb" afterDir="false" /> <change beforePath="$PROJECT_DIR$/IDoMinesweeper/bin/Debug/netcoreapp3.0/IDoMinesweeper.dll" beforeDir="false" afterPath="$PROJECT_DIR$/IDoMinesweeper/bin/Debug/netcoreapp3.0/IDoMinesweeper.dll" afterDir="false" /> @@ -48,10 +56,10 @@ <option value="$PROJECT_DIR$/GameUI/Class1.cs" /> <option value="$PROJECT_DIR$/ConsoleUserInt/Class1.cs" /> <option value="$PROJECT_DIR$/Game/CellState.cs" /> - <option value="$PROJECT_DIR$/ConsoleUserInt/GameUI.cs" /> <option value="$PROJECT_DIR$/MenuSystem/Menu.cs" /> - <option value="$PROJECT_DIR$/Game/Engine.cs" /> + <option value="$PROJECT_DIR$/ConsoleUserInt/GameUI.cs" /> <option value="$PROJECT_DIR$/IDoMinesweeper/Program.cs" /> + <option value="$PROJECT_DIR$/Game/Engine.cs" /> </list> </option> </component> @@ -114,7 +122,9 @@ <workItem from="1570541467008" duration="1357000" /> <workItem from="1570543449378" duration="28421000" /> <workItem from="1570828559519" duration="1080000" /> - <workItem from="1570969640551" duration="3567000" /> + <workItem from="1570969640551" duration="4588000" /> + <workItem from="1571052402368" duration="4070000" /> + <workItem from="1571651125428" duration="6192000" /> </task> <task id="LOCAL-00001" summary="yes"> <created>1570973690674</created> @@ -130,7 +140,14 @@ <option name="project" value="LOCAL" /> <updated>1570997742575</updated> </task> - <option name="localTasksCounter" value="3" /> + <task id="LOCAL-00003" summary="commit 3"> + <created>1570999581348</created> + <option name="number" value="00003" /> + <option name="presentableId" value="LOCAL-00003" /> + <option name="project" value="LOCAL" /> + <updated>1570999581348</updated> + </task> + <option name="localTasksCounter" value="4" /> <servers /> </component> <component name="TypeScriptGeneratedFilesManager"> @@ -143,7 +160,9 @@ <map> <entry key="MAIN"> <value> - <State /> + <State> + <option name="COLUMN_ORDER" /> + </State> </value> </entry> </map> @@ -153,7 +172,8 @@ <option name="LOCAL_CHANGES_DETAILS_PREVIEW_SHOWN" value="true" /> <MESSAGE value="yes" /> <MESSAGE value="Adding validation input: Doesn't accept non int and set maximum size of the board" /> - <option name="LAST_COMMIT_MESSAGE" value="Adding validation input: Doesn't accept non int and set maximum size of the board" /> + <MESSAGE value="commit 3" /> + <option name="LAST_COMMIT_MESSAGE" value="commit 3" /> </component> <component name="XDebuggerManager"> <breakpoint-manager> diff --git a/ConsoleUserInt/GameUI.cs b/ConsoleUserInt/GameUI.cs index 5e7aadb..24b02ca 100644 --- a/ConsoleUserInt/GameUI.cs +++ b/ConsoleUserInt/GameUI.cs @@ -8,9 +8,9 @@ namespace ConsoleUserInt { public static class GameUI { - private static readonly string _verticalSeparator = "|"; + private static readonly string _verticalSeparator = "┇"; private static readonly string _horizontalSeparator = "-"; - private static readonly string _centerSeparator = "+"; + private static readonly string _centerSeparator = "◉"; public static void PrintBoard(Engine.BoardDim game) { diff --git a/ConsoleUserInt/bin/Debug/netcoreapp3.0/ConsoleUserInt.dll b/ConsoleUserInt/bin/Debug/netcoreapp3.0/ConsoleUserInt.dll index 3d0c48f..581d4a5 100644 Binary files a/ConsoleUserInt/bin/Debug/netcoreapp3.0/ConsoleUserInt.dll and b/ConsoleUserInt/bin/Debug/netcoreapp3.0/ConsoleUserInt.dll differ diff --git a/ConsoleUserInt/bin/Debug/netcoreapp3.0/ConsoleUserInt.pdb b/ConsoleUserInt/bin/Debug/netcoreapp3.0/ConsoleUserInt.pdb index 1c345de..598f1bf 100644 Binary files a/ConsoleUserInt/bin/Debug/netcoreapp3.0/ConsoleUserInt.pdb and b/ConsoleUserInt/bin/Debug/netcoreapp3.0/ConsoleUserInt.pdb differ diff --git a/ConsoleUserInt/bin/Debug/netcoreapp3.0/Game.dll b/ConsoleUserInt/bin/Debug/netcoreapp3.0/Game.dll index 435fe5a..4792594 100644 Binary files a/ConsoleUserInt/bin/Debug/netcoreapp3.0/Game.dll and b/ConsoleUserInt/bin/Debug/netcoreapp3.0/Game.dll differ diff --git a/ConsoleUserInt/bin/Debug/netcoreapp3.0/Game.pdb b/ConsoleUserInt/bin/Debug/netcoreapp3.0/Game.pdb index 9883b60..fb33630 100644 Binary files a/ConsoleUserInt/bin/Debug/netcoreapp3.0/Game.pdb and b/ConsoleUserInt/bin/Debug/netcoreapp3.0/Game.pdb differ diff --git a/ConsoleUserInt/obj/Debug/netcoreapp3.0/ConsoleUserInt.csprojAssemblyReference.cache b/ConsoleUserInt/obj/Debug/netcoreapp3.0/ConsoleUserInt.csprojAssemblyReference.cache index e2dc7a5..0f06d2f 100644 Binary files a/ConsoleUserInt/obj/Debug/netcoreapp3.0/ConsoleUserInt.csprojAssemblyReference.cache and b/ConsoleUserInt/obj/Debug/netcoreapp3.0/ConsoleUserInt.csprojAssemblyReference.cache differ diff --git a/ConsoleUserInt/obj/Debug/netcoreapp3.0/ConsoleUserInt.dll b/ConsoleUserInt/obj/Debug/netcoreapp3.0/ConsoleUserInt.dll index 3d0c48f..581d4a5 100644 Binary files a/ConsoleUserInt/obj/Debug/netcoreapp3.0/ConsoleUserInt.dll and b/ConsoleUserInt/obj/Debug/netcoreapp3.0/ConsoleUserInt.dll differ diff --git a/ConsoleUserInt/obj/Debug/netcoreapp3.0/ConsoleUserInt.pdb b/ConsoleUserInt/obj/Debug/netcoreapp3.0/ConsoleUserInt.pdb index 1c345de..598f1bf 100644 Binary files a/ConsoleUserInt/obj/Debug/netcoreapp3.0/ConsoleUserInt.pdb and b/ConsoleUserInt/obj/Debug/netcoreapp3.0/ConsoleUserInt.pdb differ diff --git a/Game/Engine.cs b/Game/Engine.cs index ea11569..232a4c5 100644 --- a/Game/Engine.cs +++ b/Game/Engine.cs @@ -51,29 +51,45 @@ namespace Engine - public void MinesLocator(int posY, int posX) //to generate mines randomly - + public void MinesSetter(int height, int width) //to generate mines randomly + { int mineCount = 0; + int numOfMines = (height*width) / 8; Random random = new Random(); - + do { + int minePosY = random.Next(height); + int minePosX = random.Next(width); - - int mineY = random.Next(BoardHeight); - int mineX = random.Next(BoardWidth); + int[,] mineLoc = new int[minePosY,minePosX]; - int[,] mineLoc = new int[mineY,mineX]; mineCount++; + } + while (mineCount <= numOfMines) ; + + /* for (int y = 0; y < height; y++) + { + for (int x = 0; x < width; x++) + { + Console.Write(string.Format("{0}\t", mineLoc[minePosY, minePosX])); + } + } - while (mineCount < 7) ; + + */ + _minesSet = !_minesSet; + + + + Console.WriteLine($"There are {numOfMines} mines "); } diff --git a/Game/bin/Debug/netcoreapp3.0/Game.dll b/Game/bin/Debug/netcoreapp3.0/Game.dll index 435fe5a..4792594 100644 Binary files a/Game/bin/Debug/netcoreapp3.0/Game.dll and b/Game/bin/Debug/netcoreapp3.0/Game.dll differ diff --git a/Game/bin/Debug/netcoreapp3.0/Game.pdb b/Game/bin/Debug/netcoreapp3.0/Game.pdb index 9883b60..fb33630 100644 Binary files a/Game/bin/Debug/netcoreapp3.0/Game.pdb and b/Game/bin/Debug/netcoreapp3.0/Game.pdb differ diff --git a/Game/obj/Debug/netcoreapp3.0/Game.csprojAssemblyReference.cache b/Game/obj/Debug/netcoreapp3.0/Game.csprojAssemblyReference.cache index ac890ad..207a486 100644 Binary files a/Game/obj/Debug/netcoreapp3.0/Game.csprojAssemblyReference.cache and b/Game/obj/Debug/netcoreapp3.0/Game.csprojAssemblyReference.cache differ diff --git a/Game/obj/Debug/netcoreapp3.0/Game.dll b/Game/obj/Debug/netcoreapp3.0/Game.dll index 435fe5a..4792594 100644 Binary files a/Game/obj/Debug/netcoreapp3.0/Game.dll and b/Game/obj/Debug/netcoreapp3.0/Game.dll differ diff --git a/Game/obj/Debug/netcoreapp3.0/Game.pdb b/Game/obj/Debug/netcoreapp3.0/Game.pdb index 9883b60..fb33630 100644 Binary files a/Game/obj/Debug/netcoreapp3.0/Game.pdb and b/Game/obj/Debug/netcoreapp3.0/Game.pdb differ diff --git a/IDoMinesweeper/Program.cs b/IDoMinesweeper/Program.cs index 36f7006..313d99b 100644 --- a/IDoMinesweeper/Program.cs +++ b/IDoMinesweeper/Program.cs @@ -148,7 +148,7 @@ namespace IDoMinesweeper } while (doIt = false); - //still need improvement. If I put string, it'll say not only not int + //still need improvement. If I put string, it'll say not only "not int" //but also "Too small" which is weird //and do while doesn't work as my expectation yet //I guess it's time to start making better architecture'' @@ -168,13 +168,14 @@ namespace IDoMinesweeper Clear(); GameUI.PrintBoard(game); - - - game.MinesLocator(height, width); - - + game.MinesSetter(height, width); + + + + + Console.WriteLine("Check the tile"); Console.WriteLine("Y location:"); int playerMoveY = Convert.ToInt32(Console.ReadLine()); @@ -193,6 +194,8 @@ namespace IDoMinesweeper + + return "GAME OVER!!"; diff --git a/IDoMinesweeper/bin/Debug/netcoreapp3.0/ConsoleUserInt.dll b/IDoMinesweeper/bin/Debug/netcoreapp3.0/ConsoleUserInt.dll index 3d0c48f..581d4a5 100644 Binary files a/IDoMinesweeper/bin/Debug/netcoreapp3.0/ConsoleUserInt.dll and b/IDoMinesweeper/bin/Debug/netcoreapp3.0/ConsoleUserInt.dll differ diff --git a/IDoMinesweeper/bin/Debug/netcoreapp3.0/ConsoleUserInt.pdb b/IDoMinesweeper/bin/Debug/netcoreapp3.0/ConsoleUserInt.pdb index 1c345de..598f1bf 100644 Binary files a/IDoMinesweeper/bin/Debug/netcoreapp3.0/ConsoleUserInt.pdb and b/IDoMinesweeper/bin/Debug/netcoreapp3.0/ConsoleUserInt.pdb differ diff --git a/IDoMinesweeper/bin/Debug/netcoreapp3.0/Game.dll b/IDoMinesweeper/bin/Debug/netcoreapp3.0/Game.dll index 435fe5a..4792594 100644 Binary files a/IDoMinesweeper/bin/Debug/netcoreapp3.0/Game.dll and b/IDoMinesweeper/bin/Debug/netcoreapp3.0/Game.dll differ diff --git a/IDoMinesweeper/bin/Debug/netcoreapp3.0/Game.pdb b/IDoMinesweeper/bin/Debug/netcoreapp3.0/Game.pdb index 9883b60..fb33630 100644 Binary files a/IDoMinesweeper/bin/Debug/netcoreapp3.0/Game.pdb and b/IDoMinesweeper/bin/Debug/netcoreapp3.0/Game.pdb differ diff --git a/IDoMinesweeper/bin/Debug/netcoreapp3.0/IDoMinesweeper.dll b/IDoMinesweeper/bin/Debug/netcoreapp3.0/IDoMinesweeper.dll index 520c975..24f23a7 100644 Binary files a/IDoMinesweeper/bin/Debug/netcoreapp3.0/IDoMinesweeper.dll and b/IDoMinesweeper/bin/Debug/netcoreapp3.0/IDoMinesweeper.dll differ diff --git a/IDoMinesweeper/bin/Debug/netcoreapp3.0/IDoMinesweeper.pdb b/IDoMinesweeper/bin/Debug/netcoreapp3.0/IDoMinesweeper.pdb index 27cc966..8269e42 100644 Binary files a/IDoMinesweeper/bin/Debug/netcoreapp3.0/IDoMinesweeper.pdb and b/IDoMinesweeper/bin/Debug/netcoreapp3.0/IDoMinesweeper.pdb differ diff --git a/IDoMinesweeper/obj/Debug/netcoreapp3.0/IDoMinesweeper.csprojAssemblyReference.cache b/IDoMinesweeper/obj/Debug/netcoreapp3.0/IDoMinesweeper.csprojAssemblyReference.cache index cafc3eb..7017bd7 100644 Binary files a/IDoMinesweeper/obj/Debug/netcoreapp3.0/IDoMinesweeper.csprojAssemblyReference.cache and b/IDoMinesweeper/obj/Debug/netcoreapp3.0/IDoMinesweeper.csprojAssemblyReference.cache differ diff --git a/IDoMinesweeper/obj/Debug/netcoreapp3.0/IDoMinesweeper.dll b/IDoMinesweeper/obj/Debug/netcoreapp3.0/IDoMinesweeper.dll index 520c975..24f23a7 100644 Binary files a/IDoMinesweeper/obj/Debug/netcoreapp3.0/IDoMinesweeper.dll and b/IDoMinesweeper/obj/Debug/netcoreapp3.0/IDoMinesweeper.dll differ diff --git a/IDoMinesweeper/obj/Debug/netcoreapp3.0/IDoMinesweeper.pdb b/IDoMinesweeper/obj/Debug/netcoreapp3.0/IDoMinesweeper.pdb index 27cc966..8269e42 100644 Binary files a/IDoMinesweeper/obj/Debug/netcoreapp3.0/IDoMinesweeper.pdb and b/IDoMinesweeper/obj/Debug/netcoreapp3.0/IDoMinesweeper.pdb differ