using System.Collections.Generic;
static void Main(string[] args)
int position = gameCols / 2;
int numberOfMaxMinesPurRow = 4;
List<string> stage = new List<string>();
for (var i = 0; i < gameRows; i++)
stage.Add(new string(' ', gameCols));
if (Console.KeyAvailable)
var key = Console.ReadKey();
if (key.Key == ConsoleKey.Escape)
else if (key.Key == ConsoleKey.LeftArrow && position > 0)
else if (key.Key == ConsoleKey.RightArrow && position < (gameCols - 3))
var lastRow = stage[0].ToArray();
if (lastRow[position] != ' ' || lastRow[position + 1] != ' ' || lastRow[position + 2] != ' ')
Console.WriteLine("Game Over");
int minesCountOnRow = (int)(rand.NextDouble() * 10) % numberOfMaxMinesPurRow;
char[] newGameRow = new string(' ', gameCols).ToCharArray();
for (int i = 0; i < minesCountOnRow; i++)
int minePosition = (int)(rand.NextDouble() * 100) % gameCols;
int mineType = (int)(rand.NextDouble() * 10) % mines.Length;
newGameRow[minePosition] = mines[mineType];
stage.Add(new string(newGameRow));
Console.WriteLine(new string('=', gameCols + 2));
for (int index = gameRows - 1; index >= 0; index--)
Console.WriteLine("=" + stage[index] + "=");
lastRow[position + 1] = '0';
lastRow[position + 2] = ')';
Console.WriteLine("=" + new string(lastRow) + "=");
Console.WriteLine(new string('=', gameCols + 2));