📜  translate(1 2 9 一二九) prolog 编程 - Prolog 代码示例

📅  最后修改于: 2022-03-11 14:44:44.924000             🧑  作者: Mango

代码示例1
totext(0, 'zero').
totext(1, 'one').
totext(2, 'two').
totext(3, 'three').
totext(4, 'four').
totext(5, 'five').
totext(6, 'six').
totext(7, 'seven').
totext(8, 'eight').
totext(9, 'nine').

translate([], []).
translate([Head|Rest], [TranslatedHead|TranslatedRest]) :-
   totext(Head, TranslatedHead),
   translate(Rest, TranslatedRest).