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

  • Home
  • SEARCH
  • 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 972653
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T03:09:28+00:00 2026-05-16T03:09:28+00:00

I want to get the pseudocode for minmax algorithm. I have to make 2

  • 0

I want to get the pseudocode for minmax algorithm. I have to make 2 functions, def maxAgent(gameState, depth) and minAgent. Is there any body who has the right and easy pseudocode for it.

  • 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-05-16T03:09:28+00:00Added an answer on May 16, 2026 at 3:09 am

    Two players, A and B, take turns to play.

    We are given a scoring function f that evaluates a given board position, P. Larger values of f(P) are better for A and worse for B (i.e., f(P) is an estimate of how “good” P is for A without doing any further lookahead).

    Consider a board position P.

    If P is a leaf node (i.e., P is a winning position or we have looked as far ahead as we want to) then we return f(P) as the score for this node.

    Otherwise P is not a leaf node and has children C1, …, Cn. We recursively compute the scores for the children, giving S1, …, Sn.

    If A plays at P then the score for P is max{S1, …, Sn} since A will always play to maximise his advantage.

    If B plays at P then the score for P is min{S1, …, Sn} since B will always play to minimise A’s advantage.

    That should be enough to turn into code.

    Once you’ve done that, have a look at alpha-beta pruning, which should (drastically) reduce the amount of search you need to do. Alpha-beta pruning is based on the idea that if A deduces that B can play to force A’s maximum advantage to be M, then there is no point in considering any subtree whose score is greater than M since B will never allow A that option!

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

Sidebar

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.