Subject: [SWIPL] About Applying a predicate to all the elements of a list

From: Rastei Amelia Viorela <[email-masked]>
Date: Thu, 14 Dec 2000 15:28:29 +0200 (EET)

Sorry, previous question was not clear at all!

    I reformulate:
  
    How does maplist actually work? 

    I am trying to implement MINIMAX algotithm. For Tic tac Toe.
    So I HAVE 

        MINIMAX(CurrentState, Depth, Player,[ Score| Path]).

    where Depth tells the number of states I have already generate;
          Player is either 1 (me) or 0 (the computer)
          Score is the result of the game
          Path: the states till the winning state ( is a list of lists) 

        So the algorithm says:

        MINIMAX(CurrentState, Depth, Player,[Score| Path]):-

                not_enough(Depth),
		All_succesors(CurrentState, ListOfSuccesors), 
                not_empty(List_of_Succesors), 
		Choose_Best(ListOfSuccesors, Best),
		
		//and NOW: apply MINIMAX on all Succesors

		maplist(MINIMAX(....????????,ListOfSuccesors,[NewScore,NewPath)
		
		??? HOW???? THIS is My question
		
		//and here I construct Score and Path.

   Thank you! 

 Amelia Rastei,
 Dept. Computer Science,
 Babes Bolyai University,
 Cluj Napoca, Romania.