sasagawa888 / nprolog

interpreter and compiler to be compatible with ARITY/PROLOG(MS-DOS)
Other
76 stars 5 forks source link

It can not generate correct compiled code #56

Closed sasagawa888 closed 3 years ago

sasagawa888 commented 3 years ago

% ?- test(0).

test(20). test(N) :- fizzbuzz(N), N1 is N+1, test(N1).

fizzbuzz(N) :- N mod 3 =:= 0, write(fizz). fizzbuzz(N) :- N mod 5 =:= 0, write(buzz). fizzbuzz(N) :- N mod 15 =:= 0, write(fizzbuzz). fizzbuzz(N) :- write(N).

sasagawa888 commented 3 years ago

I Fixed it.