Skip to content

Commit

Permalink
Update Program.cs. Ready to use.
Browse files Browse the repository at this point in the history
  • Loading branch information
leofun01 committed Nov 22, 2019
1 parent 7904a37 commit 6baec4c
Showing 1 changed file with 16 additions and 9 deletions.
25 changes: 16 additions & 9 deletions DotNetTransformer/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,26 @@ namespace DotNetTransformer {
public static class Program {
public static void Main(string[] args) {
byte dim = 0;
string dimStr;
if(args.GetLength(0) > 0) {
try {
dim = byte.Parse(args[0], CultureInfo.InvariantCulture);
var dict = GetHyperCubeCycleCounts(dim);
Console.WriteLine("\r\n{0}D group size : {1}\r\n", dim, GetValuesSum(dict));
}
catch(Exception ex) {
Console.WriteLine("Exception message: {0}", ex.Message);
return;
}
dimStr = args[0];
}
else {
Console.Write("Enter dimensions count [0..16] : ");
dimStr = Console.ReadLine();
}
try {
dim = byte.Parse(dimStr, CultureInfo.InvariantCulture);
var dict = GetHyperCubeCycleCounts(dim);
Console.WriteLine("\r\n{0}D group size : {1}\r\n", dim, GetValuesSum(dict));
WriteDictionary(Console.Out, dict, "cLen", "count");
Console.Write("\r\nRun is complete. ");
}
catch(Exception ex) {
Console.WriteLine("Exception message : {0}", ex.Message);
}
Console.Write("\r\nPress enter to exit ... ");
Console.ReadLine();
}
public static D GetHyperCubeCycleCounts(byte dim) {
if(dim > 16) throw new ArgumentOutOfRangeException();
Expand Down

0 comments on commit 6baec4c

Please sign in to comment.