Skip to content

Instantly share code, notes, and snippets.

@tolik-fish
tolik-fish / Store.cs
Created February 27, 2025 03:48
ДЗ: Интернет магазин
using System;
using System.Collections.Generic;
namespace ConsoleApp1
{
class Program
{
static void Main(string[] args)
{
Good iPhone12 = new Good("IPhone 12");
@tolik-fish
tolik-fish / Weapon.cs
Last active February 21, 2025 20:37
ДЗ: Оружие
public class Weapon
{
private readonly int _damage;
private int _bullets;
public Weapon(int damage, int bullets)
{
if (damage <= 0)
throw new ArgumentOutOfRangeException(nameof(damage), "Отрицательное или равное нулю значение урона");
@tolik-fish
tolik-fish / GunShooting.cs
Last active February 16, 2025 11:23
ДЗ: Гений Code Style
using System.Collections;
using UnityEngine;
public class Shooter : MonoBehaviour
{
[SerializeField] private float _speed;
[SerializeField] private float _delay;
[SerializeField] private Bullet _prefab;
private Transform _target;
@tolik-fish
tolik-fish / CubeBehavior
Last active January 20, 2025 13:23
Взрывы кубов
using UnityEngine;
public class CubeBehavior : MonoBehaviour
{
private float _explosionForce = 10f;
private float _upExplosionForce = 10f;
private float _scaleNumber = 0.5f;
private float _maxDivisionChance = 1f;
private float _multiplierNextChance = 0.5f;
private int _currentDivisionCount = 0;
@tolik-fish
tolik-fish / Timer
Last active January 20, 2025 09:35
Счетчик
using System;
using System.Collections;
using UnityEngine;
public class Timer : MonoBehaviour
{
private int _buttonNumber = 0;
private float _delay = 0.5f;
private bool _isCounterIncreasing = false;
private Coroutine _coroutine;
@tolik-fish
tolik-fish / IncreasingSize
Last active January 16, 2025 15:14
Трансформации
using UnityEngine;
public class IncreasingSize : MonoBehaviour
{
[SerializeField] private Vector3 _scaleDirection;
private void Update()
{
transform.localScale += _scaleDirection * Time.deltaTime;
}
@tolik-fish
tolik-fish / gist:a85adc4ea7c2c9da9d810888e8d69138
Last active December 14, 2024 10:02
ДЗ: Перевод бойцов
using System;
using System.Collections.Generic;
using System.Linq;
namespace DZ_Transfer_of_fighters
{
internal class Program
{
static void Main(string[] args)
{
@tolik-fish
tolik-fish / gist:61e25e95327fa3397deae623fe58d90f
Created December 13, 2024 20:35
ДЗ: Отчёт о вооружении
using System;
using System.Collections.Generic;
using System.Linq;
using System.Xml.Linq;
namespace DZ_Weapons_Report
{
internal class Program
{
static void Main(string[] args)
@tolik-fish
tolik-fish / gist:2dd5a004d65ac94e8fea227070612379
Last active December 13, 2024 19:53
ДЗ: Определение просрочки
using System;
using System.Collections.Generic;
using System.Linq;
namespace DZ_Definition_of_delay
{
internal class Program
{
static void Main(string[] args)
{
@tolik-fish
tolik-fish / gist:101a48db8dbb6f316c0c5b6f255863b8
Last active December 13, 2024 17:14
ДЗ: Топ игроков сервера
using System;
using System.Collections.Generic;
using System.Linq;
namespace DZ_Top_Server_Players
{
internal class Program
{
static void Main(string[] args)
{