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 9178859
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T17:39:12+00:00 2026-06-17T17:39:12+00:00

I have been steadily working on a chess program and have a minimax search,

  • 0

I have been steadily working on a chess program and have a minimax search, iterative deepening and transposition tables soon to come. At the moment, however, I have a bug which I have isolated to be in my quiescence search. I am frustrated because I copied a pseudo-code implementation directly and still it does not seem to be working for me. Other implementations I have found online gave me similar results.

The bug seems to incorrectly calculate the opponents “best” capture when multiple recaptures are available and as a result returns a value usually favoring the side calling the search.

The engine is written in C#

public static double Quiet(Game game, double alpha, double beta, int depth)
    {           
        double eval = Evaluation.evaluate(game);
        if(depth == 0)
        {
            return eval;
        }

        // Pseudo-legal sorted moves (Captures first)
        List<SerializedMove> moves = MoveGenerator.ListAllMoves(game, false);

        foreach(SerializedMove move in moves)
        {
            // If the move is not a capture
            if(move.taken_type == SerializedMove.NONE)
            {
                // Because of move ordering break if not a capture (Captures are first)
                break;
            }

            // Make move and alternate side to move 
            game.MakeMove(move);
            if(game.whiteMoves)
            {
                double score = Quiet(game, alpha, beta, depth - 1);
                if(score > alpha)
                {
                    alpha = score;
                }
            }
            else
            {
                double score = Quiet(game, alpha, beta, depth - 1);
                if(score < beta)
                {
                    beta = score;
                }
            }
            game.UnmakeMove(move);
            if(beta <= alpha)
            {
                break;
            }
        }

        if(game.whiteMoves)
        {
            if(beta == Evaluation.KING)
            {
                return eval;
            }
            else
            {
                return beta;
            }
        }
        else
        {
            if(alpha == -Evaluation.KING)
            {
                return eval;
            }
            else
            {
                return alpha;
            }
        }
    }

My evaluation function returns +/- values in favor of white or black, respectively.

  • 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-17T17:39:14+00:00Added an answer on June 17, 2026 at 5:39 pm

    After your Quiet() function loops through the list of moves, it is returning the wrong values for white and black moves. If white is moving, alpha should be returned since that’s where you’re keeping track of the score of white’s best move. Similarly, beta should be returned if black is moving.

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

Sidebar

Related Questions

Have been working on this question for a couple hours and have come close
I have been working with SQL Server as a Developer a while. One thing
Have been using a simple CSS only tooltip. Working Example css: .tip { position:relative;
I have a class which has been steadily growing over time. It's called LayoutManager
Have been trying to get integration testing working with my seam project and the
Have been working on a Tower Defense game for iOS for some time now.
I'm using the official GitHub for Windows client (http://windows.github.com/). I have been steadily committing
Have been working on a small project, and have gotten stuck at a part
I have been working on a widget for Android. One of the things it
I currently have a VB.NET class named Customers and it's been steadily growing in

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.