hi, i'm pretty new to prolog and i can't get this to work :(
the predicate works fine, and appends "hay" onto an inputted word
after changing the word into an array, and then prints it to a file
change( Word, Output ) :- name(Word, Array), addv( Array, Output,
Word).
addv( [ H | T ] , Output, Word ) :- vowel(H),
append( [H|T], [104, 97, 121], Array),
name(Output, Array),
tell(file) , write('lookup(') , write(Word) ,
write(',') , write(Output) , write(').') ,
nl , told.
so it writes "lookup(test, estay)." into a file
i need it to append the input to the end of the file, but it
overwrites the
whole file instead. any ideas?
thanks,
declan