pseudocode  Isnt the psudocode quiescencesearch rather wrong when looking at chess In chess engines implementations would say   Make an evaluation of the current position without any search assuming this value is save   Try capture moves and maybe check giving moves to look whether we can reach more using quiescencesearch recursively   Looking at the current quiete positionidea of wikipedia you will find  Assume you have a rather smooth position your queen can capture a pawn but your queen will get captured then  We can detect quiet position only if we do that capture moves and decide no that pawnrobbery was no good idea  If we decide not a quiet position because we can capture we will find that we will loose our queen That result would be completely wrong and implementations are not done in chess engines in that way  You can find a chessrelevant correct description at httpchessprogrammingwikispacescomQuiescenceSearch  Benno