Jump to content

Repeat a string: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 1,273:
}</lang>
 
=={{header|NetLogo}}==
<lang NetLogo>
to go
output-print ( _repeat_string_ "ha" 5) ;; output "hahahahaha"
end
 
to-report _repeat_string_ [ _string _times ]
let _repeat_string "" ;; initialize
let _counter 0 ;; initialize
while [ _counter < _times ]
[
set _repeat_string ( word _repeat_string _string )
set _counter ( _counter + 1 )
]
report _repeat_string
end
</lang>
 
=={{header|NetRexx}}==
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.