Пример #1
0
 private void GameOver()
 {
     Console.Beep();
     Console.BackgroundColor = ConsoleColor.Black;
     Console.ForegroundColor = ConsoleColor.White;
     Console.WriteLine($"Score: {Snake.Count()}");
 }
Пример #2
0
 private bool IsValid(Coords head)
 {
     if (head.X < 0 || head.Y < 0 || head.X >= MapSize || head.Y >= MapSize)
     {
         return(false);
     }
     if (Snake.Count(s => s.X == head.X && s.Y == head.Y) > 1)
     {
         return(false);
     }
     return(true);
 }