From c67608370b8733caa92965ea5b8dcd6fd7b75ec5 Mon Sep 17 00:00:00 2001 From: Sergey Kozyrev Date: Wed, 18 Oct 2023 12:24:01 +0400 Subject: [PATCH 1/3] KozyrevSS PIbd-21 GasolineTanker --- Lab/{BaseCar.cs => BaseTanker.cs} | 4 +- Lab/CarsGenericCollection.cs | 43 ++--- Lab/CarsGenericStorage.cs | 47 ++++++ Lab/CollectionsFrame.Designer.cs | 104 ++++++++++-- Lab/CollectionsFrame.cs | 146 ++++++++++++++--- Lab/DrawGasolineTanker.cs | 4 +- Lab/DrawTanker.cs | 6 +- Lab/{AddBaseCar.cs => GasolineTanker.cs} | 4 +- Lab/SetGeneric.cs | 106 ++++++------ OS/First.cpp | 200 +++++++++++++++++++++++ OS/OS.sln | 31 ++++ OS/OS.vcxproj | 136 +++++++++++++++ OS/OS.vcxproj.filters | 25 +++ OS/Second.cpp | 155 ++++++++++++++++++ Rebotica/Program.cs | 7 + Rebotica/Rebotica.csproj | 10 ++ Rebotica/Rebotica.sln | 25 +++ 17 files changed, 932 insertions(+), 121 deletions(-) rename Lab/{BaseCar.cs => BaseTanker.cs} (83%) create mode 100644 Lab/CarsGenericStorage.cs rename Lab/{AddBaseCar.cs => GasolineTanker.cs} (71%) create mode 100644 OS/First.cpp create mode 100644 OS/OS.sln create mode 100644 OS/OS.vcxproj create mode 100644 OS/OS.vcxproj.filters create mode 100644 OS/Second.cpp create mode 100644 Rebotica/Program.cs create mode 100644 Rebotica/Rebotica.csproj create mode 100644 Rebotica/Rebotica.sln diff --git a/Lab/BaseCar.cs b/Lab/BaseTanker.cs similarity index 83% rename from Lab/BaseCar.cs rename to Lab/BaseTanker.cs index 3da87af..3c2005e 100644 --- a/Lab/BaseCar.cs +++ b/Lab/BaseTanker.cs @@ -6,13 +6,13 @@ using System.Threading.Tasks; namespace Lab.Entities { - public class BaseCar + public class BaseTanker { public int Speed { get; private set; } public double Weight { get; private set; } public Color BodyColor { get; private set; } public double Step => (double)Speed * 100 / Weight; - public BaseCar(int speed, double weight, Color bodyColor) + public BaseTanker(int speed, double weight, Color bodyColor) { Speed = speed; Weight = weight; diff --git a/Lab/CarsGenericCollection.cs b/Lab/CarsGenericCollection.cs index 57a4e5d..e9a87a8 100644 --- a/Lab/CarsGenericCollection.cs +++ b/Lab/CarsGenericCollection.cs @@ -26,29 +26,28 @@ namespace Lab.Generics _pictureHeight = picHeight; _collection = new SetGeneric(width * height); } - public static int? operator +(CarsGenericCollection collect, T? + public static bool operator +(CarsGenericCollection collect, T? obj) { - if (obj == null) - { - return -1; - } - return collect?._collection.Insert(obj); - } - public static bool operator -(CarsGenericCollection collect, int - pos) - { - T? obj = collect._collection.Get(pos); if (obj == null) { return false; } - return collect._collection.Remove(pos); + return (bool)collect?._collection.Insert(obj); + } + public static T? operator -(CarsGenericCollection collect, int pos) + { + T? obj = collect._collection[pos]; + if (obj != null) + { + collect._collection.Remove(pos); + } + return obj; } public U? GetU(int pos) { - return (U?)_collection.Get(pos)?.GetMoveableObject; + return (U?)_collection[pos]?.GetMoveableObject; } public Bitmap ShowCars() { @@ -78,14 +77,16 @@ namespace Lab.Generics { int width = _pictureWidth / _placeSizeWidth; int height = _pictureHeight / _placeSizeHeight; - for (int i = 0; i < _collection.Count; i++) + int i = 0; + foreach (var tank in _collection.GetCars()) { - DrawTanker? tank = _collection.Get(i); - if (tank == null) - continue; - tank.SetPosition(i % height * _placeSizeWidth, (height - i / height - 1) * _placeSizeHeight); - tank.DrawTransport(g); - + if (tank != null) + { + tank.SetPosition(i % (width) * _placeSizeWidth, (height - i / width - 1) * _placeSizeHeight); + tank.DrawTransport(g); + } + i++; } } - }} + } +} diff --git a/Lab/CarsGenericStorage.cs b/Lab/CarsGenericStorage.cs new file mode 100644 index 0000000..28da04e --- /dev/null +++ b/Lab/CarsGenericStorage.cs @@ -0,0 +1,47 @@ +using Lab.DrawningObjects; +using Lab.MovementStrategy; +using Lab.Generics; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Lab +{ + internal class CarsGenericStorage + { + readonly Dictionary> _carStorages; + public List Keys => _carStorages.Keys.ToList(); + private readonly int _pictureWidth; + private readonly int _pictureHeight; + public CarsGenericStorage(int pictureWidth, int pictureHeight) + { + _carStorages = new Dictionary>(); + _pictureWidth = pictureWidth; + _pictureHeight = pictureHeight; + } + public void AddSet(string name) + { + if (_carStorages.ContainsKey(name)) return; + _carStorages[name] = new CarsGenericCollection(_pictureWidth, _pictureHeight); + } + + public void DelSet(string name) + { + if (!_carStorages.ContainsKey(name)) return; + _carStorages.Remove(name); + } + + public CarsGenericCollection? + this[string ind] + { + get + { + if (_carStorages.ContainsKey(ind)) return _carStorages[ind]; + return null; + } + } + + } +} diff --git a/Lab/CollectionsFrame.Designer.cs b/Lab/CollectionsFrame.Designer.cs index 0ac9f15..d92d9ca 100644 --- a/Lab/CollectionsFrame.Designer.cs +++ b/Lab/CollectionsFrame.Designer.cs @@ -29,32 +29,98 @@ private void InitializeComponent() { panel1 = new Panel(); + panel2 = new Panel(); + DeleteCollectButton = new Button(); + CollectionListBox = new ListBox(); + AddCollectButton = new Button(); + SetTextBox = new TextBox(); + label2 = new Label(); UpdateButton = new Button(); DeleteButton = new Button(); AddButton = new Button(); - InputNum = new TextBox(); + CarTextBox = new TextBox(); label1 = new Label(); DrawTank = new PictureBox(); panel1.SuspendLayout(); + panel2.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)DrawTank).BeginInit(); SuspendLayout(); // // panel1 // + panel1.Controls.Add(panel2); panel1.Controls.Add(UpdateButton); panel1.Controls.Add(DeleteButton); panel1.Controls.Add(AddButton); - panel1.Controls.Add(InputNum); + panel1.Controls.Add(CarTextBox); panel1.Controls.Add(label1); panel1.Dock = DockStyle.Right; panel1.Location = new Point(550, 0); panel1.Name = "panel1"; - panel1.Size = new Size(250, 450); + panel1.Size = new Size(250, 514); panel1.TabIndex = 0; // + // panel2 + // + panel2.Controls.Add(DeleteCollectButton); + panel2.Controls.Add(CollectionListBox); + panel2.Controls.Add(AddCollectButton); + panel2.Controls.Add(SetTextBox); + panel2.Controls.Add(label2); + panel2.Location = new Point(16, 38); + panel2.Name = "panel2"; + panel2.Size = new Size(214, 220); + panel2.TabIndex = 5; + // + // DeleteCollectButton + // + DeleteCollectButton.Location = new Point(3, 181); + DeleteCollectButton.Name = "DeleteCollectButton"; + DeleteCollectButton.Size = new Size(208, 29); + DeleteCollectButton.TabIndex = 4; + DeleteCollectButton.Text = "Удалить набор"; + DeleteCollectButton.UseVisualStyleBackColor = true; + DeleteCollectButton.Click += ButtonDelObject_Click; + // + // CollectionListBox + // + CollectionListBox.FormattingEnabled = true; + CollectionListBox.ItemHeight = 20; + CollectionListBox.Location = new Point(3, 91); + CollectionListBox.Name = "CollectionListBox"; + CollectionListBox.Size = new Size(208, 84); + CollectionListBox.TabIndex = 3; + CollectionListBox.SelectedIndexChanged += ListBoxObjects_SelectedIndexChanged; + // + // AddCollectButton + // + AddCollectButton.Location = new Point(3, 56); + AddCollectButton.Name = "AddCollectButton"; + AddCollectButton.Size = new Size(208, 29); + AddCollectButton.TabIndex = 2; + AddCollectButton.Text = "Добавить набор"; + AddCollectButton.UseVisualStyleBackColor = true; + AddCollectButton.Click += ButtonAddObject_Click; + // + // SetTextBox + // + SetTextBox.Location = new Point(2, 23); + SetTextBox.Name = "SetTextBox"; + SetTextBox.Size = new Size(209, 27); + SetTextBox.TabIndex = 1; + // + // label2 + // + label2.AutoSize = true; + label2.Location = new Point(3, 0); + label2.Name = "label2"; + label2.Size = new Size(66, 20); + label2.TabIndex = 0; + label2.Text = "Наборы"; + // // UpdateButton // - UpdateButton.Location = new Point(10, 241); + UpdateButton.Location = new Point(10, 401); UpdateButton.Name = "UpdateButton"; UpdateButton.Size = new Size(228, 37); UpdateButton.TabIndex = 4; @@ -64,7 +130,7 @@ // // DeleteButton // - DeleteButton.Location = new Point(10, 176); + DeleteButton.Location = new Point(10, 358); DeleteButton.Name = "DeleteButton"; DeleteButton.Size = new Size(228, 37); DeleteButton.TabIndex = 3; @@ -74,20 +140,20 @@ // // AddButton // - AddButton.Location = new Point(10, 53); + AddButton.Location = new Point(10, 282); AddButton.Name = "AddButton"; AddButton.Size = new Size(228, 37); AddButton.TabIndex = 2; AddButton.Text = "Добавить автомобиль"; AddButton.UseVisualStyleBackColor = true; - AddButton.Click += ButtonAddTank_Click; + AddButton.Click += ButtonAddCar_Click; // - // InputNum + // CarTextBox // - InputNum.Location = new Point(10, 133); - InputNum.Name = "InputNum"; - InputNum.Size = new Size(228, 27); - InputNum.TabIndex = 1; + CarTextBox.Location = new Point(10, 325); + CarTextBox.Name = "CarTextBox"; + CarTextBox.Size = new Size(228, 27); + CarTextBox.TabIndex = 1; // // label1 // @@ -103,7 +169,7 @@ DrawTank.Dock = DockStyle.Fill; DrawTank.Location = new Point(0, 0); DrawTank.Name = "DrawTank"; - DrawTank.Size = new Size(550, 450); + DrawTank.Size = new Size(550, 514); DrawTank.TabIndex = 1; DrawTank.TabStop = false; // @@ -111,13 +177,15 @@ // AutoScaleDimensions = new SizeF(8F, 20F); AutoScaleMode = AutoScaleMode.Font; - ClientSize = new Size(800, 450); + ClientSize = new Size(800, 514); Controls.Add(DrawTank); Controls.Add(panel1); Name = "CollectionsFrame"; Text = "Form1"; panel1.ResumeLayout(false); panel1.PerformLayout(); + panel2.ResumeLayout(false); + panel2.PerformLayout(); ((System.ComponentModel.ISupportInitialize)DrawTank).EndInit(); ResumeLayout(false); } @@ -128,8 +196,14 @@ private Button UpdateButton; private Button DeleteButton; private Button AddButton; - private TextBox InputNum; + private TextBox CarTextBox; private Label label1; private PictureBox DrawTank; + private Panel panel2; + private Button DeleteCollectButton; + private ListBox CollectionListBox; + private Button AddCollectButton; + private TextBox SetTextBox; + private Label label2; } } \ No newline at end of file diff --git a/Lab/CollectionsFrame.cs b/Lab/CollectionsFrame.cs index 5d9e7fd..33c72f2 100644 --- a/Lab/CollectionsFrame.cs +++ b/Lab/CollectionsFrame.cs @@ -15,23 +15,106 @@ namespace Lab { public partial class CollectionsFrame : Form { - private readonly CarsGenericCollection _cars; - + private readonly CarsGenericStorage _storage; + /// + /// Конструктор + /// public CollectionsFrame() { InitializeComponent(); - _cars = new CarsGenericCollection(DrawTank.Width, DrawTank.Height); + _storage = new CarsGenericStorage(DrawTank.Width, DrawTank.Height); } - - private void ButtonAddTank_Click(object sender, EventArgs e) + /// + /// Заполнение listBoxObjects + /// + private void ReloadObjects() { - Frame form = new Frame(); + int index = CollectionListBox.SelectedIndex; + CollectionListBox.Items.Clear(); + foreach (var key in _storage.Keys) + { + CollectionListBox.Items.Add(key); + } + if (CollectionListBox.Items.Count > 0 && (index == -1 || index + >= CollectionListBox.Items.Count)) + { + CollectionListBox.SelectedIndex = 0; + } + else if (CollectionListBox.Items.Count > 0 && index > -1 && + index < CollectionListBox.Items.Count) + { + CollectionListBox.SelectedIndex = index; + } + } + /// + /// Добавление набора в коллекцию + /// + /// + /// + private void ButtonAddObject_Click(object sender, EventArgs e) + { + if (string.IsNullOrEmpty(SetTextBox.Text)) + { + MessageBox.Show("Не все данные заполнены", "Ошибка", + MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } + _storage.AddSet(SetTextBox.Text); + ReloadObjects(); + } + /// + /// Выбор набора + /// + /// + /// + private void ListBoxObjects_SelectedIndexChanged(object sender, + EventArgs e) + { + DrawTank.Image = + _storage[CollectionListBox.SelectedItem?.ToString() ?? string.Empty]?.ShowCars(); + } + /// + /// Удаление набора + /// + /// + /// + private void ButtonDelObject_Click(object sender, EventArgs e) + { + if (CollectionListBox.SelectedIndex == -1) + { + return; + } + if (MessageBox.Show($"Удалить объект {CollectionListBox.SelectedItem}?", "Удаление", MessageBoxButtons.YesNo, + MessageBoxIcon.Question) == DialogResult.Yes) + { + _storage.DelSet(CollectionListBox.SelectedItem.ToString() + ?? string.Empty); + ReloadObjects(); + } + } + /// + /// Добавление объекта в набор + /// + /// + /// + private void ButtonAddCar_Click(object sender, EventArgs e) + { + if (CollectionListBox.SelectedIndex == -1) + { + return; + } + var obj = _storage[CollectionListBox.SelectedItem.ToString() ?? string.Empty]; + if (obj == null) + { + return; + } + Frame form = new(); if (form.ShowDialog() == DialogResult.OK) { - if (_cars + form.SelectedCar != -1) + if (obj + form.SelectedCar) { MessageBox.Show("Объект добавлен"); - DrawTank.Image = _cars.ShowCars(); + DrawTank.Image = obj.ShowCars(); } else { @@ -39,33 +122,58 @@ namespace Lab } } } + /// + /// Удаление объекта из набора + /// + /// + /// private void ButtonRemoveCar_Click(object sender, EventArgs e) { + if (CollectionListBox.SelectedIndex == -1) + { + return; + } + var obj = _storage[CollectionListBox.SelectedItem.ToString() ?? + string.Empty]; + if (obj == null) + { + return; + } if (MessageBox.Show("Удалить объект?", "Удаление", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No) { return; } - int pos = -1; - try - { - pos = Convert.ToInt32(InputNum.Text); - } - catch (Exception ex) { } - if (_cars - pos) + int pos = Convert.ToInt32(CarTextBox.Text); + if (obj - pos != null) { MessageBox.Show("Объект удален"); - DrawTank.Image = _cars.ShowCars(); + DrawTank.Image = obj.ShowCars(); } else { MessageBox.Show("Не удалось удалить объект"); } } - - private void ButtonRefreshCollection_Click(object sender, EventArgs e) + /// + /// Обновление рисунка по набору + /// + /// + /// + private void ButtonRefreshCollection_Click(object sender, EventArgs + e) { - DrawTank.Image = _cars.ShowCars(); + if (CollectionListBox.SelectedIndex == -1) + { + return; + } + var obj = _storage[CollectionListBox.SelectedItem.ToString() ?? + string.Empty]; + if (obj == null) + { + return; + } + DrawTank.Image = obj.ShowCars(); } } } diff --git a/Lab/DrawGasolineTanker.cs b/Lab/DrawGasolineTanker.cs index 871223e..3c77089 100644 --- a/Lab/DrawGasolineTanker.cs +++ b/Lab/DrawGasolineTanker.cs @@ -14,12 +14,12 @@ namespace Lab.DrawningObjects { if (GasolineTanker != null) { - GasolineTanker = new AddBaseCar(speed, weight, bodyColor, additionalColor, bodyKit, wing, sportLine); + GasolineTanker = new GasolineTanker(speed, weight, bodyColor, additionalColor, bodyKit, wing, sportLine); } } public override void DrawTransport(Graphics g) { - if (GasolineTanker is not AddBaseCar Gasoline) + if (GasolineTanker is not GasolineTanker Gasoline) return; base.DrawTransport(g); if (Gasoline.BodyKit) diff --git a/Lab/DrawTanker.cs b/Lab/DrawTanker.cs index 14a2981..6385a21 100644 --- a/Lab/DrawTanker.cs +++ b/Lab/DrawTanker.cs @@ -11,7 +11,7 @@ namespace Lab.DrawningObjects { public class DrawTanker { - public BaseCar? GasolineTanker { get; protected set; } + public BaseTanker? GasolineTanker { get; protected set; } protected int _pictureWidth; protected int _pictureHeight; protected int _startPosX; @@ -42,7 +42,7 @@ namespace Lab.DrawningObjects { _pictureHeight = height; _pictureWidth = width; - GasolineTanker = new BaseCar(speed, weight, bodyColor); + GasolineTanker = new BaseTanker(speed, weight, bodyColor); } public DrawTanker(int speed, double weight, Color bodyColor, int width, int height, int carWidth, int carHeight) @@ -51,7 +51,7 @@ namespace Lab.DrawningObjects _pictureWidth = width; _carHeight = carHeight; _carWidth = carWidth; - GasolineTanker = new BaseCar(speed, weight, bodyColor); + GasolineTanker = new BaseTanker(speed, weight, bodyColor); } public void SetPosition(int x, int y) diff --git a/Lab/AddBaseCar.cs b/Lab/GasolineTanker.cs similarity index 71% rename from Lab/AddBaseCar.cs rename to Lab/GasolineTanker.cs index accd9e8..984ff73 100644 --- a/Lab/AddBaseCar.cs +++ b/Lab/GasolineTanker.cs @@ -6,13 +6,13 @@ using System.Threading.Tasks; namespace Lab.Entities { - public class AddBaseCar : BaseCar + public class GasolineTanker : BaseTanker { public Color AdditionalColor { get; private set; } public bool BodyKit { get; private set; } public bool Wing { get; private set; } public bool SportLine { get; private set; } - public AddBaseCar(int speed, double weight, Color bodyColor, Color additionalColor, bool bodyKit, bool wing, bool sportLine) : base(speed, weight, bodyColor) + public GasolineTanker(int speed, double weight, Color bodyColor, Color additionalColor, bool bodyKit, bool wing, bool sportLine) : base(speed, weight, bodyColor) { AdditionalColor = additionalColor; BodyKit = bodyKit; diff --git a/Lab/SetGeneric.cs b/Lab/SetGeneric.cs index 35d6d69..7e73e02 100644 --- a/Lab/SetGeneric.cs +++ b/Lab/SetGeneric.cs @@ -8,77 +8,69 @@ namespace Lab.Generics { internal class SetGeneric where T : class { - private readonly T?[] _places; - - public int Count => _places.Length; - + private readonly List _places; + public int Count => _places.Count; + + private readonly int _maxCount; + public SetGeneric(int count) { - _places = new T?[count]; + _maxCount = count; + _places = new List(_maxCount); } - - public int Insert(T car) + + public bool Insert(T car) { - int index = -1; - for (int i = 0; i < _places.Length; i++ ) - { - if (_places[i] == null) - { - index = i; break; - } - } - if ( index < 0 ) - { - return -1; - } - for (int i = index; i > 0; i-- ) - { - _places[i] = _places[i - 1]; - } - _places[0] = car; - return 0; + return Insert(car, 0); } - - public int Insert(T car, int position) + public bool Insert(T car, int position) { - if (position < 0 || position >= Count) - return -1; - if (_places[position] == null) - { - _places[position] = car; - return position; - } - int index = -1; - for (int i = position; i < Count; i++) - { - if (_places[i] == null) - { - index = i; break; - } - } - if (index < 0) - return -1; - for (int i = index; index > position; i--) - { - _places[i] = _places[i - 1]; - } - _places[position] = car; - return position; + if (position < 0 || position >= _maxCount) + return false; + + if (Count >= _maxCount) + return false; + _places.Insert(0, car); + return true; } public bool Remove(int position) { - if (position < 0 || position >= Count) + if (position < 0 || position > _maxCount) return false; - _places[position] = null; + if (position >= Count) + return false; + _places.RemoveAt(position); return true; } - - public T? Get(int position) + public T? this[int position] { - if (position < 0 || position >= Count) - return null; - return _places[position]; + get + { + if (position < 0 || position > _maxCount) + return null; + return _places[position]; + } + set + { + if (position < 0 || position > _maxCount) + return; + _places[position] = value; + } } + + + public IEnumerable GetCars(int? maxCars = null) + { + for (int i = 0; i < _places.Count; ++i) + { + yield return _places[i]; + if (maxCars.HasValue && i == maxCars.Value) + { + yield break; + } + } + } + } } diff --git a/OS/First.cpp b/OS/First.cpp new file mode 100644 index 0000000..283ef3e --- /dev/null +++ b/OS/First.cpp @@ -0,0 +1,200 @@ +#define _CRT_SECURE_NO_WARNINGS +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +using namespace std; +#define endl '\n' +#define endll cout << endl +#define LL_MAX 2223372036854775807 +typedef long long ll; + +template + +class Stack { +private: + struct Node + { + Node* back; + T value; + }; + Node* Head; +public: + Stack() + { + Head = nullptr; + } + + void Add(T component) + { + Node* bk = Head; + Head = new Node; + Head->back = bk; + Head->value = component; + } + + T Pop() + { + if (Head != nullptr) + { + Node* v = Head; + Head = Head->back; + T value = v->value; + delete(v); + return value; + } + } + + bool isEmpty() + { + if (Head == nullptr) + return true; + return false; + } +}; + + +struct Arg { +public: + string Name; + string Type; + string Value; + + Arg() {} + + Arg(string n, string t, string v) : Name(n), Type(t), Value(v) {} + + Arg(string n, string t) : Name(n), Type(t), Value("None") {} +}; + +class SysCall +{ +public: + int ID; + string Name; + vector Args; + + SysCall(int id, string name, vector args) : ID(id), Name(name), Args(args) {} + + string toString() + { + string otv = "ID: " + to_string(ID) + "\t Name: " + Name + "\n"; + for (Arg a : Args) + { + otv += "name: " + a.Name + "\t type: " + a.Type + "\t value: " + a.Value + "\n"; + } + return otv; + } +}; + +class Kernel +{ +private: + vector Calls; +public: + Kernel() + { + Calls = vector({ + SysCall(1, "A", vector({ + Arg("AB", "int") + })), + SysCall(2, "B", vector({ + Arg("AB", "int", "163"), + Arg("BA", "string", "145")})), + SysCall(3, "V", vector({ + Arg("BA", "string", "145"), + Arg("OT", "bool", "731"), + Arg("QA", "float", "921") + })), + SysCall(4, "ST", vector({ + Arg("A", "string", "45"), + Arg("O", "string", "71"), + Arg("Q", "double", "21") + })), + SysCall(5, "OP", vector({ + Arg("B", "string", "15"), + Arg("OGT", "bool", "731"), + Arg("QFA", "float", "921") + })) + }); + } + + void ShowAll() + { + for (SysCall c : Calls) + { + cout << c.toString() << "\n"; + } + } + + void Call(int id, Stack stack) + { + cout << " :" << endl; + for (auto it : Calls) + { + if (it.ID == id) + { + cout << " " << it.Name << endl; + for (auto arg : it.Args) + { + if (stack.isEmpty()) + { + cout << " ERROR" << endl; + return; + } + Arg a = stack.Pop(); + if (arg.Type != a.Type) + { + cout << " Error \t : " << it.Name << endl; return; + } + cout << ": " << a.Type << " : " << a.Value << endl; + } + cout << " " << endl; return; + } + } + cout << " ID Error" << endl; + return; + } +}; + +int main1() +{ + setlocale(LC_ALL, "Russian"); + + Kernel k; + + endll; + Stack S1; + S1.Add(Arg("AB", "int")); + k.Call(1, S1); + endll; + Stack S3; + S3.Add(Arg("QA", "float", "921")); + S3.Add(Arg("OT", "bool", "731")); + S3.Add(Arg("BA", "string", "145")); + k.Call(3, S3); + endll; + Stack S2; + S2.Add(Arg("QA", "float", "921")); + S2.Add(Arg("OT", "bool", "731")); + S2.Add(Arg("BA", "string", "145")); + k.Call(2, S2); + endll; + Stack S4; + k.Call(4, S4); + endll; + Stack S5; + k.Call(8, S5); + + return 0; +} \ No newline at end of file diff --git a/OS/OS.sln b/OS/OS.sln new file mode 100644 index 0000000..39febdf --- /dev/null +++ b/OS/OS.sln @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.7.34009.444 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OS", "OS.vcxproj", "{2396AFD1-ABAB-4058-8A95-1699DD32E088}" +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 + {2396AFD1-ABAB-4058-8A95-1699DD32E088}.Debug|x64.ActiveCfg = Debug|x64 + {2396AFD1-ABAB-4058-8A95-1699DD32E088}.Debug|x64.Build.0 = Debug|x64 + {2396AFD1-ABAB-4058-8A95-1699DD32E088}.Debug|x86.ActiveCfg = Debug|Win32 + {2396AFD1-ABAB-4058-8A95-1699DD32E088}.Debug|x86.Build.0 = Debug|Win32 + {2396AFD1-ABAB-4058-8A95-1699DD32E088}.Release|x64.ActiveCfg = Release|x64 + {2396AFD1-ABAB-4058-8A95-1699DD32E088}.Release|x64.Build.0 = Release|x64 + {2396AFD1-ABAB-4058-8A95-1699DD32E088}.Release|x86.ActiveCfg = Release|Win32 + {2396AFD1-ABAB-4058-8A95-1699DD32E088}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {47E0F701-8EA9-4BEA-AADA-DF48244F5A0E} + EndGlobalSection +EndGlobal diff --git a/OS/OS.vcxproj b/OS/OS.vcxproj new file mode 100644 index 0000000..eeaca07 --- /dev/null +++ b/OS/OS.vcxproj @@ -0,0 +1,136 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 17.0 + Win32Proj + {2396afd1-abab-4058-8a95-1699dd32e088} + OS + 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/OS/OS.vcxproj.filters b/OS/OS.vcxproj.filters new file mode 100644 index 0000000..420409a --- /dev/null +++ b/OS/OS.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {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/OS/Second.cpp b/OS/Second.cpp new file mode 100644 index 0000000..8a7d85d --- /dev/null +++ b/OS/Second.cpp @@ -0,0 +1,155 @@ +#define _CRT_SECURE_NO_WARNINGS +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +using namespace std; +#define endl '\n' +#define endll cout << endl +#define LL_MAX 2223372036854775807 +typedef long long ll; + +int ALL_TIME = 100; + +struct Laba { +public: + struct potok + { + double need; + vector coords; + potok() + { + need = rand() % 20 + 1; + } + double add(double t) + { + if (t >= need) + { + coords.push_back(need); + int otv = need; + need = 0; + return otv; + } + else + { + coords.push_back(t); + need -= t; + return t; + } + } + bool full() + { + if (need == 0) + return true; + return false; + } + }; + struct process + { + public: + vector Worker; + int count_potok = 0; + process() + { + count_potok = rand() % 5 + 1; + for (int i = 0; i < count_potok; i++) + { + Worker.emplace_back(); + } + } + + }; + vector proc; + int count_proc; + int count_all_potok = 0; + int potok_max; + double kvant; + int timer = 0; + int count_kvant; + Laba() + { + count_kvant = 0; + count_proc = 5; + for (int i = 0; i < count_proc; i++) + { + proc.emplace_back(); + count_all_potok += proc[i].count_potok; + } + potok_max = count_all_potok; + } + bool Kvant_time() + { + kvant = 30; + count_all_potok = potok_max; + for (int i = 0; i < count_proc; i++) + { + for (int j = 0; j < proc[i].count_potok; j++) + { + if (proc[i].Worker[j].full()) + count_all_potok--; + } + } + if (count_all_potok == 0) + return 0; + count_kvant++; + double time = (double)kvant / (double)count_all_potok; + for (int i = 0; i < count_proc && kvant > 0; i++) + { + for (int j = 0; j < proc[i].count_potok && kvant > 0; j++) + { + time = (double)kvant / (double)count_all_potok; + if (proc[i].Worker[j].full()) + continue; + count_all_potok--; + double m = proc[i].Worker[j].add(time); + kvant -= m; + //cout << m << " "; + } + } + return 1; + } + void Paint() + { + cout << " :" << endl; + for (int i = 0; i < count_proc; i++) + { + cout << " " << i + 1 << endl << " :" << endl; + for (int j = 0; j < count_kvant; j++) + cout << j + 1<< "\t"; + endll; + for (int j = 0; j < proc[i].count_potok; j++) + { + cout << " " << j + 1 << endl; + for (int k = 0; k < proc[i].Worker[j].coords.size(); k++) + { + cout << proc[i].Worker[j].coords[k] << "\t"; + } + endll; + } + endll; + } + } +}; + +int main() +{ + srand(time(NULL)); + setlocale(LC_ALL, "Russian"); + cout.precision(3); + Laba l; + while (l.Kvant_time()) {} + l.Paint(); + + + return 0; +} \ No newline at end of file diff --git a/Rebotica/Program.cs b/Rebotica/Program.cs new file mode 100644 index 0000000..9ecfd4b --- /dev/null +++ b/Rebotica/Program.cs @@ -0,0 +1,7 @@ +using System.Text; + +Encoding.RegisterProvider(System.Text.CodePagesEncodingProvider.Instance); +var enc1251 = Encoding.GetEncoding(1251); + +System.Console.OutputEncoding = System.Text.Encoding.UTF8; +System.Console.InputEncoding = enc1251; diff --git a/Rebotica/Rebotica.csproj b/Rebotica/Rebotica.csproj new file mode 100644 index 0000000..74abf5c --- /dev/null +++ b/Rebotica/Rebotica.csproj @@ -0,0 +1,10 @@ + + + + Exe + net6.0 + enable + enable + + + diff --git a/Rebotica/Rebotica.sln b/Rebotica/Rebotica.sln new file mode 100644 index 0000000..33afe77 --- /dev/null +++ b/Rebotica/Rebotica.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.7.34009.444 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Rebotica", "Rebotica.csproj", "{FFF4D9B9-1D85-4691-BBC2-BB054222ED65}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {FFF4D9B9-1D85-4691-BBC2-BB054222ED65}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FFF4D9B9-1D85-4691-BBC2-BB054222ED65}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FFF4D9B9-1D85-4691-BBC2-BB054222ED65}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FFF4D9B9-1D85-4691-BBC2-BB054222ED65}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {83511A19-01FF-4CB7-9778-1361B46FCB7B} + EndGlobalSection +EndGlobal -- 2.25.1 From 22dca9874304df95cb41bb89f5a31b26c1a42f12 Mon Sep 17 00:00:00 2001 From: Sergey Kozyrev Date: Wed, 18 Oct 2023 12:28:36 +0400 Subject: [PATCH 2/3] NameUpdate --- Lab/CarsGenericStorage.cs | 2 +- Lab/CollectionsFrame.Designer.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Lab/CarsGenericStorage.cs b/Lab/CarsGenericStorage.cs index 28da04e..4ae6a5b 100644 --- a/Lab/CarsGenericStorage.cs +++ b/Lab/CarsGenericStorage.cs @@ -7,7 +7,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace Lab +namespace Lab.Generics { internal class CarsGenericStorage { diff --git a/Lab/CollectionsFrame.Designer.cs b/Lab/CollectionsFrame.Designer.cs index d92d9ca..5971286 100644 --- a/Lab/CollectionsFrame.Designer.cs +++ b/Lab/CollectionsFrame.Designer.cs @@ -181,7 +181,7 @@ Controls.Add(DrawTank); Controls.Add(panel1); Name = "CollectionsFrame"; - Text = "Form1"; + Text = "Гаражи бензовозов"; panel1.ResumeLayout(false); panel1.PerformLayout(); panel2.ResumeLayout(false); -- 2.25.1 From 9a203d7f80c4aedb936ccb7aa8c30ba168a5c3ee Mon Sep 17 00:00:00 2001 From: Sergey Kozyrev Date: Wed, 18 Oct 2023 12:30:13 +0400 Subject: [PATCH 3/3] DeleteObjects --- OS/First.cpp | 200 --------------------------------------- OS/OS.sln | 31 ------ OS/OS.vcxproj | 136 -------------------------- OS/OS.vcxproj.filters | 25 ----- OS/Second.cpp | 155 ------------------------------ Rebotica/Program.cs | 7 -- Rebotica/Rebotica.csproj | 10 -- Rebotica/Rebotica.sln | 25 ----- 8 files changed, 589 deletions(-) delete mode 100644 OS/First.cpp delete mode 100644 OS/OS.sln delete mode 100644 OS/OS.vcxproj delete mode 100644 OS/OS.vcxproj.filters delete mode 100644 OS/Second.cpp delete mode 100644 Rebotica/Program.cs delete mode 100644 Rebotica/Rebotica.csproj delete mode 100644 Rebotica/Rebotica.sln diff --git a/OS/First.cpp b/OS/First.cpp deleted file mode 100644 index 283ef3e..0000000 --- a/OS/First.cpp +++ /dev/null @@ -1,200 +0,0 @@ -#define _CRT_SECURE_NO_WARNINGS -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -using namespace std; -#define endl '\n' -#define endll cout << endl -#define LL_MAX 2223372036854775807 -typedef long long ll; - -template - -class Stack { -private: - struct Node - { - Node* back; - T value; - }; - Node* Head; -public: - Stack() - { - Head = nullptr; - } - - void Add(T component) - { - Node* bk = Head; - Head = new Node; - Head->back = bk; - Head->value = component; - } - - T Pop() - { - if (Head != nullptr) - { - Node* v = Head; - Head = Head->back; - T value = v->value; - delete(v); - return value; - } - } - - bool isEmpty() - { - if (Head == nullptr) - return true; - return false; - } -}; - - -struct Arg { -public: - string Name; - string Type; - string Value; - - Arg() {} - - Arg(string n, string t, string v) : Name(n), Type(t), Value(v) {} - - Arg(string n, string t) : Name(n), Type(t), Value("None") {} -}; - -class SysCall -{ -public: - int ID; - string Name; - vector Args; - - SysCall(int id, string name, vector args) : ID(id), Name(name), Args(args) {} - - string toString() - { - string otv = "ID: " + to_string(ID) + "\t Name: " + Name + "\n"; - for (Arg a : Args) - { - otv += "name: " + a.Name + "\t type: " + a.Type + "\t value: " + a.Value + "\n"; - } - return otv; - } -}; - -class Kernel -{ -private: - vector Calls; -public: - Kernel() - { - Calls = vector({ - SysCall(1, "A", vector({ - Arg("AB", "int") - })), - SysCall(2, "B", vector({ - Arg("AB", "int", "163"), - Arg("BA", "string", "145")})), - SysCall(3, "V", vector({ - Arg("BA", "string", "145"), - Arg("OT", "bool", "731"), - Arg("QA", "float", "921") - })), - SysCall(4, "ST", vector({ - Arg("A", "string", "45"), - Arg("O", "string", "71"), - Arg("Q", "double", "21") - })), - SysCall(5, "OP", vector({ - Arg("B", "string", "15"), - Arg("OGT", "bool", "731"), - Arg("QFA", "float", "921") - })) - }); - } - - void ShowAll() - { - for (SysCall c : Calls) - { - cout << c.toString() << "\n"; - } - } - - void Call(int id, Stack stack) - { - cout << " :" << endl; - for (auto it : Calls) - { - if (it.ID == id) - { - cout << " " << it.Name << endl; - for (auto arg : it.Args) - { - if (stack.isEmpty()) - { - cout << " ERROR" << endl; - return; - } - Arg a = stack.Pop(); - if (arg.Type != a.Type) - { - cout << " Error \t : " << it.Name << endl; return; - } - cout << ": " << a.Type << " : " << a.Value << endl; - } - cout << " " << endl; return; - } - } - cout << " ID Error" << endl; - return; - } -}; - -int main1() -{ - setlocale(LC_ALL, "Russian"); - - Kernel k; - - endll; - Stack S1; - S1.Add(Arg("AB", "int")); - k.Call(1, S1); - endll; - Stack S3; - S3.Add(Arg("QA", "float", "921")); - S3.Add(Arg("OT", "bool", "731")); - S3.Add(Arg("BA", "string", "145")); - k.Call(3, S3); - endll; - Stack S2; - S2.Add(Arg("QA", "float", "921")); - S2.Add(Arg("OT", "bool", "731")); - S2.Add(Arg("BA", "string", "145")); - k.Call(2, S2); - endll; - Stack S4; - k.Call(4, S4); - endll; - Stack S5; - k.Call(8, S5); - - return 0; -} \ No newline at end of file diff --git a/OS/OS.sln b/OS/OS.sln deleted file mode 100644 index 39febdf..0000000 --- a/OS/OS.sln +++ /dev/null @@ -1,31 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.7.34009.444 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OS", "OS.vcxproj", "{2396AFD1-ABAB-4058-8A95-1699DD32E088}" -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 - {2396AFD1-ABAB-4058-8A95-1699DD32E088}.Debug|x64.ActiveCfg = Debug|x64 - {2396AFD1-ABAB-4058-8A95-1699DD32E088}.Debug|x64.Build.0 = Debug|x64 - {2396AFD1-ABAB-4058-8A95-1699DD32E088}.Debug|x86.ActiveCfg = Debug|Win32 - {2396AFD1-ABAB-4058-8A95-1699DD32E088}.Debug|x86.Build.0 = Debug|Win32 - {2396AFD1-ABAB-4058-8A95-1699DD32E088}.Release|x64.ActiveCfg = Release|x64 - {2396AFD1-ABAB-4058-8A95-1699DD32E088}.Release|x64.Build.0 = Release|x64 - {2396AFD1-ABAB-4058-8A95-1699DD32E088}.Release|x86.ActiveCfg = Release|Win32 - {2396AFD1-ABAB-4058-8A95-1699DD32E088}.Release|x86.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {47E0F701-8EA9-4BEA-AADA-DF48244F5A0E} - EndGlobalSection -EndGlobal diff --git a/OS/OS.vcxproj b/OS/OS.vcxproj deleted file mode 100644 index eeaca07..0000000 --- a/OS/OS.vcxproj +++ /dev/null @@ -1,136 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - 17.0 - Win32Proj - {2396afd1-abab-4058-8a95-1699dd32e088} - OS - 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/OS/OS.vcxproj.filters b/OS/OS.vcxproj.filters deleted file mode 100644 index 420409a..0000000 --- a/OS/OS.vcxproj.filters +++ /dev/null @@ -1,25 +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/OS/Second.cpp b/OS/Second.cpp deleted file mode 100644 index 8a7d85d..0000000 --- a/OS/Second.cpp +++ /dev/null @@ -1,155 +0,0 @@ -#define _CRT_SECURE_NO_WARNINGS -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -using namespace std; -#define endl '\n' -#define endll cout << endl -#define LL_MAX 2223372036854775807 -typedef long long ll; - -int ALL_TIME = 100; - -struct Laba { -public: - struct potok - { - double need; - vector coords; - potok() - { - need = rand() % 20 + 1; - } - double add(double t) - { - if (t >= need) - { - coords.push_back(need); - int otv = need; - need = 0; - return otv; - } - else - { - coords.push_back(t); - need -= t; - return t; - } - } - bool full() - { - if (need == 0) - return true; - return false; - } - }; - struct process - { - public: - vector Worker; - int count_potok = 0; - process() - { - count_potok = rand() % 5 + 1; - for (int i = 0; i < count_potok; i++) - { - Worker.emplace_back(); - } - } - - }; - vector proc; - int count_proc; - int count_all_potok = 0; - int potok_max; - double kvant; - int timer = 0; - int count_kvant; - Laba() - { - count_kvant = 0; - count_proc = 5; - for (int i = 0; i < count_proc; i++) - { - proc.emplace_back(); - count_all_potok += proc[i].count_potok; - } - potok_max = count_all_potok; - } - bool Kvant_time() - { - kvant = 30; - count_all_potok = potok_max; - for (int i = 0; i < count_proc; i++) - { - for (int j = 0; j < proc[i].count_potok; j++) - { - if (proc[i].Worker[j].full()) - count_all_potok--; - } - } - if (count_all_potok == 0) - return 0; - count_kvant++; - double time = (double)kvant / (double)count_all_potok; - for (int i = 0; i < count_proc && kvant > 0; i++) - { - for (int j = 0; j < proc[i].count_potok && kvant > 0; j++) - { - time = (double)kvant / (double)count_all_potok; - if (proc[i].Worker[j].full()) - continue; - count_all_potok--; - double m = proc[i].Worker[j].add(time); - kvant -= m; - //cout << m << " "; - } - } - return 1; - } - void Paint() - { - cout << " :" << endl; - for (int i = 0; i < count_proc; i++) - { - cout << " " << i + 1 << endl << " :" << endl; - for (int j = 0; j < count_kvant; j++) - cout << j + 1<< "\t"; - endll; - for (int j = 0; j < proc[i].count_potok; j++) - { - cout << " " << j + 1 << endl; - for (int k = 0; k < proc[i].Worker[j].coords.size(); k++) - { - cout << proc[i].Worker[j].coords[k] << "\t"; - } - endll; - } - endll; - } - } -}; - -int main() -{ - srand(time(NULL)); - setlocale(LC_ALL, "Russian"); - cout.precision(3); - Laba l; - while (l.Kvant_time()) {} - l.Paint(); - - - return 0; -} \ No newline at end of file diff --git a/Rebotica/Program.cs b/Rebotica/Program.cs deleted file mode 100644 index 9ecfd4b..0000000 --- a/Rebotica/Program.cs +++ /dev/null @@ -1,7 +0,0 @@ -using System.Text; - -Encoding.RegisterProvider(System.Text.CodePagesEncodingProvider.Instance); -var enc1251 = Encoding.GetEncoding(1251); - -System.Console.OutputEncoding = System.Text.Encoding.UTF8; -System.Console.InputEncoding = enc1251; diff --git a/Rebotica/Rebotica.csproj b/Rebotica/Rebotica.csproj deleted file mode 100644 index 74abf5c..0000000 --- a/Rebotica/Rebotica.csproj +++ /dev/null @@ -1,10 +0,0 @@ - - - - Exe - net6.0 - enable - enable - - - diff --git a/Rebotica/Rebotica.sln b/Rebotica/Rebotica.sln deleted file mode 100644 index 33afe77..0000000 --- a/Rebotica/Rebotica.sln +++ /dev/null @@ -1,25 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.7.34009.444 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Rebotica", "Rebotica.csproj", "{FFF4D9B9-1D85-4691-BBC2-BB054222ED65}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {FFF4D9B9-1D85-4691-BBC2-BB054222ED65}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {FFF4D9B9-1D85-4691-BBC2-BB054222ED65}.Debug|Any CPU.Build.0 = Debug|Any CPU - {FFF4D9B9-1D85-4691-BBC2-BB054222ED65}.Release|Any CPU.ActiveCfg = Release|Any CPU - {FFF4D9B9-1D85-4691-BBC2-BB054222ED65}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {83511A19-01FF-4CB7-9778-1361B46FCB7B} - EndGlobalSection -EndGlobal -- 2.25.1