function Scout (prof:byte; var meilleur:coup):integer; {Scout de base: espionner avant d'évaluer} var Resultat,Maximum: integer; Ci,Reponse:coup; premier:boolean; begin Maximum:=-32000; {plus petit que tout résultat d'évaluation} [*** cherche et classe tous les coups ***] premier:=true; repeat jouer(Ci); if (prof=1) then Resultat:=-evalue else if premier then begin {on évalue le premier coup} Resultat:=-Scout(prof-1, reponse); premier:=false; end else if MeilleurQue(maximum) then {on espionne} Resultat:=-Scout(prof-1, reponse); dejoue(Ci); if (Resultat>Maximum) then begin Maximum:=Resultat; Meilleur:=Ci; end; {if} Ci:=CoupSuivant; until PlusDeCoups; Scout:=Maximum; end;