Skip to content

Instantly share code, notes, and snippets.

string name;
char symbolForBox;
int stringLength;
string stringToOutput="";
Console.Write("Введите ваше имя: ");
name = Console.ReadLine();
Console.Write("Введите символ: ");
symbolForBox = Convert.ToChar(Console.ReadLine());
@Hellhackee
Hellhackee / gist:176adde45bdc16f7d200070f1b8b2a3c
Last active November 23, 2020 07:57
CS Light Lesson 13.1 (secret password)
string password = "1245";
string inputPassword;
bool passwordFound = false;
int tryCount = 3;
Console.WriteLine("Вы пытаетесь получить доступ к данным Зоны 51: ");
for (int i=0; i<tryCount; i++)
{
Console.Write("Введите пароль: ");
inputPassword = Console.ReadLine();
@Hellhackee
Hellhackee / gist:eb0303e1ed22d1e87124b4895ad2e7bb
Last active November 24, 2020 20:42
CS Light Lesson 14.1 (Boss fight)
float heroHealth = 500;
int skillsCount = 3;
int chosenSkill;
int burnedTurnsCount = 0;
int burningCounts = 2;
int burningDamage = 5;
int fireballDamage = 80;
int bloodStrikeDamage = 90;
float damageDone = 0;
float selfDamageDone = 0;
@Hellhackee
Hellhackee / gist:ccfe682cc2c63181e166bc7f8af7efc4
Last active November 25, 2020 07:05
CS Light Lesson 15.1 (array)
int[,] array = new int[4, 5];
int sum = 0;
int multiplication = 1;
Random random = new Random();
int minRandomValue = 2;
int maxRandomValue = 8;
for (int i = 0; i < array.GetLength(0); i++)
{
for (int j = 0; j < array.GetLength(1); j++)
@Hellhackee
Hellhackee / gist:4fe8a47fdd6cd29ed14b7018f3394dbb
Created November 24, 2020 22:03
CS Light Lesson 16.1 (max value of array)
int[,] array = new int[10, 10];
Random random = new Random();
int maxElement = int.MinValue;
int currentValue = int.MinValue;
int maxValuePositionI = 0;
int maxValuePositionJ = 0;
int minRandomValue = 1;
int maxRandomValue = 10;
Console.WriteLine("Исходная матрица: ");
@Hellhackee
Hellhackee / gist:0f180c1cbe85c7729325280e54f10ac0
Last active November 25, 2020 21:30
CS Light Lesson 17 (local max)
int[] array = new int[30];
string localMax = "";
Random random = new Random();
int minRandomValue = 0;
int maxRandomValue = 10;
for (int i = 0; i < array.Length; i++)
{
array[i] = random.Next(minRandomValue, maxRandomValue);
Console.Write(array[i] + " ");
@Hellhackee
Hellhackee / gist:9e68b4a5cfe74b9b7fa0fc2d73c07473
Last active November 25, 2020 06:45
CS Light Lesson 18.1 (input array from keyboard)
int[] array = new int[0];
int sum = 0;
string inputValue;
bool isOpen = true;
Console.WriteLine("Программа осуществляет суммирование данных");
Console.WriteLine("Для ввода доступны целые числа, а также команды sum " +
"- для вывода суммы всех введенных значений и exit - для завершения работы");
while (isOpen)
@Hellhackee
Hellhackee / gist:0bfe4a26098ef9346d486fcbe6fd76bc
Last active November 28, 2020 19:41
CS Light Lesson 20.1 (bar)
static void Main(string[] args)
{
int positionX = 0;
int PositionY = 0;
int currentValue = 40;
int maxValue = 100;
char symbol = '#';
char emptySymbol = '_';
DrawBar(positionX, PositionY, currentValue, maxValue, emptySymbol, symbol, ConsoleColor.Red);
@Hellhackee
Hellhackee / gist:1adb7fb7e865ad6bcd843f292cf24e5a
Last active November 29, 2020 14:56
CS Light Lesson 23.1 (shuffle)
static void Main(string[] args)
{
int[] array = new int[10];
Random random = new Random();
for (int i = 0; i < array.Length; i++)
array[i] = random.Next(0, 10);
WriteArray(array);
Shuffle(array);
@Hellhackee
Hellhackee / gist:02af5fc109044fbccc6152317d93c5d7
Last active December 2, 2020 20:00
CS Light Lesson 21.1 (Readint)
static void Main(string[] args)
{
Console.WriteLine("Успех. Введено число " + ReadInt());
}
static int ReadInt()
{
int foundInt = 0;
bool intFound = false;
string input;