Teacup rim text: Difference between revisions

Added Arturo implementation
(Added Arturo implementation)
Line 74:
rotateable?: function [w][
loop 1..dec size w 'i [
rotated: rotate.left w i
if or? [rotated = w][not? contains? wordset rotated] ->
return false
Line 84:
loop select wordset 'word [3 =< size word] 'word [
if rotateable? word ->
'results ++ @[ sort map 1..size word 'i [ rotate.left word i ]]
]
 
loop sort unique results 'result ->[
print join.withroot: " -> "first result</lang>
print join.with: " -> " map 1..size root 'i [ rotate.left root i]
]</lang>
 
{{out}}
 
<pre>atetea -> eat -> teaate
arcrca -> car -> rcaarc
aptpta -> ptatap -> tapapt</pre>
 
=={{header|AutoHotkey}}==
1,532

edits