Hey Java Coding Community, nice to meet you! I just found your channel, love what you're doing! I like how clear and detailed your explanations are as well as the depth of knowledge you have surrounding the topic! Since I run a tech education channel as well, I love to see fellow Content Creators sharing, educating, and inspiring a large global audience. I wish you the best of luck on your TH-cam Journey, can't wait to see you succeed! Your content really stands out and you've put so much thought into your videos, I applaud you on that! Cheers, take care, and keep up the great work ;)
9:45 I think this can be way more wholesome: def check_win(v, winning_rows): winning_rows=[[1,2,3],[4,5,6],...] for row in winning_rows: i = row[0] j = row[1] k = row[2] if v[i]==v[j]==v[k]=="o": return 0 break elif v[i]==v[j]==v[k]=="x": return 1 break else: continue 'v' is the 'board' dictionary (Ignore the indentation...;-) )
Hey Java Coding Community, nice to meet you! I just found your channel, love what you're doing!
I like how clear and detailed your explanations are as well as the depth of knowledge you have surrounding the topic! Since I run a tech education channel as well, I love to see fellow Content Creators sharing, educating, and inspiring a large global audience. I wish you the best of luck on your TH-cam Journey, can't wait to see you succeed! Your content really stands out and you've put so much thought into your videos, I applaud you on that!
Cheers, take care, and keep up the great work ;)
Thank you for kind words :) good luck to you, too!
@@javacodingcommunity No problem, thank you!
Thats very very eaasy and helpful sir thank you
9:45 I think this can be way more wholesome:
def check_win(v, winning_rows):
winning_rows=[[1,2,3],[4,5,6],...]
for row in winning_rows:
i = row[0]
j = row[1]
k = row[2]
if v[i]==v[j]==v[k]=="o":
return 0
break
elif v[i]==v[j]==v[k]=="x":
return 1
break
else:
continue
'v' is the 'board' dictionary
(Ignore the indentation...;-) )
yeah this method is good
hello! when I insert a number, it doesnt add any x or o's.
The problem is that even when player wins, the game still continuing till the draw or bot wins. What's the reason
Heya, I'm getting AttributeError: 'list' object has no attribute 'keys'
No clue why
Can you send that part of code?
can we start X from the middle?
Yes, you can modify it as you wish
Thank you
Can i make its Gui? By using tkniter on same code?
Yeah, you can put 9 buttons an some borders
I had to turn on titles to realize he said key and value pairs at the beginning
If the win move was the last move, I think it will consider it as a draw 7:37
Yes, made an error :D Order of if statements is wrong.
if the last move wins, it will say it's a draw, you should check for the win first and if it's not a win then check for the draw..
Yes, the order should be reversed, my bad.
I printed the board in the following way, looks very nice:
print(f"""
| |
{list[0]} | {list[1]} | {list[2]}
_____|_____|_____
| |
{list[3]} | {list[4]} | {list[5]}
_____|_____|_____
| |
{list[6]} | {list[7]} | {list[8]}
| |
""")
thanks!!!
He said “now is the harder part” as I’m struggling to keep up and even understand
Please do it in Java as well
Hey, thanks for the feedback! Was this helpful?
@@javacodingcommunity yes it is.
It's not by using MinMax algorithm!!
bot start game from middle of the board and bot=X