Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


RussDawgUnlimited

Member Since 06 Jun 2012
Offline Last Active Dec 10 2012 08:25 PM

Topics I've Started

C++ Tutorials?

05 November 2012 - 08:31 PM

So I'm just starting to learn C++ and I was just inquiring about some good C++ tutorials? Preferably ones that are most up to date. I've been watching a beginner video series hosted by Xoax, and its pretty good about covering essentials but I'm wanting a little more and I just can't seem to find any good ones so far from my google searches. Would be much appreciated!

Thanks in advanced guys! (In case I dont stop by for a while) Posted Image

Am I doing something wrong?

13 September 2012 - 07:31 PM

So I'm starting to learn me some programming, and I decided to start with C++ as its the most prominent, Ive been watching some tutorials and reading up on some books i found, did a program from a tutorial from Xoax.net (http://www.youtube.c...38&feature=plcp) and I attempted to copy his game (Lesson 9 Tic Tac Toe) to see if I have an understanding of what Im doing (lol) I understand the program, but when i generate this code it comes up w/ an error msg: "The program cannot find the file specified." I've tried looking into it but it seems to be an error w/ Visual C++ Basic (2010) not being able to create a .exe file for the program, I've tried to reinstall multiple times but to no avail, any ideas? Or is it because of an error in my code? I've compared it to the Xoax code and I didnt see anything different...

Heres my code for a tic tac toe game in the console:

#include <iostream>
int main() {
char cSquare1('1'); // Why not int? Char for letters/int for #'s?
char cSquare2('2');
char cSquare3('3');
char cSquare4('4');
char cSquare5('5');
char cSquare6('6');
char cSquare7('7');
char cSquare8('8');
char cSquare9('9');
int iPlayerTurn(1);
bool bGameOver(true);


//Main Game Loop
do {
  // Board
  std::cout << cSquare1 << "|" << cSquare2 << "|" << cSquare3 << std::endl;
  std::cout << "-+-+-" << std::endl;
  std::cout << cSquare4 << "|" << cSquare5 << "|" << cSquare6 << std::endl;
  std::cout << "-+-+-" << std::endl;
  std::cout << cSquare7 << "|" << cSquare8 << "|" << cSquare9 << std::endl;
  //Player Mark 1 or 2
  char cPlayerMark;
  if (iPlayerTurn == 1) {
   cPlayerMark = 'X';
  } else {
   cPlayerMark = 'O';
  }
//Player Move
std::cout << "Player " << iPlayerTurn << "'s Turn" << std::endl;
bool bValidMove;
//needs valid move, if no valid move then loop until valid
do {
  char cNextMove;
  std::cin >> cNextMove;
  bValidMove = true;
  if (cNextMove == '1' && cSquare1 == '1') {
   cSquare1 = cPlayerMark;
  } else if (cNextMove == '2' && cSquare2 == '2') {
   cSquare2 = cPlayerMark;
  } else if (cNextMove == '3' && cSquare3 == '3') {
   cSquare2 = cPlayerMark;
  } else if (cNextMove == '4' && cSquare4 == '4') {
   cSquare2 = cPlayerMark;
  } else if (cNextMove == '5' && cSquare5 == '5') {
   cSquare2 = cPlayerMark;
  } else if (cNextMove == '6' && cSquare6 == '6') {
   cSquare2 = cPlayerMark;
  } else if (cNextMove == '7' && cSquare7 == '7') {
   cSquare2 = cPlayerMark;
  } else if (cNextMove == '8' && cSquare8 == '8') {
   cSquare2 = cPlayerMark;
  } else if (cNextMove == '9' && cSquare9 == '9') {
   cSquare2 = cPlayerMark;
  } else {
   std::cout << "INVALID GO AGAIN" << std::endl;
  bValidMove = false;
  }
} while (!bValidMove);
bGameOver =  false;
bool bWinGame = true;
// check if game over
if(cSquare1 != '1') {
  if (cSquare2 == cSquare1 && cSquare3 == cSquare1) {
   bGameOver = true;
  }
  if (cSquare4 == cSquare1 && cSquare7 == cSquare1) {
   bGameOver == true;
  }
}
if(cSquare5 != '5') {
  if (cSquare1 == cSquare5 && cSquare9 == cSquare5) {
   bGameOver == true;
  }
  if (cSquare2 == cSquare5 && cSquare8 == cSquare5){
   bGameOver == true;
  }
  if (cSquare3 == cSquare5 && cSquare7 == cSquare5){
   bGameOver == true;
  }
  if (cSquare4 == cSquare5 && cSquare6 == cSquare5){
   bGameOver == true;
  }
}
if(cSquare9 != '1'){
  if(cSquare3 == cSquare9 && cSquare6 == cSquare9){
   bGameOver == true;
  }
  if(cSquare7 == cSquare9 && cSquare8 == cSquare9){
   bGameOver == true;
  }
}
//Check for No Win Condition
if(cSquare1 != '1' && cSquare2 != '2' && cSquare != '3' &&
  cSquare4 != '4' && cSquare5 != '5' && cSquare6 != '6' &&
  cSquare7 != '7' && cSquare8 != '8' && cSquare9 != '9' && !bGameOver)
{
  bGameOver = true;
  bWinGame = false;
}
//Declare Winner
if(bGameOver)
{
  if(bWinGame){
   std::cout << "Player" << iPlayerMove << " is the victor!!" << std::endl;
  }
  //Print Endgame Board
  std::cout << cSquare1 << "|" << cSquare2 << "|" << cSquare3 << std::endl;
  std::cout << "-+-+-" << std::endl;
  std::cout << cSquare4 << "|" << cSquare5 << "|" << cSquare6 << std::endl;
  std::cout << "-+-+-" << std::endl;
  std::cout << cSquare7 << "|" << cSquare8 << "|" << cSquare9 << std::endl;
  std::cout << "Game Over" << std::endl;
  std::cout << "Play Again? (y/n)" << std::endl;
  char cPlayAgain;
  std::cin >> cPlayAgain;
  //Play Again? Yes
  if(cPlayAgain == 'y'){
   //Clear Board
   bGameOver = false;
   cSquare1 = '1';
   cSquare2 = '2';
   cSquare3 = '3';
   cSquare4 = '4';
   cSquare5 = '5';
   cSquare6 = '6';
   cSquare7 = '7';
   cSquare8 = '8';
   cSquare9 = '9';
  }
  iPlayer1 = 1;
} else {
  //Alternate Player Turns
  if(iPlayerTurn == 1) {
   iPlayerTurn == 2;
  } else {
   iPlayerTurn == 1;
  }
}
} while (!bGameOver);

New to programming (duh) had some questions...

19 June 2012 - 08:58 PM

So I wanna start learning how to program, mostly to become a game programmer (duh) but I know i cant just jump right into game programming, I gotta learn how to program in general first. I'm really new to programming, the most I've ever really programmed was one of those games where you click and hold to make an object go up and release to go down, but that one game was made about 3 years ago and in flash, and Ive never really had time to get back into it.....

But now I do have time and I'm going to make time for it too, as I'm really passionate about my games and really wanna get into the industry, and Ive always found programming interesting so I figure I better start now rather than later, but enough rambling, back to my questions: I've been reading a few "so you wanna start programming" articles just to get my feet we to see what Im getting into and I think i have the idea, i just had a few questions regarding starting up, so bear with me as I haven't programmed in a long time and I need to get back into it XD,

Ive been wanting to start up using C++ but the more i read up on it i see that its not a good language to start up with due to its high difficulty for newcomers, as well as it also being outdated and inconvenient (I've read that it takes a lot of code before you can actually get a working product), so what languages would be a good starting point for someone who hasn't done any hardcore programming for years?
I've been thinking of starting off with Python until I've gotten the hang of programming, then moving on to Java and C#, based off what I've read, I just want your guys' opinion.

So basically what I'm trying to ask is what would you guys recommend for a newcomer? Any opinions are welcome, you guys know more than me lol, so anything you guys can offer helps a ton!!

Thanks a bunch.

Looking to start programming, where to start?

06 June 2012 - 09:46 PM

Im looking to get into some programming (i wanna be a game designer but i also wanna do some game programming too) and i just wanna know where are some good websites to learn from?

Where are some good programs to program with? (Preferably something free, im a tad poor :(

What language should i start with? (Ive been researching C++ but ive heard to start w/ java or python)

What would be a good way to start out? Should i jump straight into trying to make games or start w/ making simple programs and work my way up?

Just some help and advice would be great or if someone could point me in a direction of where to start would be great, ive just been going around different websites finding tutorials and stuff.

THANKS IN ADVANCE!

PARTNERS