Random Pair Game
//Heres a few tips before you copy and paste:
//Press enter to roll the dice(the other keys work too but its better to use enter for visual reasons)
//Press cntrl and A to copy everything
//I use My_Awesome_Program as namespace so check Brackeys on YouTube and watch th 1st c# tutorial
//if you want this to work.Else,you will have to make changes in the namespace.
//Give credit in case of video (GostGK)
//You are free to make changes to the code as long as the credit writeline is there
//HERES THE CODE:
//-----------------------------------------------------
using System;
namespace My_Awesome_Program
{
class Program
{
static void Main(string[] args)
{
Console.WindowHeight = 50;
Console.ForegroundColor = ConsoleColor.Cyan;
Console.Title = "Random Pair Game";
Random numberGen = new Random();
int roll01 = 0;
int roll02 = 1;
int attemts = 0;
Console.WriteLine("Made By GostGK!Check GostGK: Instagram @gostgkyt TikTok: @fortnitelegitgiveaways kgiotakos@gmail.com ");
Console.WriteLine("Press enter to roll the die!");
while (roll01 != roll02)
{
Console.ReadKey();
roll01 = numberGen.Next(1,7);
Console.WriteLine("Your first die rolled " + roll01);
roll02 = numberGen.Next(1,7);
Console.WriteLine("Your second die rolled " + roll02 + "\n");
attemts++;
}
Console.WriteLine("It took you " + attemts + " attemts to roll the sma pair!");
Console.WriteLine("\nMade By GostGK!Check GostGK: Instagram @gostgkyt TikTok: @fortnitelegitgiveaways kgiotakos@gmail.com ");
Console.ReadKey();
}
}
}
Σχόλια
Δημοσίευση σχολίου