Rep-string: Difference between revisions

Added Arturo implementation
(Added Arturo implementation)
Line 445:
00 -> 0
1 -> (n/a)</pre>
 
=={{header|Arturo}}==
 
<lang rebol>repeated?: function [text][
loop ((size text)/2)..0 'x [
if prefix? text slice text x (size text)-1 [
(x>0)? -> return slice text 0 x-1
-> return false
]
]
return false
]
 
strings: {
1001110011
1110111011
0010010010
1010101010
1111111111
0100101101
0100100
101
11
00
1
}
 
loop split.lines strings 'str [
rep: repeated? str
if? false = rep ->
print [str "-> *not* a rep-string"]
else ->
print [str "->" rep "( length:" size rep ")"]
]</lang>
 
{{out}}
 
<pre></pre>
 
=={{header|AutoHotkey}}==
1,532

edits