Question: at this point "if ( cSquare1 != '1' )", why do you only test the "side win conditions, 1 2 3 and 1 4 7" ? Instead of adding the middle "1 5 9".
I've done pretty much everything the same way, but when I run the program, it tells me that "Player 1 wins!" at the moment I input a number. Even if its a number like 5234!!
This even happens when I try to run the downloadable code from xoax.net
Also a note to everyone saying that there is a better way:
This lesson is meant to give new programmers a fun exercise to tie everything they learned in lessons 1-8 together. It also intentionally demonstrates situations that would better suited with arrays. The observant viewer would notice that lesson 10 is one-dimensional arrays.
Another great thing about this lesson is that it introduces very subtly global and local scope which is later covered in detail in lesson 11.
Also don't just tell me where to download the code. Scroll over the code so i can actually see and type it my self instead of bouncing all around an not showing somethings...
i did it, but i haven't really learned anything just copied :(. no way i could do this again without this video up. Practice makes perfect i guess... maybe if i do this 5 time i will start to actually understand what's behind it.
Heh, I'm 13 and this all makes sense to me. This is my first time learning to program and this dude is a LOT of help. I'd love to make this but it seems time consuming but at least I know how to :D
Yes, he's using Hungarian notation. And robbbert, why do you care about making your code less lines if you're just stacking code and making it less readable? It's okay to have a code that is a lot of lines, I'd rather read 200 lines of well written code than 40 lines of badly written, jumbled up code. Although you could condense some of this in a neat way by using arrays couldn't you?
If I type 1x it recognize the move, as 2o, and so on, and never pop up the invalid move as should be.....Why is this happening, the program is asking for equal to '1' or '2',
1x should be pooping invalid move and not accepting in ???
I tried to make a tic tac toe game without looking at this video (as a challenge). However, I didn't realize it was with two REAL players in mind. I thought it was Player vs Computer. My player vs AI version works, but the AI isn't proper. Rather than actively seeking out to make a straight line, the computer simply chooses (at random) a square that hasn't been filled out yet.
@LilLokoteX3 If this is what you want, then you should at the very least add if statements around this, that checks the OS platform your're running, in order to be able to adopt the logic across OS platforms. Not that it matters a lot in these games but maybe it does for some, so i'll stfu from here on and out, cheers.
checking for a valid move entry from the player is much longer than it needs to be. Using an array of characters for the game board instead of 9 separately named integers:
cin >> nextMove;
int move = atoi(&nextMove); // converts the character to an int
@thedarklordx Really thats a relief. I am making 3d animations in 3d max and then code it with microsoft studio. It takes me 6 or 7 hours just to make 1 charachter, make the mesh, then the bones, rig it, give it textures and finnaly paint it. I have alot more respect for the makers of video games.
Hehe, the tic tac toe game is simple and straight forward, so take your own suggestion seriously :) high-end game development is an endless supply of coffee as I am sure some say. Oh and these complex games apart from the physics algorithms that lure your 3d objects around on the screen are hard to comprehend but also the 3d object have to be designed and I would never claim that it's a job for one man alone ;)
ok i am extremely lost here..i managed to copy everything and it didnt work..i have an error saying "error expecting a '}'"...can anyone help me? ive also tried grabbing the code off the site and tht didnt work either...i dnt get a board just sum symbols, numbers, and letters and it saying Press any key to continue" so can sum1 kindly lve me a message on sum help!!! i rly wanna learn this stuff
@epidemiq666 "error expecting a '}'" means you're missing a closing curly bracket somewhere. I downloaded the code and it worked. Did you double click the .sln file to open it?
hmm. How come in your program you didnt type in after the include statements using namespace std instead of having to type in std::cout over and over again?
i see at 2:53 theres pretty much elseif expressions(or whatever), does c++ support select case...case... expressions? , cos vb does and its more simple than using elseif for me
i only know like really really basic c++ like nearly nothing but i was able to make a simple calculator. It took me 6 lines of code. Nothing too special.
Is "Do" anything like the "For" command? Im familiar with "While", but I haven't seen anything like "Do". Only in Dark Basic, which I didn't learn very well.
@Gr8gabe As explained in the previous videos, while and do while are basically the same, only with do while the code is run at least once because the condition is checked at the end of the loop, not at the beginning.
@NyubisVideos I see. Thanks very much. I'm much more familiar with ActionScript which I've been told is very close to C. And from what I can tell, there's not much of a difference. Thanks for posting, as well.
@Gr8gabe Not very familiar with actionscript but the important part of c++ is that it's object oriented while C is procedural. the tic tac toe game as the video guy made it could be C as well, it's not a program well suited to demonstrate C++.. However from a learning point of view, some argue that it's better to learn procedural programming at first.
I'm using Xcode and it gives me the error on line 3, " '::main' must return 'int' ". I tried a couple things, but I'm new, so I am not sure what to do. It's really annoying, since it is the only error/ warning. Any help? (please keep in mind that I'm new.)
@LordFlippy559 um its best if i saw your code but my best guess would be you didn't put a ; at the end of the statment before char or the line that char is on is indented improperly if you have any more trouble email me at ghostshooter@live.com
@pimpdog93 Thanks for the help. I figured it out, I was trying to use numbers in the char name, such as "char 1 ('1');, but i changed it to "char one ('1') and it worked fine.
@requimrar gotos are a no no in programming...i did my tic tac toe game using fuctions and 2 array ...i did it before watching this tutorial and it is alot shorter even than this one ;)
So, should I be able to recreate the whole thing before moving on. I understand mostly whats going on but at the moment I would not be able to make my own without help.
haha i made a battleships game in c++ and i did a similar thing. i totally over-coded it because i didn't know any neat shortcuts, or anything much about structuring code efficiently.
damn i could write it so much better now, i should give it another shot. you should to, it will make you feel better how much you've improved ;)
@wildboy One, they have lots of people working on the project. Two, its not only C++, they are also using OpenGL or Allegro or SDL, some kind of object oriented programming library and they are also using the Blizard's Engine to make the maps and the items, so the code only handles the actual value's of each items, not everything about the game.
It helps if you use multiple tutorials. Sometimes its boriong to just study c++, but if you really want to get the code in your head without ti becmong super annoying watch different peoples tutorials. That way you leanr it over a few times in a different way.
A really could tutorial series is
antiRTFM 's tutorials. If you are stupid don't worry trust me it doesn't get any simpler than his explanations
I thought I would try to make my own Tic Tac Toe game using what I had learned inthe first 8 videos. I did it and was proud that it was only 150 lines of code, so I checked what they had... and they only had 69... *cry*
@MrKiller00224 actually as a rule of thumb if a programmer manages to do the same thing as you in less lines of code than you there usually the more experienced/better programmer
@thedarklordx r u even a programmer?? that statement is completely invalid, u can say that for assembly but not for high level programming... actually, if u were a computer science student anywhere, u would know this...
@thedarklordx thats not true. It depends on the coding style, some people like to express them selfs using more code, but allowing that code to describe it self more easily, also in many situations less code does not mean that the program is faster. So generically thats a false argument you brought up there. Less code could however reduce the number of bugs in a system, since you got some 15 - 50 errors per 1000 lines of code (industry average), and growing with a stochastic exponential.
@BigHomieJet so? hes only 2x better than you +12 that means your pretty good considering that hes prolly been doin this for years and that your just learning
@Ethaninja Yes the way to do it with so little is to trey to remove retoricle featyres. and to stack simular code. EX
cout << "blah"; cout <<"\nBlah again";
int a; int b; int c; int d;
and if you do this be careful to have a backed up original.
by the way in my tictactoe beating the ai is inposible. I have challenged my friends to beat it and they have never one. the trick is always to get the ai to try and get the spot agacent to the players picked one. Anyways the key to computer programming
@robbbert229 is Logic because all computer programming is for is for directing and using the programmed logic.after all all a computer is made up of is trillions of transistors. Transistors are like a valve that when a small current activates it lets a huge one pass through.
I wrote the code just like it is but gives me that error | fatal error C1075: end of file found before the left brace '{' at 'c:\...(bla bla)main.cpp(20)' was matched | what shall i do wrong? Please Reply
Question: at this point "if ( cSquare1 != '1' )", why do you only test the "side win conditions, 1 2 3 and 1 4 7" ? Instead of adding the middle "1 5 9".
RemovdSande11 1 day ago in playlist C++
aburrido
JohanChk 1 month ago
why wont it let me debug? its greyed out in the sub menu and when i hit ctrl+f5 nothing happens
TriVertex 1 month ago in playlist C++ Beginner Tutorials
I've done pretty much everything the same way, but when I run the program, it tells me that "Player 1 wins!" at the moment I input a number. Even if its a number like 5234!!
This even happens when I try to run the downloadable code from xoax.net
help?
Jotenonsos 1 month ago
Fking SUBSCRIBED!
0Raidenz0 2 months ago in playlist C++ Beginner Tutorials
this shit is hurdddd... :(
politicaltruth42 2 months ago
if (cNextMove == '1' && sq1 = '1')
cNextMove gives me this message: "Expression must be a modifiable lvalue."
any ideas?
prestigeScript 3 months ago
@prestigeScript You only put 1 equals it should be sq1 == '1'
0ChrisMackle0 2 months ago
Also a note to everyone saying that there is a better way:
This lesson is meant to give new programmers a fun exercise to tie everything they learned in lessons 1-8 together. It also intentionally demonstrates situations that would better suited with arrays. The observant viewer would notice that lesson 10 is one-dimensional arrays.
Another great thing about this lesson is that it introduces very subtly global and local scope which is later covered in detail in lesson 11.
Arieken 3 months ago
to fix this code just a tad you need to move the
iPlayerTurn = 1;
so it is inside the nested
if (cPlayAgain == 'y')
otherwise the next else statement will not be referenced with the if and will generate an error.
Arieken 3 months ago
@Arieken The else doesn't belong to that if statement, it belongs to if(bGameOver)
prestigeScript 3 months ago
to viewers: you should visit their website xoax (dot) net
its a great websitte
betbetsukbet 4 months ago
Dude ur cool helps me alot from my school stuff
xXxemoskatergirlxXx1 5 months ago
i love you
0HeRenTai0 5 months ago
Why do i keep recieving this message when debugging the code: main.cpp
MSVCRTD.lib(crtexe.obj) : error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup
wmlilgiant07 6 months ago
You should definitely be a teacher or something!
Original602 6 months ago
that was confusing
SteakOfAnger 7 months ago 2
AH! I see my problem, I tried to program the game with a while loop instead using a do while loop!! UGH!
KillerAragon 7 months ago
Got it all now what :$ I can't play it ... lol
Fabio199810 7 months ago
on a side not how to turn on the line numbers since mine is currently blank unless i dubble click which just adds a mark on that one line...
MrFox1231 7 months ago
you should be typing the code and telling us what it means as you go and then do the over view...im not learning a fucking thing from you
Alaynia100 7 months ago
i did not understand that code... i should go and learn more about chars.
TheGamingVEVO 8 months ago
i feel like a boss changing up the code every-so-often to make it better.
codecvr12 9 months ago
Also don't just tell me where to download the code. Scroll over the code so i can actually see and type it my self instead of bouncing all around an not showing somethings...
kryptic127 9 months ago
all that code to play tic tac toe with numbers in a console window.... i have a new found respect for games like skyrim
kryptic127 9 months ago 8
I find this to be a good way to remind myself about the basics before, say, a test.
Remerai 9 months ago
It will be easier to read your code if its Allman style :)
DeVTeo 9 months ago
I would add a light rain sound effect in the background so the mic static doesn't sound bad.:)
SirQuote 9 months ago
Simple and lucid explanation and also very useful unlike many other tutorials that just yield a do nothing Hello World. Thanks.
bhushan80 10 months ago 2
the guy reminds me of garfield for some reason
KidsSayNoobALot 11 months ago
Could you use the system("clr"); command for the refresh so the boards wouldn't get stacked?
TheSoulAssassin20 11 months ago
Isn't there a possibility to play against the computer?
Is there a code wich clears the screen??
I don't like it if the display bord loads again and again which causes the dialog to get full
where should I put it??
MDSNproductions 11 months ago
@MDSNproductions Using just things you have learned to this point...
just after your include, add another include for stdlib.h
This library allows you to use the system() function to pass DOS Console commands.
CLS is the console command to clear screen so...
system("CLS");
There are better ways, but they are for later. ;)
eslake 11 months ago
Comment removed
MDSNproductions 11 months ago
I programmed something very similar, only python, and made it all by myself! :)
nikobroo 1 year ago
i did it, but i haven't really learned anything just copied :(. no way i could do this again without this video up. Practice makes perfect i guess... maybe if i do this 5 time i will start to actually understand what's behind it.
toogood75 1 year ago
if u pause at 0:10 you will notice binary in the background.... on a c++ tutorial...
seems like the dog is rounding up the chickens, as we say in the south.
Sikeman214 1 year ago
@Sikeman214 So...? What's the problem with that? Boolian code is binary... so it would make sense... (BTW sorry for replying 10 months later <.<)
0Raidenz0 2 months ago
@0Raidenz0 well dammy diggy, didn't dang know a pro would be watching a beginner C++ Tutorial, hot diggidy, as my confederate "negras" call me!
Sikeman214 2 months ago
@Sikeman214 I'm learning too, except i'm actually learning, and i didn't diggidy hot shmiggidy understand a shit you said
0Raidenz0 1 month ago
I'm 11 and i can follow your tutorials, Your awesome, just, awesome.
lukieie 1 year ago
great vid i just want to know though what comes at the end every time i enter the current code there are build errors
thedutchwhale 1 year ago
I....I did it!!
tuchdoun 1 year ago
You're doing great, continue the good work, thank you
thefikirkanboleh 1 year ago 26
You're doing great, continue the good work, thank you
thefikirkanboleh 1 year ago 2
This has been flagged as spam show
You're doing great, continue the good work, thank you
thefikirkanboleh 1 year ago
thank you, you're doing great, continue the good work
thefikirkanboleh 1 year ago 2
i never knew tic tac toe could be so complicated...
MEANmadMATT 1 year ago
I can't tell if there's a space between bGameOver and (true). Does it matter if I add a space or not? Or will that mess it up?
GeekingForJesus 1 year ago
@GeekingForJesus It doesn't matter, but it is neater if you do add a space.
TheRealNishok 1 year ago
awesome info keep up the good work. your lessons are really helping me learn!
egmaverikc84 1 year ago 2
Awesome! Nice and fun exercise, great tutorial and easy to understand source code as well.
ScaredHelmet 1 year ago 41
Heh, I'm 13 and this all makes sense to me. This is my first time learning to program and this dude is a LOT of help. I'd love to make this but it seems time consuming but at least I know how to :D
Therifle123 1 year ago
This has been flagged as spam show
veiw my link for 100% clean and working keygen for vb 2010 ult.......PLUS VB 2010 DOWNLOAD....
hatred82 1 year ago
@MegaCamu if you use void main() you cant use return 0. try changing void main() to int main() or erasing return 0 :)
MegaJonas90 1 year ago
When i try to use the main.cpp file, and build it, i get this error: ´::main´must return ínt´
MegaCamu 1 year ago
18 people don't know what tic-tac-toe is :p
revineu 1 year ago
you, are my c++ hero
lol9392 1 year ago 2
to keep from using std at the beginning of every console output and input i could just type using namespace std: at the beginning of the code rite?
NeatStuff4iTouch 1 year ago
he makes sense unlike others, haha
jdfskitz 1 year ago
Yes, he's using Hungarian notation. And robbbert, why do you care about making your code less lines if you're just stacking code and making it less readable? It's okay to have a code that is a lot of lines, I'd rather read 200 lines of well written code than 40 lines of badly written, jumbled up code. Although you could condense some of this in a neat way by using arrays couldn't you?
Hadesminion13 1 year ago
now i have a console project but how can i play this game???
Agend1121 1 year ago
Great tutorial as always...................
If I type 1x it recognize the move, as 2o, and so on, and never pop up the invalid move as should be.....Why is this happening, the program is asking for equal to '1' or '2',
1x should be pooping invalid move and not accepting in ???
omahdezavalos 1 year ago
Is there any reason why you call them cSquares? Or is that just a little naming convention you've got a habbit of?
Ethaninja 1 year ago
@Ethaninja I believe he is using Hungarian notation, where the name of a variable indicates the variable's type.
SlyAnubis 1 year ago
I got an error when compiling the original program. ' ::main' must return 'int'
What do I do?
OpenTheo 1 year ago
Nevermind I found out the answer after searching a bit.
USE - int main(void)
DO NOT USE - void main()
OpenTheo 1 year ago
@OpenTheo i just leave the brackets empty as long as its a one string code like this
zwerty007 1 year ago
You lost me here meh >.< This is way out of my league ;D
DoItWithADance 1 year ago
I tried to make a tic tac toe game without looking at this video (as a challenge). However, I didn't realize it was with two REAL players in mind. I thought it was Player vs Computer. My player vs AI version works, but the AI isn't proper. Rather than actively seeking out to make a straight line, the computer simply chooses (at random) a square that hasn't been filled out yet.
DasPooperTrooper 1 year ago
@DasPooperTrooper How'd you make it choose a random square?
SirRawr 1 year ago
Type in somewhere in the beginning...
system("TITLE anything you want");
system("COLOR 9");
LilLokoteX3 1 year ago
@LilLokoteX3 If this is what you want, then you should at the very least add if statements around this, that checks the OS platform your're running, in order to be able to adopt the logic across OS platforms. Not that it matters a lot in these games but maybe it does for some, so i'll stfu from here on and out, cheers.
guldahlrahmi 1 year ago
checking for a valid move entry from the player is much longer than it needs to be. Using an array of characters for the game board instead of 9 separately named integers:
cin >> nextMove;
int move = atoi(&nextMove); // converts the character to an int
if (board[move-1] == nextMove)
{ // move is valid
}
else // move is invalid
License2Bill 1 year ago
Almost completed this one. How the fuck is tictactoe so hard. I cant even imagine the code for a game like Oblivion IV
Semperfi918 1 year ago
@Semperfi918 dude it couldnt be any longer than 250,000 lines of code
thedarklordx 1 year ago
@thedarklordx Wth only 250,000 thats alot then again it takes 4 0r 5years to make with hundreds of people working on it I guess thats reasonable.
Semperfi918 1 year ago
@Semperfi918 250,000 lines wouldnt actually take years to do unless you barely worked
thedarklordx 1 year ago
@thedarklordx Really thats a relief. I am making 3d animations in 3d max and then code it with microsoft studio. It takes me 6 or 7 hours just to make 1 charachter, make the mesh, then the bones, rig it, give it textures and finnaly paint it. I have alot more respect for the makers of video games.
Semperfi918 1 year ago
@Semperfi918 good good im glad i helped
thedarklordx 1 year ago
Comment removed
guldahlrahmi 1 year ago
Hehe, the tic tac toe game is simple and straight forward, so take your own suggestion seriously :) high-end game development is an endless supply of coffee as I am sure some say. Oh and these complex games apart from the physics algorithms that lure your 3d objects around on the screen are hard to comprehend but also the 3d object have to be designed and I would never claim that it's a job for one man alone ;)
guldahlrahmi 1 year ago
Dude what's with the systems Hungarian?
MeshGearFox 1 year ago
I didn't understand any thing From this lesson but i am sure that a few did
XenonXero 1 year ago
this is neat but you can do this a lot easily doing for loops. still, a good exercise.
lostfacts 1 year ago
ok i am extremely lost here..i managed to copy everything and it didnt work..i have an error saying "error expecting a '}'"...can anyone help me? ive also tried grabbing the code off the site and tht didnt work either...i dnt get a board just sum symbols, numbers, and letters and it saying Press any key to continue" so can sum1 kindly lve me a message on sum help!!! i rly wanna learn this stuff
epidemiq666 1 year ago
@epidemiq666 :HAHA, u probly missed the } at the end of the program, the { and } help start and end the program i hope that helped
TheMadcroc23 1 year ago
@epidemiq666 "error expecting a '}'" means you're missing a closing curly bracket somewhere. I downloaded the code and it worked. Did you double click the .sln file to open it?
howitzer24 1 year ago
hmm. How come in your program you didnt type in after the include statements using namespace std instead of having to type in std::cout over and over again?
U83R8UDDH4 1 year ago
did you make this by yourself? This is awesome.
mynameisjonas45 1 year ago
i see at 2:53 theres pretty much elseif expressions(or whatever), does c++ support select case...case... expressions? , cos vb does and its more simple than using elseif for me
Wegzo 1 year ago
@Wegzo The selective structure: switch. google cplusplus reference
guldahlrahmi 1 year ago
i only know like really really basic c++ like nearly nothing but i was able to make a simple calculator. It took me 6 lines of code. Nothing too special.
1996kostas1996 1 year ago
Mine just shows the TicTacToe field and then stops.........damn
WairRazZ 1 year ago
Is "Do" anything like the "For" command? Im familiar with "While", but I haven't seen anything like "Do". Only in Dark Basic, which I didn't learn very well.
Gr8gabe 1 year ago
@Gr8gabe As explained in the previous videos, while and do while are basically the same, only with do while the code is run at least once because the condition is checked at the end of the loop, not at the beginning.
NyubisVideos 1 year ago
@NyubisVideos I see. Thanks very much. I'm much more familiar with ActionScript which I've been told is very close to C. And from what I can tell, there's not much of a difference. Thanks for posting, as well.
Gr8gabe 1 year ago
@Gr8gabe Not very familiar with actionscript but the important part of c++ is that it's object oriented while C is procedural. the tic tac toe game as the video guy made it could be C as well, it's not a program well suited to demonstrate C++.. However from a learning point of view, some argue that it's better to learn procedural programming at first.
guldahlrahmi 1 year ago
There is a shorter way to code the win game condition with the '||' operator instead of using all those 'if' statements.
iVuTECH 1 year ago
This has been flagged as spam show
very informational... but boring T_T
theMastrgamr 1 year ago
I'm using Xcode and it gives me the error on line 3, " '::main' must return 'int' ". I tried a couple things, but I'm new, so I am not sure what to do. It's really annoying, since it is the only error/ warning. Any help? (please keep in mind that I'm new.)
xoxILoveCatsxox 1 year ago
@xoxILoveCatsxox thats simple i had the same issue just change void main to int main and at the end of the program just put return 0;
pimpdog93 1 year ago
@pimpdog93 Im also having trouble with that, but after i change it to int main () it says primary expression expected before 'char'. Any ideas?
LordFlippy559 1 year ago
@LordFlippy559 um its best if i saw your code but my best guess would be you didn't put a ; at the end of the statment before char or the line that char is on is indented improperly if you have any more trouble email me at ghostshooter@live.com
pimpdog93 1 year ago
@pimpdog93 Thanks for the help. I figured it out, I was trying to use numbers in the char name, such as "char 1 ('1');, but i changed it to "char one ('1') and it worked fine.
LordFlippy559 1 year ago
WTF?
thomasbthomas 1 year ago
If you enter "123456" you will get six moves without mistakes.
PavelHvorostov 1 year ago
i like your intro music it matches your tutorials
neolegend7 1 year ago
is saying:
char cSquare1('1');
or
bool bGameOver(true);
The same as:
char cSquare1 = '1';
or
bool bGameOver = true;
can the "()" be replaced with "="? because i have learnt to use the = sign...
watermelonpizza 2 years ago
I did a tic tac toe in c++, it was full of gotos.
johnzkeePW 2 years ago
@johnzkeePW gotos are rarely needed in modern programming.
requimrar 1 year ago
@requimrar gotos are a no no in programming...i did my tic tac toe game using fuctions and 2 array ...i did it before watching this tutorial and it is alot shorter even than this one ;)
alexvisa1 1 year ago
have you tried writing this game using a multi-dimensional array?
Traviezo173 2 years ago
@Traviezo173 thats what i would do taswell.
benshelly 1 year ago
Make that into Int Main with a Return 0;
and have system("cls"); after each player's move
jakash3 2 years ago
i copyed everything i saw down and it works fine for me but is there a way to get rid of all the suff on the screen?
gamemak0r 2 years ago
system("clear");
1337NoobLord 2 years ago 2
didnt work but i found out what does...
system("cls");
gamemak0r 2 years ago 2
close enough :) yet dont use it if your using serious about making proper apps
since its windows specific it creates massive problems
1337NoobLord 2 years ago
can someone give me a complete code for these??? pls.. im begging... need to study it...
dimalibot0488 2 years ago
You could have just read the videos info on the right and navigated to the website to grab it.
kl0wn 2 years ago
is there a way to put the number of the line next to the code in visual c++?
thebiman 2 years ago
So, should I be able to recreate the whole thing before moving on. I understand mostly whats going on but at the moment I would not be able to make my own without help.
NoPrayer4TheDying 2 years ago
in the else statement of bGameOver has the Alternate player turn if(iPlayerTurn ==1){iPlayerTurn = 2;} else {iPlayerTurn = 1;}
Seantron13 2 years ago
My first tic-tac-toe was 558 lines :(
Brudof 2 years ago 3
LOL
Magmatwister 2 years ago
haha i made a battleships game in c++ and i did a similar thing. i totally over-coded it because i didn't know any neat shortcuts, or anything much about structuring code efficiently.
damn i could write it so much better now, i should give it another shot. you should to, it will make you feel better how much you've improved ;)
gnackattack 2 years ago
mine was 1000, but it had a full on unbeatable AI system.
JusTryinToFitIn 2 years ago
I did that once in gamemaker, it was 5000 lines
PaMu1337 2 years ago 2
@wildboy One, they have lots of people working on the project. Two, its not only C++, they are also using OpenGL or Allegro or SDL, some kind of object oriented programming library and they are also using the Blizard's Engine to make the maps and the items, so the code only handles the actual value's of each items, not everything about the game.
Hopefully this helped :D
CPUhacker24 2 years ago
Cool. Im already into OpenGL And want to learn it 100% through examples...
C++ And Open Gl Would be a good start to start
a proffessional game..? Assuming I had endless Time to make that game..?
And of course 3dSMAX 9 for animations and Models.:)
THats it? right?:P
Wulfgar12 2 years ago
Im gonna invest heavily in ONE game engine
then make ALOT of games through that engine:D
Wulfgar12 2 years ago
spot on, this is how Valve does it
gnackattack 2 years ago
Good luck, the ONLY company to get lucky like that is Valve.
retart441 2 years ago
oh dmn it's like alot of programming for the most simple game
pyromancer91 2 years ago
not if you really really look at what he types.
everything is understandable in relation to the output created.
Wulfgar12 2 years ago
thats intense... how do people make wow useing this stuff?
wildboy789789 2 years ago 2
Yes abit more respect for the programmers no eh?:;P
Wulfgar12 2 years ago 11
mmm guys i have a problem... how to create a multi letter constant? char doesn't work... plz help me!
FcGrreat 2 years ago
double????
XxNicxX11 2 years ago
I can't seem to remember all of this stuff. Maybe i'm just stupid
GreySnakeGenocide 2 years ago
Yes.
diegopmc 2 years ago
nah, i can't keep it in my head either ;P
kwlsk8a4life 2 years ago
It helps if you use multiple tutorials. Sometimes its boriong to just study c++, but if you really want to get the code in your head without ti becmong super annoying watch different peoples tutorials. That way you leanr it over a few times in a different way.
A really could tutorial series is
antiRTFM 's tutorials. If you are stupid don't worry trust me it doesn't get any simpler than his explanations
GNSstudios 2 years ago
I tried Anti-RTFMs tutorials, but he's got like, 80 + 10 minute tutorials. And they were all so drawn out and soooo boring.
XoaXs seem to help alot better, straight to the point.
GreySnakeGenocide 2 years ago
oh ya i know his are pretty boring lol.
I just mentioned them because the fact that they're so drawn out makes ti easy to remember everything.
Like maybe use this tutorial, which gets straight to the point, then use his for futher understanding.
Or just practice lol I guess it doesn't matter.
GNSstudios 2 years ago
yea, me too. {We are both stupid = "true" ;}
Captnuendo 2 years ago
I feel stupid too
saad6633 2 years ago
I thought I would try to make my own Tic Tac Toe game using what I had learned inthe first 8 videos. I did it and was proud that it was only 150 lines of code, so I checked what they had... and they only had 69... *cry*
BigHomieJet 2 years ago 22
@BigHomieJet You can't measure the quality of the program by counting the lines..
MrKiller00224 1 year ago 2
@MrKiller00224 fewer lines of code are always better
johnnywishbone4 1 year ago
@MrKiller00224 actually as a rule of thumb if a programmer manages to do the same thing as you in less lines of code than you there usually the more experienced/better programmer
thedarklordx 1 year ago
@thedarklordx r u even a programmer?? that statement is completely invalid, u can say that for assembly but not for high level programming... actually, if u were a computer science student anywhere, u would know this...
Santijiwi 1 year ago
@Santijiwi what statement? i made like 5 your gonna have to be more specific
thedarklordx 1 year ago
@thedarklordx thats not true. It depends on the coding style, some people like to express them selfs using more code, but allowing that code to describe it self more easily, also in many situations less code does not mean that the program is faster. So generically thats a false argument you brought up there. Less code could however reduce the number of bugs in a system, since you got some 15 - 50 errors per 1000 lines of code (industry average), and growing with a stochastic exponential.
guldahlrahmi 1 year ago
@guldahlrahmi really i didnt know that
thedarklordx 1 year ago
@BigHomieJet so? hes only 2x better than you +12 that means your pretty good considering that hes prolly been doin this for years and that your just learning
thedarklordx 1 year ago
@BigHomieJet
Rof 69 only??
muhatashim 1 year ago
@BigHomieJet I did it in 31 lines of code usimng a trick I developed.
robbbert229 1 year ago
@robbbert229 Care to share with the rest of the class? :P
Ethaninja 1 year ago
@Ethaninja Yes the way to do it with so little is to trey to remove retoricle featyres. and to stack simular code. EX
cout << "blah"; cout <<"\nBlah again";
int a; int b; int c; int d;
and if you do this be careful to have a backed up original.
by the way in my tictactoe beating the ai is inposible. I have challenged my friends to beat it and they have never one. the trick is always to get the ai to try and get the spot agacent to the players picked one. Anyways the key to computer programming
robbbert229 1 year ago
@robbbert229 is Logic because all computer programming is for is for directing and using the programmed logic.after all all a computer is made up of is trillions of transistors. Transistors are like a valve that when a small current activates it lets a huge one pass through.
robbbert229 1 year ago
@robbbert229
Stacking code can be bad for readability though...
Netanel17 1 year ago
@BigHomieJet Have a bad feeling you are trying to show off; but maybe you are not!
okorewq 8 months ago
Lol
I just made tic-tac-toe and it was 1000 lines of code
lee155912000 2 years ago 2
all that just for a simple game of tic tac toe???WTF YEAH RIGHT...LOL I COULD IMAGE HOW MUCH IT IS FOR A BIG ASS PROGRAM...GOSH..
lesan5 2 years ago
Comment removed
fastmoneyproductions 2 years ago
This comment has received too many negative votes show
people are abusing the negative rating on youtube way too much... There is nothing wrong with this comment.
iCast4 2 years ago
Guys, void main() is not C++. main() must return an int in C++ (and it does in C, too).
antred11 2 years ago
lool; funnies comment all day.
fanboyhater 2 years ago
hey, will anbody tell me the link from where i can download the code for this game?
i tried but i could not get
ghanirfan 2 years ago
I wrote the code just like it is but gives me that error | fatal error C1075: end of file found before the left brace '{' at 'c:\...(bla bla)main.cpp(20)' was matched | what shall i do wrong? Please Reply
petros19862 2 years ago