From a0a8eccb42329649c9c495ed866f604219c3c2b1 Mon Sep 17 00:00:00 2001 From: BoiledMilk123 Date: Mon, 12 Feb 2024 19:51:40 +0400 Subject: [PATCH 1/4] =?UTF-8?q?=D0=9B=D0=B0=D0=B1=D0=BE=D1=80=D0=B0=D1=82?= =?UTF-8?q?=D0=BE=D1=80=D0=BD=D0=B0=D1=8F=20=D1=80=D0=B0=D0=B1=D0=BE=D1=82?= =?UTF-8?q?=D0=B0=20=E2=84=961?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DirectionType.cs | 30 ++ .../DrawningElectricLocomotive.cs | 305 ++++++++++++++++++ .../EntityElectricLocomotive.cs | 77 +++++ .../Form1.Designer.cs | 39 --- .../ProjectElectricLocomotive/Form1.cs | 10 - .../FormElectricLocomotive.Designer.cs | 138 ++++++++ .../FormElectricLocomotive.cs | 95 ++++++ ...Form1.resx => FormElectricLocomotive.resx} | 50 +-- .../ProjectElectricLocomotive/Program.cs | 2 +- .../ProjectElectricLocomotive.csproj | 15 + .../Properties/Resources.Designer.cs | 103 ++++++ .../Properties/Resources.resx | 133 ++++++++ .../Resources/buttonDown.png | Bin 0 -> 9114 bytes .../Resources/buttonLeft.png | Bin 0 -> 6947 bytes .../Resources/buttonRight.png | Bin 0 -> 6534 bytes .../Resources/buttonUp.png | Bin 0 -> 9289 bytes 16 files changed, 922 insertions(+), 75 deletions(-) create mode 100644 ProjectElectricLocomotive/ProjectElectricLocomotive/DirectionType.cs create mode 100644 ProjectElectricLocomotive/ProjectElectricLocomotive/DrawningElectricLocomotive.cs create mode 100644 ProjectElectricLocomotive/ProjectElectricLocomotive/EntityElectricLocomotive.cs delete mode 100644 ProjectElectricLocomotive/ProjectElectricLocomotive/Form1.Designer.cs delete mode 100644 ProjectElectricLocomotive/ProjectElectricLocomotive/Form1.cs create mode 100644 ProjectElectricLocomotive/ProjectElectricLocomotive/FormElectricLocomotive.Designer.cs create mode 100644 ProjectElectricLocomotive/ProjectElectricLocomotive/FormElectricLocomotive.cs rename ProjectElectricLocomotive/ProjectElectricLocomotive/{Form1.resx => FormElectricLocomotive.resx} (93%) create mode 100644 ProjectElectricLocomotive/ProjectElectricLocomotive/Properties/Resources.Designer.cs create mode 100644 ProjectElectricLocomotive/ProjectElectricLocomotive/Properties/Resources.resx create mode 100644 ProjectElectricLocomotive/ProjectElectricLocomotive/Resources/buttonDown.png create mode 100644 ProjectElectricLocomotive/ProjectElectricLocomotive/Resources/buttonLeft.png create mode 100644 ProjectElectricLocomotive/ProjectElectricLocomotive/Resources/buttonRight.png create mode 100644 ProjectElectricLocomotive/ProjectElectricLocomotive/Resources/buttonUp.png diff --git a/ProjectElectricLocomotive/ProjectElectricLocomotive/DirectionType.cs b/ProjectElectricLocomotive/ProjectElectricLocomotive/DirectionType.cs new file mode 100644 index 0000000..17ab51c --- /dev/null +++ b/ProjectElectricLocomotive/ProjectElectricLocomotive/DirectionType.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ProjectElectricLocomotive; + +public enum DirectionType +{ + /// + /// Вверх + /// + Up = 1, + + /// + /// Вниз + /// + Down = 2, + + /// + /// Влево + /// + Left = 3, + + /// + /// Вправо + /// + Right = 4 +} diff --git a/ProjectElectricLocomotive/ProjectElectricLocomotive/DrawningElectricLocomotive.cs b/ProjectElectricLocomotive/ProjectElectricLocomotive/DrawningElectricLocomotive.cs new file mode 100644 index 0000000..616d472 --- /dev/null +++ b/ProjectElectricLocomotive/ProjectElectricLocomotive/DrawningElectricLocomotive.cs @@ -0,0 +1,305 @@ + +namespace ProjectElectricLocomotive; + +/// +/// Класс, отвечающий за прорисовку и перемещение объекта - сущности +/// +public class DrawningElectricLocomotive +{ + /// + /// Класс-сущность + /// + public EntityElectricLocomotive? EntityElectricLocomotive { get; private set; } + + /// + /// Ширина окна + /// + private int? _pictureWidth; + + /// + /// Высота окна + /// + private int? _pictureHeight; + + /// + /// Левая координата прорисовки электровоза + /// + private int? _startPosX; + + /// + /// Верхняя координата прорисовки электровоза + /// + private int? _startPosY; + + /// + /// Ширина прорисовки электровоза + /// + private readonly int _drawningElectricLocomotiveWidth = 100; + + + /// + /// Высота прорисовки электровоза + /// + private readonly int _drawingElectricLocomotiveHeight = 45; + + /// + /// Инициализация свойств + /// + /// + /// + /// + /// + /// + /// + /// + public void Init(int speed, double weight, Color bodyColor, Color additionalColor, bool bodyKit, bool electricHorns, bool batteryPlacement, int wheelsAmount) + { + EntityElectricLocomotive = new EntityElectricLocomotive(); + + EntityElectricLocomotive.Init(speed, weight, bodyColor, additionalColor, bodyKit, electricHorns, batteryPlacement, wheelsAmount); + _pictureWidth = null; + _pictureHeight = null; + _startPosX = null; + _startPosY = null; + } + + /// + /// Установка границ поля + /// + /// + /// + /// true - границы заданы, false - проверка не пройдена, нельзя разместить объект в этих размерах + public bool SetPictureSize(int width, int height) + { + // Проверка, что объект "влезает" в размеры поля + // если влезает, сохраняем границы и корректируем позицию объекта, если она была уже установлена + if(_drawingElectricLocomotiveHeight > height || _drawningElectricLocomotiveWidth > width) + { + return false; + } + + _pictureWidth = width; + _pictureHeight = height; + return true; + } + + /// + /// Установка позиции + /// + /// КоОрдината X + /// Координата Y + public void SetPosition(int x, int y) + { + if(!_pictureHeight.HasValue || !_pictureWidth.HasValue) { + return; + } + + if (_drawingElectricLocomotiveHeight + y > _pictureHeight || _drawningElectricLocomotiveWidth + x > _pictureWidth) + { + _startPosX = 0; + _startPosY = 0; + } + else + { + _startPosX = x; + _startPosY = y; + } + + } + + /// + /// Изменение направления перемещения + /// + /// Направление + /// true - перемещение выполнено, false - перемещение невозможно + public bool MoveTransport(DirectionType direction) + { + if(EntityElectricLocomotive == null || !_startPosX.HasValue || !_startPosY.HasValue) + { + return false; + } + + switch(direction) + { + //влево + case DirectionType.Left: + if(_startPosX.Value - EntityElectricLocomotive.Step + 20 > 0) + { + _startPosX -= (int)EntityElectricLocomotive.Step; + } + return true; + //вверх + case DirectionType.Up: + if(_startPosY.Value - EntityElectricLocomotive.Step + 3 > 0) + { + _startPosY -= (int)EntityElectricLocomotive.Step; + } + return true; + //вправо + case DirectionType.Right: + if (_startPosX.Value + _drawningElectricLocomotiveWidth + EntityElectricLocomotive.Step < _pictureWidth) + { + _startPosX += (int)EntityElectricLocomotive.Step; + } + return true; + //вниз + case DirectionType.Down: + if (_startPosY.Value + _drawingElectricLocomotiveHeight + EntityElectricLocomotive.Step < _pictureHeight) + { + _startPosY += (int)EntityElectricLocomotive.Step; + } + return true; + default: + return false; + } + } + + /// + /// Прорисовка объекта + /// + /// + public void DrawTransport(Graphics g) + { + if (EntityElectricLocomotive == null || !_startPosX.HasValue || !_startPosY.HasValue) + { + return; + } + + //Создание перьев и кистей для прорисовки электровоза + Pen pen = new(Color.Black); + Pen penSolid = new(Color.Black, 2); + Pen penSolidYellow = new(Color.Yellow, 0.5f); + Pen windowPen = new(Color.DeepSkyBlue); + Brush additionalBrush = new SolidBrush(EntityElectricLocomotive.AdditionalColor); + Brush blackBrush = new SolidBrush(Color.Black); + Brush whiteBrush = new SolidBrush(Color.White); + + //Инициализация опорных точек для прорисовки корпуса + Point pointStart = new Point(_startPosX.Value + 90, _startPosY.Value + 20); + Point point1 = new Point(_startPosX.Value + 90, _startPosY.Value + 5); + Point point2 = new Point(_startPosX.Value + 25, _startPosY.Value + 5); + Point pointFinish = new Point(_startPosX.Value + 20, _startPosY.Value + 20); + + //Инициализация опорных точек для прорисовки первой "юбки" + Point point3 = new Point(_startPosX.Value + 22, _startPosY.Value + 37); + Point point4 = new Point(_startPosX.Value + 15, _startPosY.Value + 37 +6 ); + Point point5 = new Point(_startPosX.Value + 22, _startPosY.Value + 37 + 6 ); + + //Инициализация опорных точек для прорисовки второй "юбки" + Point point6 = new Point(_startPosX.Value + 84, _startPosY.Value + 37); + Point point7 = new Point(_startPosX.Value + 90 + 7, _startPosY.Value + 37 + 6); + Point point8 = new Point(_startPosX.Value + 84, _startPosY.Value + 37 + 6); + + //Инициализация опорных точек для прорисовки "рогов" + Point pointHorns1 = new Point(_startPosX.Value + 28, _startPosY.Value+5); + Point pointHorns2 = new Point(_startPosX.Value + 31, _startPosY.Value + 2); + Point pointHorns3 = new Point(_startPosX.Value + 26, _startPosY.Value); + + //Инициализация опорных точек для прорисовки молнии на хранилище батарей + Point pointLightning1 = new Point(_startPosX.Value + 54, _startPosY.Value + 37); + Point pointLightning2 = new Point(_startPosX.Value + 52, _startPosY.Value + 39); + Point pointLightning3 = new Point(_startPosX.Value + 54, _startPosY.Value + 40); + Point pointLightning4 = new Point(_startPosX.Value + 52, _startPosY.Value + 41); + + //Совокупность точек полигона уголка первой "юбки" + Point[] firstTrianglePoints = + { + + point3, + point4, + point5, + + }; + //Совокупность точек полигона уголка второй "юбки" + Point[] secondTrianglePoints = + { + + point6, + point7, + point8, + + }; + + // Прорисовка уголков "юбок" + g.FillPolygon(blackBrush, firstTrianglePoints); + g.FillPolygon(blackBrush, secondTrianglePoints); + + //Прорисовка корпуса + g.DrawRectangle(pen, _startPosX.Value + 20, _startPosY.Value + 20, 70, 17); + g.DrawLine(pen, point3, point4); + + g.DrawLine(pen, pointStart, point1); + g.DrawLine(pen, point1, point2); + g.DrawLine(pen, point2, pointFinish); + + + + //Прорисовка передней и задней "юбки" + g.FillRectangle(blackBrush, _startPosX.Value + 22, _startPosY.Value + 37, 25, 5.3f); + g.FillRectangle(blackBrush, _startPosX.Value + 62, _startPosY.Value + 37, 22, 5.3f); + + + //Прорисовка двух передних колёс + g.FillEllipse(whiteBrush, _startPosX.Value + 21.3f, _startPosY.Value + 37, 10, 10); + g.DrawEllipse(penSolid, _startPosX.Value + 24, _startPosY.Value + 37, 8, 8); + g.FillEllipse(additionalBrush, _startPosX.Value + 24, _startPosY.Value + 37, 8, 8); + g.DrawEllipse(penSolid, _startPosX.Value + 39, _startPosY.Value + 37, 8, 8); + g.FillEllipse(additionalBrush, _startPosX.Value + 39, _startPosY.Value + 37, 8, 8); + + //Прорисовка "рогов" электровоза + g.DrawLine(penSolid, pointHorns1, pointHorns2); + g.DrawLine(penSolid, pointHorns2, pointHorns3); + + //Прорисовка "хранилища батарей" электровоза + g.FillRectangle(blackBrush, _startPosX.Value + 51, _startPosY.Value + 37, 8, 4.5f); + g.DrawLine(penSolidYellow, pointLightning1, pointLightning2); + g.DrawLine(penSolidYellow, pointLightning2, pointLightning3); + g.DrawLine(penSolidYellow, pointLightning3, pointLightning4); + + + //Прорисовка двух задних колёс + g.FillEllipse(whiteBrush, _startPosX.Value + 40 + 38, _startPosY.Value + 37, 10, 10); + g.DrawEllipse(penSolid, _startPosX.Value + 40 + 26, _startPosY.Value + 37, 8, 8); + g.FillEllipse(additionalBrush, _startPosX.Value + 40 + 26, _startPosY.Value + 37, 8, 8); + g.DrawEllipse(penSolid, _startPosX.Value+ 40 + 37, _startPosY.Value + 37, 8, 8); + g.FillEllipse(additionalBrush, _startPosX.Value + 40 + 37, _startPosY.Value + 37, 8, 8); + + //Прорисовка заднего "шлюза" + g.FillRectangle(blackBrush, _startPosX.Value + 90, _startPosY.Value + 9, 5.7f, 27.4f); + + //Прорисовка первого и третьего окна + g.DrawRectangle(windowPen, _startPosX.Value + 27, _startPosY.Value + 9, 8, 8); + g.DrawRectangle(windowPen, _startPosX.Value + 78, _startPosY.Value + 9, 8, 8); + + + //TODO Опциональная прорисовка колёс для усложненной работы + //switch (EntityElectricLocomotive.WheelsAmount) + //{ + // case 4: + // //TODO + + // case 3: + // //TODO + + // case 2: + // //TODO + + // case 1: + // //TODO + // return; + + //} + + //Прорисовка опциональных элементов (второе окно и дверь) + if (EntityElectricLocomotive.BodyKit) + { + Brush brWhite = new SolidBrush(Color.White); + g.DrawRectangle(windowPen, _startPosX.Value + 39.3f, _startPosY.Value + 9, 8, 8); + + g.DrawRectangle(pen, _startPosX.Value + 50, _startPosY.Value + 14, 8, 12); + + g.FillRectangle(brWhite, _startPosX.Value + 51, _startPosY.Value + 16, 7, 10); + } + + } +} diff --git a/ProjectElectricLocomotive/ProjectElectricLocomotive/EntityElectricLocomotive.cs b/ProjectElectricLocomotive/ProjectElectricLocomotive/EntityElectricLocomotive.cs new file mode 100644 index 0000000..938828a --- /dev/null +++ b/ProjectElectricLocomotive/ProjectElectricLocomotive/EntityElectricLocomotive.cs @@ -0,0 +1,77 @@ + +namespace ProjectElectricLocomotive; + +/// +/// Класс-сущность "Тепловоз" +/// +public class EntityElectricLocomotive +{ + /// + /// Скорость + /// + public int Speed { get; private set; } + + /// + /// Вес + /// + public double Weight { get; private set; } + + /// + /// Основной цвет + /// + public Color BodyColor { get; private set; } + + /// + /// Дополнительный цвет (для дополнительных элементов) + /// + public Color AdditionalColor { get; private set; } + + /// + /// Признак (опция) наличия обвеса + /// + public bool BodyKit { get; private set; } + + /// + /// Признак (опция) наличия "рогов" + /// + public bool ElectricHorns { get; private set; } + + /// + /// Признак (опция) количества колёс + /// + public int WheelsAmount { get; private set; } + + /// + /// Признак (опция) наличия места под батарею + /// + public bool BatteryPlacement { get; private set; } + + /// + /// Шаг перемещения объекта + /// + public double Step => Speed * 100 / Weight; + + /// + /// Инициализация полей объекта-класса тепловоза + /// + /// + /// + /// + /// + /// + /// + /// + /// + public void Init(int speed, double weight, Color bodyColor, Color additionalColor, bool bodyKit, bool electricHorns, bool batteryPlacement, int wheelsAmount) + { + Speed = speed; + Weight = weight; + BodyColor = bodyColor; + AdditionalColor = additionalColor; + BodyKit = bodyKit; + ElectricHorns = electricHorns; + BatteryPlacement = batteryPlacement; + WheelsAmount = wheelsAmount; + + } +} diff --git a/ProjectElectricLocomotive/ProjectElectricLocomotive/Form1.Designer.cs b/ProjectElectricLocomotive/ProjectElectricLocomotive/Form1.Designer.cs deleted file mode 100644 index 6cd3a18..0000000 --- a/ProjectElectricLocomotive/ProjectElectricLocomotive/Form1.Designer.cs +++ /dev/null @@ -1,39 +0,0 @@ -namespace ProjectElectricLocomotive -{ - partial class Form1 - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.components = new System.ComponentModel.Container(); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(800, 450); - this.Text = "Form1"; - } - - #endregion - } -} \ No newline at end of file diff --git a/ProjectElectricLocomotive/ProjectElectricLocomotive/Form1.cs b/ProjectElectricLocomotive/ProjectElectricLocomotive/Form1.cs deleted file mode 100644 index eb6a0ea..0000000 --- a/ProjectElectricLocomotive/ProjectElectricLocomotive/Form1.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace ProjectElectricLocomotive -{ - public partial class Form1 : Form - { - public Form1() - { - InitializeComponent(); - } - } -} \ No newline at end of file diff --git a/ProjectElectricLocomotive/ProjectElectricLocomotive/FormElectricLocomotive.Designer.cs b/ProjectElectricLocomotive/ProjectElectricLocomotive/FormElectricLocomotive.Designer.cs new file mode 100644 index 0000000..577dbcc --- /dev/null +++ b/ProjectElectricLocomotive/ProjectElectricLocomotive/FormElectricLocomotive.Designer.cs @@ -0,0 +1,138 @@ +namespace ProjectElectricLocomotive +{ + partial class FormElectricLocomotive + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + pictureBoxElectricLocomotive = new PictureBox(); + buttonCreate = new Button(); + buttonLeft = new Button(); + buttonDown = new Button(); + buttonRight = new Button(); + buttonUp = new Button(); + ((System.ComponentModel.ISupportInitialize)pictureBoxElectricLocomotive).BeginInit(); + SuspendLayout(); + // + // pictureBoxElectricLocomotive + // + pictureBoxElectricLocomotive.Dock = DockStyle.Fill; + pictureBoxElectricLocomotive.Location = new Point(0, 0); + pictureBoxElectricLocomotive.Name = "pictureBoxElectricLocomotive"; + pictureBoxElectricLocomotive.Size = new Size(866, 479); + pictureBoxElectricLocomotive.TabIndex = 0; + pictureBoxElectricLocomotive.TabStop = false; + // + // buttonCreate + // + buttonCreate.Anchor = AnchorStyles.Bottom | AnchorStyles.Left; + buttonCreate.Location = new Point(12, 430); + buttonCreate.Name = "buttonCreate"; + buttonCreate.Size = new Size(104, 37); + buttonCreate.TabIndex = 1; + buttonCreate.Text = "Создать"; + buttonCreate.UseVisualStyleBackColor = true; + buttonCreate.Click += ButtonCreate_Click; + // + // buttonLeft + // + buttonLeft.Anchor = AnchorStyles.Bottom | AnchorStyles.Right; + buttonLeft.BackColor = Color.Snow; + buttonLeft.BackgroundImage = Properties.Resources.buttonLeft; + buttonLeft.BackgroundImageLayout = ImageLayout.Stretch; + buttonLeft.Location = new Point(695, 405); + buttonLeft.Name = "buttonLeft"; + buttonLeft.Size = new Size(45, 45); + buttonLeft.TabIndex = 2; + buttonLeft.UseVisualStyleBackColor = false; + buttonLeft.Click += ButtonMove_Click; + // + // buttonDown + // + buttonDown.Anchor = AnchorStyles.Bottom | AnchorStyles.Right; + buttonDown.BackColor = Color.Snow; + buttonDown.BackgroundImage = Properties.Resources.buttonDown; + buttonDown.BackgroundImageLayout = ImageLayout.Stretch; + buttonDown.Location = new Point(746, 405); + buttonDown.Name = "buttonDown"; + buttonDown.Size = new Size(45, 45); + buttonDown.TabIndex = 3; + buttonDown.UseVisualStyleBackColor = false; + buttonDown.Click += ButtonMove_Click; + // + // buttonRight + // + buttonRight.Anchor = AnchorStyles.Bottom | AnchorStyles.Right; + buttonRight.BackColor = Color.Snow; + buttonRight.BackgroundImage = Properties.Resources.buttonRight; + buttonRight.BackgroundImageLayout = ImageLayout.Stretch; + buttonRight.Location = new Point(795, 405); + buttonRight.Name = "buttonRight"; + buttonRight.Size = new Size(45, 45); + buttonRight.TabIndex = 4; + buttonRight.UseVisualStyleBackColor = false; + buttonRight.Click += ButtonMove_Click; + // + // buttonUp + // + buttonUp.Anchor = AnchorStyles.Bottom | AnchorStyles.Right; + buttonUp.BackColor = Color.Snow; + buttonUp.BackgroundImage = Properties.Resources.buttonUp; + buttonUp.BackgroundImageLayout = ImageLayout.Stretch; + buttonUp.Location = new Point(746, 354); + buttonUp.Name = "buttonUp"; + buttonUp.Size = new Size(45, 45); + buttonUp.TabIndex = 5; + buttonUp.UseVisualStyleBackColor = false; + buttonUp.Click += ButtonMove_Click; + // + // FormElectricLocomotive + // + AutoScaleDimensions = new SizeF(7F, 15F); + AutoScaleMode = AutoScaleMode.Font; + ClientSize = new Size(866, 479); + Controls.Add(buttonUp); + Controls.Add(buttonRight); + Controls.Add(buttonDown); + Controls.Add(buttonLeft); + Controls.Add(buttonCreate); + Controls.Add(pictureBoxElectricLocomotive); + Name = "FormElectricLocomotive"; + Text = "Электровоз"; + ((System.ComponentModel.ISupportInitialize)pictureBoxElectricLocomotive).EndInit(); + ResumeLayout(false); + } + + #endregion + + private PictureBox pictureBoxElectricLocomotive; + private Button buttonCreate; + private Button buttonLeft; + private Button buttonDown; + private Button buttonRight; + private Button buttonUp; + } +} \ No newline at end of file diff --git a/ProjectElectricLocomotive/ProjectElectricLocomotive/FormElectricLocomotive.cs b/ProjectElectricLocomotive/ProjectElectricLocomotive/FormElectricLocomotive.cs new file mode 100644 index 0000000..2de42d9 --- /dev/null +++ b/ProjectElectricLocomotive/ProjectElectricLocomotive/FormElectricLocomotive.cs @@ -0,0 +1,95 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace ProjectElectricLocomotive; + +public partial class FormElectricLocomotive : Form +{ + private DrawningElectricLocomotive? _drawningElectricLocomotive; + + public FormElectricLocomotive() + { + InitializeComponent(); + } + + /// + /// Метод прорисовки электровоза + /// + private void Draw() + { + if (_drawningElectricLocomotive == null) + { + return; + } + Bitmap bmp = new(pictureBoxElectricLocomotive.Width, + pictureBoxElectricLocomotive.Height); + Graphics gr = Graphics.FromImage(bmp); + _drawningElectricLocomotive.DrawTransport(gr); + pictureBoxElectricLocomotive.Image = bmp; + } + + private void ButtonCreate_Click(object sender, EventArgs e) + { + Random random = new(); + _drawningElectricLocomotive = new DrawningElectricLocomotive(); + _drawningElectricLocomotive.Init(random.Next(100, 300), random.Next(1000, 3000), + Color.FromArgb(random.Next(0, 256), random.Next(0, 256), random.Next(0, 256)), + Color.FromArgb(random.Next(0, 256), random.Next(0, 256), random.Next(0, 256)), + Convert.ToBoolean(random.Next(0, 2)), Convert.ToBoolean(random.Next(0, 2)), Convert.ToBoolean(random.Next(0, 2)), random.Next(1, 5)); + _drawningElectricLocomotive.SetPictureSize(pictureBoxElectricLocomotive.Width, pictureBoxElectricLocomotive.Height); + _drawningElectricLocomotive.SetPosition(random.Next(10, 100), random.Next(10, 100)); + + Bitmap bmp = new(pictureBoxElectricLocomotive.Width, pictureBoxElectricLocomotive.Height); + Graphics gr = Graphics.FromImage(bmp); + _drawningElectricLocomotive.DrawTransport(gr); + pictureBoxElectricLocomotive.Image = bmp; + } + + /// + /// Перемещение объекта по форме (нажатие кнопок навигации) + /// + /// + /// + private void ButtonMove_Click(object sender, EventArgs e) + { + if (_drawningElectricLocomotive == null) + { + return; + } + string name = ((Button)sender)?.Name ?? string.Empty; + bool result = false; + switch (name) + { + case "buttonUp": + result = + _drawningElectricLocomotive.MoveTransport(DirectionType.Up); + break; + case "buttonDown": + result = + _drawningElectricLocomotive.MoveTransport(DirectionType.Down); + break; + case "buttonLeft": + result = + _drawningElectricLocomotive.MoveTransport(DirectionType.Left); + break; + case "buttonRight": + result = + _drawningElectricLocomotive.MoveTransport(DirectionType.Right); + break; + } + if (result) + { + Draw(); + } + } +} + + + diff --git a/ProjectElectricLocomotive/ProjectElectricLocomotive/Form1.resx b/ProjectElectricLocomotive/ProjectElectricLocomotive/FormElectricLocomotive.resx similarity index 93% rename from ProjectElectricLocomotive/ProjectElectricLocomotive/Form1.resx rename to ProjectElectricLocomotive/ProjectElectricLocomotive/FormElectricLocomotive.resx index 1af7de1..af32865 100644 --- a/ProjectElectricLocomotive/ProjectElectricLocomotive/Form1.resx +++ b/ProjectElectricLocomotive/ProjectElectricLocomotive/FormElectricLocomotive.resx @@ -1,17 +1,17 @@  - diff --git a/ProjectElectricLocomotive/ProjectElectricLocomotive/Program.cs b/ProjectElectricLocomotive/ProjectElectricLocomotive/Program.cs index 9a38110..ddb490c 100644 --- a/ProjectElectricLocomotive/ProjectElectricLocomotive/Program.cs +++ b/ProjectElectricLocomotive/ProjectElectricLocomotive/Program.cs @@ -11,7 +11,7 @@ namespace ProjectElectricLocomotive // To customize application configuration such as set high DPI settings or default font, // see https://aka.ms/applicationconfiguration. ApplicationConfiguration.Initialize(); - Application.Run(new Form1()); + Application.Run(new FormElectricLocomotive()); } } } \ No newline at end of file diff --git a/ProjectElectricLocomotive/ProjectElectricLocomotive/ProjectElectricLocomotive.csproj b/ProjectElectricLocomotive/ProjectElectricLocomotive/ProjectElectricLocomotive.csproj index e1a0735..244387d 100644 --- a/ProjectElectricLocomotive/ProjectElectricLocomotive/ProjectElectricLocomotive.csproj +++ b/ProjectElectricLocomotive/ProjectElectricLocomotive/ProjectElectricLocomotive.csproj @@ -8,4 +8,19 @@ enable + + + True + True + Resources.resx + + + + + + ResXFileCodeGenerator + Resources.Designer.cs + + + \ No newline at end of file diff --git a/ProjectElectricLocomotive/ProjectElectricLocomotive/Properties/Resources.Designer.cs b/ProjectElectricLocomotive/ProjectElectricLocomotive/Properties/Resources.Designer.cs new file mode 100644 index 0000000..90ecb95 --- /dev/null +++ b/ProjectElectricLocomotive/ProjectElectricLocomotive/Properties/Resources.Designer.cs @@ -0,0 +1,103 @@ +//------------------------------------------------------------------------------ +// +// Этот код создан программой. +// Исполняемая версия:4.0.30319.42000 +// +// Изменения в этом файле могут привести к неправильной работе и будут потеряны в случае +// повторной генерации кода. +// +//------------------------------------------------------------------------------ + +namespace ProjectElectricLocomotive.Properties { + using System; + + + /// + /// Класс ресурса со строгой типизацией для поиска локализованных строк и т.д. + /// + // Этот класс создан автоматически классом StronglyTypedResourceBuilder + // с помощью такого средства, как ResGen или Visual Studio. + // Чтобы добавить или удалить член, измените файл .ResX и снова запустите ResGen + // с параметром /str или перестройте свой проект VS. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Возвращает кэшированный экземпляр ResourceManager, использованный этим классом. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ProjectElectricLocomotive.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Перезаписывает свойство CurrentUICulture текущего потока для всех + /// обращений к ресурсу с помощью этого класса ресурса со строгой типизацией. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Поиск локализованного ресурса типа System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap buttonDown { + get { + object obj = ResourceManager.GetObject("buttonDown", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Поиск локализованного ресурса типа System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap buttonLeft { + get { + object obj = ResourceManager.GetObject("buttonLeft", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Поиск локализованного ресурса типа System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap buttonRight { + get { + object obj = ResourceManager.GetObject("buttonRight", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Поиск локализованного ресурса типа System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap buttonUp { + get { + object obj = ResourceManager.GetObject("buttonUp", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + } +} diff --git a/ProjectElectricLocomotive/ProjectElectricLocomotive/Properties/Resources.resx b/ProjectElectricLocomotive/ProjectElectricLocomotive/Properties/Resources.resx new file mode 100644 index 0000000..3393d19 --- /dev/null +++ b/ProjectElectricLocomotive/ProjectElectricLocomotive/Properties/Resources.resx @@ -0,0 +1,133 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + ..\Resources\buttonLeft.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\buttonDown.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\buttonUp.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\buttonRight.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + \ No newline at end of file diff --git a/ProjectElectricLocomotive/ProjectElectricLocomotive/Resources/buttonDown.png b/ProjectElectricLocomotive/ProjectElectricLocomotive/Resources/buttonDown.png new file mode 100644 index 0000000000000000000000000000000000000000..dfbc40caa477c32d0e6b4d2c07db033780ffeebd GIT binary patch literal 9114 zcmeHtXHXPP_ixYaE@{ab5m^ZeE6G(!iVO%!RKO)ldXT6n836%@AO=)|oa;yGRHPzE+y3gr8efpeVpXz%?=g+aR>|+4{ zu<7b(nE(LOKQSp-481VsHM>YJARm)+nxORK{#kkj>!M+(0lM}Z>%;!L_) z8sva4bD7<@Mp{0#2oV1?sKF1@r=&E{$2l^B_wPh(h=;biji}!ov#;^(r@1YKx`|tGQh_X zlt#a<`%)rMw$6dFQErAff>VuIuegyLZ*Bm0F!ufvr2Ir)F@1Y&vjK{QMqe$DIVJU%{w*V z^6m65=x~=(ddEz$=#79$8z|)yw}pI#^AiyMILJrf{nx*9GoTegfjj@TWrrA`^~XQc zbZLO&923PEIKt!O0Q}`%056FPeVc^^F8tq|2aqHT&WDb(lU0*^y^g zvdhLr#L@43H=DYy3_BS&FoIr?)camh*VoT00VD`mmko8yJJmCS>>8_QhKb~*ksU!O zfrYA%D*j^VPlO#nHI^ z_|iN93D_oWp_EH~vHN5#*e8UOG^{vf29&tOG|%$^)0jpiS>KLpsk4) zaE~NZ278o`}c-aZEexs1Qp$xZ$_z?A52}c2+LdNg?gd z2Npujw|KM~RY|2v@@$xz^J`yOunP(!&OQ=Ao;o7i=%zJy!1<+?vRZH3{()lht=(Q` z@`b(7dT`!X*S^p;y4D)|DxNCeSYg-VXV$S@CLBSVt;@j?oTx8Q6-zY1Lzk9pS1a@L zklV3M2e_B*Y+07bQFM9oiatXMD*ex1_z`-ic*W%TE9PfxOZ1=VFSwK@u`HpFMB`R z!=5but;8Kq^@j)gh8oul=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zdhb-G92h@nb8Bz;GA7`q)+yTQxP`BxTMHqJlM{ctR%n@%Q*#MWMz=tE*RU^iH}_JB zVv{d~RjQodUQK{_-L_XR@Gx*@_0Mi@OJf!vAG)RF2DB4yUS#0h$YVOphQhtl7^Xs- z;9gL0#`z1-1OdSyCgrZ^hvffquRuZjfA1Uok6QjeypmxcfO76J8j4IB$qfgx{W}j` M?ekitn)c!U2hG@eK>z>% literal 0 HcmV?d00001 diff --git a/ProjectElectricLocomotive/ProjectElectricLocomotive/Resources/buttonLeft.png b/ProjectElectricLocomotive/ProjectElectricLocomotive/Resources/buttonLeft.png new file mode 100644 index 0000000000000000000000000000000000000000..1aceaf14b1ca2b81bef1624b4a132ee17091ad7a GIT binary patch literal 6947 zcmb7JXH=8jvc?Jsf+AI^(vhN}x6peJp(GRq0~o5(!2p6FQlteELX{S(^dcbeAtDe6 z0-;D3=|x0hkj{1_n8<|W1Xv4ZeF3Fpt!21s|li@ zxR6dkah~Gh1+s>zaE_5I&iR0J)F~WIZ868KaN$Jl|6={q>mPw#@x2@z^-tjc z4)pmN?N7>o?ZAKV`p0$&4Y92;{S)}V1HGCrImGoh4uN>es*V+8eW8`S>UpXgKKR$u zd@7&tLAZozWOv~+L$136aX}yx?_PH07u|@IQMj_2a{^Z!3~B{O8b$1nj&V`j1*n%j zAYeT*ckz890VG+C2@X@s8iI%idUkjBr&s2EUaK%k-w?Kf+ok3H!+v(=p)>9?C-@|6-sfe}*434iK}tWfvMXknG6!{y=KE ze$zHC9< zu6E%YC;leXa~!_KgX0vR6m&!TT|+7a-fD|g(cV6F?tRDE^>PHXZ963{YlmE+t2z&} zk8>~^qU(D<#k-&{^OQ;c-Ib&u4rZbz2N6OqV72Kt0WKE*ZT4IX@TQE7!%`MtHBvO= z={{}0!mZ2+jc%AGn@+Pv zwJd@*3Z~LFtu0y_Ln$%5>eqA16Aa*w+r}ZK{kz^bHC7(oO~G4x?pIh8MAy~Y^f!sx zJ>64=C0s6DOtJOuil+Zcf(VE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.png b/ProjectElectricLocomotive/ProjectElectricLocomotive/Resources/buttonRight.png new file mode 100644 index 0000000000000000000000000000000000000000..a1c14932cec2476ff8ebd1d332e03668444df5aa GIT binary patch literal 6534 zcmaKxc|26_-~a8BE&IMiWEo>@G1e#~V=2VgciEE=vJ46(WEo>8Tej5L_uXIyStomu zk##Ucgj=6JeSeSN{rEoazs`AIujhL`*SXFgC)QA3oAxs2Wg;RXTAe$$?-LP`B8Z4c zh{#AUR#*xbm@h6|h7e;-91eGWe%{vEmz0`5HaT5dUiCC6)Xd!KhCCQNnZ-^-#38J6 zTiy8S%;x-vZ{{6NiZ5DMm3*T-gsZi=U@i$pUIm*Bb~P@PQ8HLs_pA+gc_FupzrWz= z^z0&b{#T+^Y;x?ioi-l8Zp62SUq_KIw32rG2vJ@!4)I5NL`)2bn2y_I!XO4%>?O!; zTLBWLKMMjN22bN5saIFDxnWd)1O~)!@gssV6{6!E)z5l)VTYWvY{1hes_VaI%zsvql zgA9nLEbIdRBDPCxr2n-&Iu52t7<-o1pN{{(TK^rvZQCUi+n9e5SgZ}r-y!}^8YbJ; zvh#)DC`KsZqEs~?AGgAq?gWaRVDP4XG`ZI!*1Syp{K#`9yScx!XCHZ0mtliOVj0kH z==EQ1b{D_LmK!}%A;;v_i3c_>v~;grDM0Pd**2H%E&b@8=e86??Q8C!e+c&@r-OXI z!rbQ&3)g1Oc*)dnv|26xHrwumP3MRY@n=_Jy*uRGAiyD!mJ^R;3PxK&uI=$&>>Y!9v z3{|T^PiOpS?7(!fn9lvvf+dU~xLjW<9Q?l1l}U3alqJncTSmk&gsxS}K4@*Ww(!hj z*4St8h%9Kidw>36i0R%}o#_~@q7?9cUv%kRU(M@ugDso20{VIKHy~m|Wk#t!cB_t; zT0hzat+}t0)WSc?=4jGkKH4?8h`ZJ!rF>YQ$2si1UIK$q2VGa+EIjx)@4#9n?XV&` zNy8Hcgn`8%-g|ZNuM6{yEzCs+WD@qkAnmBqrkgd{a;Z9RXOh4Kennzj49JA--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b@P*)DEQ(}3lWiyrvB~s8nzMt1E$Z0Bme*a literal 0 HcmV?d00001 diff --git a/ProjectElectricLocomotive/ProjectElectricLocomotive/Resources/buttonUp.png b/ProjectElectricLocomotive/ProjectElectricLocomotive/Resources/buttonUp.png new file mode 100644 index 0000000000000000000000000000000000000000..3ad1f8286b3acf9c83e64925600520e498713e63 GIT binary patch literal 9289 zcmeHtXIzud^6x%rl+YnSDAE+9NC~}%qEZAAMd<_$qI9H)G@pPdDo8I%i;6#b5fzXc z6%Ygg>4-oS1XL7IkS;f#clZ3yxi9Xk`{M5Blh2dc*`1wvX6L(;$=}6WV^G;E@`XX5JdLc30C=2)-El`VXknXUrw-4} z&F$^&wY=y^&A2--JYG^(6&4rM0eTH*B+5!GfCV?}rz(a-BPojrMgLHv8` z;eq#=#s7ORgQn#wuAx}C{{ttR7w9K*LI0BjYrA}9;gS5G44^Cn!o?;2zR-VfK@CH^ z`%VA7mqC-P!79=Cum1nu=7LLP{)@_BfpU%c-^VlPo-ek?|BK2{Kk`3YIru35zo?9$ zGW};Oi!Akx{Ys_7MH*~TRGb5qcRsds+}KvSy5mc1J!}eY`CJDEo2k7!6W?1( z=9y_x>jDi|_cDVdgHYA;s(UeD|LskvUYwiRIg3oaD+MRD%&1P6IpVVg;OWTjb+J`4 z$rZGa82lUOk!w4kekr=TJcCr8%8cUWXob+BtrRmkA}1%X?Q87TBBR z)eJDj{HVDLQGJ*THdFcJ<}h%LM5G{|KD2QIqRNPgi&aNe)b$an8;f!~%XuW_5UcXb zKJ@VOApdHWQg*EEOp^v9fRz47gnX*}c8jekN?QrEZVt433R3=H;}vNQ{0!DUIPDvuZ5)z6`4t~C6kT-*PW^mh>SRm zIgg?rcl*k$ypP6ZgU{v!>vKvPB1PlLyv=9v*(qqX4zQn#u)d^QCyD$81w2-fptcO9 zQ8q!?&u9K_)K@BmYE{BA1Qt|&o9?tvD@0_;x9iIaMC$(>-3VYwnU4B;L4>3SeId2k z%`oQwa$*G=Lpaewj5il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400 Subject: [PATCH 2/4] =?UTF-8?q?=D0=9B=D0=B0=D0=B1=D0=BE=D1=80=D0=B0=D1=82?= =?UTF-8?q?=D0=BE=D1=80=D0=BD=D0=B0=D1=8F=20=D1=80=D0=B0=D0=B1=D0=BE=D1=82?= =?UTF-8?q?=D0=B0=201.=20=D0=9F=D1=80=D0=B0=D0=B2=D0=BA=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DrawningElectricLocomotive.cs | 117 ++++--- cfdiv3/cfdiv3.sln | 31 ++ cfdiv3/cfdiv3/A.cpp | 70 ++++ cfdiv3/cfdiv3/cfdiv3.vcxproj | 135 ++++++++ cfdiv3/cfdiv3/cfdiv3.vcxproj.filters | 22 ++ lab_aisd/lab_aisd.sln | 31 ++ lab_aisd/lab_aisd/lab1.cpp | 301 ++++++++++++++++++ lab_aisd/lab_aisd/lab_aisd.vcxproj | 135 ++++++++ lab_aisd/lab_aisd/lab_aisd.vcxproj.filters | 22 ++ 9 files changed, 815 insertions(+), 49 deletions(-) create mode 100644 cfdiv3/cfdiv3.sln create mode 100644 cfdiv3/cfdiv3/A.cpp create mode 100644 cfdiv3/cfdiv3/cfdiv3.vcxproj create mode 100644 cfdiv3/cfdiv3/cfdiv3.vcxproj.filters create mode 100644 lab_aisd/lab_aisd.sln create mode 100644 lab_aisd/lab_aisd/lab1.cpp create mode 100644 lab_aisd/lab_aisd/lab_aisd.vcxproj create mode 100644 lab_aisd/lab_aisd/lab_aisd.vcxproj.filters diff --git a/ProjectElectricLocomotive/ProjectElectricLocomotive/DrawningElectricLocomotive.cs b/ProjectElectricLocomotive/ProjectElectricLocomotive/DrawningElectricLocomotive.cs index 616d472..1842639 100644 --- a/ProjectElectricLocomotive/ProjectElectricLocomotive/DrawningElectricLocomotive.cs +++ b/ProjectElectricLocomotive/ProjectElectricLocomotive/DrawningElectricLocomotive.cs @@ -34,13 +34,13 @@ public class DrawningElectricLocomotive /// /// Ширина прорисовки электровоза /// - private readonly int _drawningElectricLocomotiveWidth = 100; + private readonly int _drawningElectricLocomotiveWidth = 83; /// /// Высота прорисовки электровоза /// - private readonly int _drawingElectricLocomotiveHeight = 45; + private readonly int _drawningElectricLocomotiveHeight = 45; /// /// Инициализация свойств @@ -71,13 +71,19 @@ public class DrawningElectricLocomotive /// true - границы заданы, false - проверка не пройдена, нельзя разместить объект в этих размерах public bool SetPictureSize(int width, int height) { - // Проверка, что объект "влезает" в размеры поля - // если влезает, сохраняем границы и корректируем позицию объекта, если она была уже установлена - if(_drawingElectricLocomotiveHeight > height || _drawningElectricLocomotiveWidth > width) + if(_drawningElectricLocomotiveHeight > height || _drawningElectricLocomotiveWidth > width) { return false; } + if(_startPosY.HasValue && _startPosY - _drawningElectricLocomotiveHeight < _pictureHeight ) + { + _startPosY -= _drawningElectricLocomotiveHeight; + } + if (_startPosX.HasValue && _startPosX - _drawningElectricLocomotiveWidth < _pictureWidth ) + { + _startPosX -= _drawningElectricLocomotiveWidth; + } _pictureWidth = width; _pictureHeight = height; return true; @@ -94,17 +100,30 @@ public class DrawningElectricLocomotive return; } - if (_drawingElectricLocomotiveHeight + y > _pictureHeight || _drawningElectricLocomotiveWidth + x > _pictureWidth) + + _startPosX = x; + _startPosY = y; + + if ( _drawningElectricLocomotiveHeight + y > _pictureHeight) + { + _startPosY = _pictureHeight - _drawningElectricLocomotiveHeight; + } + if ( _drawningElectricLocomotiveWidth + x > _pictureWidth) + { + _startPosX = _pictureWidth - _drawningElectricLocomotiveWidth; + + } + if (x < 0) { _startPosX = 0; - _startPosY = 0; + } - else + if (y < 0) { - _startPosX = x; - _startPosY = y; + _startPosY = 0; + } - + } /// @@ -123,14 +142,14 @@ public class DrawningElectricLocomotive { //влево case DirectionType.Left: - if(_startPosX.Value - EntityElectricLocomotive.Step + 20 > 0) + if(_startPosX.Value - EntityElectricLocomotive.Step > 0) { _startPosX -= (int)EntityElectricLocomotive.Step; } return true; //вверх case DirectionType.Up: - if(_startPosY.Value - EntityElectricLocomotive.Step + 3 > 0) + if(_startPosY.Value - EntityElectricLocomotive.Step > 0) { _startPosY -= (int)EntityElectricLocomotive.Step; } @@ -144,7 +163,7 @@ public class DrawningElectricLocomotive return true; //вниз case DirectionType.Down: - if (_startPosY.Value + _drawingElectricLocomotiveHeight + EntityElectricLocomotive.Step < _pictureHeight) + if (_startPosY.Value + _drawningElectricLocomotiveHeight + EntityElectricLocomotive.Step < _pictureHeight) { _startPosY += (int)EntityElectricLocomotive.Step; } @@ -175,31 +194,31 @@ public class DrawningElectricLocomotive Brush whiteBrush = new SolidBrush(Color.White); //Инициализация опорных точек для прорисовки корпуса - Point pointStart = new Point(_startPosX.Value + 90, _startPosY.Value + 20); - Point point1 = new Point(_startPosX.Value + 90, _startPosY.Value + 5); - Point point2 = new Point(_startPosX.Value + 25, _startPosY.Value + 5); - Point pointFinish = new Point(_startPosX.Value + 20, _startPosY.Value + 20); + Point pointStart = new Point(_startPosX.Value + 75, _startPosY.Value + 20); + Point point1 = new Point(_startPosX.Value + 75, _startPosY.Value + 5); + Point point2 = new Point(_startPosX.Value + 10, _startPosY.Value + 5); + Point pointFinish = new Point(_startPosX.Value + 5, _startPosY.Value + 20); //Инициализация опорных точек для прорисовки первой "юбки" - Point point3 = new Point(_startPosX.Value + 22, _startPosY.Value + 37); - Point point4 = new Point(_startPosX.Value + 15, _startPosY.Value + 37 +6 ); - Point point5 = new Point(_startPosX.Value + 22, _startPosY.Value + 37 + 6 ); + Point point3 = new Point(_startPosX.Value + 7, _startPosY.Value + 37); + Point point4 = new Point(_startPosX.Value + 0, _startPosY.Value + 37 +6 ); + Point point5 = new Point(_startPosX.Value + 7, _startPosY.Value + 37 + 6 ); //Инициализация опорных точек для прорисовки второй "юбки" - Point point6 = new Point(_startPosX.Value + 84, _startPosY.Value + 37); - Point point7 = new Point(_startPosX.Value + 90 + 7, _startPosY.Value + 37 + 6); - Point point8 = new Point(_startPosX.Value + 84, _startPosY.Value + 37 + 6); + Point point6 = new Point(_startPosX.Value + 69, _startPosY.Value + 37); + Point point7 = new Point(_startPosX.Value + 75 + 7, _startPosY.Value + 37 + 6); + Point point8 = new Point(_startPosX.Value + 69, _startPosY.Value + 37 + 6); //Инициализация опорных точек для прорисовки "рогов" - Point pointHorns1 = new Point(_startPosX.Value + 28, _startPosY.Value+5); - Point pointHorns2 = new Point(_startPosX.Value + 31, _startPosY.Value + 2); - Point pointHorns3 = new Point(_startPosX.Value + 26, _startPosY.Value); + Point pointHorns1 = new Point(_startPosX.Value + 13, _startPosY.Value+5); + Point pointHorns2 = new Point(_startPosX.Value + 16, _startPosY.Value + 2); + Point pointHorns3 = new Point(_startPosX.Value + 11, _startPosY.Value); //Инициализация опорных точек для прорисовки молнии на хранилище батарей - Point pointLightning1 = new Point(_startPosX.Value + 54, _startPosY.Value + 37); - Point pointLightning2 = new Point(_startPosX.Value + 52, _startPosY.Value + 39); - Point pointLightning3 = new Point(_startPosX.Value + 54, _startPosY.Value + 40); - Point pointLightning4 = new Point(_startPosX.Value + 52, _startPosY.Value + 41); + Point pointLightning1 = new Point(_startPosX.Value + 39, _startPosY.Value + 37); + Point pointLightning2 = new Point(_startPosX.Value + 37, _startPosY.Value + 39); + Point pointLightning3 = new Point(_startPosX.Value + 39, _startPosY.Value + 40); + Point pointLightning4 = new Point(_startPosX.Value + 37, _startPosY.Value + 41); //Совокупность точек полигона уголка первой "юбки" Point[] firstTrianglePoints = @@ -225,7 +244,7 @@ public class DrawningElectricLocomotive g.FillPolygon(blackBrush, secondTrianglePoints); //Прорисовка корпуса - g.DrawRectangle(pen, _startPosX.Value + 20, _startPosY.Value + 20, 70, 17); + g.DrawRectangle(pen, _startPosX.Value + 5, _startPosY.Value + 20, 70, 17); g.DrawLine(pen, point3, point4); g.DrawLine(pen, pointStart, point1); @@ -235,41 +254,41 @@ public class DrawningElectricLocomotive //Прорисовка передней и задней "юбки" - g.FillRectangle(blackBrush, _startPosX.Value + 22, _startPosY.Value + 37, 25, 5.3f); - g.FillRectangle(blackBrush, _startPosX.Value + 62, _startPosY.Value + 37, 22, 5.3f); + g.FillRectangle(blackBrush, _startPosX.Value + 7, _startPosY.Value + 37, 25, 5.3f); + g.FillRectangle(blackBrush, _startPosX.Value + 47, _startPosY.Value + 37, 22, 5.3f); //Прорисовка двух передних колёс - g.FillEllipse(whiteBrush, _startPosX.Value + 21.3f, _startPosY.Value + 37, 10, 10); + g.FillEllipse(whiteBrush, _startPosX.Value + 6.3f, _startPosY.Value + 37, 10, 10); + g.DrawEllipse(penSolid, _startPosX.Value + 9, _startPosY.Value + 37, 8, 8); + g.FillEllipse(additionalBrush, _startPosX.Value + 9, _startPosY.Value + 37, 8, 8); g.DrawEllipse(penSolid, _startPosX.Value + 24, _startPosY.Value + 37, 8, 8); g.FillEllipse(additionalBrush, _startPosX.Value + 24, _startPosY.Value + 37, 8, 8); - g.DrawEllipse(penSolid, _startPosX.Value + 39, _startPosY.Value + 37, 8, 8); - g.FillEllipse(additionalBrush, _startPosX.Value + 39, _startPosY.Value + 37, 8, 8); //Прорисовка "рогов" электровоза g.DrawLine(penSolid, pointHorns1, pointHorns2); g.DrawLine(penSolid, pointHorns2, pointHorns3); //Прорисовка "хранилища батарей" электровоза - g.FillRectangle(blackBrush, _startPosX.Value + 51, _startPosY.Value + 37, 8, 4.5f); + g.FillRectangle(blackBrush, _startPosX.Value + 36, _startPosY.Value + 37, 8, 4.5f); g.DrawLine(penSolidYellow, pointLightning1, pointLightning2); g.DrawLine(penSolidYellow, pointLightning2, pointLightning3); g.DrawLine(penSolidYellow, pointLightning3, pointLightning4); //Прорисовка двух задних колёс - g.FillEllipse(whiteBrush, _startPosX.Value + 40 + 38, _startPosY.Value + 37, 10, 10); - g.DrawEllipse(penSolid, _startPosX.Value + 40 + 26, _startPosY.Value + 37, 8, 8); - g.FillEllipse(additionalBrush, _startPosX.Value + 40 + 26, _startPosY.Value + 37, 8, 8); - g.DrawEllipse(penSolid, _startPosX.Value+ 40 + 37, _startPosY.Value + 37, 8, 8); - g.FillEllipse(additionalBrush, _startPosX.Value + 40 + 37, _startPosY.Value + 37, 8, 8); + g.FillEllipse(whiteBrush, _startPosX.Value + 25 + 38, _startPosY.Value + 37, 10, 10); + g.DrawEllipse(penSolid, _startPosX.Value + 25 + 26, _startPosY.Value + 37, 8, 8); + g.FillEllipse(additionalBrush, _startPosX.Value + 25 + 26, _startPosY.Value + 37, 8, 8); + g.DrawEllipse(penSolid, _startPosX.Value+ 25 + 37, _startPosY.Value + 37, 8, 8); + g.FillEllipse(additionalBrush, _startPosX.Value + 25 + 37, _startPosY.Value + 37, 8, 8); //Прорисовка заднего "шлюза" - g.FillRectangle(blackBrush, _startPosX.Value + 90, _startPosY.Value + 9, 5.7f, 27.4f); + g.FillRectangle(blackBrush, _startPosX.Value + 75, _startPosY.Value + 9, 5.7f, 27.4f); //Прорисовка первого и третьего окна - g.DrawRectangle(windowPen, _startPosX.Value + 27, _startPosY.Value + 9, 8, 8); - g.DrawRectangle(windowPen, _startPosX.Value + 78, _startPosY.Value + 9, 8, 8); + g.DrawRectangle(windowPen, _startPosX.Value + 12, _startPosY.Value + 9, 8, 8); + g.DrawRectangle(windowPen, _startPosX.Value + 63, _startPosY.Value + 9, 8, 8); //TODO Опциональная прорисовка колёс для усложненной работы @@ -294,11 +313,11 @@ public class DrawningElectricLocomotive if (EntityElectricLocomotive.BodyKit) { Brush brWhite = new SolidBrush(Color.White); - g.DrawRectangle(windowPen, _startPosX.Value + 39.3f, _startPosY.Value + 9, 8, 8); + g.DrawRectangle(windowPen, _startPosX.Value + 24.3f, _startPosY.Value + 9, 8, 8); - g.DrawRectangle(pen, _startPosX.Value + 50, _startPosY.Value + 14, 8, 12); + g.DrawRectangle(pen, _startPosX.Value + 35, _startPosY.Value + 14, 8, 12); - g.FillRectangle(brWhite, _startPosX.Value + 51, _startPosY.Value + 16, 7, 10); + g.FillRectangle(brWhite, _startPosX.Value + 36, _startPosY.Value + 16, 7, 10); } } diff --git a/cfdiv3/cfdiv3.sln b/cfdiv3/cfdiv3.sln new file mode 100644 index 0000000..7695ced --- /dev/null +++ b/cfdiv3/cfdiv3.sln @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.7.34024.191 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cfdiv3", "cfdiv3\cfdiv3.vcxproj", "{A580EAEA-AEBB-4210-8DFA-E3E1241D9FCF}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {A580EAEA-AEBB-4210-8DFA-E3E1241D9FCF}.Debug|x64.ActiveCfg = Debug|x64 + {A580EAEA-AEBB-4210-8DFA-E3E1241D9FCF}.Debug|x64.Build.0 = Debug|x64 + {A580EAEA-AEBB-4210-8DFA-E3E1241D9FCF}.Debug|x86.ActiveCfg = Debug|Win32 + {A580EAEA-AEBB-4210-8DFA-E3E1241D9FCF}.Debug|x86.Build.0 = Debug|Win32 + {A580EAEA-AEBB-4210-8DFA-E3E1241D9FCF}.Release|x64.ActiveCfg = Release|x64 + {A580EAEA-AEBB-4210-8DFA-E3E1241D9FCF}.Release|x64.Build.0 = Release|x64 + {A580EAEA-AEBB-4210-8DFA-E3E1241D9FCF}.Release|x86.ActiveCfg = Release|Win32 + {A580EAEA-AEBB-4210-8DFA-E3E1241D9FCF}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {C6324E34-5959-487B-98C6-891D3D3A1B32} + EndGlobalSection +EndGlobal diff --git a/cfdiv3/cfdiv3/A.cpp b/cfdiv3/cfdiv3/A.cpp new file mode 100644 index 0000000..e2cb95d --- /dev/null +++ b/cfdiv3/cfdiv3/A.cpp @@ -0,0 +1,70 @@ +#define _USE_MATH_DEFINES +#define _CRT_SECURE_NO_WARNINGS +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace std; + +typedef long long ll; +typedef long double ld; +typedef pair pll; +typedef pair pii; + +const ll LINF = 100098809990; +const int INF = 1009000999; +const int N = 1002; +const ld PI = 3.1415926535; +const ld E = 2.7182818284; +const ll MOD = 1000000007; +const int MAX = 150010; + + +ll solve(vectorv, ll n) { + ll time = v[0]-1, k = 0; + for (int j = 0; j < n; j++) { + for (int i = time + 1; i < 10e10; i++) { + if (i % v[j] == 0) { + k += 1; + time = i; + if (k == n) { + return i; + } + break; + } + } + } + +} + +int main() { + ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); + + ll t, n, zn, f = 0; + + + cin >> t; + for (int i = 0; i < t; i++) { + cin >> n; + vectorv; + for (int j = 0; j < n; j++) { + cin >> zn; + v.push_back(zn); + } + f = solve(v, n); + cout << f << '\n'; + + + } + + return 0; +} \ No newline at end of file diff --git a/cfdiv3/cfdiv3/cfdiv3.vcxproj b/cfdiv3/cfdiv3/cfdiv3.vcxproj new file mode 100644 index 0000000..743f735 --- /dev/null +++ b/cfdiv3/cfdiv3/cfdiv3.vcxproj @@ -0,0 +1,135 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 17.0 + Win32Proj + {a580eaea-aebb-4210-8dfa-e3e1241d9fcf} + cfdiv3 + 10.0 + + + + Application + true + v143 + Unicode + + + Application + false + v143 + true + Unicode + + + Application + true + v143 + Unicode + + + Application + false + v143 + true + Unicode + + + + + + + + + + + + + + + + + + + + + + Level3 + true + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + Level3 + true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + + + + + \ No newline at end of file diff --git a/cfdiv3/cfdiv3/cfdiv3.vcxproj.filters b/cfdiv3/cfdiv3/cfdiv3.vcxproj.filters new file mode 100644 index 0000000..fd18e8a --- /dev/null +++ b/cfdiv3/cfdiv3/cfdiv3.vcxproj.filters @@ -0,0 +1,22 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Исходные файлы + + + \ No newline at end of file diff --git a/lab_aisd/lab_aisd.sln b/lab_aisd/lab_aisd.sln new file mode 100644 index 0000000..c507d95 --- /dev/null +++ b/lab_aisd/lab_aisd.sln @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.7.34024.191 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lab_aisd", "lab_aisd\lab_aisd.vcxproj", "{DD05AB56-9070-4CED-A979-38A2FBA74B9A}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {DD05AB56-9070-4CED-A979-38A2FBA74B9A}.Debug|x64.ActiveCfg = Debug|x64 + {DD05AB56-9070-4CED-A979-38A2FBA74B9A}.Debug|x64.Build.0 = Debug|x64 + {DD05AB56-9070-4CED-A979-38A2FBA74B9A}.Debug|x86.ActiveCfg = Debug|Win32 + {DD05AB56-9070-4CED-A979-38A2FBA74B9A}.Debug|x86.Build.0 = Debug|Win32 + {DD05AB56-9070-4CED-A979-38A2FBA74B9A}.Release|x64.ActiveCfg = Release|x64 + {DD05AB56-9070-4CED-A979-38A2FBA74B9A}.Release|x64.Build.0 = Release|x64 + {DD05AB56-9070-4CED-A979-38A2FBA74B9A}.Release|x86.ActiveCfg = Release|Win32 + {DD05AB56-9070-4CED-A979-38A2FBA74B9A}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {B1FBCA36-B401-40B8-BC85-D0E8E011D3C8} + EndGlobalSection +EndGlobal diff --git a/lab_aisd/lab_aisd/lab1.cpp b/lab_aisd/lab_aisd/lab1.cpp new file mode 100644 index 0000000..1aa6217 --- /dev/null +++ b/lab_aisd/lab_aisd/lab1.cpp @@ -0,0 +1,301 @@ +#include +#include +using namespace std; + +#define SIZE 100 + +struct Students { + string name; + int course_number; + string faculty; +}; + +struct Stack { + +public: + struct Node + { + public: + Students data; + Node* next; + Node(Students data) + { + this->data = data; + this->next = nullptr; + } + }; +private: + Node* head; + int size; +public: + Stack() + { + head = nullptr; + size = 0; + } + int length() + { + return size; + } + void push(Students data) + { + Node* temp = new Node(data); + temp->next = head; + head = temp; + size++; + } + Students top() + { + if (head == nullptr) exit(0); + return head->data; + } + void pop() + { + if (head == nullptr) return; + Node* ptr = head->next; + delete head; + head = ptr; + size--; + } + bool isEmpty() + { + return size != 0; + } + void print() + { + if (head == nullptr) return; + Node* ptr = head; + while(true) + { + cout << "Name = " << ptr->data.name << "\t"; + cout << "Course number = " << ptr->data.course_number << "\t"; + cout << "Faculty = " << ptr->data.faculty << "\n"; + if (ptr->next == nullptr) break; + ptr = ptr->next; + } + } + void erase() + { + if (head == nullptr) return; + Node* ptr = head; + while (ptr->next != nullptr) + { + head = ptr; + ptr = ptr->next; + delete head; + } + head = nullptr; + size = 0; + } + Node* begin() + { + return head; + } +}; + + +void merge(int arr[], int left[], int left_size, int right[], int right_size) +{ + int i = 0, j = 0, k = 0; + while (i < left_size && j < right_size) + { + if (left[i] < right[j]) + { + arr[k] = left[i]; + i++; + } + else + { + arr[k] = right[j]; + j++; + } + k++; + } + while (i < left_size) + { + arr[k] = left[i]; + i++; + k++; + } + while (j < right_size) + { + arr[k] = right[j]; + j++; + k++; + } +} + +void merge(Stack& stack, Stack& left, Stack& right) +{ + + while (left.isEmpty() && right.isEmpty()) { + if (left.top().name < right.top().name) + { + stack.push(left.top()); + left.pop(); + } + else + { + stack.push(right.top()); + right.pop(); + } + } + while(left.isEmpty()) + { + stack.push(left.top()); + left.pop(); + } + while (right.isEmpty()) + { + stack.push(right.top()); + right.pop(); + } +} + +void divide(Stack& stack) { + + if (stack.length() <= 1) { + return; + } + + int divide_to = (stack.length() % 2 == 0) ? stack.length() / 2 : stack.length() / 2 + 1; + + Stack stackLeft, stackRight; + + for (int i = 0; i < stack.length(); i++) + { + if (i < divide_to) + { + stackLeft.push(stack.top()); + stack.pop(); + } + else + { + stackRight.push(stack.top()); + stack.pop(); + } + } + + divide(stackLeft); + divide(stackRight); + merge(stack, stackLeft, stackRight); + +} + +void divide(int arr[], int size) +{ + if (size <= 1) + { + return; + } + + int divide_to = (size % 2 == 0) ? size/2 : size / 2 + 1; + + int left[SIZE]; + int right[SIZE]; + + for (int i = 0; i < size; ++i) + { + if (i < divide_to) left[i] = arr[i]; + else right[i - divide_to] = arr[i]; + } + + divide(left, divide_to); + divide(right, size - divide_to); + merge(arr, left, divide_to, right, size - divide_to); +} + +void ShakingSort(int arr[]) { + int control = SIZE - 1; + int left = 0, right = control; + do { + for (int i = left; i < right; i++) { + if (arr[i] > arr[i + 1]) { + swap(arr[i], arr[i + 1]); + control = i; + } + } + right = control; + for (int i = right; i > left; i--) { + if (arr[i] < arr[i - 1]) { + swap(arr[i], arr[i - 1]); + control = i; + } + } + left = control; + } while (left < right); +} + +void bubbleSort(Stack& stack) +{ + int swapped, i; + Stack::Node* ptr; + Stack::Node* lptr = nullptr; + + if (stack.begin() == nullptr) + return; + + do + { + swapped = 0; + ptr = stack.begin(); + + while (ptr->next != lptr) + { + if (ptr->data.name > ptr->next->data.name) + { + swap(ptr->data, ptr->next->data); + swapped = 1; + } + ptr = ptr->next; + } + lptr = ptr; + } while (swapped); +} + +int main() +{ + Stack Test; + if (Test.isEmpty()) cout << "Stack is empty\n"; + + Students student1; + student1.course_number = 4; + student1.faculty = "FIST"; + student1.name = "Aleksey Romanov"; + Test.push(student1); + + Students student2; + student2.course_number = 1; + student2.faculty = "IATU"; + student2.name = "Danila Bugrov"; + Test.push(student2); + + Students student3; + student3.course_number = 3; + student3.faculty = "RTF"; + student3.name = "Roman Ivanov"; + Test.push(student3); + + Students student4; + student4.course_number = 2; + student4.faculty = "RTF"; + student4.name = "Ivan Aleksandrov"; + Test.push(student4); + + Test.print(); + //Test.erase(); + bubbleSort(Test); + cout << '\n'; + Test.print(); + + + + /*int arr[SIZE]; + for (auto& e : arr) e = rand() % SIZE; + for (auto& e : arr) cout << e << " "; + cout << '\n'; + ShakingSort(arr); + for (auto& e : arr) cout << e << " "; + cout << '\n';*/ + +} \ No newline at end of file diff --git a/lab_aisd/lab_aisd/lab_aisd.vcxproj b/lab_aisd/lab_aisd/lab_aisd.vcxproj new file mode 100644 index 0000000..e19585a --- /dev/null +++ b/lab_aisd/lab_aisd/lab_aisd.vcxproj @@ -0,0 +1,135 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 17.0 + Win32Proj + {dd05ab56-9070-4ced-a979-38a2fba74b9a} + labaisd + 10.0 + + + + Application + true + v143 + Unicode + + + Application + false + v143 + true + Unicode + + + Application + true + v143 + Unicode + + + Application + false + v143 + true + Unicode + + + + + + + + + + + + + + + + + + + + + + Level3 + true + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + Level3 + true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + + + + + \ No newline at end of file diff --git a/lab_aisd/lab_aisd/lab_aisd.vcxproj.filters b/lab_aisd/lab_aisd/lab_aisd.vcxproj.filters new file mode 100644 index 0000000..b28bd20 --- /dev/null +++ b/lab_aisd/lab_aisd/lab_aisd.vcxproj.filters @@ -0,0 +1,22 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Исходные файлы + + + \ No newline at end of file -- 2.25.1 From 2678df6efed362562d211520045d8c1be95b53e1 Mon Sep 17 00:00:00 2001 From: BoiledMilk123 Date: Mon, 26 Feb 2024 22:01:19 +0400 Subject: [PATCH 3/4] =?UTF-8?q?=D0=9B=D0=B0=D0=B1=D0=BE=D1=80=D0=B0=D1=82?= =?UTF-8?q?=D0=BE=D1=80=D0=BD=D0=B0=D1=8F=20=D1=80=D0=B0=D0=B1=D0=BE=D1=82?= =?UTF-8?q?=D0=B0=201.=20=D0=9F=D1=80=D0=B0=D0=B2=D0=BA=D0=B8=202?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DrawningElectricLocomotive.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ProjectElectricLocomotive/ProjectElectricLocomotive/DrawningElectricLocomotive.cs b/ProjectElectricLocomotive/ProjectElectricLocomotive/DrawningElectricLocomotive.cs index 1842639..3b5a2f6 100644 --- a/ProjectElectricLocomotive/ProjectElectricLocomotive/DrawningElectricLocomotive.cs +++ b/ProjectElectricLocomotive/ProjectElectricLocomotive/DrawningElectricLocomotive.cs @@ -76,13 +76,13 @@ public class DrawningElectricLocomotive return false; } - if(_startPosY.HasValue && _startPosY - _drawningElectricLocomotiveHeight < _pictureHeight ) + if(_startPosY.HasValue && _startPosY + _drawningElectricLocomotiveHeight < _pictureHeight ) { - _startPosY -= _drawningElectricLocomotiveHeight; + _startPosY = _pictureHeight - _drawningElectricLocomotiveHeight; } - if (_startPosX.HasValue && _startPosX - _drawningElectricLocomotiveWidth < _pictureWidth ) + if (_startPosX.HasValue && _startPosX + _drawningElectricLocomotiveWidth < _pictureWidth ) { - _startPosX -= _drawningElectricLocomotiveWidth; + _startPosX = _pictureWidth - _drawningElectricLocomotiveWidth; } _pictureWidth = width; _pictureHeight = height; -- 2.25.1 From 5e1d237096be727f7e437dc79db9fe98f82c0ab4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D1=81402?= <с402@LAPTOP-GSFF9G8M> Date: Tue, 27 Feb 2024 11:59:12 +0300 Subject: [PATCH 4/4] =?UTF-8?q?=D0=9B=D0=B0=D0=B1=D0=BE=D1=80=D0=B0=D1=82?= =?UTF-8?q?=D0=BE=D1=80=D0=BD=D0=B0=D1=8F=20=D1=80=D0=B0=D0=B1=D0=BE=D1=82?= =?UTF-8?q?=D0=B0=20=E2=84=961.=20=D0=9F=D1=80=D0=B0=D0=B2=D0=BA=D0=B8=203?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DrawningElectricLocomotive.cs | 95 +++--- .../EntityElectricLocomotive.cs | 19 +- .../FormElectricLocomotive.cs | 4 +- cfdiv3/cfdiv3.sln | 31 -- cfdiv3/cfdiv3/A.cpp | 70 ---- cfdiv3/cfdiv3/cfdiv3.vcxproj | 135 -------- cfdiv3/cfdiv3/cfdiv3.vcxproj.filters | 22 -- lab_aisd/lab_aisd.sln | 31 -- lab_aisd/lab_aisd/lab1.cpp | 301 ------------------ lab_aisd/lab_aisd/lab_aisd.vcxproj | 135 -------- lab_aisd/lab_aisd/lab_aisd.vcxproj.filters | 22 -- 11 files changed, 45 insertions(+), 820 deletions(-) delete mode 100644 cfdiv3/cfdiv3.sln delete mode 100644 cfdiv3/cfdiv3/A.cpp delete mode 100644 cfdiv3/cfdiv3/cfdiv3.vcxproj delete mode 100644 cfdiv3/cfdiv3/cfdiv3.vcxproj.filters delete mode 100644 lab_aisd/lab_aisd.sln delete mode 100644 lab_aisd/lab_aisd/lab1.cpp delete mode 100644 lab_aisd/lab_aisd/lab_aisd.vcxproj delete mode 100644 lab_aisd/lab_aisd/lab_aisd.vcxproj.filters diff --git a/ProjectElectricLocomotive/ProjectElectricLocomotive/DrawningElectricLocomotive.cs b/ProjectElectricLocomotive/ProjectElectricLocomotive/DrawningElectricLocomotive.cs index 3b5a2f6..b3298c0 100644 --- a/ProjectElectricLocomotive/ProjectElectricLocomotive/DrawningElectricLocomotive.cs +++ b/ProjectElectricLocomotive/ProjectElectricLocomotive/DrawningElectricLocomotive.cs @@ -52,11 +52,11 @@ public class DrawningElectricLocomotive /// /// /// - public void Init(int speed, double weight, Color bodyColor, Color additionalColor, bool bodyKit, bool electricHorns, bool batteryPlacement, int wheelsAmount) + public void Init(int speed, double weight, Color bodyColor, Color additionalColor, bool electricHorns, bool batteryPlacement) { EntityElectricLocomotive = new EntityElectricLocomotive(); - EntityElectricLocomotive.Init(speed, weight, bodyColor, additionalColor, bodyKit, electricHorns, batteryPlacement, wheelsAmount); + EntityElectricLocomotive.Init(speed, weight, bodyColor, additionalColor, electricHorns, batteryPlacement); _pictureWidth = null; _pictureHeight = null; _startPosX = null; @@ -75,8 +75,9 @@ public class DrawningElectricLocomotive { return false; } - - if(_startPosY.HasValue && _startPosY + _drawningElectricLocomotiveHeight < _pictureHeight ) + _pictureWidth = width; + _pictureHeight = height; + if (_startPosY.HasValue && _startPosY + _drawningElectricLocomotiveHeight < _pictureHeight ) { _startPosY = _pictureHeight - _drawningElectricLocomotiveHeight; } @@ -84,8 +85,6 @@ public class DrawningElectricLocomotive { _startPosX = _pictureWidth - _drawningElectricLocomotiveWidth; } - _pictureWidth = width; - _pictureHeight = height; return true; } @@ -104,6 +103,8 @@ public class DrawningElectricLocomotive _startPosX = x; _startPosY = y; + + if ( _drawningElectricLocomotiveHeight + y > _pictureHeight) { _startPosY = _pictureHeight - _drawningElectricLocomotiveHeight; @@ -111,7 +112,6 @@ public class DrawningElectricLocomotive if ( _drawningElectricLocomotiveWidth + x > _pictureWidth) { _startPosX = _pictureWidth - _drawningElectricLocomotiveWidth; - } if (x < 0) { @@ -208,18 +208,7 @@ public class DrawningElectricLocomotive Point point6 = new Point(_startPosX.Value + 69, _startPosY.Value + 37); Point point7 = new Point(_startPosX.Value + 75 + 7, _startPosY.Value + 37 + 6); Point point8 = new Point(_startPosX.Value + 69, _startPosY.Value + 37 + 6); - - //Инициализация опорных точек для прорисовки "рогов" - Point pointHorns1 = new Point(_startPosX.Value + 13, _startPosY.Value+5); - Point pointHorns2 = new Point(_startPosX.Value + 16, _startPosY.Value + 2); - Point pointHorns3 = new Point(_startPosX.Value + 11, _startPosY.Value); - - //Инициализация опорных точек для прорисовки молнии на хранилище батарей - Point pointLightning1 = new Point(_startPosX.Value + 39, _startPosY.Value + 37); - Point pointLightning2 = new Point(_startPosX.Value + 37, _startPosY.Value + 39); - Point pointLightning3 = new Point(_startPosX.Value + 39, _startPosY.Value + 40); - Point pointLightning4 = new Point(_startPosX.Value + 37, _startPosY.Value + 41); - + //Совокупность точек полигона уголка первой "юбки" Point[] firstTrianglePoints = { @@ -252,12 +241,18 @@ public class DrawningElectricLocomotive g.DrawLine(pen, point2, pointFinish); + Brush brWhite = new SolidBrush(Color.White); + g.DrawRectangle(windowPen, _startPosX.Value + 24.3f, _startPosY.Value + 9, 8, 8); + + g.DrawRectangle(pen, _startPosX.Value + 35, _startPosY.Value + 14, 8, 12); + + g.FillRectangle(brWhite, _startPosX.Value + 36, _startPosY.Value + 16, 7, 10); + //Прорисовка передней и задней "юбки" g.FillRectangle(blackBrush, _startPosX.Value + 7, _startPosY.Value + 37, 25, 5.3f); g.FillRectangle(blackBrush, _startPosX.Value + 47, _startPosY.Value + 37, 22, 5.3f); - //Прорисовка двух передних колёс g.FillEllipse(whiteBrush, _startPosX.Value + 6.3f, _startPosY.Value + 37, 10, 10); g.DrawEllipse(penSolid, _startPosX.Value + 9, _startPosY.Value + 37, 8, 8); @@ -265,17 +260,6 @@ public class DrawningElectricLocomotive g.DrawEllipse(penSolid, _startPosX.Value + 24, _startPosY.Value + 37, 8, 8); g.FillEllipse(additionalBrush, _startPosX.Value + 24, _startPosY.Value + 37, 8, 8); - //Прорисовка "рогов" электровоза - g.DrawLine(penSolid, pointHorns1, pointHorns2); - g.DrawLine(penSolid, pointHorns2, pointHorns3); - - //Прорисовка "хранилища батарей" электровоза - g.FillRectangle(blackBrush, _startPosX.Value + 36, _startPosY.Value + 37, 8, 4.5f); - g.DrawLine(penSolidYellow, pointLightning1, pointLightning2); - g.DrawLine(penSolidYellow, pointLightning2, pointLightning3); - g.DrawLine(penSolidYellow, pointLightning3, pointLightning4); - - //Прорисовка двух задних колёс g.FillEllipse(whiteBrush, _startPosX.Value + 25 + 38, _startPosY.Value + 37, 10, 10); g.DrawEllipse(penSolid, _startPosX.Value + 25 + 26, _startPosY.Value + 37, 8, 8); @@ -291,33 +275,34 @@ public class DrawningElectricLocomotive g.DrawRectangle(windowPen, _startPosX.Value + 63, _startPosY.Value + 9, 8, 8); - //TODO Опциональная прорисовка колёс для усложненной работы - //switch (EntityElectricLocomotive.WheelsAmount) - //{ - // case 4: - // //TODO - - // case 3: - // //TODO - - // case 2: - // //TODO - - // case 1: - // //TODO - // return; - - //} - - //Прорисовка опциональных элементов (второе окно и дверь) - if (EntityElectricLocomotive.BodyKit) + + if (EntityElectricLocomotive.ElectricHorns) { - Brush brWhite = new SolidBrush(Color.White); - g.DrawRectangle(windowPen, _startPosX.Value + 24.3f, _startPosY.Value + 9, 8, 8); - g.DrawRectangle(pen, _startPosX.Value + 35, _startPosY.Value + 14, 8, 12); - g.FillRectangle(brWhite, _startPosX.Value + 36, _startPosY.Value + 16, 7, 10); + //Инициализация опорных точек для прорисовки "рогов" + Point pointHorns1 = new Point(_startPosX.Value + 13, _startPosY.Value + 5); + Point pointHorns2 = new Point(_startPosX.Value + 16, _startPosY.Value + 2); + Point pointHorns3 = new Point(_startPosX.Value + 11, _startPosY.Value); + + //Прорисовка "рогов" электровоза + g.DrawLine(penSolid, pointHorns1, pointHorns2); + g.DrawLine(penSolid, pointHorns2, pointHorns3); + } + if(EntityElectricLocomotive.BatteryPlacement) + { + //Инициализация опорных точек для прорисовки молнии на хранилище батарей + Point pointLightning1 = new Point(_startPosX.Value + 39, _startPosY.Value + 37); + Point pointLightning2 = new Point(_startPosX.Value + 37, _startPosY.Value + 39); + Point pointLightning3 = new Point(_startPosX.Value + 39, _startPosY.Value + 40); + Point pointLightning4 = new Point(_startPosX.Value + 37, _startPosY.Value + 41); + + //Прорисовка "хранилища батарей" электровоза + g.FillRectangle(blackBrush, _startPosX.Value + 36, _startPosY.Value + 37, 8, 4.5f); + g.DrawLine(penSolidYellow, pointLightning1, pointLightning2); + g.DrawLine(penSolidYellow, pointLightning2, pointLightning3); + g.DrawLine(penSolidYellow, pointLightning3, pointLightning4); + } } diff --git a/ProjectElectricLocomotive/ProjectElectricLocomotive/EntityElectricLocomotive.cs b/ProjectElectricLocomotive/ProjectElectricLocomotive/EntityElectricLocomotive.cs index 938828a..0a3040f 100644 --- a/ProjectElectricLocomotive/ProjectElectricLocomotive/EntityElectricLocomotive.cs +++ b/ProjectElectricLocomotive/ProjectElectricLocomotive/EntityElectricLocomotive.cs @@ -27,20 +27,10 @@ public class EntityElectricLocomotive public Color AdditionalColor { get; private set; } /// - /// Признак (опция) наличия обвеса - /// - public bool BodyKit { get; private set; } - - /// - /// Признак (опция) наличия "рогов" + /// Признак (опция) наличия "корпус" /// public bool ElectricHorns { get; private set; } - /// - /// Признак (опция) количества колёс - /// - public int WheelsAmount { get; private set; } - /// /// Признак (опция) наличия места под батарею /// @@ -58,20 +48,17 @@ public class EntityElectricLocomotive /// /// /// - /// /// /// - /// - public void Init(int speed, double weight, Color bodyColor, Color additionalColor, bool bodyKit, bool electricHorns, bool batteryPlacement, int wheelsAmount) + + public void Init(int speed, double weight, Color bodyColor, Color additionalColor, bool electricHorns, bool batteryPlacement) { Speed = speed; Weight = weight; BodyColor = bodyColor; AdditionalColor = additionalColor; - BodyKit = bodyKit; ElectricHorns = electricHorns; BatteryPlacement = batteryPlacement; - WheelsAmount = wheelsAmount; } } diff --git a/ProjectElectricLocomotive/ProjectElectricLocomotive/FormElectricLocomotive.cs b/ProjectElectricLocomotive/ProjectElectricLocomotive/FormElectricLocomotive.cs index 2de42d9..d788b47 100644 --- a/ProjectElectricLocomotive/ProjectElectricLocomotive/FormElectricLocomotive.cs +++ b/ProjectElectricLocomotive/ProjectElectricLocomotive/FormElectricLocomotive.cs @@ -42,9 +42,9 @@ public partial class FormElectricLocomotive : Form _drawningElectricLocomotive.Init(random.Next(100, 300), random.Next(1000, 3000), Color.FromArgb(random.Next(0, 256), random.Next(0, 256), random.Next(0, 256)), Color.FromArgb(random.Next(0, 256), random.Next(0, 256), random.Next(0, 256)), - Convert.ToBoolean(random.Next(0, 2)), Convert.ToBoolean(random.Next(0, 2)), Convert.ToBoolean(random.Next(0, 2)), random.Next(1, 5)); + Convert.ToBoolean(random.Next(0, 2)), Convert.ToBoolean(random.Next(0, 2))); _drawningElectricLocomotive.SetPictureSize(pictureBoxElectricLocomotive.Width, pictureBoxElectricLocomotive.Height); - _drawningElectricLocomotive.SetPosition(random.Next(10, 100), random.Next(10, 100)); + _drawningElectricLocomotive.SetPosition(random.Next(0,pictureBoxElectricLocomotive.Width), random.Next(0,pictureBoxElectricLocomotive.Height)); Bitmap bmp = new(pictureBoxElectricLocomotive.Width, pictureBoxElectricLocomotive.Height); Graphics gr = Graphics.FromImage(bmp); diff --git a/cfdiv3/cfdiv3.sln b/cfdiv3/cfdiv3.sln deleted file mode 100644 index 7695ced..0000000 --- a/cfdiv3/cfdiv3.sln +++ /dev/null @@ -1,31 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.7.34024.191 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cfdiv3", "cfdiv3\cfdiv3.vcxproj", "{A580EAEA-AEBB-4210-8DFA-E3E1241D9FCF}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release|x64 = Release|x64 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {A580EAEA-AEBB-4210-8DFA-E3E1241D9FCF}.Debug|x64.ActiveCfg = Debug|x64 - {A580EAEA-AEBB-4210-8DFA-E3E1241D9FCF}.Debug|x64.Build.0 = Debug|x64 - {A580EAEA-AEBB-4210-8DFA-E3E1241D9FCF}.Debug|x86.ActiveCfg = Debug|Win32 - {A580EAEA-AEBB-4210-8DFA-E3E1241D9FCF}.Debug|x86.Build.0 = Debug|Win32 - {A580EAEA-AEBB-4210-8DFA-E3E1241D9FCF}.Release|x64.ActiveCfg = Release|x64 - {A580EAEA-AEBB-4210-8DFA-E3E1241D9FCF}.Release|x64.Build.0 = Release|x64 - {A580EAEA-AEBB-4210-8DFA-E3E1241D9FCF}.Release|x86.ActiveCfg = Release|Win32 - {A580EAEA-AEBB-4210-8DFA-E3E1241D9FCF}.Release|x86.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {C6324E34-5959-487B-98C6-891D3D3A1B32} - EndGlobalSection -EndGlobal diff --git a/cfdiv3/cfdiv3/A.cpp b/cfdiv3/cfdiv3/A.cpp deleted file mode 100644 index e2cb95d..0000000 --- a/cfdiv3/cfdiv3/A.cpp +++ /dev/null @@ -1,70 +0,0 @@ -#define _USE_MATH_DEFINES -#define _CRT_SECURE_NO_WARNINGS -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -using namespace std; - -typedef long long ll; -typedef long double ld; -typedef pair pll; -typedef pair pii; - -const ll LINF = 100098809990; -const int INF = 1009000999; -const int N = 1002; -const ld PI = 3.1415926535; -const ld E = 2.7182818284; -const ll MOD = 1000000007; -const int MAX = 150010; - - -ll solve(vectorv, ll n) { - ll time = v[0]-1, k = 0; - for (int j = 0; j < n; j++) { - for (int i = time + 1; i < 10e10; i++) { - if (i % v[j] == 0) { - k += 1; - time = i; - if (k == n) { - return i; - } - break; - } - } - } - -} - -int main() { - ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); - - ll t, n, zn, f = 0; - - - cin >> t; - for (int i = 0; i < t; i++) { - cin >> n; - vectorv; - for (int j = 0; j < n; j++) { - cin >> zn; - v.push_back(zn); - } - f = solve(v, n); - cout << f << '\n'; - - - } - - return 0; -} \ No newline at end of file diff --git a/cfdiv3/cfdiv3/cfdiv3.vcxproj b/cfdiv3/cfdiv3/cfdiv3.vcxproj deleted file mode 100644 index 743f735..0000000 --- a/cfdiv3/cfdiv3/cfdiv3.vcxproj +++ /dev/null @@ -1,135 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - 17.0 - Win32Proj - {a580eaea-aebb-4210-8dfa-e3e1241d9fcf} - cfdiv3 - 10.0 - - - - Application - true - v143 - Unicode - - - Application - false - v143 - true - Unicode - - - Application - true - v143 - Unicode - - - Application - false - v143 - true - Unicode - - - - - - - - - - - - - - - - - - - - - - Level3 - true - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - - - Console - true - - - - - Level3 - true - true - true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - - - Console - true - true - true - - - - - Level3 - true - _DEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - - - Console - true - - - - - Level3 - true - true - true - NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - - - Console - true - true - true - - - - - - - - - \ No newline at end of file diff --git a/cfdiv3/cfdiv3/cfdiv3.vcxproj.filters b/cfdiv3/cfdiv3/cfdiv3.vcxproj.filters deleted file mode 100644 index fd18e8a..0000000 --- a/cfdiv3/cfdiv3/cfdiv3.vcxproj.filters +++ /dev/null @@ -1,22 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - - - - - Исходные файлы - - - \ No newline at end of file diff --git a/lab_aisd/lab_aisd.sln b/lab_aisd/lab_aisd.sln deleted file mode 100644 index c507d95..0000000 --- a/lab_aisd/lab_aisd.sln +++ /dev/null @@ -1,31 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.7.34024.191 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lab_aisd", "lab_aisd\lab_aisd.vcxproj", "{DD05AB56-9070-4CED-A979-38A2FBA74B9A}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release|x64 = Release|x64 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {DD05AB56-9070-4CED-A979-38A2FBA74B9A}.Debug|x64.ActiveCfg = Debug|x64 - {DD05AB56-9070-4CED-A979-38A2FBA74B9A}.Debug|x64.Build.0 = Debug|x64 - {DD05AB56-9070-4CED-A979-38A2FBA74B9A}.Debug|x86.ActiveCfg = Debug|Win32 - {DD05AB56-9070-4CED-A979-38A2FBA74B9A}.Debug|x86.Build.0 = Debug|Win32 - {DD05AB56-9070-4CED-A979-38A2FBA74B9A}.Release|x64.ActiveCfg = Release|x64 - {DD05AB56-9070-4CED-A979-38A2FBA74B9A}.Release|x64.Build.0 = Release|x64 - {DD05AB56-9070-4CED-A979-38A2FBA74B9A}.Release|x86.ActiveCfg = Release|Win32 - {DD05AB56-9070-4CED-A979-38A2FBA74B9A}.Release|x86.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {B1FBCA36-B401-40B8-BC85-D0E8E011D3C8} - EndGlobalSection -EndGlobal diff --git a/lab_aisd/lab_aisd/lab1.cpp b/lab_aisd/lab_aisd/lab1.cpp deleted file mode 100644 index 1aa6217..0000000 --- a/lab_aisd/lab_aisd/lab1.cpp +++ /dev/null @@ -1,301 +0,0 @@ -#include -#include -using namespace std; - -#define SIZE 100 - -struct Students { - string name; - int course_number; - string faculty; -}; - -struct Stack { - -public: - struct Node - { - public: - Students data; - Node* next; - Node(Students data) - { - this->data = data; - this->next = nullptr; - } - }; -private: - Node* head; - int size; -public: - Stack() - { - head = nullptr; - size = 0; - } - int length() - { - return size; - } - void push(Students data) - { - Node* temp = new Node(data); - temp->next = head; - head = temp; - size++; - } - Students top() - { - if (head == nullptr) exit(0); - return head->data; - } - void pop() - { - if (head == nullptr) return; - Node* ptr = head->next; - delete head; - head = ptr; - size--; - } - bool isEmpty() - { - return size != 0; - } - void print() - { - if (head == nullptr) return; - Node* ptr = head; - while(true) - { - cout << "Name = " << ptr->data.name << "\t"; - cout << "Course number = " << ptr->data.course_number << "\t"; - cout << "Faculty = " << ptr->data.faculty << "\n"; - if (ptr->next == nullptr) break; - ptr = ptr->next; - } - } - void erase() - { - if (head == nullptr) return; - Node* ptr = head; - while (ptr->next != nullptr) - { - head = ptr; - ptr = ptr->next; - delete head; - } - head = nullptr; - size = 0; - } - Node* begin() - { - return head; - } -}; - - -void merge(int arr[], int left[], int left_size, int right[], int right_size) -{ - int i = 0, j = 0, k = 0; - while (i < left_size && j < right_size) - { - if (left[i] < right[j]) - { - arr[k] = left[i]; - i++; - } - else - { - arr[k] = right[j]; - j++; - } - k++; - } - while (i < left_size) - { - arr[k] = left[i]; - i++; - k++; - } - while (j < right_size) - { - arr[k] = right[j]; - j++; - k++; - } -} - -void merge(Stack& stack, Stack& left, Stack& right) -{ - - while (left.isEmpty() && right.isEmpty()) { - if (left.top().name < right.top().name) - { - stack.push(left.top()); - left.pop(); - } - else - { - stack.push(right.top()); - right.pop(); - } - } - while(left.isEmpty()) - { - stack.push(left.top()); - left.pop(); - } - while (right.isEmpty()) - { - stack.push(right.top()); - right.pop(); - } -} - -void divide(Stack& stack) { - - if (stack.length() <= 1) { - return; - } - - int divide_to = (stack.length() % 2 == 0) ? stack.length() / 2 : stack.length() / 2 + 1; - - Stack stackLeft, stackRight; - - for (int i = 0; i < stack.length(); i++) - { - if (i < divide_to) - { - stackLeft.push(stack.top()); - stack.pop(); - } - else - { - stackRight.push(stack.top()); - stack.pop(); - } - } - - divide(stackLeft); - divide(stackRight); - merge(stack, stackLeft, stackRight); - -} - -void divide(int arr[], int size) -{ - if (size <= 1) - { - return; - } - - int divide_to = (size % 2 == 0) ? size/2 : size / 2 + 1; - - int left[SIZE]; - int right[SIZE]; - - for (int i = 0; i < size; ++i) - { - if (i < divide_to) left[i] = arr[i]; - else right[i - divide_to] = arr[i]; - } - - divide(left, divide_to); - divide(right, size - divide_to); - merge(arr, left, divide_to, right, size - divide_to); -} - -void ShakingSort(int arr[]) { - int control = SIZE - 1; - int left = 0, right = control; - do { - for (int i = left; i < right; i++) { - if (arr[i] > arr[i + 1]) { - swap(arr[i], arr[i + 1]); - control = i; - } - } - right = control; - for (int i = right; i > left; i--) { - if (arr[i] < arr[i - 1]) { - swap(arr[i], arr[i - 1]); - control = i; - } - } - left = control; - } while (left < right); -} - -void bubbleSort(Stack& stack) -{ - int swapped, i; - Stack::Node* ptr; - Stack::Node* lptr = nullptr; - - if (stack.begin() == nullptr) - return; - - do - { - swapped = 0; - ptr = stack.begin(); - - while (ptr->next != lptr) - { - if (ptr->data.name > ptr->next->data.name) - { - swap(ptr->data, ptr->next->data); - swapped = 1; - } - ptr = ptr->next; - } - lptr = ptr; - } while (swapped); -} - -int main() -{ - Stack Test; - if (Test.isEmpty()) cout << "Stack is empty\n"; - - Students student1; - student1.course_number = 4; - student1.faculty = "FIST"; - student1.name = "Aleksey Romanov"; - Test.push(student1); - - Students student2; - student2.course_number = 1; - student2.faculty = "IATU"; - student2.name = "Danila Bugrov"; - Test.push(student2); - - Students student3; - student3.course_number = 3; - student3.faculty = "RTF"; - student3.name = "Roman Ivanov"; - Test.push(student3); - - Students student4; - student4.course_number = 2; - student4.faculty = "RTF"; - student4.name = "Ivan Aleksandrov"; - Test.push(student4); - - Test.print(); - //Test.erase(); - bubbleSort(Test); - cout << '\n'; - Test.print(); - - - - /*int arr[SIZE]; - for (auto& e : arr) e = rand() % SIZE; - for (auto& e : arr) cout << e << " "; - cout << '\n'; - ShakingSort(arr); - for (auto& e : arr) cout << e << " "; - cout << '\n';*/ - -} \ No newline at end of file diff --git a/lab_aisd/lab_aisd/lab_aisd.vcxproj b/lab_aisd/lab_aisd/lab_aisd.vcxproj deleted file mode 100644 index e19585a..0000000 --- a/lab_aisd/lab_aisd/lab_aisd.vcxproj +++ /dev/null @@ -1,135 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - 17.0 - Win32Proj - {dd05ab56-9070-4ced-a979-38a2fba74b9a} - labaisd - 10.0 - - - - Application - true - v143 - Unicode - - - Application - false - v143 - true - Unicode - - - Application - true - v143 - Unicode - - - Application - false - v143 - true - Unicode - - - - - - - - - - - - - - - - - - - - - - Level3 - true - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - - - Console - true - - - - - Level3 - true - true - true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - - - Console - true - true - true - - - - - Level3 - true - _DEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - - - Console - true - - - - - Level3 - true - true - true - NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - - - Console - true - true - true - - - - - - - - - \ No newline at end of file diff --git a/lab_aisd/lab_aisd/lab_aisd.vcxproj.filters b/lab_aisd/lab_aisd/lab_aisd.vcxproj.filters deleted file mode 100644 index b28bd20..0000000 --- a/lab_aisd/lab_aisd/lab_aisd.vcxproj.filters +++ /dev/null @@ -1,22 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - - - - - Исходные файлы - - - \ No newline at end of file -- 2.25.1