3
Contributors
4
Replies
5
Views
8 Years
Discussion Span
Last Post by saphar
-2

Please I need urgent help.
Because it is due tomorow. Can somebody help me.

-1

What have you tried? Post the code you have worked on and maybe someone will be able to point out why it is not working.

-1

Well, the thing is that I dont understand the random number coding. How to use it.

#include<iostream>
#include<(time>
using namespace std;

int get_random(int x)
{
    int x=6;


    do
    {

    int seed=(unassigned)time(0);
    srand(seed);

    int answer=rand();
    answer=answer/(RAND_MAX/10);

    while(answer=0,answer<=2,answer--);
    }

This is what I have done so far.

Edited by Dani: Formatting fixed

-1

Let me give the steps to follow assuming that the random function that you have written gives some random number for each call.

You need to call this 3 time for one roll. (Use a loop here)
It is given in the PDF that each player is given 3 chances (nest the above loop inside another loop that loops 3 times).
In the second loop you get the random number 3 times. And check for the condition for scores.
Sum all the individual scores.
That’s it

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.