Commit 714a0dee by adbaga

commit 3

parent 06a2f5ca
......@@ -3,7 +3,17 @@
<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/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$/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" />
<change beforePath="$PROJECT_DIR$/Game/obj/Debug/netcoreapp3.0/Game.csprojAssemblyReference.cache" beforeDir="false" afterPath="$PROJECT_DIR$/Game/obj/Debug/netcoreapp3.0/Game.csprojAssemblyReference.cache" afterDir="false" />
<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/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" />
<change beforePath="$PROJECT_DIR$/IDoMinesweeper/bin/Debug/netcoreapp3.0/IDoMinesweeper.pdb" beforeDir="false" afterPath="$PROJECT_DIR$/IDoMinesweeper/bin/Debug/netcoreapp3.0/IDoMinesweeper.pdb" afterDir="false" />
<change beforePath="$PROJECT_DIR$/IDoMinesweeper/obj/Debug/netcoreapp3.0/IDoMinesweeper.csprojAssemblyReference.cache" beforeDir="false" afterPath="$PROJECT_DIR$/IDoMinesweeper/obj/Debug/netcoreapp3.0/IDoMinesweeper.csprojAssemblyReference.cache" afterDir="false" />
......@@ -39,8 +49,8 @@
<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$/Game/Engine.cs" />
<option value="$PROJECT_DIR$/MenuSystem/Menu.cs" />
<option value="$PROJECT_DIR$/Game/Engine.cs" />
<option value="$PROJECT_DIR$/IDoMinesweeper/Program.cs" />
</list>
</option>
......@@ -104,7 +114,7 @@
<workItem from="1570541467008" duration="1357000" />
<workItem from="1570543449378" duration="28421000" />
<workItem from="1570828559519" duration="1080000" />
<workItem from="1570969640551" duration="1737000" />
<workItem from="1570969640551" duration="3567000" />
</task>
<task id="LOCAL-00001" summary="yes">
<created>1570973690674</created>
......@@ -113,7 +123,14 @@
<option name="project" value="LOCAL" />
<updated>1570973690675</updated>
</task>
<option name="localTasksCounter" value="2" />
<task id="LOCAL-00002" summary="Adding validation input: Doesn't accept non int and set maximum size of the board">
<created>1570997742575</created>
<option name="number" value="00002" />
<option name="presentableId" value="LOCAL-00002" />
<option name="project" value="LOCAL" />
<updated>1570997742575</updated>
</task>
<option name="localTasksCounter" value="3" />
<servers />
</component>
<component name="TypeScriptGeneratedFilesManager">
......@@ -135,7 +152,8 @@
<component name="VcsManagerConfiguration">
<option name="LOCAL_CHANGES_DETAILS_PREVIEW_SHOWN" value="true" />
<MESSAGE value="yes" />
<option name="LAST_COMMIT_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" />
</component>
<component name="XDebuggerManager">
<breakpoint-manager>
......
......@@ -76,6 +76,73 @@ namespace Engine
}
/*public class ReceiveInput
{
Console.WriteLine("Board height (Min. 8): ");
Console.WriteLine(">");
var checkHeight = Console.ReadLine();
int height = 0;
if (!int.TryParse(checkHeight, out height))
{
Console.WriteLine("Not an integer");
}
else
{
height = Convert.ToInt32(checkHeight);
}
var checkWidth = Console.ReadLine();
int width = 0;
if (!int.TryParse(checkWidth, out width))
{
Console.WriteLine("Not an integer");
}
else
{
width = Convert.ToInt32(checkWidth);
}
//var width = Convert.ToInt32(ReadLine());
var doIt = false;
do
{
if (height < 8 || width < 8)
{
Console.WriteLine("Too small. Minimal is 8x8");
break;
}
else if(height > 30 || width > 30)
{
Console.WriteLine("Too big. Maximum size is 30x30");
break;
}
} while (doIt = false);
var game = new BoardDim(height, width);
//previously game
var done = false;
}
*/
public void checkTile(int posY, int posX)
{
......
......@@ -80,7 +80,12 @@ namespace IDoMinesweeper
static string TestGame()
{
// do do-while and if it's correct it'll be done. Otherwise, it's gonna keep asking for input''''
//var customizeBoard = new Engine.ReceiveInput(); would be used for
//future improvement to check and
//validate input
WriteLine("Board height (Min. 8): ");
WriteLine(">");
var checkHeight = ReadLine();
......@@ -107,7 +112,7 @@ namespace IDoMinesweeper
var checkWidth = ReadLine();
int width = 0;
if (!int.TryParse(checkHeight, out height))
if (!int.TryParse(checkWidth, out width))
{
Console.WriteLine("Not an integer");
}
......@@ -115,7 +120,7 @@ namespace IDoMinesweeper
{
width = Convert.ToInt32(checkWidth);
}
//var width = Convert.ToInt32(ReadLine());
var doIt = false;
do
......@@ -124,32 +129,36 @@ namespace IDoMinesweeper
if (height < 8 || width < 8)
{
Console.WriteLine("Too small. Minimal is 8x8");
Console.WriteLine("Too small. Minimal board size is 8x8");
return "";
break;
}
else if(height > 30 || width > 30)
{
Console.WriteLine("Too big. Maximum size is 30x30");
Console.WriteLine("Too big. Maximum board size is 30x30");
return "";
break;
}
else
{
doIt = true;
}
} while (doIt = false);
} while (doIt = false);
//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''
var game = new BoardDim(height, width);
//previously game
var done = false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment