Magic 8-ball exercise


I got the magic 8-ball program to work and tried to create my own dice program but it doesn’t seem to work:

The output always comes back as ‘The die says: error’ .

Why is this?

You write “error” based on some condition, you could look at what you’re doing in that condition, if there’s a comparison being made then what are the values that you’re comparing?

i think i found the mistake,

i wrote the lines:

int danswer = std::rand(); 

std::rand() % 6;

instead of:

int danswer = std::rand() % 6;