Re: Euphoria sucks at golfing

new topic     » goto parent     » topic index » view thread      » older message » newer message
petelomax said...

This works in Phix (105 characters)

object t=lower(gets(0)),L="llama",i=0for j=1to 5do i=find(L[j],t,i+1)L[j]=i end for?L[1..-not find(0,L)] 

Notes: lower() is an autoinclude, I overwrite L with the result as we go, and finally use negative indexes.

Pete

I don't have Phix or OpenEuphoria installed anywhere these days, but the "i" object isn't needed just put the initial start index value in L[1]. Try the code below to verify it works. (103 characters)

object t=lower(gets(0)),L=1&"llama"for j=2to 6do L[j]=find(L[j],t,L[j-1]) end for?L[2..-not find(0,L)] 
new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu