How to draw right triangle using recursion in prolog?
问题 I get the answer for this right triangle as shown below: shape:- shape(0, 6). shape(S, A) :- S < A, count(0, S), S1 is S+1, shape(S1, A). shape(S, X) :- S >= X. count(A, B) :- A =< B, write('*'), A1 is A+1, count(A1,B). count(A, B) :- A > B, nl. * ** *** **** ***** ****** What should i modify to print the right triangle of this type? * ** *** **** ***** ****** 回答1: shape(S, _) :- S =< 0. shape(S, N) :- S > 0, S1 is S-1, count(0, S1, N), shape(S1, N). count(A, _, N) :- A >= N, nl. count(A, B,