[Home]
[Edit this page]
[Recent Changes]
[Special Pages]
[Help]
PrologFor
[Edit this page] [Page history] [What links here] [Discuss this topic] [Printer Friendly]
PrologFor
(Prolog) For
A for-loop can be achieved by letting backtracking fail.
PREDICATES
nondeterm name(symbol)
printNames
CLAUSES
name("Leonardo").
name("Donnatello").
name("Michelangelo").
name("Rafael").
printNames :-
name(X),
write(X),
nl,
fail.
printNames.
GOAL
printNames.
'for' links
Code links
[Edit this page] [Page history] [What links here] [Discuss this topic] [Printer Friendly]
