Re: newbie - Prolog, lists, recursion
From: o (dcsmpayne_at_bigpond.com)
Date: 11/04/03
- Next message: Matthew Purver: "Re: newbie - Prolog, lists, recursion"
- Previous message: o: "newbie - Prolog, lists, recursion"
- In reply to: o: "newbie - Prolog, lists, recursion"
- Next in thread: Matthew Purver: "Re: newbie - Prolog, lists, recursion"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 04 Nov 2003 10:13:29 GMT
This is an extension of my first post ...
I am also working on a predicate where I am trying to count the even numbers
(chars) in a number.
i.e. count_even(243,C) returns C = 2.
I can't think how to "loop" over the number char by char, that's why the
recusrion is needed - so I tried to work it out by saying the number is a
list, hence the first post.
Please note - I have used the Java forum extensively and those who seek help
with assignments are frowned upon - these q's are not assignments. I am
trying to create some teaching materials (high shcool level) and teach
myself some Prolog at the same time. I have found a few interesting
"questions" from various www sites and am now working on them, but I need
help (too entrenched in an imperative mindset).
yours thankfully
Darren
- Next message: Matthew Purver: "Re: newbie - Prolog, lists, recursion"
- Previous message: o: "newbie - Prolog, lists, recursion"
- In reply to: o: "newbie - Prolog, lists, recursion"
- Next in thread: Matthew Purver: "Re: newbie - Prolog, lists, recursion"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|