From ra27946@scs.ubbcluj.ro  Thu Dec 14 14:28:22 2000
Received: from Proxy2.UBBCluj.Ro (IDENT:root@Mail-Exchange.UBBCluj.ro [193.230.247.198])
	by swi.psy.uva.nl (8.9.3/8.9.3) with ESMTP id OAA02014
	for <prolog@swi.psy.uva.nl>; Thu, 14 Dec 2000 14:28:18 +0100 (MET)
Received: from Zeus.UBBCluj.Ro (IDENT:root@Zeus.UBBCluj.Ro [193.231.20.1])
	by Proxy2.UBBCluj.Ro (8.9.3/8.9.3) with ESMTP id PAA03400
	for <prolog@swi.psy.uva.nl>; Thu, 14 Dec 2000 15:29:48 +0200
Received: from Home.SCS.UBBCluj.Ro (IDENT:root@home.scs.ubbcluj.ro [193.231.20.38])
	by Zeus.UBBCluj.Ro (8.9.3/8.9.3) with ESMTP id PAA01459
	for <prolog@swi.psy.uva.nl>; Thu, 14 Dec 2000 15:28:32 +0200
Received: from Rave.SCS.UBBCluj.Ro (IDENT:ra27946@Rave.SCS.UBBCluj.Ro [193.231.20.39])
	by Home.SCS.UBBCluj.Ro (8.11.0/8.11.0) with ESMTP id eBEDSSb22205
	for <prolog@swi.psy.uva.nl>; Thu, 14 Dec 2000 15:28:28 +0200
Date: Thu, 14 Dec 2000 15:28:29 +0200 (EET)
From: Rastei Amelia Viorela <ra27946@scs.ubbcluj.ro>
To: prolog@swi.psy.uva.nl
In-Reply-To: <Pine.LNX.4.21.0012141305380.29318-100000@Rave.SCS.UBBCluj.Ro>
Message-ID: <Pine.LNX.4.21.0012141501540.5875-100000@Rave.SCS.UBBCluj.Ro>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Subject: [SWIPL] About Applying a predicate to all the elements of a list



    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. 



