Permalink
Browse files

Four4Sample - initialize NumeralCount in app

  • Loading branch information...
bobbymcr committed Mar 17, 2018
1 parent f9db227 commit 42ac4e6a571401d70740184687e780a1aef3a861
Showing with 7 additions and 7 deletions.
  1. +7 −7 projects/Four4Sample/Four4/Program.cs
@@ -13,7 +13,7 @@ private static void Main(string[] args)
{
Stopwatch stopwatch = Stopwatch.StartNew();
char d = GetDigit(args);
int d = GetDigit(args);
ExpressionSearch search = InitSearch(d);
Results results = new Results();
@@ -29,28 +29,28 @@ private static void Main(string[] args)
}
}
private static char GetDigit(string[] args)
private static int GetDigit(string[] args)
{
char d = '4';
int d = 4;
if ((args.Length != 0) && (args[0].Length > 0))
{
char c = args[0][0];
switch (c)
{
case '3':
case '4':
d = c;
d = c - '0';
break;
}
}
return d;
}
private static ExpressionSearch InitSearch(char c)
private static ExpressionSearch InitSearch(int n)
{
string d = c.ToString();
ExpressionSearch search = new ExpressionSearch();
string d = n.ToString();
ExpressionSearch search = new ExpressionSearch() { NumeralCount = n };
search.AddOperator("+");
search.AddOperator("-");
search.AddOperator("*");

0 comments on commit 42ac4e6

Please sign in to comment.