#include <iostream>
#include <string>
using namespace std;
string random_number_generator () {
srand(time(NULL));
int random_number = rand() % 3;
string roll;
if (random_number == 0) {
roll = "rock";
}
else if (random_number == 1) {
roll = "paper";
}
else if (random_number == 2) {
roll = "scissors";
}
return roll;
}
int main (){
string player1, player2, player1roll, player2roll;
cout << "what is the name of player 1?";
cin >> player1;
cout << "what is the name of player 2?";
cin >> player2;
player1roll = random_number_generator();
cout << player1 << " got " << player1roll << endl;
player2roll = random_number_generator();
cout << player2 << " got " << player2roll << endl;
if (player1roll == player2roll) {
cout << "The game is a tie." << endl;
} else if ((player1roll == "rock" && player2roll == "scissors") ||
(player1roll == "paper" && player2roll == "rock") ||
(player1roll == "scissors" && player2roll == "paper")) {
cout << player1 << " is the winner" ;
} else {
cout << player2 << " is the winner" ;
}
}