procedure body in place of its call to return logical value is no longer necessary the general schema is as followsprocedure trybegin if solution incomplete then initialize selection of candidate moves and select the first onewhile ~(no more movesdo record movetryerase moveselect next move end else print solution end end try it comes as surprise that the search for all possible solutions is realized by simpler program than the search for single solution in the eight queenn problem another simplification is posssible indeedthe somewhat cumbersome mechanism of enumeration of safe positions which consists of the two procedures first and nextwas used to disentangle the linear search of the next safe position (the loop over within nextand the linear search of the first which yields complete solution nowthanks to the simplification of the latter loopsuch disentanglement is no longer necessary as the simplest loop over will sufficewith the safe filtered by an if embedded within the loopwithout invoking the additional procedures the extended algorithm to determine all solutions of the eight queens problem is shown in the following program actuallythere are only significantly differing solutionsour program does not recognize symmetries the solutions generated first are listed in table the numbers to the right indicate the frequency of execution of the test for safe fields its average over all solutions is procedure write(adens _queens *var kintegerbegin for : to do texts writeint(wx[ ] endtexts writeln(wend writeprocedure try (iinteger)var jintegerbegin if then for : to do if [jb[ +jc[ - + then [ :ja[ :falseb[ + :falsec[ - + :falsetry( ) [ :- [ :trueb[ + :truec[ - + :true end end else writem : + (*solutions count*