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; }
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); } }
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(); }
static void Main(string[] args) { Console.SetBufferSize(80, 25); HorizontLine upLine = new HorizontLine(0, 78, 0, '='); HorizontLine downLine = new HorizontLine(0, 78, 24, '='); VerticalLine leftLine = new VerticalLine(1, 23, 0, '|'); VerticalLine rightLine = new VerticalLine(1, 23, 78, '|'); upLine.Drow(); downLine.Drow(); leftLine.Drow(); rightLine.Drow(); Point p = new Point(5, 5, '*'); Snake snake = new Snake(p, 5, Direction.RIGHT); snake.Drow(); while (true) { if (Console.KeyAvailable) { ConsoleKeyInfo key = Console.ReadKey(); snake.GetDirection(key.Key); } snake.Move(); snake.Drow(); Thread.Sleep(100); } Console.ReadLine(); }
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(); }
static void Main(string[] args) { Console.SetBufferSize(80, 25); Walls walls = new Walls(80, 25); walls.Draw(); HorisontalLine lowLine = new HorisontalLine(0, 78, 0, '+'); lowLine.Drow(); HorisontalLine upperLine = new HorisontalLine(0, 78, 24, '+'); upperLine.Drow(); VerticalLine leftLine = new VerticalLine(0, 0, 24, '+'); leftLine.Drow(); VerticalLine rightLine = new VerticalLine(78, 0, 24, '+'); rightLine.Drow(); Point p1 = new Point(4, 4, '*'); Snake snake = new Snake(p1, 4, Direction.RIGHT); snake.Drow(); FoodCreator foodCreator = new FoodCreator(80, 25, '$'); Point food = foodCreator.CreateFood(); food.Draw(); while (true) { if (walls.IsHit(snake) || snake.IsHitTail()) { break; } 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); } } }
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); } } }
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(); }
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(); }
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(); } }
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(); }
static void Main(string[] args) { Point p1 = new Point(1, 3, '*'); p1.Draw(); Point p2 = new Point(4, 5, '#'); p2.Draw(); HorizontalLine Hline = new HorizontalLine(5, 10, 8, '+'); Hline.Drow(); VerticalLine Vline = new VerticalLine(2, 8, 2, '/'); Vline.Drow(); Console.ReadLine(); }
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(); }
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(); }
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(); }
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) { //лень пилить } }