Skip to content

Instantly share code, notes, and snippets.

@jacket0
jacket0 / OCP.cs
Last active March 10, 2026 16:16 — forked from HolyMonkey/OCP.cs
namespace IMJunior
{
class Program
{
static void Main(string[] args)
{
var systems = new Dictionary<string, IPaymentFactory>
{
{ "QIWI", new QIWIPaymentFactory() },
{ "WebMoney", new WebMoneyPaymentFactory() },
public class Player
{
public Player(string name, int age, IWeapon weapon, IMovement movement)
{
if (string.IsNullOrWhiteSpace(name))
throw new ArgumentException(nameof(name));
if (age <= 0)
throw new ArgumentException(nameof(age));
namespace Lesson
{
class Program
{
static void Main(string[] args)
{
var first = new Pathfinder(new FileLogWritter());
var second = new Pathfinder(new ConsoleLogWritter());
var third = new Pathfinder(new SecureLogger(new FileLogWritter(), DayOfWeek.Friday));
@jacket0
jacket0 / Store.cs
Last active February 6, 2026 16:15 — forked from HolyMonkey/Store.cs
namespace ConsoleApp1
{
internal class Program
{
static void Main(string[] args)
{
Product iPhone12 = new Product("IPhone 12");
Product iPhone11 = new Product("IPhone 11");
@jacket0
jacket0 / Weapon.cs
Last active February 2, 2026 09:02 — forked from HolyMonkey/Weapon.cs
using System;
namespace Weapon
{
public class Weapon
{
public int Damage { get; private set; }
public int Bullets { get; private set; }
public Weapon(int damage, int bullets)
@jacket0
jacket0 / 42
Last active July 8, 2024 10:16
using System;
using System.Collections.Generic;
namespace MyTask
{
class Program
{
static void Main(string[] args)
{
const int NextCarCommand = 1;
@jacket0
jacket0 / 41
Last active July 8, 2024 10:17
using System;
using System.Collections.Generic;
namespace MyTask
{
enum GenderEnum
{
Male,
Female
}
@jacket0
jacket0 / 38
Last active July 8, 2024 10:17
3
using System;
using System.Collections.Generic;
namespace MyTask
{
class Program
{
static void Main(string[] args)
{
const int AddClientCommand = 1;
@jacket0
jacket0 / w4
Last active July 8, 2024 10:14
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace MyTask
{
class Program
{
@jacket0
jacket0 / w3
Last active July 8, 2024 10:15
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace MyTask
{
class Program
{