Example #1
0
        static void Main(string[] args)
        {
            if (args.Length == 0)
            {
                SnakeGameManager.Play();
            }
            else if (args.Length == 2)
            {
                int.TryParse(args[0], out int width);
                int.TryParse(args[1], out int height);
                SnakeGameManager.Play(width, height);
            }

            else if (args.Length == 3)
            {
                int.TryParse(args[0], out int width);
                int.TryParse(args[1], out int height);
                int.TryParse(args[2], out int fruitcount);
                SnakeGameManager.Play(width, height, fruitcount);
            }
            else if (args.Length == 4)
            {
                int.TryParse(args[0], out int width);
                int.TryParse(args[1], out int height);
                int.TryParse(args[2], out int fruitcount);
                int.TryParse(args[3], out int deltaTime);
                SnakeGameManager.Play(width, height, fruitcount, deltaTime);
            }
        }