Esempio n. 1
0
        static void Main(string[] args)
        {
            //Console.SetBufferSize(999, 25);

            // Draw frame

            HorizontalLine upLine = new HorizontalLine(0, 78, 0, '+');
            HorizontalLine downLine = new HorizontalLine(0, 78, 24, '+');
            VerticalLine leftLine = new VerticalLine(0, 24, 0, '+');
            VerticalLine rightLine = new VerticalLine(0, 24, 78, '+');
            upLine.Drow();
            downLine.Drow();
            leftLine.Drow();
            rightLine.Drow();

            Point p = new Point(2, 5, '*');
            Snake snake = new Snake(p, 4, Direction.RIGHT);
            snake.Drow();

            while (true)
            {
                if(Console.KeyAvailable)
                {
                    ConsoleKeyInfo key = Console.ReadKey();
                    snake.HandleKey(key.Key);
                }
                System.Threading.Thread.Sleep(100);
                snake.Move();
            }

            Console.ReadLine();
        }
Esempio n. 2
0
        static void Main(string[] args)
        {
            HorizontalLine upline = new HorizontalLine(0, 75, 0, '+');

            upline.Drow();
            HorizontalLine downline = new HorizontalLine(0, 75, 20, '+');

            downline.Drow();
            VerticalLine leftline = new VerticalLine(0, 20, 0, '+');

            leftline.Drow();
            VerticalLine rightline = new VerticalLine(0, 20, 75, '+');

            rightline.Drow();
        }
Esempio n. 3
0
        static void Main(string[] args)
        {
            Point p1 = new Point(1, 1, '*');

            p1.Draw();
            Point p2 = new Point(2, 3, '#');

            p2.Draw();
            HorizontalLine line = new HorizontalLine(5, 10, 3, '*');

            line.Drow();
            VerticalLine line2 = new VerticalLine(0, 5, 9, '#');

            line2.Drow();
            Console.ReadLine();
        }
Esempio n. 4
0
        static void Main(string[] args)
        {
            Console.SetBufferSize(400, 100);

            HorisontalLine Upline    = new HorisontalLine(0, 78, 0, '+');
            HorisontalLine Downline  = new HorisontalLine(0, 78, 24, '+');
            VerticalLine   Leftline  = new VerticalLine(0, 24, 0, '+');
            VerticalLine   Rightline = new VerticalLine(0, 24, 78, '+');

            Upline.Drow();
            Downline.Drow();
            Leftline.Drow();
            Rightline.Drow();

            Console.ReadLine();
        }
Esempio n. 5
0
        static void Main(string[] args)
        {
            Console.SetWindowSize(80, 28);

            // Отрисовка линий
            HorizontalLine upLine    = new HorizontalLine(0, Console.BufferWidth - 1, 0, '+');
            HorizontalLine downLine  = new HorizontalLine(0, Console.BufferWidth - 1, Console.BufferHeight - 1, '+');
            VerticalLine   leftLine  = new VerticalLine(0, Console.BufferHeight - 1, 0, '+');
            VerticalLine   rightLine = new VerticalLine(0, Console.BufferHeight - 1, Console.BufferWidth - 1, '+');

            upLine.Drow();
            downLine.Drow();
            leftLine.Drow();
            rightLine.Drow();

            //Отрисовка Точек
            Point p1 = new Point(5, 6, '*');

            p1.Draw();
        }
Esempio n. 6
0
        static void Main(string[] args)
        {
            Console.SetBufferSize(150, 95);

            HorizontalLine lineUp = new HorizontalLine(0, 78, 0, '+');

            lineUp.Drow();
            HorizontalLine LineDown = new HorizontalLine(0, 78, 24, '+');

            LineDown.Drow();
            VerticalLine LeftLine = new VerticalLine(0, 0, 24, '+');

            LeftLine.Drow();
            VerticalLine RightLine = new VerticalLine(78, 0, 24, '+');

            RightLine.Drow();



            Console.ReadLine();
        }
Esempio n. 7
0
        static void Main(string[] args)
        {
            Console.SetWindowSize(1, 1);
            Console.SetBufferSize(80, 25);
            Console.SetWindowSize(80, 25);

            HorizontalLine upLine    = new HorizontalLine(0, 78, 0, '+');
            HorizontalLine downLine  = new HorizontalLine(0, 78, 24, '+');
            VerticalLine   leftLine  = new VerticalLine(0, 24, 0, '+');
            VerticalLine   rightLine = new VerticalLine(0, 24, 78, '+');

            upLine.Drow();
            downLine.Drow();
            leftLine.Drow();
            rightLine.Drow();

            Point p = new Point(4, 5, '*');

            p.Draw();

            Console.ReadKey();
        }
Esempio n. 8
0
        static void Main(string[] args)
        {
            Console.SetBufferSize(80, 25);

            // Нарисуем рамку
            HorizontalLine lineHup   = new HorizontalLine(0, 78, 0, '+');
            HorizontalLine lineHdown = new HorizontalLine(0, 78, 24, '+');
            VerticalLine   lineVr    = new VerticalLine(0, 24, 0, '+');
            VerticalLine   lineVl    = new VerticalLine(0, 24, 78, '+');

            lineHup.Drow();
            lineHdown.Drow();
            lineVr.Drow();
            lineVl.Drow();

            Point p     = new Point(4, 5, '@');
            Snake snake = new Snake(p, 4, Direction.RIGHT);

            snake.Drow();

            Console.ReadLine();
        }