Leapfrogging by AndoDaan

function mRandom()
\x09temp=''

\x09while #temp<9 do
\x09\x09cr=math.random(1,9)..''
\x09\x09if string.find(temp, cr)==nil then temp=temp..cr end
\x09end
\x09return temp
end

function calc(ip)
\x09ps=0
\x09output=''
\x09np=''
\x09for i=1,#ip do
\x09\x09for k=1,#ip do
\x09\x09\x09if ip:sub(k,k)==i..'' then np=k end
\x09\x09end
\x09\x09jump=np-ps
\x09\x09if jump>0 then
\x09\x09\x09output=output..'>'..jump
\x09\x09\x09ps=ps+jump
\x09\x09elseif jump<=0 then
\x09\x09\x09output=output..'<'..math.abs(jump-1)
\x09\x09\x09ps=ps+jump-1
\x09\x09end
\x09end
\x09return output
end


while''do
\x09a=io.read('*l')
\x09print(calc(a))
end

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return to the top page