Original Post
Hi all, I don't know if this is the best place to post this question but here goes: I'm working on a prolog program that basically translates a list of chinese number into a list of english numbers or vice versa (depending on the arguments provided), here is my code:
translation(ling,zero).
translation(yi,one).
translation(er,two).
translation(san,three).
translation(si,four).
translation(wu,five).
translation(liu,six).
translation(qi,seven).
translation(ba,eight).
translation(jiu,nine).
translation(shi,ten).
translateE2C([],[]).
translateE2C([Ch|Ct],[Eh|Et]) :- translation(Ch, Eh), translateE2C(Ct,Et).
calling might look like: translateE2C([ling,yi,er],X). (output: X=[zero, one, two]) The program works exactly like it is supposed to up until a point. The only problem is that the output doesnt display the last part of the list when 9 or more words are provided to it (output: X = [zero, one, two, three, four, five, six, seven, eight|...]). I am just wondering why it is doing that at that point, and if there is any way to "force" it to print everything it is supposed to? Thanks for your help :)