Re: [eclipse-clp-users] Counting

From: Wit Jakuczun <wit.jakuczun_at_gmail.com>
Date: Fri, 14 May 2010 10:27:10 +0200
Dear Peter,
   if you are new to ECLiPSe and from your question I infere you are
new to Prolog I would suggest reading any basic Prolog programming
book. I could recommend "Clause and Effect: Prolog Programming for the
Working Programmer" by W.F.Clocksin.
   ECLiPSe provides its users with a powerful logical loops
construction but using them without understanding mechanisms could be
a pain in the future. That was my story :). Solution to your problem
was given by Philipp.

Best regards,
   Lucjan Jakuczun


2010/5/12 peter barkly <peterbarkly_at_yahoo.co.uk>:
> Hello,
>
> I am new to Eclipse.
>
> How do I count elements of a list/array that satisfy a particular condition?
>
> For example, I want to count the number of elements in a list that are
> larger than 10.
>
> solve(Count):-
>     dim(Array, [5]),
>     for(I, 1, 5) do
>     (
>       % get value of Count here
>     ).
>
>
>
> ------------------------------------------------------------------------------
>
>
> _______________________________________________
> ECLiPSe-CLP-Users mailing list
> ECLiPSe-CLP-Users_at_lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/eclipse-clp-users
>
>
Received on Fri May 14 2010 - 08:27:17 CEST

This archive was generated by hypermail 2.2.0 : Thu Feb 02 2012 - 02:31:58 CET