private void GameOver() { Console.Beep(); Console.BackgroundColor = ConsoleColor.Black; Console.ForegroundColor = ConsoleColor.White; Console.WriteLine($"Score: {Snake.Count()}"); }
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); }