Create a gist now

Instantly share code, notes, and snippets.

Choose your life
using System;
namespace choice
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Enter option 1.");
var option1 = Console.ReadLine();
Console.WriteLine("Enter option 2.");
var option2 = Console.ReadLine();
Console.WriteLine("Press any key!");
Console.ReadKey(true);
var random = new System.Random();
var result = random.Next(2);
if (result == 0)
{
Console.WriteLine($"{option1}!");
}
else
{
Console.WriteLine($"{option2}!");
}
Console.ReadKey(true);
}
}
}
@121jigowatts
Owner

2択で迷ったときはプログラムで解決

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment