Tic-Tac-Toe Game in Python - Unbeatable Minimax AI

แชร์
ฝัง
  • เผยแพร่เมื่อ 4 ส.ค. 2024
  • Today we learn about Python wheel files, which are the packaging format for Python applications and modules.
    ◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾
    📚 Programming Books & Merch 📚
    🐍 The Python Bible Book: www.neuralnine.com/books/
    💻 The Algorithm Bible Book: www.neuralnine.com/books/
    👕 Programming Merch: www.neuralnine.com/shop
    💼 Services 💼
    💻 Freelancing & Tutoring: www.neuralnine.com/services
    🌐 Social Media & Contact 🌐
    📱 Website: www.neuralnine.com/
    📷 Instagram: / neuralnine
    🐦 Twitter: / neuralnine
    🤵 LinkedIn: / neuralnine
    📁 GitHub: github.com/NeuralNine
    🎙 Discord: / discord
    Timestamps:
    (0:00) Intro
    (0:18) Preview Results
    (1:26) Game Development
    (18:50) Minimax AI Algorithm
    (32:20) Game Main Loop
    (42:03) Outro
  • วิทยาศาสตร์และเทคโนโลยี

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

  • @tithos
    @tithos 3 หลายเดือนก่อน +11

    Please make the in-depth minimax episode

  • @deepbrar1
    @deepbrar1 3 หลายเดือนก่อน +11

    DuuuDE, I have been working on the same project i.e.(creating a AI using minimax algorithm for tic tac toe in python). It's been a few days since i started working on it and still haven't finished it.
    Of course i won't watch this video right now because I wanna implement it myself but I surely will compare mine with yours after I am done building it :)

    • @unstoppableforever1266
      @unstoppableforever1266 7 วันที่ผ่านมา +1

      Ooo did u think abt making them fight?

    • @deepbrar1
      @deepbrar1 6 วันที่ผ่านมา

      @@unstoppableforever1266 yep i tried that and it's always a tie....

  • @shaurryabaheti
    @shaurryabaheti 3 หลายเดือนก่อน +3

    I guess a good feature update to this would be a depth choice from the player, to make difficulty level a choice.

  • @muhammadsuleman3327
    @muhammadsuleman3327 11 วันที่ผ่านมา

    Thanks dude ! It was very helpful please make more videos like this.

  • @casualchou
    @casualchou 3 หลายเดือนก่อน +2

    Interesting one. Didn't knew we can use any algorithm to solve such problem instead of a ml model

  • @ebenezerarmah7406
    @ebenezerarmah7406 หลายเดือนก่อน +1

    What’s the “depth” variable used for in the minmax function. Looks like it wasn’t used at all. What will removing that parameter do?

  • @robinpipslayertekprofitsfa2644
    @robinpipslayertekprofitsfa2644 3 หลายเดือนก่อน

    Man You are always dropping Gems!! 😵🤓 Glad I #Subscribe

  • @uttamvaghasia2961
    @uttamvaghasia2961 3 หลายเดือนก่อน

    i followed you along but when i runned the game, it does not let me make my moves in certain squares and does in some case i am unable to make moves in any of the squares. Can anyone give me a better approach on how should I debug the problem?

  • @ThomasRStevenson
    @ThomasRStevenson 3 หลายเดือนก่อน

    Great example of using a minimax function. Could you replace the minimax function with a unsupervised pytorch NN algorithm that learns over time?

  • @Pyth_onist
    @Pyth_onist 3 หลายเดือนก่อน

    I got one too 😅
    Time to get to work

  • @ShuchiBoo
    @ShuchiBoo วันที่ผ่านมา

    What is the platform used for the written code ???

  • @thomasgoodwin2648
    @thomasgoodwin2648 3 หลายเดือนก่อน +2

    Gray should be (128, 128,128).
    (180,180,180) is LIGHT_GRAY!
    (Sorry, only thing I found I could pick on😉)
    🖖🤓👍

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

    Nice code and explanation, but when I tried with the player 2 starting the game, it does not work properly.

  • @jntb3000
    @jntb3000 15 วันที่ผ่านมา

    Hi I thought AI requires some sort of neural network? Otherwise it would just be normal procedural programming, correct? Thanks

    • @NeuralNine
      @NeuralNine  8 วันที่ผ่านมา

      It depends. AI is a broad term, which can include any "artificial intelligence" displayed by a computer. Then there is machine learning, which is a sub-field of AI and then there is deep learning, which is a sub-field of ML. Deep learning involves neural networks.

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

    Could you please make the source code for this available ?
    Thank you for your content

  • @zenkaikalashnikov4753
    @zenkaikalashnikov4753 3 หลายเดือนก่อน

    i get
    ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
    error on
    def check_win(player, check_board = board):
    for col in range(BOARD_COLS):
    if check_board[0][col] == player and check_board[1][col] == player and check_board[2][col] == player:
    return True

    for row in range(BOARD_ROWS):
    if check_board[row][0] == player and check_board[row][1] == player and check_board[row][2] == player:
    return True

    if check_board[0][0] == player and check_board[1][1] == player and check_board[2][2] == player:
    return True

    if check_board[0][0] == player and check_board[1][1] == player and check_board[2][2] == player:
    return True

    return False
    what did i do wrong

    • @Vincent2103
      @Vincent2103 2 หลายเดือนก่อน

      if check_board[0][2] == player and check_board[1][1] == player and check_board[2][0] == player:
      return True
      replace the last one
      +------+-----+------+
      | 0,0 | 0,1 | 0,2 |
      +------+-----+------+
      | 1,0 | 1,1 | 1,2 |
      +------+-----+------+
      | 2,0 | 2,1 | 2,2 |
      +------+-----+------+
      not sure is this solved it cause im still new to this my bad