Help on a game.

Whether you're a newbie or an experienced programmer, any questions, help, or just talk of any language will be welcomed here.

Moderator: Coders of Rage

User avatar
resatti
Chaos Rift Newbie
Chaos Rift Newbie
Posts: 11
Joined: Thu Oct 02, 2008 5:14 pm
Location: N/A
Contact:

Re: Help on a game.

Post by resatti »

Okay, check this out

Code: Select all

#include <string> 
#include <iostream>
using namespace std;

int main()

{
   // Variables.
   string input;
   float x = 0.0;
   float y = 0.0;
   float z = 0.0;

   // Main Function.
   system("TITLE The Number Game!");
   
   cout << "The Number Game!" << endl;
   cout << "To play the number game, enter a number between 1 and 10." << endl << endl;
   cin >> x;
   cout << endl << endl;
   cout << "Number entered: " << x << endl;
   cout << "Let's begin the game. You need to answer a series or questions using Y and N. These resemble Yes and NO."
      " You must use capitals. Here comes the first question." << endl << endl;

   cout << "Is " << x << "larger than five(5)?" << endl;

      cout << "Input your answer." << endl;
      cout << "Input your answer." << endl;
      cin >> input;

      if (input == "Y" && x > 5){
         cout << "Correct!";
      } else {
         cout << "Wrong.";
      }


   system("pause");
   return 0;

}
I also recommend a different tutorial:
-reconnetworks on YouTube
-Books like the following (forgive me if any of the titles are offensive):
-...For Dummies
-The Complete Idiots Guide to...
-Sam Teaches You ... in 24 hours/ 21 days/etc.
-Thompson Course Technology(Highly Recommended)
Click here to see the hidden message (It might contain spoilers)
PART 1
R: What do you want for breakfast, L?

L: Well, let's see. I want tacos, waffles, and snickerdoodle.

A: Snickerdoodle?

R: Tacos and waffles don't go together, L.

L: I know that, R. A, snickerdoodle is a German cookie.

A: Well, whay didn't you say so, L? My butt just got equiped with a cookie gun!

R and L: Gun?

R: Run, L, A is gonna shoot us with his...

...whatever it is called!!!! Come on, L!

(L gets hit in the back of the head with a cookie and becomes unconsis.)

R: L!?

(Cookies fly everywhere, but R manages to escape)

A: It's going out of control!!!!! I can't stop it! Ohh......

(A explodes with a loud and thunderous BAM POP SLASH!)

The house (which belongs to L) no longer existed. A blew up and left R wondering what happened to A and L. R checked out the scene and saw no trace of A or L. There were many questions to be asked: Where is L and A? Is L and A alive? How did A get a cookie gun in his a**? No one knew the answer.

Countinued...
Spoiler'd. --Mar
Post Reply