Article View: comp.lang.prolog
Article #1931simple question
From: C Wayne Huling
Date: Tue, 19 Mar 1991 16:29
Date: Tue, 19 Mar 1991 16:29
27 lines
963 bytes
963 bytes
I am attempting to build a simple list, but can't seem to get it to work.
Could someone please help me with this problem?
writeln(S):-
write(S),
nl.
query:-
writeln('Enter the verticies'),
querytop(L),
write(L).
querytop(L):-
read(A),
query(A,L).
query(end,_):-!.
query(A,L):-
L=[A|L],
writeln('Another one...'),
querytop(L).
I read the stuff, but it isn't being put in the list, it stops after entering
2 numbers. Why isn't it working?
Technical Details
Message-ID:
<WAYNE.91Mar19112927@offa.cs.odu.edu>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!unix.cis.pitt.edu!dsinc!cs.widener.edu!ukma!xanth!xanth.cs.odu.edu!wayneShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!unix.cis.pitt.edu!dsinc!cs.widener.edu!ukma!xanth!xanth.cs.odu.edu!wayne From: wayne@cs.odu.edu (C Wayne Huling) Newsgroups: comp.lang.prolog Subject: simple question Message-ID: <WAYNE.91Mar19112927@offa.cs.odu.edu> Date: 19 Mar 91 16:29:27 GMT Sender: usenet@cs.odu.edu (Usenet News Poster) Organization: Old Dominion University, Norfolk, VA Lines: 27 Nntp-Posting-Host: offa.cs.odu.edu