RosettaCodeData/Task/Repeat-a-string/Euphoria/repeat-a-string-1.euphoria

17 lines
350 B
Text
Raw Permalink Normal View History

2013-04-10 23:57:08 -07:00
function repeat_string(object x, integer times)
sequence out
if atom(x) then
return repeat(x,times)
else
out = ""
for n = 1 to times do
out &= x
end for
return out
end if
end function
puts(1,repeat_string("ha",5) & '\n') -- hahahahaha
puts(1,repeat_string('*',5) & '\n') -- *****