Question: ```
#include <ctime>
#include <cstdlib>
#include <iostream>
using namespace std;

int main()
{
  // initialize the computer's random number generator
  srand(time(0)); rand();

  // declare variables
  char c1;
  char c2;
  char c3;

  c1 = 'R';
  c2 = 'P';
  c3 = 'S';

  // start loop
  while (true)
  {

    // determine computer's choice
    int result = rand() % 3; // 0 or 1 or 2

    if (result == 0) 
      result = c1;

    if (result == 1) 
      result = c2;

    if (result == 2) 
      result = c3;

    // prompt for, and read, the human's choice

    char humanChoice;
    cout << "Rock, Paper, or Scissors? [R/P/S or Q] ";
    cin >> humanChoice;
    cin.ignore(1000, 10);

    // if human wants to quit, break out of loop
    if (humanChoice == 'Q') break;

    // print results
    cout << result << endl;
    cout << humanChoice << endl;

  // end loop
  }

  // end program 

  return 0;
}

```

What's up guys? I am on my first step of my midterm project which is to create a rock-paper-scissors game. This is just the beginning, and I am far from done, but I already have run into an error. When I compile and run this, I am getting that the compute has chosen the number 83, when it must be either r p or s. Does anyone see where I went wrong with this?

Answer: 
**result** is of type **int** (and as such it is being interpreted as a decimal number by cout), you mean it to have type **char** (so that it is intepretted as a text character).

Also you have "overloaded" **result** to first hold the value of `rand() % 3` and then second the character value. In general, it's best to keep variables separate for readability - the optimizer can figure out to reuse the same storage for them to save stack space.

Try this:

```
char result;

switch (rand() % 3)
{
case 0: result = c1; break;
case 1: result = c2; break;
case 2: result = c3; break;
}

```
The 83 refers to the unicode value of 's'. Since result is an int, when you assign the char 's' to result, it gets cast to an int. Therefore, it outputs 83.

Try using a different variable for the output. For example:

```
char response;
if(result==0)
    response = c1;
...
cout << response << end1

```