Skip to content

Commit

Permalink
small changes to roman.pl
Browse files Browse the repository at this point in the history
  • Loading branch information
flach committed Mar 20, 2018
1 parent 99b0a32 commit 7167c1f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions roman.pl
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,16 @@
d(2,N) --> i(N),i(N).
d(3,N) --> i(N),i(N),i(N).
d(4,N) --> i(N),v(N).
%d(4,N) --> i(N),i(N),i(N),i(N).
d(5,N) --> v(N).
d(6,N) --> v(N),i(N).
d(7,N) --> v(N),i(N),i(N).
d(8,N) --> v(N),i(N),i(N),i(N).
d(9,N) --> i(N),{N1 is N+1},i(N1).

/** <examples>
?- phrase(roman(1984),R).
?- phrase(roman(Y),[m,c,m,l,x,x,x,i,v]).
*/

0 comments on commit 7167c1f

Please sign in to comment.