Tic Tac Toe AI with MiniMax using Python | Part 1: Programming Tic Tac Toe

แชร์
ฝัง
  • เผยแพร่เมื่อ 5 ม.ค. 2025

ความคิดเห็น • 28

  • @empowercode
    @empowercode 3 ปีที่แล้ว +4

    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 ;)

    • @javacodingcommunity
      @javacodingcommunity  3 ปีที่แล้ว

      Thank you for kind words :) good luck to you, too!

    • @empowercode
      @empowercode 3 ปีที่แล้ว

      @@javacodingcommunity No problem, thank you!

  • @TanveerAhmad-xe9qk
    @TanveerAhmad-xe9qk 3 ปีที่แล้ว +2

    Thats very very eaasy and helpful sir thank you

  • @rahuljoshi3338
    @rahuljoshi3338 3 ปีที่แล้ว +2

    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...;-) )

    • @jojomark4946
      @jojomark4946 3 ปีที่แล้ว

      yeah this method is good

  • @eterna6527
    @eterna6527 2 ปีที่แล้ว

    hello! when I insert a number, it doesnt add any x or o's.

  • @nijatquliyev4856
    @nijatquliyev4856 ปีที่แล้ว

    The problem is that even when player wins, the game still continuing till the draw or bot wins. What's the reason

  • @joelfitzgibbon685
    @joelfitzgibbon685 3 ปีที่แล้ว

    Heya, I'm getting AttributeError: 'list' object has no attribute 'keys'
    No clue why

  • @farooqsial8237
    @farooqsial8237 2 ปีที่แล้ว

    can we start X from the middle?

  • @mrohit1617
    @mrohit1617 9 หลายเดือนก่อน

    Thank you

  • @thisweirdo2123
    @thisweirdo2123 3 ปีที่แล้ว

    Can i make its Gui? By using tkniter on same code?

  • @vu5700
    @vu5700 3 ปีที่แล้ว

    I had to turn on titles to realize he said key and value pairs at the beginning

  • @strix4602
    @strix4602 2 ปีที่แล้ว

    If the win move was the last move, I think it will consider it as a draw 7:37

    • @javacodingcommunity
      @javacodingcommunity  2 ปีที่แล้ว +1

      Yes, made an error :D Order of if statements is wrong.

  • @aminerf4168
    @aminerf4168 3 ปีที่แล้ว +2

    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..

  • @milantenbosch
    @milantenbosch ปีที่แล้ว +1

    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]}
    | |
    """)

  • @mustafamzztk261
    @mustafamzztk261 2 ปีที่แล้ว

    thanks!!!

  • @snivylord9854
    @snivylord9854 2 ปีที่แล้ว

    He said “now is the harder part” as I’m struggling to keep up and even understand

  • @ubaid3212
    @ubaid3212 3 ปีที่แล้ว

    Please do it in Java as well

  • @ronakbhatt4880
    @ronakbhatt4880 2 ปีที่แล้ว

    It's not by using MinMax algorithm!!

  • @farooqsial8237
    @farooqsial8237 2 ปีที่แล้ว

    bot start game from middle of the board and bot=X