Tic Tac Toe Game in C++

preview_player
Показать описание
How to code tic tac toe in c++. In this video, you will learn how to code tic tac toe in C++ using a 2D array. You will learn how to get user input and do safe type checking to check for valid inputs and clear unwanted inputs. You will also learn how to update the 2D array tic tac toe board, and check for winning conditions horizontally, vertically, and diagonally.

If you need to review past C++ Topics:

C++ Playlist:

Subscribe for more coding tutorials 😄!
Рекомендации по теме
Комментарии
Автор

Completed Code:

Print Board:
//print game board
cout << " | | " << endl;
cout << " " << board[0][0] << " | " << board[0][1] << " | " << board[0][2] << endl;
cout << "___|___|___" << endl;
cout << " | | " << endl;
cout << " " << board[1][0] << " | " << board[1][1] << " | " << board[1][2] << endl;
cout << "___|___|___" << endl;
cout << " | | " << endl;
cout << " " << board[2][0] << " | " << board[2][1] << " | " << board[2][2] << endl;
cout << " | | " << endl;

KennyYipCoding
Автор

Finally a tutorial that doesnt yell, assumes that i know everything because begginer mean to not have experience not that you dont know stuff apparently . thank you amazing tutorial recently started learning programming and wanted some easy projects to explore what i know and what i dont

literallynustiu
Автор

this man needs more people following, nice vid

thxact
Автор

i wrote the whole board part only to find out u gave it in the description

joelfernandes
Автор

fabulous explanation. Thankyou very much👍👍

AmreshSahu-mpku
Автор

So, one thing I did differently is not using a while loop and just keeping the if else statements in the for loop. For the statements which returned "Invalid input", I just put a continue statement and subtracted 1 from i to compensate for the invalid input. This seems simpler than using a while loop to me.

advaybm
Автор

I use 6 hours writting tictactoe 103 line of code from scratch and watching you how to create char array to put in board. Is that too long to writting this projects as begginner?

mysmellisaugmented
Автор

Do you have a discord where we can ask for help?

augusturiam