你好我想用read(X)把变量i输入到列表中, 例如:
give_word(Word,Hiddenword):-
first_and_last(Word,First,Last),
length(Word,Le),
MiddleLe is Le-2,
middle(Hidden,MiddleLe),
append([First],Hidden,Firsthalf),
append(Firsthalf,[Last],Hiddenword).
kremala:-
write('Give a word:'),nl,
read(Word),nl,
give_word(Word,Hidden),
write(Hidden).
例如,如果用户给出单词“person”,我希望实际上give_word中的变量是一个列表Word = [p,e,r,s,o,n]。