#include <iostream>
#include <vector>
#include <string>
int main()
{
std::vector<std::string> computer_atcions = {"paper", "scissors", "stone"};
std::string user_input = "";
int result = 0;
int won_count = 0;
int loss_count = 0;
std::cout << "Please, input paper, scissors or stone: ";
for(int i = 0; i < computer_atcions.size(); i++)
{
std::cin >> user_input;
if (user_input != "paper" && user_input != "scissors" && user_input != "stone")
{
std::cout << "Please, input paper, scissors or stone: ";
continue;
}
computer_atcions.push_back(user_input);
if (user_input == computer_atcions[i])
{
std::cout << user_input << " draw " << computer_atcions[i] << std::endl;
}
else if (user_input == "paper" && computer_atcions[i] == "stone")
{
std::cout << user_input << " beats " << computer_atcions[i] << std::endl;
won_count++;
}
else if (user_input == "paper" && computer_atcions[i] == "scissors")
{
std::cout << user_input << " loses to " << computer_atcions[i] << std::endl;
loss_count++;
}
else if (user_input == "stone" && computer_atcions[i] == "scissors")
{
std::cout << user_input << " beats " << computer_atcions[i] << std::endl;
won_count++;
}
else if (user_input == "stone" && computer_atcions[i] == "paper")
{
std::cout << user_input << " loses to " << computer_atcions[i] << std::endl;
loss_count++;
}
else if (user_input == "scissors" && computer_atcions[i] == "paper")
{
std::cout << user_input << " beats " << computer_atcions[i] << std::endl;
won_count++;
}
else if (user_input == "scissors" && computer_atcions[i] == "stone")
{
std::cout << user_input << " loses to " << computer_atcions[i] << std::endl;
loss_count++;
}
else
{
std::cout << "debug" << std::endl;
break;
}
std::cout << "You have lost " << loss_count << " and won " << won_count << " games." << std::endl;
//std::cout << computer_atcions[i] << user_input << std::endl;
}
return 0;
}