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_...102...>: > 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.3.0 : Wed Sep 25 2024 - 15:13:20 CEST