Всем привет, не получается у меня нарисовать фигуру в цикле
| Код | public class Figure { public List<Coordinate> Coordinates { get; set; } public Positions StorePosition { get; set; } public Positions CurrentPosition { get; set; } }
|
| Код | public class Factory { public Square CreateSquare() { var square = new Square(); square.Coordinates = new List<Coordinate> { new Coordinate(1, 1), new Coordinate(1, 2), new Coordinate(2, 1), new Coordinate(2, 2) }; return square; } }
|
вот здесь я завис
| Код | class ConsoleTetris:Factory { static void Main(string[] args) { Factory factory = new Factory(); var square = factory.CreateSquare(); int rows = 10; int columns = 7; int[,] myArray = new int[rows, columns];
for (int x = 0; x < rows; x++) { for (int y = 0; y < columns; y++) { for (int i = 0; i < square.Coordinates.Count; i++) { if(square.Coordinates[i].X==1)
if (square.Coordinates.Count==1) i++; Console.SetCursorPosition(square.Coordinates.Count, i); Console.Write("#"); Console.Write(""); } } }
|
|