
It looks like you're new here. If you want to get involved, click one of these buttons!
This is what I did but it is stopping when one of the numbers roll 6
this is from https://www.youtube.com/watch?v=9ozOSKCiO0I&list=PLPV2KyIb3jR4CtEelGPsmPzlvP7ISPYzR&index=5
of brackeys
Here is the code ⤵️
PLEASE HELP ME
using System;
namespace my_programmC
{
class Program
{
static void Main(string[] args)
{
Random numberGen = new Random();
int roll = 0;
int rolL1 = 0;
int attempts = 0;
Console.WriteLine("Press Enter to roll the dice.");
while(roll != 6 && rolL1 != 6) {
Console.ReadKey();
roll = numberGen.Next(1, 7);
rolL1 = numberGen.Next(1, 7);
Console.WriteLine("You rolled " + roll + " and " + rolL1);
attempts++;
}
Console.WriteLine("It took you " + attempts + " attempts to roll a six.");
// this is for not to close before clicking
Console.ReadKey();
}
}
}
Can somebody help, please