a nicer way to do ties is declare int tie = 9 in the main(); uses while(tie) instead of while(1) put tie -= 1; in the while loop. add if(tie
@thewiedzmin60625 жыл бұрын
Nice follow up to the last one! I know its a little bloated but it will be an easy program to explain to the newbies and new learners! Thank you! 🙏
@keiseruskatherine9 жыл бұрын
Love this channel but this music is killing me.
@Nick-jb4xi6 жыл бұрын
I like the music, but it should fade out before you are talking.
@emcjava93806 жыл бұрын
I think the matrix[0][0] can change to matrix[a\3][a%3]
@burninglegend84553 жыл бұрын
how would I add a play again function for this?
@salehahmed28454 жыл бұрын
how can i make a loop that rematch the game or display a new board to count the wins?
@karlhoehenstain493910 жыл бұрын
Excellent tutorials. This could be supplemented with some lines to reject the case of errors in the letter. This case appears as draw. Other. In a previous comment, I suggested a tutorial for using a DLL ( C++) from a Excel spreadsheet and consider the cases of 32 and 64 bits. regards
@shakin200910 жыл бұрын
holy intro, a few seconds intro is all you need, i cant hear what your saying. otherwise good tut.
@odilesutsakhan25399 жыл бұрын
what's the equivalent of system() but for mac OS X users?
@roshanthapamagar13187 жыл бұрын
The function system(); is same for mac user user but the commands are different. Like in windows system("cls") clears the screen. You can replace the command inside the function which clears the screen or pauses the window. System("mac OS X terminal command here ");
@windowsphone8.1gamesandapp9110 жыл бұрын
Great tutorial, where are you from?
@ABugWithTheBigDreams8 жыл бұрын
if i want to ask for replay the game then ? I tried to implement it by using goto statement but previous inputs are showing how to reset the game after one play ? Nice tutorial and Thank you
@vx36668 жыл бұрын
Boy, use a do-while statement. Something like: char ans; int main() { char ans; // Other statements do { // The game code here cout ans; cout
@arkasza20076 жыл бұрын
I've done that, and it's asking me with every move if I want to play again haha, how can I fix it?
@GHhost-m4j6 жыл бұрын
you can put the contents of int main() into a function - game().Make another function that should replace the present elements of the matrix('x','o') with the initial elements of the matrix('1','2','3'...) or just make a new vector(Matrix[3][3]) and in the beginning of the game() function you should write matrix[3][3]=Matrix[3][3].Matrix [3][3] should have '1','2','3' ... as elements. In the end of the game() function you should put this code: if(n==9){ couta; if(a==1)game(); else return 0; } and the main function: int main(){ game(); }
@SaadAli-hw5oq8 жыл бұрын
I want to play with PC so what will I have to do??
@dawiddworak5388 жыл бұрын
Make function that will choose number of field.
@isbahprincess48718 жыл бұрын
i want to make it in runn ing form so what should i do?
@beri41387 жыл бұрын
Saad Ali void computermove(char matrix[3][3]) {again: int num1 = rand()%3; int num2 = rand()%3; if (matrix[num1][num2] != 'X' && matrix[num1][num2] != 'O') {matrix[num1][num2] = 'O'; return;} else goto again; { The idea is that we generate 2 random numbers that are between 0 and 2. We use those numbers as coordinates in the matrix. We check if the coordinates are already taken by a X or a O. If they arent taken, we put a O in that spot. If they are taken, we generate new coordinates.
@zielak07015 жыл бұрын
Did you make a player versus a computer?
@girishsaravate2424 жыл бұрын
Hey i want X in red and O in green ,how to make it?
@biqbicle49822 жыл бұрын
idk
@lightwaters6 жыл бұрын
its been just 30 days since i started c++..I made this whole game where user can enter name, check who wins or looses then press a key to restart...only thing is I took 1200 lines of code....lol.... using just loops and arrays no functions since thats where I am at ...but interesting to see the power of functions .thank you the source code file is no longer there can anyone paste it here if they have it ?..thx
@arism.accola73016 жыл бұрын
When I input 10 the player changes and do not ask again for an input. How can i fix this problem?
@chuy63398 жыл бұрын
i used your code on visual studio 2013 and the screen closes rapidly... need help
@akoskovacs77948 жыл бұрын
try to write system("pause"); at the end of your main()
@zrabatah8 жыл бұрын
What is the song?
@chuy63398 жыл бұрын
how could i add a code so that the user can input their names?
@herooyyy8 жыл бұрын
+Jesus Rosales First of all u need to create a two string for both players and a void class where it asks for your names. Then just change the 'X' and 'Y' to the name of the strings
@antoniagrosan95048 жыл бұрын
Hi! I have a problem: i tried to make the board, but when i compile it, it doesn't show anything, but a "?" in a square. I also wanted to konw what should i do to make system ("pause") and (cls) work, because it says "system was not declared in this scope". Thank youu
@95539549618 жыл бұрын
you have to add "include" . because system() exists in this library.
@antoniagrosan95048 жыл бұрын
thank you!!
@pradyumnkejriwal30078 жыл бұрын
nope you have to include "cstdlib"
@sarvjeetrawat77196 жыл бұрын
thanks its work
@Xitrii3 жыл бұрын
How to add a function where I can restart the game.
@biqbicle49822 жыл бұрын
idk
@iTzNickGaming8 жыл бұрын
Anyone can help me out this is for a school project, how can I make it so there is a mode for single player
@magicape12584 жыл бұрын
3 years too late sorry but, you would have to make a randomizer for the bot
@ChidoriVRasengan977 жыл бұрын
C++ Noob here, are there any algorithms and/or data structures used in this code, if so could you point those out please? Thanks.
@boranollana33366 жыл бұрын
Man what is there to ask about?
@boranollana33366 жыл бұрын
I saw this video before i knew shit in c++ and i did not understand shit. After half semester of studying i understood everything. Do not go and watch tutorials like this if you do not know anything at all.
@nilslorand9 жыл бұрын
One bug: If you press 1 (its X), then 1 Again (It says its occupied), then 2 (it turns into X not O. So the field then looks like that X X 3 4 5 6 7 8 9
@mavelrecord96766 жыл бұрын
That is not a bug its actually correct, the player changes(toggle ) after ever play which means losing one turn to wrong input gives an opportunity to the other player
@dustin41386 жыл бұрын
mavel record lol this is known as correcting error "by canging the question not the error" lol
@codewithhb69894 жыл бұрын
you are champion man
@yasir24819 жыл бұрын
That's cool dude. thnx a lot.
@zhaoweilim94167 жыл бұрын
Thanks for sharing this video !!! help me a lot !!!^_^
@alaaamr38697 жыл бұрын
can u do another one 5*5 plzz
@alaakhaled1888 жыл бұрын
Thank You
@isbahprincess48718 жыл бұрын
which algorithm of artificial intelligence you are using?
@massimogiardina91388 жыл бұрын
none lol..
@komendantlopp91167 жыл бұрын
I do this in notelad++ and I don't know how to open this!
@yojojo3517 жыл бұрын
thanks
@karangupta77784 жыл бұрын
please help it gives me error on char player = 'X';
@vectordhruv89083 жыл бұрын
Sir why are you not uploading videos since 3 years
@amirkaric63138 жыл бұрын
hy bro, could you send me a code?
@nilslorand9 жыл бұрын
I use codeblocks and system ("cls") does not work
@momogames37649 жыл бұрын
+Nils Lorand #include
@momogames37649 жыл бұрын
+Nils Lorand #include
@ABugWithTheBigDreams8 жыл бұрын
+Nils Lorand i also use code blocks try this system("cls"); i added stdlib & it works for me add new libraries and try again :)
@johnwbyrd8 жыл бұрын
That's because the author of this tutorial does not understand cross-platform development.
@javirubaine86078 жыл бұрын
What does ("cls") mean ?
@chuy63398 жыл бұрын
and when i type one it turns into X but when i press 2 it turns into X again
@jamesa.6463 жыл бұрын
Yea I am having the same problem rn
@MorgothResurrection9 жыл бұрын
Well, this kind of coding and examples can show the importance of for or while loops.... It is a mess! It's got like 100+ lines for things that were not necessary and nobody would try to read through that XD
@cpthermes37035 жыл бұрын
void TogglePlayer() { if (player == 'X') player = '0'; else player = 'X'; } this is the only part i do not understand, please explain! :(
@xor_2555 жыл бұрын
if value of player='X' then change it to 'O' coz after x it's o's turn and when its value is anything other than x(like o) change it to X
@cpthermes37035 жыл бұрын
@@xor_255 thank you, by the time u wrote the comment i have already gotten the idea. But thank you for your time and effort explaining :)
@TheLlamaCannon8 жыл бұрын
you didnt update the version of the game! lol nice tutorial bro
@peterkulik59437 жыл бұрын
Ohh, copy-paste master course? :D
@renzpulvira32149 жыл бұрын
u talk like dendi.
@isbahprincess48718 жыл бұрын
plz help
@robsentadesse52506 жыл бұрын
I want play with computer
@A1exGx8 жыл бұрын
Oh god, the Win function is an example of terrible programming, using tens of ifs instead of repetitives such as for or while... the Input as well, it took him 200 lines of code when it could've been done efficiently in less than 100.
@yoshiman841568 жыл бұрын
this is 100 lines and does every thing his program does
@ChidoriVRasengan977 жыл бұрын
C++ Noob here, are there any algorithms and/or data structures used in this code, if so could you point those out please? Thanks.