logo

Crowdly

Mitu korda visatakse täringud? Random rnd = new Random (); int cpu...

✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.

Mitu korda visatakse täringud?

Random rnd = new Random();

int cpuRnd, userRnd;

int cpuScore = 0;

int userScore = 0;

for(int i = 0; i < 3; i++)

{

    cpuRnd = rnd.Next(1, 7);

    userRnd = rnd.Next(1, 7);

    if (cpuRnd > userRnd)

    {

        cpuScore++;

    }

    else if (cpuRnd < userRnd)

    {

        userScore++;

    }

    else

    {

        continue; //programm lihtsalt jätkab oma tööd

    }

}

More questions like this

Want instant access to all verified answers on moodle.tktk.ee?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!