WITH ada.integer_text_io; WITH ada.text_io; WITH Useful; PROCEDURE writeboard ( Placed : IN OUT integer; Examined : IN OUT integer; Positions : IN Useful.Columns; outfile : IN OUT ada.text_io.file_type ) IS BEGIN -- update counter of solutions useful.count := useful.count + 1; -- heading for a solution ada.text_io.put (file => outfile, item => " Found solution # "); ada.integer_text_io.put (file => outfile, item => useful.count); ada.text_io.new_line (file => outfile); -- indicate how many queens were temporarily placed ada.text_io.put (file => outfile, item => " Placed "); ada.integer_text_io.put (file => outfile, item => Placed, width => 5); ada.text_io.put_line (file => outfile, item => " queens in process. "); -- indicate how many positions were examined ada.text_io.put (file => outfile, item => " Tested "); ada.integer_text_io.put (file => outfile, item => Examined, width => 5 ); ada.text_io.put_line (file => outfile, item => " locations in process. "); ada.text_io.new_line (file => outfile); -- show solution ada.text_io.put (file => outfile, item => " Here's Solution # "); ada.integer_text_io.put (file => outfile, item => useful.count) ; ada.text_io.new_line (file => outfile, spacing => 1 ); -- show the coordinates of the queens' positions FOR i IN Useful.OneToEight LOOP ada.integer_text_io.put (file => outfile, item => i, width => 2); ada.text_io.put (file => outfile, item => ", "); ada.integer_text_io.put (file => outfile, item => Positions(i), width => 2); ada.text_io.new_line (file => outfile, spacing => 1); END LOOP; -- space between solutions ada.text_io.new_line (file => outfile,spacing => 3); -- reset counters for queens placed and positions tried Placed := 0; Examined := 0; END writeboard;