Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.IO;
- using System.Threading;
- namespace ConsoleApp63
- {
- class Program
- {
- public static void Main(string[] args)
- {
- Console.CursorVisible = false;
- Console.BackgroundColor = ConsoleColor.White;
- Console.ForegroundColor = ConsoleColor.Black;
- char[,] monitor1;
- sozdaniemonitor(out monitor1, "monitor.txt");
- Console.WindowWidth = 70;
- int width = Console.WindowWidth;
- int height = Console.WindowHeight;
- Console.SetCursorPosition(0, 0);
- for (int i = 0; i < height; i++)
- {
- for (int j = 0; j < width; j++)
- {
- Console.Write(" ");
- }
- Console.WriteLine();
- }
- Console.SetCursorPosition(width / 2 - 20, 10);
- Console.Write("Добрый вечер. Это симулятор работы на заводе. ");
- Console.SetCursorPosition(width / 2 - 20, 12);
- Console.Write("При проблеме с какой-либо системой экран");
- Console.SetCursorPosition(width / 2 - 20, 13);
- Console.Write("загорится красным");
- Console.SetCursorPosition(width / 2 - 20, 15);
- Console.Write("Требуется решить проблему клавишами B, R,K,D,T,F");
- Console.SetCursorPosition(width / 2 - 20, 17);
- Console.Write("Нажмите Enter для продолжения");
- Console.SetCursorPosition(0, 0);
- Console.ReadLine();
- Console.Clear();
- Console.SetCursorPosition(width / 2 - 20, 10);
- Console.Write("Клавиша B(Beton) заполняет бетон.");
- Console.SetCursorPosition(width / 2 - 20, 11);
- Console.Write("Если будет ошибка то загорится экран 1");
- Console.SetCursorPosition(width / 2 - 20, 13);
- Console.Write("R (Reset) сбрасывает ошибку у погрузчика");
- Console.SetCursorPosition(width / 2 - 20, 14);
- Console.Write("Соответственно, экран 2 покажет ошибку");
- Console.SetCursorPosition(0, 0);
- Console.ReadLine();
- Console.Clear();
- Console.SetCursorPosition(width / 2 - 20, 10);
- Console.Write("K(kick) пиздануть по компьютеру. ");
- Console.SetCursorPosition(width / 2 - 20, 11);
- Console.Write("Вы не поверите, но это помогает.");
- Console.SetCursorPosition(width / 2 - 20, 12);
- Console.Write("Экран 3 покажет это");
- Console.SetCursorPosition(0, 0);
- Console.ReadLine();
- Console.Clear();
- Console.SetCursorPosition(width / 2 - 20, 10);
- Console.Write("D(del) убрать брак на конвейере");
- Console.SetCursorPosition(width / 2 - 20, 11);
- Console.Write("Экран 4 скажет об этой проблеме");
- Console.SetCursorPosition(width / 2 - 20, 13);
- Console.Write("T(transp) поможет убрать выпавшую плитку");
- Console.SetCursorPosition(width / 2 - 20, 14);
- Console.Write("Экран 5 расскажет об этом");
- Console.SetCursorPosition(0, 0);
- Console.ReadLine();
- Console.Clear();
- Console.SetCursorPosition(width / 2 - 20, 10);
- Console.Write("F(Fill) заполнит пленкой автомат");
- Console.SetCursorPosition(width / 2 - 20, 11);
- Console.Write("Экран 6 демонстрирует эту ошибку");
- Console.SetCursorPosition(width / 2 - 20, 13);
- Console.Write("Если вы что-то забыли, нажав на Enter");
- Console.SetCursorPosition(width / 2 - 20, 14);
- Console.Write("вам скажут за что ответственна эта система");
- Console.SetCursorPosition(width / 2 - 20, 16);
- Console.Write("Чтобы отладить систему курсором не надо выделять");
- Console.SetCursorPosition(width / 2 - 20, 18);
- Console.Write("Просто нажмите на клавишу");
- Console.SetCursorPosition(0, 0);
- Console.ReadLine();
- Console.Clear();
- Console.SetCursorPosition(width / 2 - 20, 10);
- Console.Write("Трата на проблему больше 20 минут приведет к -премии");
- Console.SetCursorPosition(width / 2 - 20, 13);
- Console.Write("Решение ошибок, даже в холостую");
- Console.SetCursorPosition(width / 2 - 20, 14);
- Console.Write("+5 минут ко времени бездействия");
- Console.SetCursorPosition(width / 2 - 20, 16);
- Console.Write("Если вы готовы то нажмите Enter");
- Console.SetCursorPosition(width / 2 - 20, 18);
- Console.Write("И ваш 12 часовой рабочий день начнется");
- Console.SetCursorPosition(0, 0);
- Console.ReadLine();
- Console.Clear();
- Console.SetCursorPosition(0, 0);
- Console.BackgroundColor = ConsoleColor.Blue;
- for (int i = 0; i < height; i++)
- {
- for (int j = 0; j < width; j++)
- {
- Console.Write(" ");
- }
- Console.WriteLine();
- }
- Console.ForegroundColor = ConsoleColor.White;
- Console.SetCursorPosition(width / 2 - 20, 10);
- Console.Write("Welcome!");
- Thread.Sleep(225);
- Console.SetCursorPosition(width / 2 - 20, 13);
- Console.Write("Doistori4eskaya");
- Thread.Sleep(225);
- Console.SetCursorPosition(width / 2 - 20, 14);
- Console.Write("Obaldennaya system загружена");
- Thread.Sleep(225);
- Console.SetCursorPosition(width / 2 - 20, 16);
- Console.Write("Версия 0.0000021с");
- Thread.Sleep(225);
- Console.SetCursorPosition(width / 2 - 20, 18);
- Console.Write("Удачи вам, и не заебись, и не ебимы будете)");
- Thread.Sleep(5000);
- Console.ForegroundColor = ConsoleColor.Black;
- Console.BackgroundColor = ConsoleColor.White;
- Console.SetCursorPosition(0, 0);
- for (int i = 0; i < height; i++)
- {
- for (int j = 0; j < width; j++)
- {
- Console.Write(" ");
- }
- Console.WriteLine();
- }
- Thread.Sleep(500);
- Console.SetCursorPosition(width / 2 - 30, 10);
- for (int i = 0; i < 30; i++)
- {
- Console.Write("-");
- Thread.Sleep(25);
- Console.Write("\b \b");
- Console.Write("=");
- Thread.Sleep(25);
- Console.Write("\b \b");
- Console.Write("#");
- }
- Console.Write(" ..100% 1 Система работает");
- Thread.Sleep(225);
- Console.SetCursorPosition(width / 2 - 30, 11);
- for (int i = 0; i < 30; i++)
- {
- Console.Write("-");
- Thread.Sleep(25);
- Console.Write("\b \b");
- Console.Write("=");
- Thread.Sleep(25);
- Console.Write("\b \b");
- Console.Write("#");
- }
- Console.Write(" ..100% 2 Система работает");
- Thread.Sleep(225);
- Console.SetCursorPosition(width / 2 - 30, 12);
- for (int i = 0; i < 24; i++)
- {
- Console.Write("-");
- Thread.Sleep(25);
- Console.Write("\b \b");
- Console.Write("=");
- Thread.Sleep(25);
- Console.Write("\b \b");
- Console.Write("#");
- }
- Console.Write(" ..80% Система не загрузилась");
- Console.SetCursorPosition(width / 2 - 30, 13);
- Console.Write(" Пизданите по компьютеру");
- Console.ReadLine();
- Thread.Sleep(225);
- Console.SetCursorPosition(width / 2 - 6, 12);
- Console.Write(" ");
- Console.SetCursorPosition(width / 2 - 30, 13);
- Console.Write(" ");
- Console.SetCursorPosition(width / 2 - 6, 12);
- for (int i = 24; i < 30; i++)
- {
- Console.Write("-");
- Thread.Sleep(25);
- Console.Write("\b \b");
- Console.Write("=");
- Thread.Sleep(25);
- Console.Write("\b \b");
- Console.Write("#");
- }
- Console.Write(" ..100% 3 Система работает");
- Thread.Sleep(225);
- Console.SetCursorPosition(width / 2 - 30, 13);
- for (int i = 0; i < 30; i++)
- {
- Console.Write("-");
- Thread.Sleep(25);
- Console.Write("\b \b");
- Console.Write("=");
- Thread.Sleep(25);
- Console.Write("\b \b");
- Console.Write("#");
- }
- Console.Write(" ..100% 4 Система работает");
- Thread.Sleep(225);
- Console.SetCursorPosition(width / 2 - 30, 14);
- for (int i = 0; i < 30; i++)
- {
- Console.Write("-");
- Thread.Sleep(25);
- Console.Write("\b \b");
- Console.Write("=");
- Thread.Sleep(25);
- Console.Write("\b \b");
- Console.Write("#");
- }
- Console.Write(" ..100% 5 Система работает");
- Thread.Sleep(225);
- Console.SetCursorPosition(width / 2 - 30, 15);
- for (int i = 0; i < 30; i++)
- {
- Console.Write("-");
- Thread.Sleep(25);
- Console.Write("\b \b");
- Console.Write("=");
- Thread.Sleep(25);
- Console.Write("\b \b");
- Console.Write("#");
- }
- Console.Write(" ..100% 6 Система работает");
- Console.SetCursorPosition(width / 2 - 30, 17);
- Console.Write(" Все заработало. Нажмите enter чтобы продолжить");
- Console.ReadLine();
- Console.Clear();
- Console.SetCursorPosition(0, 0);
- int nap = 2;
- int end = 0;
- int miganie1 = 0; //мигание 1-6
- int miganie2 = 0;
- int miganie3 = 0;
- int miganie4 = 0;
- int miganie5 = 0;
- int miganie6 = 0;
- int problem = 0; //если есть проблема чтобы другие не возникали
- int trigProb = 0;// триггер счет минут
- int minProb = 0; // минут сколько было проблем
- int hours = 9;// начало рабочего дня
- int second = 0;
- int counProb = 0;// считает количество проблем
- int prev = 0;
- int trigvuv = 0;
- Random rnd1 = new Random();//шанс гавна
- Random rnd2 = new Random(); //выбор проблемы
- ConsoleKeyInfo Key;
- for (int i = 0; i < 22; i++)
- {
- Console.SetCursorPosition(1 + i, 4);
- Console.ForegroundColor = ConsoleColor.Yellow;
- Console.Write('#');
- Console.SetCursorPosition(1 + i, 8);
- Console.Write('#');
- Console.ForegroundColor = ConsoleColor.Black;
- }
- for (int i = 0; i < 5; i++)
- {
- Console.SetCursorPosition(1, 4 + i);
- Console.ForegroundColor = ConsoleColor.Yellow;
- Console.Write('#');
- Console.SetCursorPosition(22, 4 + i);
- Console.Write('#');
- Console.ForegroundColor = ConsoleColor.Black;
- }
- while (end < 2)
- {
- if (trigvuv == 0)//триггер вывода первых экранов
- {
- Console.SetCursorPosition(8, 3);
- Console.WriteLine("Экран 1");
- Console.WriteLine();
- for (int i = 0; i < monitor1.GetLength(0); i++)
- {
- for (int j = 0; j < monitor1.GetLength(1); j++)
- {
- Console.SetCursorPosition(1 + j, 4 + i);
- if (monitor1[i, j] == '~')
- {
- Console.ForegroundColor = ConsoleColor.Blue;
- Console.Write(monitor1[i, j]);
- Console.ForegroundColor = ConsoleColor.Black;
- }
- else
- {
- Console.Write(monitor1[i, j]);
- }
- }
- }
- Console.SetCursorPosition(23, 5);
- Console.Write("=");
- Console.SetCursorPosition(23, 6);
- Console.Write("=");
- Console.SetCursorPosition(22, 0);
- Console.SetCursorPosition(8 + 23, 3);
- Console.WriteLine("Экран 2");
- for (int i = 0; i < monitor1.GetLength(0); i++)
- {
- for (int j = 0; j < monitor1.GetLength(1); j++)
- {
- Console.SetCursorPosition(24 + j, 4 + i);
- if (monitor1[i, j] == '~')
- {
- Console.ForegroundColor = ConsoleColor.Blue;
- Console.Write(monitor1[i, j]);
- Console.ForegroundColor = ConsoleColor.Black;
- }
- else
- {
- Console.Write(monitor1[i, j]);
- }
- }
- }
- Console.SetCursorPosition(46, 5);
- Console.Write("=");
- Console.SetCursorPosition(46, 6);
- Console.Write("=");
- Console.SetCursorPosition(22, 0);
- Console.SetCursorPosition(8 + 23 + 23, 3);
- Console.WriteLine("Экран 3");
- for (int i = 0; i < monitor1.GetLength(0); i++)
- {
- for (int j = 0; j < monitor1.GetLength(1); j++)
- {
- Console.SetCursorPosition(47 + j, 4 + i);
- if (monitor1[i, j] == '~')
- {
- Console.ForegroundColor = ConsoleColor.Blue;
- Console.Write(monitor1[i, j]);
- Console.ForegroundColor = ConsoleColor.Black;
- }
- else
- {
- Console.Write(monitor1[i, j]);
- }
- }
- }
- Console.SetCursorPosition(8, 10);
- Console.WriteLine("Экран 4");
- for (int i = 0; i < monitor1.GetLength(0); i++)
- {
- for (int j = 0; j < monitor1.GetLength(1); j++)
- {
- Console.SetCursorPosition(1 + j, 11 + i);
- if (monitor1[i, j] == '~')
- {
- Console.ForegroundColor = ConsoleColor.Blue;
- Console.Write(monitor1[i, j]);
- Console.ForegroundColor = ConsoleColor.Black;
- }
- else
- {
- Console.Write(monitor1[i, j]);
- }
- }
- }
- Console.SetCursorPosition(8 + 23, 10);
- Console.WriteLine("Экран 5");
- for (int i = 0; i < monitor1.GetLength(0); i++)
- {
- for (int j = 0; j < monitor1.GetLength(1); j++)
- {
- Console.SetCursorPosition(24 + j, 11 + i);
- if (monitor1[i, j] == '~')
- {
- Console.ForegroundColor = ConsoleColor.Blue;
- Console.Write(monitor1[i, j]);
- Console.ForegroundColor = ConsoleColor.Black;
- }
- else
- {
- Console.Write(monitor1[i, j]);
- }
- }
- }
- Console.SetCursorPosition(8 + 23 + 23, 10);
- Console.WriteLine("Экран 6");
- for (int i = 0; i < monitor1.GetLength(0); i++)
- {
- for (int j = 0; j < monitor1.GetLength(1); j++)
- {
- Console.SetCursorPosition(47 + j, 11 + i);
- if (monitor1[i, j] == '~')
- {
- Console.ForegroundColor = ConsoleColor.Blue;
- Console.Write(monitor1[i, j]);
- Console.ForegroundColor = ConsoleColor.Black;
- }
- else
- {
- Console.Write(monitor1[i, j]);
- }
- }
- }
- trigvuv = 1;
- }
- Vudelenie(ref nap, monitor1, ref prev, 1);
- if (rnd1.Next(100) < 10 && problem == 0)// шанс проблемы и проблема не должна быть
- {
- int vubor = rnd2.Next(5); //рандом 2
- if (problem == 0)
- {
- switch (vubor)
- {
- case 0: //первый экран
- miganie1 = 1;
- problem = 1;
- counProb++;
- trigProb = 1;
- break;
- case 1:// второй экран
- miganie2 = 1;
- problem = 1;
- counProb++;
- trigProb = 1;
- break;
- case 2:// третий экран
- miganie3 = 1;
- problem = 1;
- counProb++;
- trigProb = 1;
- break;
- case 3://четвертый экран
- miganie4 = 1;
- problem = 1;
- counProb++;
- trigProb = 1;
- break;
- case 4://пятый
- miganie5 = 1;
- problem = 1;
- counProb++;
- trigProb = 1;
- break;
- case 5://шестой
- miganie6 = 1;
- problem = 1;
- counProb++;
- trigProb = 1;
- break;
- }
- }
- }
- if (miganie1 == 1 && problem == 1)
- {
- for (int i = 1; i < monitor1.GetLength(0) - 1; i++)
- {
- for (int j = 1; j < monitor1.GetLength(1) - 1; j++)
- {
- Console.SetCursorPosition(1 + j, 4 + i);
- Console.ForegroundColor = ConsoleColor.Red;
- Console.BackgroundColor = ConsoleColor.Red;
- Console.Write(monitor1[i, j]);
- Console.ForegroundColor = ConsoleColor.Black;
- Console.BackgroundColor = ConsoleColor.White;
- }
- }
- Console.Beep(699, 150);
- Thread.Sleep(10);
- }
- if (miganie2 == 1 && problem == 1)
- {
- for (int i = 1; i < monitor1.GetLength(0) - 1; i++)
- {
- for (int j = 1; j < monitor1.GetLength(1) - 1; j++)
- {
- Console.SetCursorPosition(24 + j, 4 + i);
- Console.ForegroundColor = ConsoleColor.Red;
- Console.BackgroundColor = ConsoleColor.Red;
- Console.Write(monitor1[i, j]);
- Console.ForegroundColor = ConsoleColor.Black;
- Console.BackgroundColor = ConsoleColor.White;
- }
- }
- Console.Beep(699, 150);
- Thread.Sleep(10);
- }
- if (miganie3 == 1 && problem == 1)
- {
- for (int i = 1; i < monitor1.GetLength(0) - 1; i++)
- {
- for (int j = 1; j < monitor1.GetLength(1) - 1; j++)
- {
- Console.SetCursorPosition(47 + j, 4 + i);
- Console.ForegroundColor = ConsoleColor.Red;
- Console.BackgroundColor = ConsoleColor.Red;
- Console.Write(monitor1[i, j]);
- Console.ForegroundColor = ConsoleColor.Black;
- Console.BackgroundColor = ConsoleColor.White;
- }
- }
- Console.Beep(699, 150);
- Thread.Sleep(10);
- }
- if (miganie4 == 1 && problem == 1)
- {
- for (int i = 1; i < monitor1.GetLength(0) - 1; i++)
- {
- for (int j = 1; j < monitor1.GetLength(1) - 1; j++)
- {
- Console.SetCursorPosition(1 + j, 11 + i);
- Console.ForegroundColor = ConsoleColor.Red;
- Console.BackgroundColor = ConsoleColor.Red;
- Console.Write(monitor1[i, j]);
- Console.ForegroundColor = ConsoleColor.Black;
- Console.BackgroundColor = ConsoleColor.White;
- }
- }
- Console.Beep(699, 150);
- Thread.Sleep(10);
- }
- if (miganie5 == 1 && problem == 1)
- {
- for (int i = 1; i < monitor1.GetLength(0) - 1; i++)
- {
- for (int j = 1; j < monitor1.GetLength(1) - 1; j++)
- {
- Console.SetCursorPosition(24 + j, 11 + i);
- Console.ForegroundColor = ConsoleColor.Red;
- Console.BackgroundColor = ConsoleColor.Red;
- Console.Write(monitor1[i, j]);
- Console.ForegroundColor = ConsoleColor.Black;
- Console.BackgroundColor = ConsoleColor.White;
- }
- }
- Console.Beep(699, 150);
- Thread.Sleep(10);
- }
- if (miganie6 == 1 && problem == 1)
- {
- for (int i = 1; i < monitor1.GetLength(0) - 1; i++)
- {
- for (int j = 1; j < monitor1.GetLength(1) - 1; j++)
- {
- Console.SetCursorPosition(47 + j, 11 + i);
- Console.ForegroundColor = ConsoleColor.Red;
- Console.BackgroundColor = ConsoleColor.Red;
- Console.Write(monitor1[i, j]);
- Console.ForegroundColor = ConsoleColor.Black;
- Console.BackgroundColor = ConsoleColor.White;
- }
- }
- Console.Beep(699, 150);
- Thread.Sleep(10);
- }
- if (Console.KeyAvailable)
- {
- Key = Console.ReadKey(true);
- prev = nap;
- switch (Key.Key)
- {
- case ConsoleKey.LeftArrow:
- nap--;
- if (nap == 1)
- nap = 2;
- if (nap == 9)
- nap = 10;
- break;
- case ConsoleKey.RightArrow:
- nap++;
- if (nap == 5)
- {
- nap = 4;
- }
- if (nap == 13)
- {
- nap = 12;
- }
- break;
- case ConsoleKey.UpArrow:
- nap -= 8;
- if (nap == -6)
- nap = 2;
- if (nap == -5)
- nap = 3;
- if (nap == -4)
- nap = 4;
- break;
- case ConsoleKey.DownArrow:
- nap += 8;
- if (nap == 18)
- nap = 10;
- if (nap == 19)
- nap = 11;
- if (nap == 20)
- nap = 12;
- break;
- case ConsoleKey.B:
- Console.Clear();
- minProb += 5;
- second += 5;
- if (miganie1 == 0)
- {
- Console.SetCursorPosition(width / 2 - 15, 10);
- trigvuv = 0;
- Console.WriteLine("Полный бак бетона");
- Console.ReadLine();
- Console.Clear();
- }
- if (miganie1 == 1)
- {
- Console.SetCursorPosition(width / 2 - 15, 10);
- Console.WriteLine("Бетонама заполнили нащальника");
- trigvuv = 0;
- miganie1 = 0;
- trigProb = 0;
- problem = 0;
- Console.ReadLine();
- Console.Clear();
- }
- break;
- case ConsoleKey.R:
- Console.Clear();
- minProb += 5;
- second += 5;
- if (miganie2 == 0)
- {
- Console.SetCursorPosition(width / 2 - 18, 10);
- trigvuv = 0;
- Console.WriteLine("Нечего сбрасывать. Погрузчик работает нормально");
- Console.ReadLine();
- Console.Clear();
- }
- if (miganie2 == 1)
- {
- Console.SetCursorPosition(width / 2 - 15, 10);
- Console.WriteLine("Сброс ошибки прошел успешно");
- Thread.Sleep(300);
- Console.SetCursorPosition(width / 2 - 15, 11);
- Console.WriteLine("Всё заработало");
- trigvuv = 0;
- miganie2 = 0;
- trigProb = 0;
- problem = 0;
- Console.ReadLine();
- Console.Clear();
- }
- break;
- case ConsoleKey.K:
- minProb += 5;
- second += 5;
- Console.Clear();
- if (miganie3 == 0)
- {
- Console.SetCursorPosition(width / 2 - 15, 10);
- trigvuv = 0;
- Console.WriteLine("Зачем пинать и так работающий механизм?");
- Console.ReadLine();
- Console.Clear();
- }
- if (miganie3 == 1)
- {
- Console.SetCursorPosition(width / 2 - 15, 10);
- Console.WriteLine("ХДЫЩ!");
- Thread.Sleep(300);
- Console.SetCursorPosition(width / 2 - 15, 11);
- Console.WriteLine("Всё заработало");
- trigvuv = 0;
- miganie3 = 0;
- trigProb = 0;
- problem = 0;
- Console.ReadLine();
- Console.Clear();
- }
- break;
- case ConsoleKey.D:
- minProb += 5;
- second += 5;
- Console.Clear();
- if (miganie4 == 0)
- {
- Console.SetCursorPosition(width / 2 - 15, 10);
- trigvuv = 0;
- Console.WriteLine("Зачем приостанавливать если нет брака?");
- Console.ReadLine();
- Console.Clear();
- }
- if (miganie4 == 1)
- {
- Console.SetCursorPosition(width / 2 - 15, 10);
- Console.WriteLine("Брак сняли");
- Thread.Sleep(300);
- Console.SetCursorPosition(width / 2 - 15, 11);
- Console.WriteLine("Всё заработало");
- trigvuv = 0;
- miganie4 = 0;
- trigProb = 0;
- problem = 0;
- Console.ReadLine();
- Console.Clear();
- }
- break;
- case ConsoleKey.T:
- minProb += 5;
- second += 5;
- Console.Clear();
- if (miganie5 == 0)
- {
- Console.SetCursorPosition(width / 2 - 10, 10);
- trigvuv = 0;
- Console.WriteLine("Датчики не видят помех");
- Console.ReadLine();
- Console.Clear();
- }
- if (miganie5 == 1)
- {
- Console.SetCursorPosition(width / 2 - 15, 10);
- Console.WriteLine("Убрали упавшую плитку");
- Thread.Sleep(300);
- Console.SetCursorPosition(width / 2 - 15, 11);
- Console.WriteLine("Датчики не видят помех");
- trigvuv = 0;
- miganie5 = 0;
- trigProb = 0;
- problem = 0;
- Console.ReadLine();
- Console.Clear();
- }
- break;
- case ConsoleKey.F:
- minProb += 5;
- second += 5;
- Console.Clear();
- if (miganie6 == 0)
- {
- Console.SetCursorPosition(width / 2 - 10, 10);
- trigvuv = 0;
- Console.WriteLine("Обмотки полно");
- Console.ReadLine();
- Console.Clear();
- }
- if (miganie6 == 1)
- {
- Console.SetCursorPosition(width / 2 - 15, 10);
- Console.WriteLine("Заправили обмотку");
- Thread.Sleep(300);
- Console.SetCursorPosition(width / 2 - 15, 11);
- Console.WriteLine("Все выполнено");
- trigvuv = 0;
- miganie6 = 0;
- trigProb = 0;
- problem = 0;
- Console.ReadLine();
- Console.Clear();
- }
- break;
- case ConsoleKey.Enter:
- Console.Clear();
- if (nap == 2 && miganie1 == 1)
- {
- Console.SetCursorPosition(width / 2 - 15, 10);
- Console.Write("Закочнился бетон. Заполните его");
- Console.ReadLine();
- trigvuv = 0;
- Console.Clear();
- }
- if (nap == 2 && miganie1 == 0)
- {
- Console.SetCursorPosition(width / 2 - 15, 10);
- Console.Write("Система работает в норме");
- Console.ReadLine();
- Console.Clear();
- trigvuv = 0;
- }
- if (nap == 3 && miganie2 == 1)
- {
- Console.SetCursorPosition(width / 2 - 15, 10);
- Console.Write("Ошибка погрузчика. Сбросьте её");
- Console.ReadLine();
- trigvuv = 0;
- Console.Clear();
- }
- if (nap == 3 && miganie2 == 0)
- {
- Console.SetCursorPosition(width / 2 - 15, 10);
- Console.Write("Система работает в норме");
- Console.ReadLine();
- Console.Clear();
- trigvuv = 0;
- }
- if (nap == 4 && miganie3 == 1)
- {
- Console.SetCursorPosition(width / 2 - 15, 10);
- Console.Write("Хз что, ебаните ногой по компу");
- Console.ReadLine();
- trigvuv = 0;
- Console.Clear();
- }
- if (nap == 4 && miganie3 == 0)
- {
- Console.SetCursorPosition(width / 2 - 15, 10);
- Console.Write("Система работает в норме");
- Console.ReadLine();
- Console.Clear();
- trigvuv = 0;
- }
- if (nap == 10 && miganie4 == 1)
- {
- Console.SetCursorPosition(width / 2 - 15, 10);
- Console.Write("Нашелся брак. Снимите его");
- Console.ReadLine();
- trigvuv = 0;
- Console.Clear();
- }
- if (nap == 10 && miganie4 == 0)
- {
- Console.SetCursorPosition(width / 2 - 15, 10);
- Console.Write("Система работает в норме");
- Console.ReadLine();
- Console.Clear();
- trigvuv = 0;
- }
- if (nap == 11 && miganie5 == 1)
- {
- Console.SetCursorPosition(width / 2 - 12, 10);
- Console.Write("Упала плитка. Она мешает датчикам, уберите её");
- Console.ReadLine();
- trigvuv = 0;
- Console.Clear();
- }
- if (nap == 11 && miganie5 == 0)
- {
- Console.SetCursorPosition(width / 2 - 15, 10);
- Console.Write("Закончилась обмотка. Пополните её");
- Console.ReadLine();
- Console.Clear();
- trigvuv = 0;
- }
- if (nap == 12 && miganie6 == 1)
- {
- Console.SetCursorPosition(width / 2 - 15, 10);
- Console.Write("Нашелся брак. Снимите его");
- Console.ReadLine();
- trigvuv = 0;
- Console.Clear();
- }
- if (nap == 12 && miganie6 == 0)
- {
- Console.SetCursorPosition(width / 2 - 15, 10);
- Console.Write("Система работает в норме");
- Console.ReadLine();
- Console.Clear();
- trigvuv = 0;
- }
- break;
- }
- }
- Vudelenie(ref nap, monitor1, ref prev,0);
- Console.SetCursorPosition(25, 0);
- if (second == 60)
- {
- second = 0;
- hours++;
- }
- if (second > 60)
- {
- second -= 60;
- hours++;
- }
- if (second < 10)
- Console.Write("Время: " + hours + ":0" + second);
- if (second > 9)
- Console.Write("Время: " + hours + ":" + second);
- Console.SetCursorPosition(15, 1);
- Console.Write("Проблем: " + counProb + " Время без работы: " + minProb);
- second += 2;
- if (trigProb == 1)
- {
- minProb += 2;
- }
- Console.SetCursorPosition(1, 18);
- Console.Write("B(заполнить бетон),R((сбросить ошибку),K((пиздануть)");
- Console.SetCursorPosition(1, 20);
- Console.Write("D(удалить брак), T(убрать плитку),F(Заполнить обмотку)");
- Thread.Sleep(500);
- if (hours == 21)
- end = 7;
- }
- Console.Clear();
- int ka4 = 0;
- ka4 = minProb / counProb;
- if (ka4 > 19)
- {
- Console.SetCursorPosition(width / 2 - 15, 10);
- Console.WriteLine("Долго решал проблемы. Минус премия!");
- }
- if (ka4 < 20)
- {
- Console.SetCursorPosition(width / 2 - 15, 10);
- Console.Write("Молодец, будет двойная премия за этот день");
- }
- //сообщение об работе
- }
- static void Vudelenie(ref int nap, char[,] mon, ref int prev,int nt)
- {
- if (nap != prev)
- {
- switch (prev)
- {
- case 2:
- for (int i = 0; i < mon.GetLength(0); i++)
- {
- for (int j = 0; j < mon.GetLength(1); j++)
- {
- Console.SetCursorPosition(1 + j, 4 + i);
- if (mon[i, j] == '#')
- {
- Console.ForegroundColor = ConsoleColor.Black;
- Console.Write(mon[i, j]);
- }
- }
- }
- break;
- case 3:
- for (int i = 0; i < mon.GetLength(0); i++)
- {
- for (int j = 0; j < mon.GetLength(1); j++)
- {
- Console.SetCursorPosition(24 + j, 4 + i);
- if (mon[i, j] == '#')
- {
- Console.ForegroundColor = ConsoleColor.Black;
- Console.Write(mon[i, j]);
- Console.ForegroundColor = ConsoleColor.Black;
- }
- }
- }
- break;
- case 4:
- for (int i = 0; i < mon.GetLength(0); i++)
- {
- for (int j = 0; j < mon.GetLength(1); j++)
- {
- Console.SetCursorPosition(47 + j, 4 + i);
- if (mon[i, j] == '#')
- {
- Console.ForegroundColor = ConsoleColor.Black;
- Console.Write(mon[i, j]);
- Console.ForegroundColor = ConsoleColor.Black;
- }
- }
- }
- break;
- case 10:
- for (int i = 0; i < mon.GetLength(0); i++)
- {
- for (int j = 0; j < mon.GetLength(1); j++)
- {
- Console.SetCursorPosition(1 + j, 11 + i);
- if (mon[i, j] == '#')
- {
- Console.ForegroundColor = ConsoleColor.Black;
- Console.Write(mon[i, j]);
- Console.ForegroundColor = ConsoleColor.Black;
- }
- }
- }
- break;
- case 11:
- for (int i = 0; i < mon.GetLength(0); i++)
- {
- for (int j = 0; j < mon.GetLength(1); j++)
- {
- Console.SetCursorPosition(24 + j, 11 + i);
- if (mon[i, j] == '#')
- {
- Console.ForegroundColor = ConsoleColor.Black;
- Console.Write(mon[i, j]);
- Console.ForegroundColor = ConsoleColor.Black;
- }
- }
- }
- break;
- case 12:
- for (int i = 0; i < mon.GetLength(0); i++)
- {
- for (int j = 0; j < mon.GetLength(1); j++)
- {
- Console.SetCursorPosition(47 + j, 11 + i);
- if (mon[i, j] == '#')
- {
- Console.ForegroundColor = ConsoleColor.Black;
- Console.Write(mon[i, j]);
- Console.ForegroundColor = ConsoleColor.Black;
- }
- }
- }
- break;
- }
- switch (nap)
- {
- case 2:
- for (int i = 0; i < 22; i++)
- {
- Console.SetCursorPosition(1 + i, 4);
- Console.ForegroundColor = ConsoleColor.Yellow;
- Console.Write('#');
- Console.SetCursorPosition(1 + i, 8);
- Console.Write('#');
- Console.ForegroundColor = ConsoleColor.Black;
- }
- for (int i = 0; i < 5; i++)
- {
- Console.SetCursorPosition(1, 4 + i);
- Console.ForegroundColor = ConsoleColor.Yellow;
- Console.Write('#');
- Console.SetCursorPosition(22, 4 + i);
- Console.Write('#');
- Console.ForegroundColor = ConsoleColor.Black;
- }
- break;
- case 3:
- for (int i = 0; i < mon.GetLength(0); i++)
- {
- for (int j = 0; j < mon.GetLength(1); j++)
- {
- Console.SetCursorPosition(24 + j, 4 + i);
- if (mon[i, j] == '#')
- {
- Console.ForegroundColor = ConsoleColor.Yellow;
- Console.Write(mon[i, j]);
- Console.ForegroundColor = ConsoleColor.Black;
- }
- }
- }
- break;
- case 4:
- for (int i = 0; i < mon.GetLength(0); i++)
- {
- for (int j = 0; j < mon.GetLength(1); j++)
- {
- Console.SetCursorPosition(47 + j, 4 + i);
- if (mon[i, j] == '#')
- {
- Console.ForegroundColor = ConsoleColor.Yellow;
- Console.Write(mon[i, j]);
- Console.ForegroundColor = ConsoleColor.Black;
- }
- }
- }
- break;
- case 10:
- for (int i = 0; i < mon.GetLength(0); i++)
- {
- for (int j = 0; j < mon.GetLength(1); j++)
- {
- Console.SetCursorPosition(1 + j, 11 + i);
- if (mon[i, j] == '#')
- {
- Console.ForegroundColor = ConsoleColor.Yellow;
- Console.Write(mon[i, j]);
- Console.ForegroundColor = ConsoleColor.Black;
- }
- }
- }
- break;
- case 11:
- for (int i = 0; i < mon.GetLength(0); i++)
- {
- for (int j = 0; j < mon.GetLength(1); j++)
- {
- Console.SetCursorPosition(24 + j, 11 + i);
- if (mon[i, j] == '#')
- {
- Console.ForegroundColor = ConsoleColor.Yellow;
- Console.Write(mon[i, j]);
- Console.ForegroundColor = ConsoleColor.Black;
- }
- }
- }
- break;
- case 12:
- for (int i = 0; i < mon.GetLength(0); i++)
- {
- for (int j = 0; j < mon.GetLength(1); j++)
- {
- Console.SetCursorPosition(47 + j, 11 + i);
- if (mon[i, j] == '#')
- {
- Console.ForegroundColor = ConsoleColor.Yellow;
- Console.Write(mon[i, j]);
- Console.ForegroundColor = ConsoleColor.Black;
- }
- }
- }
- break;
- }
- }
- if (nt==1)
- {
- switch (nap)
- {
- case 2:
- for (int i = 0; i < 22; i++)
- {
- Console.SetCursorPosition(1 + i, 4);
- Console.ForegroundColor = ConsoleColor.Yellow;
- Console.Write('#');
- Console.SetCursorPosition(1 + i, 8);
- Console.Write('#');
- Console.ForegroundColor = ConsoleColor.Black;
- }
- for (int i = 0; i < 5; i++)
- {
- Console.SetCursorPosition(1, 4 + i);
- Console.ForegroundColor = ConsoleColor.Yellow;
- Console.Write('#');
- Console.SetCursorPosition(22, 4 + i);
- Console.Write('#');
- Console.ForegroundColor = ConsoleColor.Black;
- }
- break;
- case 3:
- for (int i = 0; i < mon.GetLength(0); i++)
- {
- for (int j = 0; j < mon.GetLength(1); j++)
- {
- Console.SetCursorPosition(24 + j, 4 + i);
- if (mon[i, j] == '#')
- {
- Console.ForegroundColor = ConsoleColor.Yellow;
- Console.Write(mon[i, j]);
- Console.ForegroundColor = ConsoleColor.Black;
- }
- }
- }
- break;
- case 4:
- for (int i = 0; i < mon.GetLength(0); i++)
- {
- for (int j = 0; j < mon.GetLength(1); j++)
- {
- Console.SetCursorPosition(47 + j, 4 + i);
- if (mon[i, j] == '#')
- {
- Console.ForegroundColor = ConsoleColor.Yellow;
- Console.Write(mon[i, j]);
- Console.ForegroundColor = ConsoleColor.Black;
- }
- }
- }
- break;
- case 10:
- for (int i = 0; i < mon.GetLength(0); i++)
- {
- for (int j = 0; j < mon.GetLength(1); j++)
- {
- Console.SetCursorPosition(1 + j, 11 + i);
- if (mon[i, j] == '#')
- {
- Console.ForegroundColor = ConsoleColor.Yellow;
- Console.Write(mon[i, j]);
- Console.ForegroundColor = ConsoleColor.Black;
- }
- }
- }
- break;
- case 11:
- for (int i = 0; i < mon.GetLength(0); i++)
- {
- for (int j = 0; j < mon.GetLength(1); j++)
- {
- Console.SetCursorPosition(24 + j, 11 + i);
- if (mon[i, j] == '#')
- {
- Console.ForegroundColor = ConsoleColor.Yellow;
- Console.Write(mon[i, j]);
- Console.ForegroundColor = ConsoleColor.Black;
- }
- }
- }
- break;
- case 12:
- for (int i = 0; i < mon.GetLength(0); i++)
- {
- for (int j = 0; j < mon.GetLength(1); j++)
- {
- Console.SetCursorPosition(47 + j, 11 + i);
- if (mon[i, j] == '#')
- {
- Console.ForegroundColor = ConsoleColor.Yellow;
- Console.Write(mon[i, j]);
- Console.ForegroundColor = ConsoleColor.Black;
- }
- }
- }
- break;
- }
- }
- }
- static void vuvodmonitor(ref char[,] monitor1)
- {
- Console.SetCursorPosition(8, 3);
- Console.WriteLine("Экран 1");
- Console.WriteLine();
- for (int i = 0; i < monitor1.GetLength(0); i++)
- {
- for (int j = 0; j < monitor1.GetLength(1); j++)
- {
- Console.SetCursorPosition(1 + j, 4 + i);
- Console.Write(monitor1[i, j]);
- }
- }
- Console.SetCursorPosition(23, 5);
- Console.Write("=");
- Console.SetCursorPosition(23, 6);
- Console.Write("=");
- Console.SetCursorPosition(22, 0);
- Console.SetCursorPosition(8 + 23, 3);
- Console.WriteLine("Экран 2");
- for (int i = 0; i < monitor1.GetLength(0); i++)
- {
- for (int j = 0; j < monitor1.GetLength(1); j++)
- {
- Console.SetCursorPosition(24 + j, 4 + i);
- if (monitor1[i, j] == '~')
- {
- Console.ForegroundColor = ConsoleColor.Blue;
- Console.Write(monitor1[i, j]);
- Console.ForegroundColor = ConsoleColor.Black;
- }
- else
- {
- Console.Write(monitor1[i, j]);
- }
- }
- }
- Console.SetCursorPosition(46, 5);
- Console.Write("=");
- Console.SetCursorPosition(46, 6);
- Console.Write("=");
- Console.SetCursorPosition(22, 0);
- Console.SetCursorPosition(8 + 23 + 23, 3);
- Console.WriteLine("Экран 3");
- for (int i = 0; i < monitor1.GetLength(0); i++)
- {
- for (int j = 0; j < monitor1.GetLength(1); j++)
- {
- Console.SetCursorPosition(47 + j, 4 + i);
- Console.Write(monitor1[i, j]);
- }
- }
- Console.SetCursorPosition(8, 10);
- Console.WriteLine("Экран 4");
- for (int i = 0; i < monitor1.GetLength(0); i++)
- {
- for (int j = 0; j < monitor1.GetLength(1); j++)
- {
- Console.SetCursorPosition(1 + j, 11 + i);
- Console.Write(monitor1[i, j]);
- }
- }
- Console.SetCursorPosition(8 + 23, 10);
- Console.WriteLine("Экран 5");
- for (int i = 0; i < monitor1.GetLength(0); i++)
- {
- for (int j = 0; j < monitor1.GetLength(1); j++)
- {
- Console.SetCursorPosition(24 + j, 11 + i);
- Console.Write(monitor1[i, j]);
- }
- }
- Console.SetCursorPosition(8 + 23 + 23, 10);
- Console.WriteLine("Экран 6");
- for (int i = 0; i < monitor1.GetLength(0); i++)
- {
- for (int j = 0; j < monitor1.GetLength(1); j++)
- {
- Console.SetCursorPosition(47 + j, 11 + i);
- Console.Write(monitor1[i, j]);
- }
- }
- }
- static void sozdaniemonitor(out char[,] mon, string sre)
- {
- string[] NewFile = File.ReadAllLines(sre);
- mon = new char[NewFile.Length, NewFile[1].Length];
- for (int i = 0; i < mon.GetLength(0); i++)
- {
- for (int j = 0; j < mon.GetLength(1); j++)
- {
- mon[i, j] = NewFile[i][j];
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement