Skip to content

Instantly share code, notes, and snippets.

@Hellhackee
Hellhackee / gist:86b536ca7f7eb943ae3af46e9b0a3563
Last active November 19, 2020 19:32
CS Light Lesson 1.1 (variables)
ushort coinsCount;
float currentTime;
string characterName;
bool isDead;
uint enemyDamage;
double cooldownBetweenAttacks;
int speed;
byte armor;
char enemyLabel;
short health;
@Hellhackee
Hellhackee / gist:df0af7108f4baccdef68f0a273c8b682
Last active November 19, 2020 23:38
CS Light Lesson 3.1 (captures)
int row = 3;
int count = 52;
int rowCount = count / row;
int remainingCaptures = count % row;
Console.WriteLine($"Будет выведено {rowCount} полностью заполненных рядов и останется {remainingCaptures} картинок сверх меры");
@Hellhackee
Hellhackee / gist:8754702f9f490c435224d77e2b05a6ff
Created November 19, 2020 20:09
CS Light Lesson 4.1(crystall's shop)
int goldCount;
int price = 12;
int crystallCount;
bool enoughGold;
Console.WriteLine("Доброго времени суток, путник, ты попал в лавку драгоценностей.");
Console.WriteLine($"Я готов предложить на продажу кристаллы по {price} золотых монет.");
Console.Write("Сколько золота у вас сейчас: ");
goldCount = Convert.ToInt32(Console.ReadLine());
Console.Write("Сколько кристаллов ты хочешь купить: ");
@Hellhackee
Hellhackee / gist:5ba1f13459fc55704e1e95b783d45c9f
Last active November 19, 2020 23:49
CS Light Lesson 5.1 (medical)
int peopleCount;
int timeForOnePerson = 10;
int waitingTime;
Console.WriteLine("Вы пришли в поликлинику.");
Console.Write("Сколько перед вами человек: ");
peopleCount = Convert.ToInt32(Console.ReadLine());
waitingTime = peopleCount * timeForOnePerson;
int hours = waitingTime / 60;
@Hellhackee
Hellhackee / gist:ca1df5862e6a303881caff5f26f2e03f
Created November 19, 2020 20:40
CS Light Lesson 6.1 (string)
int age;
string name;
string post;
int yearsWorked;
int pay;
Console.WriteLine("Добрый день, я хотел бы задать вам несколько вопросов.");
Console.Write("Как Вас зовут: ");
name = Console.ReadLine();
Console.Write("Сколько Вам лет: ");
@Hellhackee
Hellhackee / gist:7de45d230578fec41b40ab7e84ea49eb
Created November 21, 2020 19:56
CS Light Lesson 7.1 (cycles)
string message;
int messageCount = 5;
Console.Write("Введите сообщение: ");
message = Console.ReadLine();
for (int i = 0; i < messageCount; i++)
Console.WriteLine(message);
@Hellhackee
Hellhackee / gist:4fa94e0fc622f1a028a9f78279db6e9b
Created November 21, 2020 20:03
CS Light Lesson 8.1 (stop cycle)
string endMessage = "exit";
string inputMessage = "";
while (endMessage != inputMessage)
{
Console.Write("Введите 'стоп-слово': ");
inputMessage = Console.ReadLine();
}
@Hellhackee
Hellhackee / gist:d4fbf8803a616a1e311215647eb21105
Created November 21, 2020 20:06
CS Light Lesson 8.2 (stop cycles)
string endMessage = "exit";
string inputMessage = "";
while (true)
{
Console.Write("Введите 'стоп-слово': ");
inputMessage = Console.ReadLine();
if (inputMessage == endMessage)
{
break;
@Hellhackee
Hellhackee / gist:0ee59a8ea2b97fc0b7fca3898223430c
Created November 21, 2020 21:29
CS Light Lesson 9.1 (converter)
float rub = 100;
float usd = 12;
float eur = 20;
int rubToUsd = 60;
float rubToEur = 90;
float UsdToEur = 1.2f;
string valuesToTransfer;
float countToChange;
bool isMoneyEnought = true;
char continueValue;
@Hellhackee
Hellhackee / gist:2c6c8ef3e9cf596b76483d8e36f98089
Created November 21, 2020 22:41
CS Light Lesson 10.1 (commands)
string name = "";
int yearOfBirth = 0;
string password = "";
string chosenHobby = "Отсутвуют";
string chosenParameter;
bool closeSite = false;
Console.WriteLine("Добро пожаловать на наш форум.");
while (!closeSite)
{