Skip to content

Instantly share code, notes, and snippets.

View RPVUnityDeveloper's full-sized avatar

RPV RPVUnityDeveloper

View GitHub Profile
class Program
{
static void Main()
{
int minValue = 0;
int maxValue = 100;
int currentPower = 2;
Random rand = new Random();
int number = rand.Next(minValue, maxValue);
@RPVUnityDeveloper
RPVUnityDeveloper / gist:d4006ae1d2c1d8a6c2ea2564fedb5f43
Last active November 2, 2025 09:01
Кратные числа
class Program
{
static void Main()
{
int minRandomNumber = 10;
int maxRandomNumber = 25;
int rangeStart = 50;
int rangeEnd = 150;
Random random = new Random();
@RPVUnityDeveloper
RPVUnityDeveloper / gist:26faf79f3b6708584e2ac00c31139be9
Created November 2, 2025 07:46
Программа под паролем
class Program
{
static void Main()
{
string correctPassword = "12345";
int attempts = 3;
for (int i = 1; i <= attempts; i++)
{
class Program
{
static void Main()
{
Console.Write("Введите символ рамки: ");
char borderChar = Console.ReadKey().KeyChar;
Console.WriteLine();
Console.Write("Введите имя: ");
string name = Console.ReadLine();
@RPVUnityDeveloper
RPVUnityDeveloper / gist:65869a8a2205c4e3f2d76c57e549c47b
Created November 1, 2025 19:33
Конвертер валют
class Program
{
static void Main()
{
const string CommandGoldToCrystal = "1";
const string CommandCrystalToGold = "2";
const string CommandGoldToDiamond = "3";
const string CommandDiamondToGold = "4";
const string CommandCrystalToDiamond = "5";
const string CommandDiamondToCrystal = "6";
@RPVUnityDeveloper
RPVUnityDeveloper / gist:dffe213fc65406fe5806a5b433d463e7
Created November 1, 2025 11:14
Консольное меню
public class Class
{
static void Main()
{
const string CommandFirstText = "1";
const string CommandSecondText = "2";
const string CommandRandomNumber = "3";
const string CommandClearConsole = "4";
const string CommandExit = "0";
public class Class
{
static void Main()
{
Random random = new Random();
int minValue = -100;
int maxValue = 100;
int multipleX = 3;
int multipleY = 5;
int number = random.Next(minValue, maxValue);
@RPVUnityDeveloper
RPVUnityDeveloper / gist:86513cc4945e8be77148bddc57fab6b3
Last active November 1, 2025 11:15
Последовательность
public class Class
{
static void Main()
{
int number = 5;
int step = 7;
int maxNumber = 789;
for (int i = number; i <= maxNumber; i += step)
{
@RPVUnityDeveloper
RPVUnityDeveloper / gist:90eadfb7f9dadf8d5a19f526e27b8180
Created November 1, 2025 09:47
Контроль выхода
public class Class
{
static void Main()
{
string wordExit = "exit";
string word = "";
while (word != wordExit)
{
Console.Write("Введите слово: ");
@RPVUnityDeveloper
RPVUnityDeveloper / gist:f255e02f4437eecf9233dfc383f49247
Last active November 1, 2025 10:12
Освоение циклов
public class Class
{
static void Main()
{
string name;
int count;
Console.Write("Как вас зовут: ");
name = Console.ReadLine();