Ok, im not that much of a geeky smart guy in C++,
but i've got some skillz..
so im trying to make a very simple game that will randomize
1 number for the computer and 1 number for the person using the program and whomever(person or computer) gets the highest number(lets say 1-10) wins, and keeps score also...
If anyone can just post here, or help me make this program in anyway that would be awsome!!!

As for keeping score, you could have two variables.

int games_won_by_computer;
int games_won_by_player;

Once you're done that game, you could try a guessing game where the user guesses a random number in as few tries as possible.

Ok, im not that much of a geeky smart guy in C++,
but i've got some skillz..
so im trying to make a very simple game that will randomize
1 number for the computer and 1 number for the person using the program and whomever(person or computer) gets the highest number(lets say 1-10) wins, and keeps score also...
If anyone can just post here, or help me make this program in anyway that would be awsome!!!

its very simple
wat exactly u want ?
source code ??

// 07/08/10 04:52

/*
  Guess the computers Number game
*/

//main
#include <iostream>
#include <string>
#include <conio.h>

using namespace std;

int main()
{
 double firmver = 0.01;; // Game version
 
 cout << "\t\t\tGuess Num " << firmver;
 cout << "\nCompete with the computer.\nTry to guess the right number!\nSee how thinks faster!\n\n";
 cout << "Do you want to play?(yes/no || y/n)" << endl;
 
 string playgame; // to check if player wants to play
 cin >> playgame;
 cin.get();
 
 // Does player want to play?
 if(playgame == "yes" || playgame == "YES" 
 || playgame == "Yes" || playgame == "y" 
 || playgame == "Y")
 {
  cout << "Press any key to start" << endl;
  
  //Game loop
  while(playgame == "yes" || playgame == "YES" 
 || playgame == "Yes" || playgame == "y" 
 || playgame == "Y")
  {
  int psnum; //player secret num
  int csnum; //computer secret num
 
 
 
 long pgnum; //player guess num   
 int cgnum; // computer guess num
 
 int amountpg = 1; // amount player guesses max 3 times per guess 
 int amountcg = 0; // amount computer guesses max 3 times per guess
 
 psnum = rand() % 50 + 1; // Initiliaze  player secret num from 1-50;
 csnum = rand() % 50 + 1; // Initiliaze  computer secret num from 1-50;
 cout << amountpg << endl;
 
while(amountpg != 3)
 {
 cout << "Please guess your number" << endl;
 
 cin >> pgnum;
 
 if(pgnum == psnum)
 {
  cout << "You guessed right" << endl;
  amountpg = 0;
 }
 
 if (pgnum > psnum)
 {
  cout << "It is too high" << endl;
  amountpg++;
   cout << amountpg << endl;
 }
 
 if (pgnum < psnum)
  {
  cout << "It is too low" << endl;
  amountpg;
   cout << amountpg << endl;
  }
}
  
   cout << "You guessed 3 times wrong! Concentrate on solving the next guess" << endl;
   psnum = rand() % 50 + 1; // Initiliaze  player secret num from 1-50;
   amountpg == 0;
   
}
}
}

Edited 6 Years Ago by Nick Evan: Added code-tags

#include<iostream>
#include<string>

using namespace std;

int main()
{
    string s;
    cout << "Please enter your first name followed by a newline\n";
    cin >> s;
    cout << "Hello, " << s << '\n';
    return 0; // this return statement isn't necessary

Edited 3 Years Ago by mike_2000_17: Fixed formatting

If you've got any c++ skillz, you should be able to make this. Learn about random number generation, loops and functions. Then you should be set for a number-style game. :)

This article has been dead for over six months. Start a new discussion instead.