Follow us on Twitter!
It is the path of least resistance that makes rivers and men crooked. - Bj Palmer
Thursday, April 24, 2014
Navigation
Home
HellBoundHackers Main:
HellBoundHackers Find:
HellBoundHackers Information:
Learn
Communicate
Submit
Shop
Challenges
HellBoundHackers Exploit:
HellBoundHackers Programming:
HellBoundHackers Think:
HellBoundHackers Track:
HellBoundHackers Patch:
HellBoundHackers Other:
HellBoundHackers Need Help?
Other
Members Online
Total Online: 28
Guests Online: 22
Members Online: 6

Registered Members: 82895
Newest Member: kevy90
Latest Articles
View Thread

HellBound Hackers | HellBound Hackers | Lessons

Author

Code Bank


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 27-10-06 23:29
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++

Code
//Rock Paper Scissors game by Moonbat
#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();
}





Author

RE: Code Bank


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 27-10-06 23:30
submit code is right under the submit section on the right side lol


Author

RE: Code Bank


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 27-10-06 23:34
Nice work... Pfft


Author

RE: ok


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 27-10-06 23:36
sorry, you can delete this thread
Author

RE: Code Bank


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 27-10-06 23:43
I'm doing the exact thing in my ICTP class next week.Grin


Author

RE: lol


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 27-10-06 23:44
Lol, well, you can use this if you want...