public bool IsConnectedToCenter(int position, ref List<int> explored, ref Dictionary<int, Rune> board)
{
if (position == 12)
{
return true;
}
if (explored == null)
{
explored = new List<int>();
}
explored.Add(position);
List<int> positions = GetNeighboursPosition(position, board);
for (int i = 0; i < positions.Count; i++)
{
if (!explored.Contains(positions[i]))
{
bool connected = IsConnectedToCenter(positions[i], ref explored, ref board);
if (connected)
return true;
}
}
return false;
}