예제 #1
0
        static void Main()
        {
            //console window size
            SetWindowSize(100, 55);
            SetBufferSize(100, 55);
            ForegroundColor = ConsoleColor.Black;
            BackgroundColor = ConsoleColor.Magenta;
            Clear();

            //declare point coordinates
            //drawing point coordinates
            //drawing borders
            HorizontalLine newPoint1 = new HorizontalLine(0, 99, 0, Convert.ToChar("\u2588"));

            newPoint1.DrawHorizontalLine();

            VerticalLine newPoint2 = new VerticalLine(0, 54, 0, Convert.ToChar("\u2588"));

            newPoint2.DrawVerticalLine();

            HorizontalLine newPoint3 = new HorizontalLine(0, 99, 52, Convert.ToChar("\u2588"));

            newPoint3.DrawHorizontalLine();

            VerticalLine newPoint4 = new VerticalLine(0, 53, 99, Convert.ToChar("\u2588"));

            newPoint4.DrawVerticalLine();



            ReadLine();
        }
예제 #2
0
파일: Program.cs 프로젝트: nata1993/snake
        public Walls(int mapWidth, int mapHeight)
        {
            wallList = new List <Figure>();
            HorizontalLine topLine    = new HorizontalLine(0, mapWidth - 2, 0, Convert.ToChar("\u2588"));
            HorizontalLine bottomLine = new HorizontalLine(0, mapWidth - 2, mapHeight - 1, Convert.ToChar("\u2588"));
            VerticalLine   leftLine   = new VerticalLine(0, mapHeight - 1, 0, Convert.ToChar("\u2588"));
            VerticalLine   rightLine  = new VerticalLine(0, mapHeight - 1, mapWidth - 2, Convert.ToChar("\u2588"));

            VerticalLine middleLine1 = new VerticalLine(5, 19, 25, '$');  //added aditional walls - feature four
            VerticalLine middleLine2 = new VerticalLine(5, 19, 52, '$');

            wallList.Add(topLine);
            wallList.Add(bottomLine);
            wallList.Add(leftLine);
            wallList.Add(rightLine);

            wallList.Add(middleLine1);
            wallList.Add(middleLine2);
        }