Well, here's rock paper scissors in C++. Made in like 5 mins.
/*Script in C++. Rock paper sicrrors!. Enjoy.*/
#include <iostream>
#include <cstdlib>
#include <ctime>
using namespace std;
int main()
{
srand((unsigned)time(0));
int choice;
int againchoice;
int computerchoice = (rand()%2)+1;
cout <<"Type 0 for Rock, 1 for Paper and 2 for Scissors.\n";
cin >> choice;
if (choice == 0)
{
if (computerchoice == 0)
cout << "It has resulted in a Tie!\n\n";
else if (computerchoice == 1)
cout << "Paper has beaten Rock. You have lost!\n\n";
else if (computerchoice == 2)
cout << "Rock has beaten Scissors. You have won!\n\n";
}
if (choice == 1)
{
if (computerchoice == 0)
cout << "It has resulted in a Tie!\n\n";
else if (computerchoice == 1)
cout << "Paper has beaten Rock. You have won!\n\n";
else if (computerchoice == 2)
cout << "Scissors has beaten Paper. You have lost!\n\n";
}
if (choice == 2)
{
if (computerchoice == 0)
cout << "It has resulted in a Tie!\n\n";
else if (computerchoice == 1)
cout << "Scissors has beaten Paper. You have won\n\n";
else if (computerchoice == 2)
cout << "Rock has beaten Scissors. You have lost!\n\n";
}
cout << "Would you like to play again? 1 for Yes and 2 for No.\n";
cin >> againchoice;
if (againchoice == 1)
{
system("cls");
return main();
}
else if (againchoice == 2)
{
system("EXIT");
}
}
Can't compile? I'll upload the .exe. (C++ compiles to .exe)
http://www.megaupload.com/?d=5ZX82RC6Yes, it's clean. Scan yourself. I'm not uploading scan results to proove it is clean.