Skip to content

Instantly share code, notes, and snippets.

View Strelok78's full-sized avatar

Shota Strelok78

  • Saint-Petersburg, Russia
View GitHub Profile
@Strelok78
Strelok78 / CarService
Last active July 20, 2023 16:33
The car's breakdown is immediately clear. The breakdown is repaired by replacing the part, but the number of parts is limited. If there is no part in stock, then you can refuse the customer and pay a fine, but if you replace the wrong part, you will have to compensate for the damage and spend the part.
internal class Program
{
public static void Main()
{
int clientsCount = 10;
Queue<Client> queue = new Queue<Client>();
AutoService autoService;
for (int i = 0; i < clientsCount; i++)
queue.Enqueue(new Client());
@Strelok78
Strelok78 / Zoo
Last active May 17, 2023 07:59
The user chooses which enclosure to approach. When approaching an aviary, the user is shown information about what kind of aviary it is, how many animals live there, their gender and what sound the animal makes.
internal class Program
{
public static void Main()
{
const int CommandExit = 0;
Zoo zoo = new Zoo();
int number;
bool isWalking = true;
while (isWalking)
@Strelok78
Strelok78 / Aquarium
Last active May 17, 2023 07:58
There is an aquarium in which fish swim. There can be a maximum of a certain number of fish in this aquarium. Fish can be added to the aquarium or fish can be taken out of the aquarium. All the fish are displayed in a list, the fish also have an age. For 1 iteration, fish age by a certain number of lives and can die.
internal class Program
{
public static void Main()
{
User user = new User();
while (user.IsManaging)
{
user.ManageAquarium();
}
@Strelok78
Strelok78 / Two Squad Fight
Last active May 17, 2023 07:56
Program simulates the battle of two squads.
internal class Program
{
public static void Main()
{
Battlefield battlefield = new();
battlefield.EnterGame();
}
}
class Battlefield
@Strelok78
Strelok78 / SuperMarket
Last active May 17, 2023 07:55
The cashier program in the supermarket.
internal class Program
{
public static void Main()
{
SuperMarket superMarket = new SuperMarket();
superMarket.AddCustomer();
superMarket.PaymentProcess();
}
}
@Strelok78
Strelok78 / Coliseum
Last active May 17, 2023 07:54
Choose 2 fighters and they fight each other to death
internal class Program
{
public static void Main()
{
UserInterface userInterface = new();
userInterface.MainMenu();
}
}
class UserInterface
@Strelok78
Strelok78 / Train planer
Last active May 17, 2023 07:52
The program helps the user to make a train plan. In the upper part of the program, full information about the current flight or its absence is displayed.
internal class Program
{
public static void Main()
{
Terminal userInterface = new Terminal();
userInterface.ShowMainMenu();
}
class Train
@Strelok78
Strelok78 / Shop
Last active May 17, 2023 07:51
There is a seller, he has a list of goods, and if necessary, he can show it to you, also the seller can sell you the goods. After the sale, the goods are transferred to you, and you can also look at your things.
internal class Program
{
public static void Main()
{
Player player1 = new Player("Mr. KickAss", 300);
Vendor vendor1 = new Vendor("Chichi", 500);
Shop tradeMenu = new Shop(player1, vendor1);
tradeMenu.ShowMainMenu();
}
@Strelok78
Strelok78 / Book repository
Last active May 17, 2023 07:50
Each book has a title, author and year of release. You can add a book to the repository, remove a book, show all books and show books by the specified parameter.
internal class Program
{
public static void Main()
{
User user = new User();
user.ShowMenu();
}
}
class Book
@Strelok78
Strelok78 / Card deck
Last active May 17, 2023 07:49
There is a deck with cards. The player takes out the cards until he decides that he has enough cards. After that, all information about the drawn cards is displayed.
internal class Program
{
public static void Main()
{
Player player = new Player();
player.ShowMenu();
}
}