Questions tagged [minimax]

A concept used in artificial intelligence/game theory for two-player games. The idea is to minimize the opponent's gain and maximize yours. Questions using this tag cover problems understanding/implementing the algorithm.

Minimax involves generating a game-tree to consider all the possible outcomes of a game, given its present configuration. The minimax agent then chooses the branch which leads to the agent's maximum gain and, consequentially, to the minimum gain of the opponent (a zero-sum game).

While generating a whole game tree may seem a computationally expensive task, several techniques have been developed to reduce the computation time. One of the most famous techniques is Alpha-Beta Pruning: given a branch in the game tree, stop evaluating that branch ("prune") as soon as you find an outcome in that branch that is worse than a previously-examined branch. Some variations (such as those used in Chess programs) only consider up to a certain number of turns and not always up to end-game.

Another variation of minimax, termed as expectiminimax, introduces "chance" elements in the game such as dice throws.

Finally, note that while minimax is originally intended for two-player games, the technique has been extended to games with more complex set-ups.

Further reading:

910 questions
-2
votes
1 answer

Tic-Tac-Toe AI picks wrong position

I am making a C program of Tic-Tac-Toe. I am trying to make the AI invincible at the moment but I have encountered a problem. The problem is that the AI just prints the symbol in the next available question. Why? And how can I fix it? Here's my…
-2
votes
2 answers

human vs machine tic-tac-toe

in these days i have been struggling with minimax algorithm and i can say i finally understood it ( thank to another post in stackoverflow). Therefore i opened my editor and i tried to implement it into a EXTREMELY simple ( do not blame me for code…
-3
votes
1 answer

Uncaught TypeError: cannot create property '35' on string ''

I am currently in the process of making a Connect Four AI using the minimax algorithm. I have made the board and win/draw checks, and have finished implementing the AI. However, when I go to test it, I get the following error: Uncaught TypeError:…
-3
votes
1 answer

Java Minimax tic-tac-toe game not working as intended

So I've been looking into creating a simple tic-tac-toe game where the human player plays against an ai run by the minimax algorithm. I have spent the last few days trying to figure these two bugs out but I cant for the life of me seem to. for one,…
-3
votes
1 answer

Can a tic tac toe AI Minmax function be unbeatable at a depth of 3?

So, my assignment was to think of a good evaluation function so that the Tic Tac Toe AI we have designed using the Minimax algorithm would be unbeatable. The limits we had were to not change the source code for the rest of the game, and that the…
-3
votes
1 answer

minimax function not generating all game states

Can anyone tell me why my code prints 1 and not 8? It seems to not be going through very single state. Why is that? using the minimax algorithm find the best possible move to make based on a game state, a possible tic tac toe board. Usually, it…
PAS
  • 149
  • 1
  • 8
-4
votes
1 answer

incorrect output from minimax algorithm for Tic Tac Toe

There are no errors in the code execution , but the output of the minimax algorithm in incorrect , please have a look,` the AI_makemove function is called from the main loop, and the board_state is the copy of the actual board. The function…
-4
votes
1 answer

Minimax code for tic-tac-toe in python

I've been trying to code a tic-tac-toe game but I'm facing a problem. For example if I put a cross on one of the corners, the bot should mark "O" in the centre but that doesn't happen. Instead, it marks it on adjacent to the cross. The bot is not…
Tobias
  • 1
-4
votes
1 answer

Python Tic Tac Toe using minimax does not make best move

I have been trying to get this to work for over a week now and cant seem to get it to choose the best possible move. Can someone take a look and help me out? I feel like I have missed something stupid. Thanks! from tkinter import * import…
Nick
  • 1
  • 1
-4
votes
1 answer

How to generate all possible combinations of a 24 digit binary number?

I basically have a 24 digit number and I need to get every combination of that number with 1's and 0's I know that there is over 16,700,000 possible combinations. I need to get every single possible combination for a minimax algorithm game that I am…
1 2 3
60
61