Welcome to HBH! If you have tried to register and didn't get a verification email, please using the following link to resend the verification email.
Code Bank
I didn't see anywhere to submit code to the code bank, so I'm going to post it here. This is basically a Rock, Paper Scissors game written in C++
#include <iostream>
#include <cstdlib>
#include <ctime>
using namespace std;
int main()
{
srand((unsigned)time(0));
int choice;
int compchoice = rand()%3;
cout << "Welcome to ~ Rock Paper Scissors ~!! I assume you know how to play,";
cout << " so lets begin. You are playing against the computer. Type 0 for";
cout << " rock, 1 for paper, and 2 for scissors\n";
cin >> choice;
if (choice == 0)
{
if (compchoice == 0)
cout << "It's a tie!\n\n\n\n";
else if (compchoice == 1)
cout << "Paper beats rock! Sorry, you lose!\n\n\n\n";
else if (compchoice == 2)
cout << "Rock beats scissors! You win!\n\n\n\n";
}
if (choice == 1)
{
if (compchoice == 0)
cout << "It's a tie!\n\n\n\n";
else if (compchoice == 1)
cout << "Paper beats rock! You win!\n\n\n\n";
else if (compchoice == 2)
cout << "Scissors beat paper! Sorry, you lose!\n\n\n\n";
}
if (choice == 2)
{
if (compchoice == 0)
cout << "It's a tie!\n\n\n\n";
else if (compchoice == 1)
cout << "Scissors beat paper! You win!\n\n\n\n";
else if (compchoice == 2)
cout << "Rock beats scissors! Sorry, you lose!\n\n\n\n";
}
cout << "Press enter to play again...\n";
cin.get();
cin.get();
system("cls");
return main();
}