From Randy.Justice@cnet.navy.mil  Fri Sep  1 20:15:34 2000
Received: from smtp.cnet.navy.mil (smtp.cnet.navy.Mil [160.125.64.11])
	by swi.psy.uva.nl (8.9.3/8.9.3) with ESMTP id UAA14100
	for <prolog@swi.psy.uva.nl>; Fri, 1 Sep 2000 20:15:32 +0200 (MET DST)
Received: from penx68322m1.cnet.navy.mil (pens0394.cnet.navy.Mil [160.125.210.190])
	by smtp.cnet.navy.mil (8.8.6 (PHNE_17190)/8.8.6) with ESMTP id NAA26897
	for <prolog@swi.psy.uva.nl>; Fri, 1 Sep 2000 13:15:05 -0500 (CDT)
Received: by pens0394.cnet.navy.Mil with Internet Mail Service (5.5.2650.21)
	id <RYNW09YJ>; Fri, 1 Sep 2000 13:17:15 -0500
Message-ID: <B4CA1F5D8D23D411ADC7009027E791BF1DF4D6@pens0394.cnet.navy.Mil>
From: "Justice, Randy -CONT" <Randy.Justice@cnet.navy.mil>
To: "Prolog@Swi. Psy. Uva. Nl (E-mail)" <prolog@swi.psy.uva.nl>
Subject: List
Date: Fri, 1 Sep 2000 13:17:13 -0500 
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2650.21)
Content-Type: text/plain;
	charset="iso-8859-1"

How would like to give me a hand and teach me something?


I have the following setup.
/*  
     Face,
     Rank
*/
card(a,  1).
card(2,  2). 
card(3,  3).
card(4,  4). 
card(5,  5).
card(6,  6). 
card(7,  7).
card(8,  8). 
card(9,  9).
card(10, 10).
card(j,  11). 
card(q,  12).
card(k,  13). 
 

/* Card name,
   stack */   
    
topcard(2, 1).
topcard(8, 2).
topcard(5, 3).
topcard(9, 4).
topcard(2, 5).
topcard(10, 6).
topcard(3, 7).
topcard(j, 8).
topcard(5, 9).
topcard(3, 10).
topcard(q, 11).
topcard(4, 12).

/* Test where two cards equals 14. */

is_fourteen(ICard1, ICard2):- 
   card(ICard1,ICard1_Value), 
   !,    
   card(ICard2,ICard2_Value),
   !,
   14 =:= ICard1_Value + ICard2_Value.


/* Returns a list of cards that equals 14. */
 
check_fourteen(Card1,Card2,StackCard1,StackCard2):-
    topcard(Card1,StackCard1),
    topcard(Card2,StackCard2),
    is_fourteen(Card1,Card2).


When I run this I get dups.
?- check_fourteen(A,B,C,D).

A = 2
B = q
C = 1
D = 11 ;

A = 5
B = 9
C = 3
D = 4 ;

A = 9
B = 5
C = 4
D = 3 

I want a list of cards that equls fourteen (14). Where (5,9,3,4){ Stack 3
contains card 5, Stack 4 contains card 9 } are (9,5,4,3){ Stack 4 contains
card 9, Stack 3 contains card 5 }the same and only one should be displayed. 


Thanks for any help
Randy 

