Esempio n. 1
0
        static void Main(string[] args)
        {
            Console.SetBufferSize(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();


            Emploee e = new Emploee();

            e.age = 42;
            e.pay = 30000;
        }
Esempio n. 2
0
        static void Main(string[] args)
        {
            Console.SetWindowSize(80, 25);

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

            upLine.Drow();

            HorizontalLine downLine = new HorizontalLine(0, 78, 24, '+');

            downLine.Drow();

            VerticalLine leftLine = new VerticalLine(0, 24, 0, '+');

            leftLine.Drow();

            VerticalLine rightLine = new VerticalLine(0, 24, 78, '+');

            rightLine.Drow();

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

            p.Draw();

            Console.ReadLine();
        }
Esempio n. 3
0
        static void Main(string[] args)
        {
            Console.SetBufferSize(120, 30);


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

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

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

            p.Draw();



            /* Point p1 = new Point(1, 3, '*');
             * p1.Draw();
             *
             * Point p2 = new Point(4, 5, '#');
             * p2.Draw();
             *
             * HorizontalLine line = new HorizontalLine(5,10,8,'+');
             * line.Drow();
             *
             * VertikalLine lineV = new VertikalLine(5, 10, 12, '#');
             * lineV.Drow();*/

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

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

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

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

            snake.Drow();

            while (true)
            {
                if (Console.KeyAvailable)
                {
                    ConsoleKeyInfo key = Console.ReadKey();
                    snake.HandleKey(key.Key);
                }

                Thread.Sleep(100);
                snake.Move();
            }

            //Console.ReadLine();
        }
Esempio n. 5
0
        static void Main(string[] args)
        {
            Console.SetWindowSize(105, 30);
            HorizontalLine HLineUp = new HorizontalLine(1, 100, 0, '+');

            HLineUp.Drow();
            VerticalLine VLineLeft = new VerticalLine(1, 1, 28, '+');

            VLineLeft.Drow();
            HorizontalLine HLineDown = new HorizontalLine(2, 100, 28, '+');

            HLineDown.Drow();
            VerticalLine VLineRight = new VerticalLine(100, 1, 28, '+');

            VLineRight.Drow();

            Point tail  = new Point(48, 14, '*');
            Snake snake = new Snake(tail, 5, Direction.RIGHT);

            snake.Drow();
            while (true)
            {
                if (Console.KeyAvailable)
                {
                    ConsoleKeyInfo key = Console.ReadKey();
                    snake.turn(key);
                }
                snake.Move();
                Thread.Sleep(300);
            }
        }
Esempio n. 6
0
        static void Main( string[] args )
        {
            Point p1 = new Point(1, 3, '*');
            p1.Draw();

            Point p2 = new Point(4, 5, '#');
            p2.Draw();

            HorizontalLine line = new HorizontalLine(5, 10, 8, '+');
            line.Drow();

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

            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, '*');
            Snake snake = new Snake(p, 4, Direction.RIGHT);

            snake.Drow();

            FoodCreator foodCreator = new FoodCreator(80, 25, '$');
            Point       food        = foodCreator.CreateFood();

            food.Draw();

            while (true)
            {
                if (snake.Eat(food))
                {
                    food = foodCreator.CreateFood();
                    food.Draw();
                    snake.Drow();
                }
                else
                {
                    snake.Move();
                }

                Thread.Sleep(100);

                if (Console.KeyAvailable)
                {
                    ConsoleKeyInfo key = Console.ReadKey();
                    snake.HandleKey(key.Key);
                }
            }
        }
Esempio n. 8
0
        static void Main(string[] args)
        {
            Point p1 = new Point(1, 3, '*');

            p1.Draw();

            Point p2 = new Point(4, 5, '#');

            p2.Draw();

            HorizontalLine line = new HorizontalLine(5, 10, 8, '+');

            line.Drow();
            Console.ReadLine();
        }
Esempio n. 9
0
        public Walls(int mapWidth, int mapHeight)
        {
            wallList = new List <Figure>();

            //Отрисовка рамочки
            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();
        }
Esempio n. 10
0
 static void Main(string[] args)
 {
     Console.SetBufferSize(80, 25);
     Point p1 = new Point(10,20,'*');
     p1.Draw();
     HorizontalLine Upline = new HorizontalLine(0, 78, 0, '+');
     VerticalLine LeftLine = new VerticalLine(0, 24, 0, '+');
     HorizontalLine Downline = new HorizontalLine(0, 78, 24, '+');
     VerticalLine Rightline = new VerticalLine(0, 24, 78, '+');
     Upline.Drow();
     LeftLine.Drow();
     Rightline.Drow();
     Downline.Drow();
     Console.ReadLine();
 }
Esempio n. 11
0
        static void Main(string[] args)
        {
            Console.SetBufferSize(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,'*');
            Snake snake = new Snake(p, 4, Direction.RIGHT);
            snake.Drow();

            // Еда
            FoodCreator foodCreator = new FoodCreator(80,25,'$');
            Point food = foodCreator.CreateFood();
            food.Draw();

            while (true)
            {
                if (snake.Eat(food))
                {
                    food = foodCreator.CreateFood();
                    food.Draw();
                }
                else
                {
                    snake.Move();
                }

                Thread.Sleep(100);

                if (Console.KeyAvailable)
                {
                    ConsoleKeyInfo key = Console.ReadKey();
                    snake.HandleKey(key.Key);

                }
                Thread.Sleep(100);
                snake.Move();
            }
        }
Esempio n. 12
0
        static void Main(string [] args)
        {
            Console.SetBufferSize(80,25);

            //Отрисовка рамки
            HorizontalLine upLine = new HorizontalLine(0,78, 0 , '+');
            HorizontalLine downLine = new HorizontalLine(0,78, 24 , '+');
            VerticalLine leftLine = new HorizontalLine(0,24, 0 , '+');
            VerticalLine rightLine = new HorizontalLine(0,24, 78 , '+');
            upLine.Drow();
            downLine.Drow();
            leftLine.Drow();
            rightLine.Drow();

            //Отрисовка точек
            Point p = new Point(4,5,'*');
            p.Draw();
        }
Esempio n. 13
0
        static void Main(string[] args)
        {
            Console.SetBufferSize(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, '*');
            Snake snake = new Snake(p, 4, Direction.RIGHT);

            snake.Drow();
        }
Esempio n. 14
0
        static void Main(string[] args)
        {
            HorizontalLine HLine1 = new HorizontalLine(2, 50, 1, '_');

            HLine1.Drow();

            HorizontalLine HLine2 = new HorizontalLine(2, 50, 20, '_');

            HLine2.Drow();

            VerticalLine VLine1 = new VerticalLine(2, 20, 1, '|');

            VLine1.Drow();

            VerticalLine VLine2 = new VerticalLine(2, 20, 51, '|');

            VLine2.Drow();

            Console.ReadLine();
        }
Esempio n. 15
0
        static void Main(string[] args)
        {
            Console.SetBufferSize(80, 26);

            //Рамочка
            HorizontalLine upLine    = new HorizontalLine(0, 78, 0, '+');
            HorizontalLine downLine  = new HorizontalLine(0, 78, 24, '+');
            VerticalLine   leftLine  = new VerticalLine(0, 0, 24, '+');
            VerticalLine   rightLine = new VerticalLine(78, 0, 24, '+');

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

            //Змейка
            Point p     = new Point(4, 5, '*');
            Snake snake = new Snake(p, 4, Direction.RIGHT);

            snake.Drow();
        }
Esempio n. 16
0
        static void Main(string[] args)
        {
            Console.SetWindowSize(80, 26);
            Console.SetBufferSize(80, 26);

            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, '*');

            Snake snake = new Snake(p, 4, Direction.RIGHT );
            snake.Drow();

            while (true)
            {
                //лень пилить
            }
        }
Esempio n. 17
0
        static void Main(string[] args)
        {
            Console.SetBufferSize(120, 30);

            HorizontalLine hLine1 = new HorizontalLine(0, 78, 0, '#');
            HorizontalLine hLine2 = new HorizontalLine(0, 78, 24, '#');

            hLine1.Drow();
            hLine2.Drow();

            VerticalLine vLine1 = new VerticalLine(0, 24, 0, '#');
            VerticalLine vLine2 = new VerticalLine(0, 24, 78, '#');

            vLine1.Drow();
            vLine2.Drow();


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

            snake.Drow();

            Console.ReadLine();
        }