Skip to content

Instantly share code, notes, and snippets.

@Hellhackee
Hellhackee / gist:3210fa0512cbfec2ed984329600558c6
Last active December 2, 2020 20:25
CS Light Lesson 29.1 (draw player)
class Program
{
static void Main(string[] args)
{
Player player = new Player(10, 10);
Draw drawer = new Draw();
player.SetIcon('&');
drawer.DrawPlayer(player.X, player.Y, player.Icon);
}
@Hellhackee
Hellhackee / gist:954439e80f9fd54b831d11319e63a419
Created December 1, 2020 21:44
CS Light Lesson 28.1 (class player)
class Program
{
static void Main(string[] args)
{
Player player1 = new Player("Тестировщик", 20, 100, 1000);
Player player2 = new Player("Топ донатер", 14, 999, 999999);
player1.ShowInfo();
player2.ShowInfo();
}
@Hellhackee
Hellhackee / gist:786973f689d78a9c8f8d082eb50252c3
Created November 30, 2020 23:57
CS Light Lesson 27.1 (dossier)
static void Main(string[] args)
{
Dictionary<string, string> dossiers = new Dictionary<string, string>();
string input;
string inputName;
string inputPost;
bool isExit = false;
while (!isExit)
{
@Hellhackee
Hellhackee / gist:84c6ae2ad78682cda8bb9a8d5560f95e
Created November 30, 2020 23:39
CS Light Lesson 26.1 (sum list)
static void Main(string[] args)
{
List<int> numbers = new List<int>();
int sum = 0;
string inputValue;
int inputNumber;
bool isOpen = true;
Console.WriteLine("Программа осуществляет суммирование данных");
Console.WriteLine("Для ввода доступны целые числа, а также команды sum " +
@Hellhackee
Hellhackee / gist:d0cefa1cee99f0bf2ff6afbd9dafa6de
Last active December 2, 2020 20:15
CS Light Lesson 25.1 (shop)
static void Main(string[] args)
{
Queue<int> buyersList = new Queue<int>();
int sum = 0;
buyersList.Enqueue(18);
buyersList.Enqueue(213);
buyersList.Enqueue(108);
buyersList.Enqueue(65);
buyersList.Enqueue(34);
@Hellhackee
Hellhackee / gist:f8165f4cd680533e16319c91998412ec
Created November 30, 2020 23:11
CS Light Lesson 24.1 (translator)
static void Main(string[] args)
{
Dictionary<string, string> translator = new Dictionary<string, string>();
string input;
translator.Add("Птица", "Bird");
translator.Add("Рыба", "Fish");
translator.Add("Рептилия", "Reptile");
translator.Add("Бактерия", "Bacterium");
translator.Add("Хищник", "Predator");
@Hellhackee
Hellhackee / gist:b0d4293fc5533ab5264d453ab24a83bf
Last active December 2, 2020 21:35
CS Light Lesson 22.1 (move map)
static void Main(string[] args)
{
bool isFinish = false;
int valueChangeX;
int valueChangeY;
int userX = 4;
int userY = 4;
char[,] map =
{
{'#','#','#','#','#','#','#','#','#','#','#','#','#'},
@Hellhackee
Hellhackee / gist:21bb76e795e96aae8f944319d478ad5d
Last active November 29, 2020 14:40
CS Light Lesson 19.1 (post-name array)
static void Main(string[] args)
{
string[] names = new string[0];
string[] posts = new string[0];
string input;
string inputValue;
bool isExit = false;
int indexToDelete;
int foundIndex;
@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;
@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);