pseudocode - pseudcode for minmax algorithm -


I want to receive pseudododode for the Minmax algorithm. I have to make 2 functions, DEF MaxAgeent (gamestate, depth) and minajent. Is there a body that has the right and easy proxy for it?

Two players, A and B, change to move.

We are given a scoring function that evaluates the position of a given board, p. Large values ​​of F (P) are better for A and better for B (i.e., F)

Consider the position of a board P

if P is a leaf node (i.e., P. is a winning position or we look forward to as much as we want), then we return f (p) to this node as a score.

Otherwise P is not a leaf node and children of C1., CN. We continually calculate the score for children I, S1, ..., Ausan.

If there is drama in P, then the score for P is a maximum of {S1, ..., Ausan} because A. always will be maximizing your profits.

If BP plays on, then minimum minute {S1, ..., Ausan} for P will be because B will always run to reduce A's profit.

> It should be enough to change the code.

Once you do this, take a look at alpha-beta sorting, The alpha-beta sorting is based on the idea that if A has given B to compel M to make maximum profit, then any subtree whose score is M Bigger, there is no point in considering B, B will never allow that option!


Comments

Popular posts from this blog

c# - sqlDecimal to decimal clr stored procedure Unable to cast object of type 'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible' -

Calling GetGUIThreadInfo from Outlook VBA -

Obfuscating Python code? -