Help I'm stuck!

From: rhapsody (blurrynight_at_yahoo.com)
Date: 08/10/04


Date: Tue, 10 Aug 2004 08:37:25 -0400

Help I'm stuck, can anybody tell me how to retrieve sc() with the maximum
score? I couldn't figure it out, just started learning and too used to
procedural programming concept. Below are the codes I'm stuck in... using
Visual Prolog 5.2

Database
        sc(symbol Sid,symbol Cid, integer ExamScore).
        
Clauses
        sc("S1","C1",55).
        sc("S1","C2",60).
        sc("S1","C3",70).
        sc("S2","C1",100).
        sc("S2","C2",80).
        sc("S3","C1",40).
        sc("S3","C2",30).

Predicates
        elem_max(integer,integer,integer)
        nondeterm high()
Clauses
        high():-
                sc(S,C,Score),
                write("S: ", S, " C: ", C, " Score: ",Score),
                nl,
                fail.
                        
        elem_max(E1,E2,E1):- E1 >= E2, !.
        elem_max(_,E2,E2).

Goal
        high().



Relevant Pages

  • List option of FTP
    ... i was trying to test creation of a FTP Client, ... but when i type LIST it seems to get stuck, do i have to retrieve the LIST ...
    (microsoft.public.inetserver.iis.ftp)
  • LIST option problems
    ... i was trying to test creation of a FTP Client, ... but when i type LIST it seems to get stuck, do i have to retrieve the LIST ...
    (microsoft.public.inetserver.iis.ftp)
  • Re: creating checkboxlist from arraylist
    ... Thanks for the response. ... database to retrieve the text field and the value field. ... I am stuck ...
    (microsoft.public.dotnet.framework.aspnet.webcontrols)
  • Re: mplayer on 6.2
    ... => Couldn't fetch it - please try to retrieve this ... i just don't have the patience for this ports thing anymore.... ... just made that directory and stuck the codecs there and stuff appears to ...
    (freebsd-questions)
  • Re: Help Im stuck!
    ... can anybody tell me how to retrieve scwith the maximum ... just started learning and too used to ... Below are the codes I'm stuck in... ...
    (comp.lang.prolog)