Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8283431
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T10:43:47+00:00 2026-06-08T10:43:47+00:00

So I was recently looking at the minimax function which is used in zero

  • 0

So I was recently looking at the minimax function which is used in zero sum games. I understood it perfectly, other then how the board is implemented for the actual function:

For example this sample implementation I found has this declaration:

int miniMax(Board eval, int iterations)

My only question is what exactly is Board? Is it a struct, class, array or some other structure? Also how would I implement a sample board for mini-max, like a tic-tac-toe board (As a example)? Couldn’t find anything on Wikipedia or Google.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T10:43:49+00:00Added an answer on June 8, 2026 at 10:43 am

    Board is just the current board game. It could be any structure you use to represent the board of the game.

    When called first, the minimax function would receive the current board configuration, reached by the different plays made so far (the current state of the game). In the minimax function what you do is modify the board, each modification should represent a possible move according to the game rules. Each of those modified boards should be passed as argument to a new minimax call. Once you reach a certain depth (this is, a number of iterations), you select the best move using an evaluation function to give a score to every modified board and choosing the one with the highest score.

    The algorithm you are reading is generic and could work for any game. You might define Board according to convenience, that is, what suits best for the board of the game you want to represent.

    For tic-tac-toe, you might want to represent the board with a 3×3 array so you might change Board:

    int miniMax(char board[3][3], int iterations)
    

    Or perhaps, you may want to represent your board using 2 bits for each square:

    typedef struct {
        unsigned square1: 2;
        unsigned square2: 2;
        unsigned square3: 2;
        unsigned square4: 2;
        unsigned square5: 2;
        unsigned square6: 2;
        unsigned square7: 2;
        unsigned square8: 2;
        unsigned square9: 2;
    } Board;
    

    Though, for tic-tac-toe you don’t need a lightweight board representation since its maximum depth is just 9. I’m just giving you examples to let you understand it can be any structure you use to represent the board game.

    If you are going to deal with minimax function and the game is much more complex than tic-tac-toe, you should seriously consider using alpha-beta pruning which is a big improvement.

    EDIT: I think you shouldn’t call your board “eval” since that can be confused with the evaluation function which is a totally different thing.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've recently been looking at functional programming with Javascript, to which I'm a noob.
Recently I've been looking at opening a tab using this script: $('.tofour').click(function() { //
I was recently looking for a personal wiki and come upon Hatta , which
I've just recently started looking into the details of which events fire when in
I've been looking recently on a deep stack with 2000 recursive function calls, and
Background: Recently while looking at a structured text editor I noticed they used a
I was recently looking to practice utilizing dictionaries in python and stumbled across these
I recently started looking into building web applications using .NET MVC and I stumbled
I've recently been looking through my warnings in Eclipse and come across this one:
I've been looking recently at Boost.Spirit (the version included in Boost 1.39), however I'm

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.