[eclipse-clp-users] Counting

From: peter barkly <peterbarkly_at_yahoo.co.uk>
Date: Wed, 12 May 2010 02:26:51 -0700 (PDT)
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
    ).


      
Received on Wed May 12 2010 - 09:27:00 CEST

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