Skip to content

Instantly share code, notes, and snippets.

@Ralentar
Ralentar / WitcherPoker.cs
Last active March 28, 2025 20:29
Ведьмачий покер на кубиках (ведьмак 1, 2)
using System;
namespace Poker
{
internal class Program
{
static void Main(string[] args)
{
Player lutik = new Player("Lutik", 0, ConsoleColor.Cyan);
Player geralt = new Player("Geralt", 50, ConsoleColor.Red);
@Ralentar
Ralentar / PasswordGenerator.cs
Last active July 15, 2025 07:00
PasswordGenerator
using System;
using System.Collections.Generic;
using System.IO;
namespace PasswordGenerator
{
internal class Program
{
static void Main(string[] args)
{
@Ralentar
Ralentar / LinQ .cs
Last active July 15, 2025 06:59
LinQ
using System;
using System.Collections.Generic;
using System.Linq;
namespace Temp
{
internal class Program
{
static void Main(string[] args)
{
@Ralentar
Ralentar / Conversion.cs
Last active July 15, 2025 06:58
Преобразование типов
using System;
using System.Globalization;
namespace Temp
{
internal class Program
{
static void Main(string[] args)
{
int intAge;
@Ralentar
Ralentar / Enum.cs
Last active July 15, 2025 06:57
Enum
using System;
using System.Collections.Generic;
namespace Temp
{
internal class Program
{
static void Main(string[] args)
{
List<Entity> list = new List<Entity>
@Ralentar
Ralentar / Modifiers.cs
Last active July 15, 2025 06:56
Fields and Properties
using System;
namespace Temp
{
internal class Program
{
static void Main(string[] args)
{
Example example1 = new Example(5, 7, -5); // создать объект - экземпляр класса
@Ralentar
Ralentar / OOP.cs
Last active July 15, 2025 06:46
Инкапсуляция - пояснение
using System;
namespace Temp
{
internal class Program
{
// НАГЛЯДНОЕ ПОСОБИЕ ДЛЯ ПОЯСНЕНИЯ ИНКАПСУЛЯЦИИ
static void Main(string[] args)
{
@Ralentar
Ralentar / Is-a.cs
Last active July 15, 2025 06:51
Is-a Наследование
using System;
namespace Temp
{
class Program
{
static void Main(string[] args)
{
Knight figtherKnigth = new Knight(100, 10);
Barbarian figtherBarbarian = new Barbarian(120, 2, 7, 2);
@Ralentar
Ralentar / Has-a.cs
Last active July 15, 2025 06:48
Has-a Вложенность объектов
using System;
namespace Temp
{
class Program
{
static void Main(string[] args)
{
Performer worker1 = new Performer("Вася");
Performer worker2 = new Performer("Петя");
@Ralentar
Ralentar / Pacman.cs
Last active July 15, 2025 06:51
Pacman
using System;
using System.IO; // необходимо добавить компонент для работы с файлами
using System.Threading; // необходимо добавить компонент для организации многопоточности
namespace Temp
{
internal class Pacman
{
static void Main(string[] args)
{