alhobarata
Programmer
- May 31, 2008
- 1
This code make transformation of number to text and vice versa
%----------------------------------
dx(X)-->cm(X);c(X);d(X).
cm([DDD,mil])-->c(DDD),[0,0,0].
c([cento,e|DD])-->[1],d(DD).
d([dez])-->[1,0].
%----------------------------------
Test with:
?- dx(C,[1,1,0,0,0,0],[]).
The answer is:
C = [[cento, e, dez], mil]
I want the answer become:
C = [cento, e, dez, mil]
thanks in advance.
%----------------------------------
dx(X)-->cm(X);c(X);d(X).
cm([DDD,mil])-->c(DDD),[0,0,0].
c([cento,e|DD])-->[1],d(DD).
d([dez])-->[1,0].
%----------------------------------
Test with:
?- dx(C,[1,1,0,0,0,0],[]).
The answer is:
C = [[cento, e, dez], mil]
I want the answer become:
C = [cento, e, dez, mil]
thanks in advance.