CapelliC gets credit for the solution, but I will change it a bit for clarity and try to add some explanation:
% Print a triangle of 1 to N stars
star(N) :- star(1, N). % (I modified this slightly to accept N parameter)
% Print rows of NStars stars up to MaxStars stars
star(NStars , MaxStars ) :-
NStars =< MaxStars , % Print this row if NStars <= MaxStars
row_of_stars(NStars), % Print NStars for this row
NStars1 is NStars+1, % Increment the star count
star(NStars1, MaxStars ). % recursively print NStar1 to MaxStars triangle
star(NStars, MaxStars) :-
NStars > MaxStars . % Done when exceed MaxStars
% Print NumStars stars
row_of_stars(NumStars) :-
row_of_stars(1, NumStars). % Print NumStars starting with star number 1
row_of_stars(N, MaxStars) :-
N =< MaxStars, % This case is if star number doesn't exceed max
write('*'), % Print a star
N1 is N+1, % Increment the star count
print_a_star(N1, MaxStars). % Print the next star in the row
row_of_stars(N, MaxStars) :-
N > MaxStars, nl. % Done when exceed MaxStars
: star row_of_stars ( count). star "". , : . row_of_stars ( count) . , . , , , .