-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProgram.cs
43 lines (36 loc) · 1.21 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
using System;
namespace CellularAutomataConsole
{
class Program
{
static void Main(string[] args)
{
int liveChance;
bool runProgram = true;
bool newIteration = true;
while (runProgram)
{
Console.Write("\n\tLive cell chance (1-100): ");
int.TryParse(Console.ReadLine(), out liveChance);
Console.WriteLine();
CMGenerator generator = new CMGenerator(80, 80, liveChance);
generator.randomizeGrid();
generator.drawGrid();
Console.WriteLine("\n\tPress any key...");
Console.ReadKey();
do
{
generator.Smooth1();
generator.drawGrid();
Console.Write("\tNew iteration? (y/n): ");
newIteration = (Console.ReadLine() != "n");
Console.WriteLine();
} while (newIteration);
Console.Clear();
Console.Write("\n\tNew map? (y/n): ");
runProgram = (Console.ReadLine() != "n");
Console.WriteLine();
}
}
}
}