I am beggining to learn Prolog and I would like to know how to implements a function that turns a list of strings into an ordered list of lists of characters. For example:
?- f([sheep,dog,cat],Z).
should return
Z=[[c,a,t], [d,o,g], [s,h,e,e,p]].
I know i should use the predicates sort(L1,L2) and atom_chars(A,B) respectively. But how exactly do I write the code? There are very few Prolog tutorials online so I really don't know how to put it... Thanks in advance!