Rep-string: Difference between revisions
Content added Content deleted
m (→{{header|Wren}}: Minor tidy) |
(Added Easylang) |
||
Line 1,365: | Line 1,365: | ||
00 1 rep-string 0 |
00 1 rep-string 0 |
||
1 not a rep-string</pre> |
1 not a rep-string</pre> |
||
=={{header|EasyLang}}== |
|||
{{trans|C}} |
|||
<syntaxhighlight> |
|||
func$ repstr s$ . |
|||
sl = len s$ div 2 + 1 |
|||
while sl > 1 |
|||
r$ = substr s$ sl -1 |
|||
if r$ = substr s$ 1 len r$ |
|||
return substr r$ 1 (sl - 1) |
|||
. |
|||
sl -= 1 |
|||
. |
|||
return "" |
|||
. |
|||
repeat |
|||
s$ = input |
|||
until s$ = "" |
|||
print s$ & " -> " & repstr s$ |
|||
. |
|||
input_data |
|||
1001110011 |
|||
1110111011 |
|||
0010010010 |
|||
1010101010 |
|||
1111111111 |
|||
0100101101 |
|||
0100100 |
|||
101 |
|||
11 |
|||
00 |
|||
1 |
|||
</syntaxhighlight> |
|||
=={{header|EchoLisp}}== |
=={{header|EchoLisp}}== |