6 lines
144 B
Prolog
6 lines
144 B
Prolog
%repeat(Str,Num,Res).
|
|
repeat(Str,1,Str).
|
|
repeat(Str,Num,Res):-
|
|
Num1 is Num-1,
|
|
repeat(Str,Num1,Res1),
|
|
string_concat(Str, Res1, Res).
|