Skip to content

Instantly share code, notes, and snippets.

@121jigowatts
Created March 16, 2017 05:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 121jigowatts/596374bb140ffa3a401721354e61e878 to your computer and use it in GitHub Desktop.
Save 121jigowatts/596374bb140ffa3a401721354e61e878 to your computer and use it in GitHub Desktop.
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
Copy link
Author

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

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