what happens if the random function in computer moves picks a already filled space?
@shinayang-um7mk6 ай бұрын
1:51
@SalKulti3 ай бұрын
Why was !number used instead of just the norma, number 0?
@andarling9742 Жыл бұрын
u could check winner by creating an an array of playermoves and check if there are 3 numbers that when num1 - num2 = num2 - num3 && num1-num2
@narayanswamyghanta315 Жыл бұрын
Looking at this game code, I understood that i lack in algorthimic thinking.
@guillermofrancella085 ай бұрын
Bro is back with the Code. Love you man.
@DawoodRizwan-k7f2 ай бұрын
so good bro...
@ra2dsla72 жыл бұрын
could u please explain the condition in details (!number > 0 || !number < 8)?
@shintiao17322 жыл бұрын
@koji is not the same, you try input the same number in player and you will know that.
@ali_gd_0161 Жыл бұрын
Think of it as ( !(number >0) || !(number < 8) The ! Operator changes the boolean value of the condition in front of it. E.g if it's true it becomes false
@nicko4140 Жыл бұрын
@@ali_gd_0161 im confused how it loops after you select a non empty space. is the !number>0 || !number
@hupmitom5509 Жыл бұрын
number = 1 the logic is the same. I think it is easier to understand.
@BroDevsRBLX11 ай бұрын
It just means as long as the number is 8 the loop will execute@@Kak-koi
@firestickman4605Ай бұрын
thank you so much!
@RaviYadav-wm7tpАй бұрын
30 mins in half way there, yet to create the winning criteria this was really helpful
@havocblast87374 ай бұрын
I ended up taking this idea an started working on a terminal submarine hunting game where you are trying to sink a submarine that is hiding/moving around under the water. I do need to figure out how to make drawing the board faster since I am using colors to print a grid of blue spaces in the terminal for the water. Board is currently 40 by 80. Thanks for bringing me down that rabbit hole lol
@HunaBopa Жыл бұрын
Bro, I have a question for you. Look, we did implement the minimax algorithm in Python and create an AI Tic Tac Toe player that is invincible. However, in C++ it's a daunting task for me. Can you help me implement the minimax algorithm in C++?
@baconheadhair693825 күн бұрын
i am the one who is invincible
@FrederikWollert6 ай бұрын
Good Video Bro.
@shintiao17322 жыл бұрын
if we never use the "char computer" in cheakWinner function ,why need to import this parameter?
@anvrag Жыл бұрын
for fun..
@kshitijsrivastava8312 Жыл бұрын
For me its showing an exception report after performing the code, telling its a bug.
@CodeZ32533 ай бұрын
you said originally you would have used switch statements but I thought they could only be used with ints
@baconheadhair693825 күн бұрын
They can be used with singlr digit things like ints and chars but not for things like strings
@jessechen2132 Жыл бұрын
When a user enters a letter rather than a number, the program crashes. Do you know how to solve it?
@anvrag Жыл бұрын
std::cin.clear(); fflush(stdin); use this two lines of powerful code which will help u to prevent crashes (use it below the input)
@FlorrioEggGaming Жыл бұрын
@@anvrag truly powerful code
@Toothless_Rides8 ай бұрын
@@anvrag how? when I coded this in, it became an infinite loop...
@NovaStargazer2328 күн бұрын
@@Toothless_Rides Fflush(stdin) not work for linux Use while(cin.get() != ' ') { continue; }
@baconheadhair693825 күн бұрын
@@Toothless_Ridesyou could also make it accept a char value insteas and then just use isdigit() to make sure its a number and stoi() to convert it to an int
@gamsterilyass29524 ай бұрын
Assembly ?
@triculex28542 ай бұрын
while(!num>0 || !num
@diosinvictoАй бұрын
I hate a double negation😂😂.... But this one's better while(number < 0 || number > 8)
@baconheadhair693825 күн бұрын
@@diosinvictoThat isnt a double negation, its just two negations. A double negation is negating a negation. Your code also isn’t „better“. It quite literally does the exact same thing