Baffled by lack of iterations

I would consider myself a beginner to C++. I took a couple of classes in high school that dealt with simple C++, but that was 12 years ago. I haven't really touched it since.

I wanted to dive back in and create a simple console application that would calculate the odds of dice rolls for the Star Wars: Edge of the Empire role playing game. For the most part, it was working pretty well, but I got stuck on this particular loop. It is supposed to go through 2 iterations, but it seems that the variable "n" is incrementing prematurely.

You are using the assignment operator '=' instead of the is-equal-to operator '=='if (n = green - 1)
here the result of green-1 is assigned to the variable n, and if the result is non-zero, the condition is true.