-
Notifications
You must be signed in to change notification settings - Fork 0
/
Program.cs
59 lines (56 loc) · 1.77 KB
/
Program.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
using System;
using Benchmarks;
namespace MainProgram
{
class Program
{
static readonly int[] options = { 0, 1, 2 };
static void Main(string[] args)
{
int numOfVirtCores = Environment.ProcessorCount;
bool wrongInput = true;
int option;
do
{
Console.WriteLine("Which benchmark do you want to perform:");
Console.WriteLine("1 - Ternary x Ifelse");
Console.WriteLine("2 - A* Pathfinding");
Console.WriteLine("0 - Exit");
Console.WriteLine("");
string input = Console.ReadLine();
if (int.TryParse(input, out option))
wrongInput = false;
foreach (int num in options)
{
if (num == option)
{
wrongInput = false;
break;
}
else
wrongInput = true;
}
if (wrongInput)
Console.WriteLine("Invalid, try again.\n");
} while (wrongInput);
switch (option)
{
case 1:
Vector2.Benchmark(numOfVirtCores);
break;
case 2:
Pathfinding.Benchmark(numOfVirtCores);
break;
case 0:
Console.WriteLine("Exiting..");
System.Environment.Exit(0);
break;
default:
return;
}
Console.WriteLine("");
Console.WriteLine("Enter to exit.");
Console.ReadLine();
}
}
}