[eclipse-clp-users] Counting

From: peter barkly <peterbarkly_at_...102...>
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.3.0 : Tue Apr 16 2024 - 09:13:20 CEST