Prolog : Simple question
Posted
by abduls85
on Stack Overflow
See other posts from Stack Overflow
or by abduls85
Published on 2010-03-14T02:59:20Z
Indexed on
2010/03/14
3:05 UTC
Read the original article
Hit count: 637
prolog
I want to add any strings user entered into a list
run :- write('How many students you have: '),read(x),nl. enterNameOfStudents(x).
enterNameOfStudents(x) :- for(A, 1, x, 1),write('Please enter the names of students'),read(A),??????,nl,fail.
What do i put in the ?????? portion to ensure that whatever the user enter will go into a user-defined list which will be used for further processing later ? Please help. I have tried numerous stuff like append and other but it does not work :(
© Stack Overflow or respective owner