示例#1
0
        static void WriteBoard(Board b)
        {
            //fps timer
            sw.Start();
            int _count = 0;

            foreach (char c in b.IterateBoard())
            {
                _count++;
                if (_count == b.Width)
                {
                    Console.WriteLine();
                    _count = 0;
                }
                else
                {
                    Console.Write(c);
                }
            }
            sw.Stop();
            Console.Title = $"Snake - FPS: {1000 / sw.ElapsedMilliseconds}"; //measure of draw speed, not game speed
            sw.Reset();
        }