Horje
translate( 1 2 9 one two nine ) prolog programming Code Example
[Solved] - translate( 1 2 9 one two nine ) prolog programming Code Example
Try following codes
translate( 1 2 9 one two nine ) prolog programming
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).
Date: 2022-05-21 05:02:10
Category: prolog
More for You