0

Hi all,

FIrst I have to say my experiences with C++ are very low. But since we're given an assignment to develop a simple game in C++ now I have to try it out. But I have the basic idea on OOP and programming. So friends where should I start. What area's of C++ should I discover. Any reference web sites or complete projects so I can study them. appriciate any kind of help and ideas. thank you in advance..!!!

Edited by baby_c

4
Contributors
3
Replies
8
Views
5 Years
Discussion Span
Last Post by sternone
0

We once did a project with a kind of chess game. But that is very broad and needed all kind of c++ skills. Do you have a kind of game in mind? Cause it such a large field(complex game/simple game?). You can even do a rock paper scissor game which isn't that hectic.

0

Depending on the game, there are all kinds of answers. If it's a Uni assignment, try Space Invaders - I've seen it written in under 500 lines of code, in a nasty way though.

0
#include <stdio.h>
#include <stdlib.h>
#include <time.h>

int main ()
{
  int iSecret, iGuess;

  /* initialize random seed: */
  srand ( time(NULL) );

  /* generate secret number: */
  iSecret = rand() % 10 + 1;

  do {
    printf ("Guess the number (1 to 10): ");
    scanf ("%d",&iGuess);
    if (iSecret<iGuess) puts ("The secret number is lower");
    else if (iSecret>iGuess) puts ("The secret number is higher");
  } while (iSecret!=iGuess);

  puts ("Congratulations!");
  return 0;
}
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.