using System.Collections.Generic;
static List<Bit> bits = new List<Bit>();
static Random rnd = new Random();
static int treasureElement;
public static void Main()
Console.WriteLine("press enter to start");
treasureElement = rnd.Next(0,8);
for (int i = 0; i < repeat; i++)
Console.WriteLine(treasureElement.ToString());
public static void CreateMap()
userInput = Console.ReadLine();
if (userInput == "w" && element != 0 && element != 2 && element != 1)
if (userInput == "s" && element != 6 && element != 7 && element != 8)
if (userInput == "a" && element != 0 && element != 6 && element != 3)
if (userInput == "d" && element != 8 && element != 5 && element != 2)
var player = bits.ElementAt(element);
var treasurePlace = bits.ElementAt(treasureElement);
if (userInput.Contains("dig") && bits.IndexOf(player) == treasureElement)
Console.WriteLine("good");
Console.WriteLine("nufin");
Console.WriteLine(treasureElement.ToString());
Console.WriteLine(element);
for (int i = 0; i < repeat; i++)
bits.ElementAt(i).on = 1;
Console.Write(bits.ElementAt(i).on + " ");