Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!


1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


Saint Squireen

Member Since 04 Jul 2012
Offline Last Active Dec 30 2012 05:19 PM

Topics I've Started

CodeBlocks and SFML Confusion?

24 December 2012 - 10:03 PM

Hello,

 

    My problem is that I have been trying to link SFML with codeblocks and I can never seem to be able to do it. The first time I have ever tried this was probably a year ago, when I was first learning C++.

 

I tried and I couldn't do it.

 

I decided that maybe I was too new in the programming world anyways to try this SFML thing out. So I waited a bit and tried again. Didn't work. Couldn't make sense of what I was doing, didn't know if it was working....

 

Again I waited,

 

and again I failed.

 

So now I'm thinking, "There has got to be an easier way of doing this..." I come up with the idea that maybe somebody has made a video tutorial on how to link up SFML and codeblocks. So I go and search, find nothing, but still the idea that if somebody had made a video tutorial, the how in the world could I mess up linking and compiling it together?

 

That's when I came here. Before you go ahead and tell me I'm such a dumbass, that SFML is one of the easiest ones to work with, understand that I am young and don't have any clue on what I was doing when I was trying to work with SFML.

 

******************************************************************************************************

Now the real qestion: Does anybody know where a guy can find a video tutorial on how to put codeblocks and SFML together? Can someone take time out of their day and make one perhaps?

******************************************************************************************************

 

Anything to help would be appreciated and any questions regarding anything, just ask below.


Code Blocks; SFML; QT

19 September 2012 - 02:23 PM

Hello,

I have been trying for the longest time now to get my code blocks working. First off, I had code blocks originally, then switched to QT (whilst deleting code blocks), and now I want to go back to code blocks. The problem with that is code blocks doesn't work. I don't know if that is because I have QT and code blocks installed at the same time or what. If its because of that, then should I completely delete QT? Is there any way to have both QT and codeblocks operational at the same time? I would prefer to have both of them operational at the same time, but if that just isn't possible, then I would willingly delete QT. Anybody know what I should do?

C++ Alternative to Unity?

15 September 2012 - 07:43 AM

Hello,

Today, I ,for some wierd reason, was all excited and gun-ho to start researching and programming with a game engine. The first game engine that popped into my head was Unity because, well...... C'mon its pretty well known. Anyways I go to google type in Unity and click on the website and I get suddenly amazed at what I see! Theres all this stuff that means nothing to me!! But it looks high-tech and smart!!! Anyways, 5 minutes later I start to question whether or not if I should go and download it or see what languages it can be written in. I obviously go with the smarter of the two decisions and went and checked the languages. Good thing I did that because I found that it doesn't carry C++! I was pretty sad after that, so I did a little background checks to see if there was a plugin or anything of the type and found that it would be somewhat difficult to do and it just would not be the same. (Next thought that came into my head.) "Maybe I should go to GameDev and see if they have any suggestions on what I can do now that I know what I can't do!!".
Thats where you guys come in. I haven't done any work at all with game engines so I have no idea what to search for or even know what to type into google (hahaha).

What do you guys suggest if the requirements are:

1. Has to be programmable in C++.
2. Doesn't matter the difficulty.
3. Has to have at least the very basics of a game engine (I don't know everything that is included in game engines soo......)
4. Oh, and it has to be free. [I'm not made of money here;)]


Thats it for the requirements and thanks in advance!!

Checking my Progress in Game Programming

31 August 2012 - 02:18 PM

Hello! Today I want to find out if I am ready to start moving along in my learning by showing you guys the coding of my 2 and a half games. Basically my "Question" is, am I ready to move on based on the style of programming in these games? Also, if not, then what kind of tips can you give me to push me in the direction of Industrial Qualified style of game programming? Thanks!

[source lang="cpp"]#include <iostream>#include <cstdlib>#include <ctime>#include <stdio.h>using namespace std;int number,guess=0,maximum=0,choice=0,restart=1,tries=0,gameRun=1,times=0,compare=0,go=0;void personGuess(){ while(restart==1){ tries=0; cout<<"\n\n\n\n\nWhat do you want the maximum number to be?\n"; cin>>maximum; srand(time(0)); number=((rand()%maximum)+1); cout<<"\n\nWhats your Guess?\n"; guess=-1; while(guess!=number){ cin>>guess; tries++; cout<<"\n\n\n\n\n"; cout<<endl<<endl; if(guess>number){cout<<"Too high, try again.\n";} if(guess<number){cout<<"Too low, try again.\n";} } cout<<"You found the random number, "<<number<<"!!! Good job!!\n\nTries: "<<tries<<"\n\n\n\n\nWould you like to try again? 1} Yes 2} No\n\n"; restart=0; while(restart!=1 and restart!=2){ cin>>restart; } cout<<"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"; }}void compGuess(){ restart=1; while(restart==1){ times=1,compare=0,go=0,tries=0; cout<<"Choose the number that your computer will have to guess.\n\n"; cin>>number; cout<<"\n\n\n"; cout<<"\n\n\n\n\nAlso choose the number that will be the maximum number your computer can pick.\n\n"; cin>>maximum; cout<<"\n\n\n"; srand(time(0)); guess=((rand()%maximum)+1); cout<<guess<<endl; tries++; while(guess!=number){ if(guess>number){ if(times==1){ guess=guess-maximum/4; } if(times==2){ guess=guess-maximum/4/4; } if(times==3){ guess=guess-100; } if(times==4){ guess=guess-50; } if(times==5){ guess=guess-25; } if(times==6){ guess=guess-10; } if(times==7){ guess=guess-5; } if(times==8){ guess--; } compare=1; tries++; cout<<guess<<endl; } if(compare==1 and guess<number and times!=8){ times=times+1; } if(guess<number or go==2){ if(times==1){ guess=guess+maximum/4; } if(times==2){ guess=guess+maximum/4/4; } if(times==3){ guess=guess+100; } if(times==4){ guess=guess+50; } if(times==5){ guess=guess+25; } if(times==6){ guess=guess+10; } if(times==7){ guess=guess+5; } if(times==8){ guess++; } compare=2; tries++; cout<<guess<<endl; } if(compare==2 and guess>number and times!=8){ times=times+1; } } cout<<"\n\n\n\aYour computer found your number, "<<number<<"!!! It found it in "<<tries<<" tries.\n\n\n"; cout<<"Would you like to restart? (1) for Yes and (2) for No."; restart=0; while(restart!=1 and restart!=2){ cin>>restart; } cout<<"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"; }}int main(){ while(gameRun==1){ choice=0; cout<<"Do you want to try and guess a computer generated number (1),\nor have the computer guess a number of your choice (2)?\n\n"; while(choice!=1 and choice!=2){ cin>>choice; } cout<<"\n\n\n\n\n"; if(choice==1){ personGuess(); } if(choice==2){ compGuess(); } cout<<"Do you want to repick the game type (1),\nor completely quit the game (2)?\n\n"; gameRun=0; while(gameRun!=1 and gameRun!=2){ cin>>gameRun; } cout<<"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"; } cout<<"Guessing Game script finished.\n\n"; system("pause");}\\\\This line is not part of the code, just me saying there is a total of 149 lines in my Guessing Game Program. :D \\\\[/source]

[source lang="cpp"]#include <iostream>#include <cstdlib>using namespace std;int n=0,m=0;int main(){ cout << "Choose a number to run the Matrix.\n\n"; n=0;m=0; while(n<100000 or n>999999998){ cin>>n; cout<<"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"; if(n<100000){cout<<"Number is too small, try again.\n\n\n";} if(n>999999998){cout<<"Number is too big try again.";} if(n>999999999){cout<<"Number is so big you just crashed the Matrix. Just saying.";} } cout<<"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nMake sure to look for patterns!!! ;D"; while(m!=100000000){m++;} while(1){cout<<n;} cout<<"Matrix program script finished.\n\n"; system("pause");}\\\\This line is not part of the code, just me saying there is a total of 21 lines in my Matrix Program. :D \\\\[/source]

[source lang="cpp"]#include <iostream>#include <cstdlib>#include <ctime>#include <stdio.h>using namespace std;int topLeft=0,topCenter=0,topRight=0,middleLeft=0,middleCenter=0,middleRight=0,bottomLeft=0,bottomCenter=0,bottomRight=0,turn=0,restart=1,playerMove=0,compMove=0,playerMoveAccept=0,compMoveAccept=0,win=0,fourCorners=0,care=0,chance=0,difficulty=0,placement=0;void compAI(){ care=1; srand(time(0)); chance=((rand()%10)+1); if(chance>=difficulty){ if(middleCenter==1 and topLeft==0 and topRight==0 and bottomLeft==0 and bottomRight==0){ srand(time(0)); placement=((rand()%4)+1); if(placement==1){topLeft=2;care=0;} if(placement==2){topRight=2;care=0;} if(placement==3){bottomLeft=2;care=0;} if(placement==4){bottomRight=2;care=0;} } if(fourCorners==1 and care==1){ if(topLeft==0 and topRight==2 and bottomLeft==2 and bottomRight==2 and care==1){topLeft=2;care=0;} if(topLeft==2 and topRight==0 and bottomLeft==2 and bottomRight==2 and care==1){topRight==2;care=0;} if(topLeft==2 and topRight==2 and bottomLeft==0 and bottomRight==2 and care==1){bottomLeft=2;care=0;} if(topLeft==2 and topRight==2 and bottomLeft==2 and bottomRight==0 and care==1){bottomRight==2;care=0;} } if(topLeft==2 and topRight==2 and bottomLeft==2 and bottomRight==2 and middleCenter==0 and care==1){middleCenter=2;care=0;} if(topCenter==2 and bottomCenter==2 and middleLeft==2 and middleRight==2 and middleCenter==0 and care==1){middleCenter=2;care=0;} if(topLeft==2 and topCenter==0 and topRight==2 and middleCenter==2 and bottomCenter==2 and care==1){topCenter=2;care=0;} if(bottomLeft==2 and bottomCenter==0 and bottomRight==2 and middleCenter==2 and topCenter==2 and care==1){bottomCenter=0;care=0;} if(topLeft==2 and middleLeft==0 and bottomLeft==2 and middleCenter==2 and middleRight==2 and care==1){middleLeft=2;care=0;} if(topRight==2 and middleRight==0 and bottomRight==2 and middleCenter==2 and middleLeft==2 and care==1){middleRight=2;care=0;} if(topLeft==2 and middleLeft==0 and bottomLeft==2 and care==1){middleLeft=2;care=0;} if(topCenter==2 and middleCenter==0 and bottomCenter==2 and care==1){middleCenter=2;care=0;} if(topRight==2 and middleRight==0 and bottomRight==2 and care==1){middleRight=2;care=0;} if(topLeft==0 and middleLeft==2 and bottomLeft==2 and care==1){topLeft=2;care=0;} if(topCenter==0 and middleCenter==2 and bottomCenter==2 and care==1){topCenter=2;care=0;} if(topRight==0 and middleRight==2 and bottomRight==2 and care==1){topRight=2;care=0;} if(topLeft==2 and middleLeft==2 and bottomLeft==0 and care==1){bottomLeft=2;care=0;} if(topCenter==2 and middleCenter==2 and bottomCenter==0 and care==1){bottomCenter=2;care=0;} if(topRight==2 and middleRight==2 and bottomRight==0 and care==1){bottomRight=2;care=0;} if(topLeft==2 and topCenter==2 and topRight==0 and care==1){topRight=2;care=0;} if(middleLeft==2 and middleCenter==2 and middleRight==0 and care==1){middleRight=2;care=0;} if(bottomLeft==2 and bottomCenter==2 and bottomRight==0 and care==1){bottomRight=2;care=0;} if(topLeft==2 and topCenter==0 and topRight==2 and care==1){topCenter=2;care=0;} if(middleLeft==2 and middleCenter==0 and middleRight==2 and care==1){middleCenter=2;care=0;} if(bottomLeft==2 and bottomCenter==0 and bottomRight==2 and care==1){bottomCenter=2;care=0;} if(topLeft==0 and topCenter==2 and topRight==2 and care==1){topLeft=2;care=0;} if(middleLeft==0 and middleCenter==2 and middleRight==2 and care==1){middleLeft=2;care=0;} if(bottomLeft==0 and bottomCenter==2 and bottomRight==2 and care==1){bottomLeft=2;care=0;} if(topLeft==2 and middleCenter==0 and bottomRight==2 and care==1){middleCenter=2;care=0;} if(topLeft==0 and middleCenter==2 and bottomRight==2 and care==1){topLeft=2;care=0;} if(topLeft==2 and middleCenter==2 and bottomRight==0 and care==1){bottomRight=2;care=0;} if(topRight==2 and middleCenter==0 and bottomLeft==2 and care==1){middleCenter=2;care=0;} if(topRight==0 and middleCenter==2 and bottomLeft==2 and care==1){topRight=2;care=0;} if(topRight==2 and middleCenter==2 and bottomLeft==0 and care==1){bottomLeft=2;care=0;} if(fourCorners==1 and care==1){ if(topLeft==0 and topRight==1 and bottomLeft==1 and bottomRight==1 and care==1){topLeft=2;care=0;} if(topLeft==1 and topRight==0 and bottomLeft==1 and bottomRight==1 and care==1){topRight==2;care=0;} if(topLeft==1 and topRight==1 and bottomLeft==0 and bottomRight==1 and care==1){bottomLeft=2;care=0;} if(topLeft==1 and topRight==1 and bottomLeft==1 and bottomRight==0 and care==1){bottomRight==2;care=0;} } if(topLeft==1 and topRight==1 and bottomLeft==1 and bottomRight==1 and middleCenter==0 and care==1){middleCenter=2;care=0;} if(topCenter==1 and bottomCenter==1 and middleLeft==1 and middleRight==1 and middleCenter==0 and care==1){middleCenter=2;care=0;} if(topLeft==1 and topCenter==0 and topRight==1 and middleCenter==1 and bottomCenter==1 and care==1){topCenter=2;care=0;} if(bottomLeft==1 and bottomCenter==0 and bottomRight==1 and middleCenter==1 and topCenter==1 and care==1){bottomCenter=0;care=0;} if(topLeft==1 and middleLeft==0 and bottomLeft==1 and middleCenter==1 and middleRight==1 and care==1){middleLeft=2;care=0;} if(topRight==1 and middleRight==0 and bottomRight==1 and middleCenter==1 and middleLeft==1 and care==1){middleRight=2;care=0;} if(topLeft==1 and middleLeft==0 and bottomLeft==1 and care==1){middleLeft=2;care=0;} if(topCenter==1 and middleCenter==0 and bottomCenter==1 and care==1){middleCenter=2;care=0;} if(topRight==1 and middleRight==0 and bottomRight==1 and care==1){middleRight=2;care=0;} if(topLeft==0 and middleLeft==1 and bottomLeft==1 and care==1){topLeft=2;care=0;} if(topCenter==0 and middleCenter==1 and bottomCenter==1 and care==1){topCenter=2;care=0;} if(topRight==0 and middleRight==1 and bottomRight==1 and care==1){topRight=2;care=0;} if(topLeft==1 and middleLeft==1 and bottomLeft==0 and care==1){bottomLeft=2;care=0;} if(topCenter==1 and middleCenter==1 and bottomCenter==0 and care==1){bottomCenter=2;care=0;} if(topRight==1 and middleRight==1 and bottomRight==0 and care==1){bottomRight=2;care=0;} if(topLeft==1 and topCenter==1 and topRight==0 and care==1){topRight=2;care=0;} if(middleLeft==1 and middleCenter==1 and middleRight==0 and care==1){middleRight=2;care=0;} if(bottomLeft==1 and bottomCenter==1 and bottomRight==0 and care==1){bottomRight=2;care=0;} if(topLeft==1 and topCenter==0 and topRight==1 and care==1){topCenter=2;care=0;} if(middleLeft==1 and middleCenter==0 and middleRight==1 and care==1){middleCenter=2;care=0;} if(bottomLeft==1 and bottomCenter==0 and bottomRight==1 and care==1){bottomCenter=2;care=0;} if(topLeft==0 and topCenter==1 and topRight==1 and care==1){topLeft=2;care=0;} if(middleLeft==0 and middleCenter==1 and middleRight==1 and care==1){middleLeft=2;care=0;} if(bottomLeft==0 and bottomCenter==1 and bottomRight==1 and care==1){bottomLeft=2;care=0;} if(topLeft==1 and middleCenter==0 and bottomRight==1 and care==1){middleCenter=2;care=0;} if(topLeft==0 and middleCenter==1 and bottomRight==1 and care==1){topLeft=2;care=0;} if(topLeft==1 and middleCenter==1 and bottomRight==0 and care==1){bottomRight=2;care=0;} if(topRight==1 and middleCenter==0 and bottomLeft==1 and care==1){middleCenter=2;care=0;} if(topRight==0 and middleCenter==1 and bottomLeft==1 and care==1){topRight=2;care=0;} if(topRight==1 and middleCenter==1 and bottomLeft==0 and care==1){bottomLeft=2;care=0;} }}void gameDisplay(){ if(topLeft==0){cout<<" ";} if(topLeft==1){cout<<"X";} if(topLeft==2){cout<<"O";} cout<<"|"; if(topCenter==0){cout<<" ";} if(topCenter==1){cout<<"X";} if(topCenter==2){cout<<"O";} cout<<"|"; if(topRight==0){cout<<" ";} if(topRight==1){cout<<"X";} if(topRight==2){cout<<"O";} cout<<endl; cout<<"_____"<<endl; if(middleLeft==0){cout<<" ";} if(middleLeft==1){cout<<"X";} if(middleLeft==2){cout<<"O";} cout<<"|"; if(middleCenter==0){cout<<" ";} if(middleCenter==1){cout<<"X";} if(middleCenter==2){cout<<"O";} cout<<"|"; if(middleRight==0){cout<<" ";} if(middleRight==1){cout<<"X";} if(middleRight==2){cout<<"O";} cout<<endl; cout<<"_____"<<endl; if(bottomLeft==0){cout<<" ";} if(bottomLeft==1){cout<<"X";} if(bottomLeft==2){cout<<"O";} cout<<"|"; if(bottomCenter==0){cout<<" ";} if(bottomCenter==1){cout<<"X";} if(bottomCenter==2){cout<<"O";} cout<<"|"; if(bottomRight==0){cout<<" ";} if(bottomRight==1){cout<<"X";} if(bottomRight==2){cout<<"O";} cout<<endl<<endl<<endl<<endl<<endl;}void playerInput(){ playerMoveAccept=0; while(playerMoveAccept==0){ playerMove=0; while(playerMove!=1 and playerMove!=2 and playerMove!=3 and playerMove!=4 and playerMove!=5 and playerMove!=6 and playerMove!=7 and playerMove!=8 and playerMove!=9 and playerMove!=99){ cin>>playerMove; if(playerMove==1 and topLeft==0){topLeft=1;playerMoveAccept=1;} if(playerMove==1 and topLeft==1 and topLeft==2){playerMove=0;} if(playerMove==2 and topCenter==0){topCenter=1;playerMoveAccept=1;} if(playerMove==2 and topCenter==1 and topCenter==2){playerMove=0;} if(playerMove==3 and topRight==0){topRight=1;playerMoveAccept=1;} if(playerMove==3 and topRight==1 and topRight==2){playerMove=0;} if(playerMove==4 and middleLeft==0){middleLeft=1;playerMoveAccept=1;} if(playerMove==4 and middleLeft==1 and middleLeft==2){playerMove=0;} if(playerMove==5 and middleCenter==0){middleCenter=1;playerMoveAccept=1;} if(playerMove==5 and middleCenter==1 and middleCenter==2){playerMove=0;} if(playerMove==6 and middleRight==0){middleRight=1;playerMoveAccept=1;} if(playerMove==6 and middleRight==1 and middleRight==2){playerMove=0;} if(playerMove==7 and bottomLeft==0){bottomLeft=1;playerMoveAccept=1;} if(playerMove==7 and bottomLeft==1 and bottomLeft==2){playerMove=0;} if(playerMove==8 and bottomCenter==0){bottomCenter=1;playerMoveAccept=1;} if(playerMove==8 and bottomCenter==1 and bottomCenter==2){playerMove=0;} if(playerMove==9 and bottomRight==0){bottomRight=1;playerMoveAccept=1;} if(playerMove==9 and bottomRight==1 and bottomRight==2){playerMove=0;} if(playerMove==99){cout<<"\n\nDo you want to Quit? 1} Yes 2} No\n\n"; while(playerMove!=1 and playerMove!=2){ cin>>playerMove; } if(playerMove==1){playerMove=99;win=8;} if(playerMove==2){playerMove=0;cout<<"\n\n\n\n\n";gameDisplay();} } cout<<"\n\n\n\n\n"; } }}void compInput(){ compAI(); compMoveAccept=0; if(care==1){ while(compMoveAccept==0){ srand(time(0)); compMove=((rand()%9)+1); if(compMove==1 and topLeft==0){topLeft=2;compMoveAccept=1;} if(compMove==1 and topLeft==1 and topLeft==2){compMove=0;} if(compMove==2 and topCenter==0){topCenter=2;compMoveAccept=1;} if(compMove==2 and topCenter==1 and topCenter==2){compMove=0;} if(compMove==3 and topRight==0){topRight=2;compMoveAccept=1;} if(compMove==3 and topRight==1 and topRight==2){compMove=0;} if(compMove==4 and middleLeft==0){middleLeft=2;compMoveAccept=1;} if(compMove==4 and middleLeft==1 and middleLeft==2){compMove=0;} if(compMove==5 and middleCenter==0){middleCenter=2;compMoveAccept=1;} if(compMove==5 and middleCenter==1 and middleCenter==2){compMove=0;} if(compMove==6 and middleRight==0){middleRight=2;compMoveAccept=1;} if(compMove==6 and middleRight==1 and middleRight==2){compMove=0;} if(compMove==7 and bottomLeft==0){bottomLeft=2;compMoveAccept=1;} if(compMove==7 and bottomLeft==1 and bottomLeft==2){compMove=0;} if(compMove==8 and bottomCenter==0){bottomCenter=2;compMoveAccept=1;} if(compMove==8 and bottomCenter==1 and bottomCenter==2){compMove=0;} if(compMove==9 and bottomRight==0){bottomRight=2;compMoveAccept=1;} if(compMove==9 and bottomRight==1 and bottomRight==2){compMove=0;} cout<<"\n\n\n\n\n"; } }}void winCheck(){ if(topLeft==1 and topCenter==1 and topRight==1){win=1;} if(middleLeft==1 and middleCenter==1 and middleRight==1){win=1;} if(bottomLeft==1 and bottomCenter==1 and bottomRight==1){win=1;} if(topLeft==1 and middleLeft==1 and bottomLeft==1){win=1;} if(topCenter==1 and middleCenter==1 and bottomCenter==1){win=1;} if(topRight==1 and middleRight==1 and bottomRight==1){win=1;} if(topLeft==1 and middleCenter==1 and bottomRight==1){win=1;} if(topRight==1 and middleCenter==1 and bottomLeft==1){win=1;} if(topLeft==1 and bottomLeft==1 and topRight==1 and bottomRight==1 and middleCenter==1){win==5;} if(topCenter==1 and bottomCenter==1 and middleLeft==1 and middleRight==1 and middleCenter==1){win=5;} if(topLeft==1 and topCenter==1 and topRight==1 and middleCenter==1 and bottomCenter==1){win=5;} if(bottomLeft==1 and bottomCenter==1 and bottomRight==1 and middleCenter==1 and topCenter==1){win=5;} if(topLeft==1 and middleLeft==1 and bottomLeft==1 and middleCenter==1 and middleRight==1){win=5;} if(middleLeft==1 and middleCenter==1 and middleRight==1 and topRight==1 and bottomRight==1){win=5;} if(fourCorners==1){ if(topLeft==1 and bottomLeft==1 and topRight==1 and bottomRight==1){win=7;} } if(topLeft!=0 and topCenter!=0 and topRight!=0 and middleLeft!=0 and middleCenter!=0 and middleRight!=0 and bottomLeft!=0 and bottomCenter!=0 and bottomRight!=0){win==3;} if(topLeft==2 and topCenter==2 and topRight==2){win=2;} if(middleLeft==2 and middleCenter==2 and middleRight==2){win=2;} if(bottomLeft==2 and bottomCenter==2 and bottomRight==2){win=2;} if(topLeft==2 and middleLeft==2 and bottomLeft==2){win=2;} if(topCenter==2 and middleCenter==2 and bottomCenter==2){win=2;} if(topRight==2 and middleRight==2 and bottomRight==2){win=2;} if(topLeft==2 and middleCenter==2 and bottomRight==2){win=2;} if(topRight==2 and middleCenter==2 and bottomLeft==2){win=2;} if(topLeft==2 and bottomLeft==2 and topRight==2 and bottomRight==2 and middleCenter==2){win=4;} if(topCenter==2 and bottomCenter==2 and middleLeft==2 and middleRight==2 and middleCenter==2){win=4;} if(topLeft==2 and topCenter==2 and topRight==2 and middleCenter==2 and bottomCenter==2){win=4;} if(bottomLeft==2 and bottomCenter==2 and bottomRight==2 and middleCenter==2 and topCenter==2){win=4;} if(topLeft==2 and middleLeft==2 and bottomLeft==2 and middleCenter==2 and middleRight==2){win=4;} if(middleLeft==2 and middleCenter==2 and middleRight==2 and topRight==2 and bottomRight==2){win=4;} if(fourCorners==1){ if(topLeft==2 and bottomLeft==2 and topRight==2 and bottomRight==2){win=6;} }}int main(){ while (restart==1){ cout<<"What Difficulty do you want? 1} Easy 2} Medium 3} Hard\n\n"; difficulty=0; while(difficulty!=1 and difficulty!=2 and difficulty!=3){ cin>>difficulty; } cout<<"\n\n"; if(difficulty==1){ difficulty=7; } if(difficulty==2){ difficulty=6; } if(difficulty==3){ difficulty=0; } cout<<"NOTE: Type 99 on your turn for an option to quit mid-game.\n\n\n\n\n"; cout<<"Do you want to play with the extra 'Four Corners' rule?\n(Press '1' for yes or '2' for no.)\n\n"; fourCorners=0; while(fourCorners!=1 and fourCorners!=2){ cin>>fourCorners; } cout<<endl<<endl<<endl<<endl<<endl; win=0;topLeft=0;topCenter=0;topRight=0;middleLeft=0;middleCenter=0;middleRight=0;bottomLeft=0;bottomCenter=0;bottomRight=0; srand(time(0)); turn=((rand()%2)+1); gameDisplay(); while(win==0){ while (turn==1 and win==0){ cout<<"Your turn!\n\n"; playerInput(); turn=2; gameDisplay(); winCheck(); } while (turn==2 and win==0){ cout<<"Computer's turn!\n\n\n\n\n"; compInput(); turn=1; gameDisplay(); winCheck(); } } if(win==1){ cout<<"Hurrah!! You won against your computer!!!\n\n\n"; } if(win==2){ cout<<"You lost against your own computer!!!\n\n\n"; } if(win==3){ cout<<"Wow! You tied against your computer!!!!\n\n\n"; } if(win==4){ cout<<"What the...... Your computer just owned you!!!!!! Your computer got a double win!!!!!!!!!!\n\n\n"; } if(win==5){ cout<<"Dang! You just double beat your own computer!!! ppppsssshhh So much for Artificial Intelligence hahaha:)\n\n\n"; } if(win==6){ cout<<"Woah!! Your computer used the Four Corners rule against you!!!\n\n\n"; } if(win==7){ cout<<"Woah!! You used the Four Corners rule againt your computer!!!\n\n\n"; } if(win==8){cout<<"You quit the game? Hopefully not because of a bug...;D\n\n\n";} cout<<"Would you like to retart?\n(Press '1' for yes or '2' for no.)\n"; restart=0; while(restart!=1 and restart!=2){cin>>restart;} cout<<"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"; } cout<<"Tic-Tac-Toe game script finished.\n\n"; system("pause");}\\\\This line is not part of the code, just me saying there is a total of 337 lines in my Tic-Tac-Toe Program. :D \\\\[/source]


Feel free to plug this into any compiler/debugger and check to see how it runs and plays.

P.S.~ I'm pretty sure you know which one of these games is the "Half Game":D

Pause at the end of Command Line Scripts?

28 August 2012 - 06:05 PM

How can I pause at the end of my Command Line (Basic) Scripts (Programs)? All I want to do is, at the end of my running application, have it pause and wait until any key is pressed before exiting so that any final lines of text on the screen will stayand be legible.

~Saint Squireen~

PARTNERS