Repeat a string: Difference between revisions

added a shorter J implementation
(Updated the two D entries)
(added a shorter J implementation)
Line 463:
5 # 'ha' NB. repeat each item 5 times
hhhhhaaaaa
(5 ((* # 'ha') $ ]) 'ha' NB. repeat array 5 times (explicit)
hahahahaha
5 ((* ;@#) $ ])< 'ha' NB. repeatboxing is used to treat the array 5as timesa (tacit)whole
hahahahaha</lang>
 
Anonymous user