Re: Euphoria sucks at golfing

new topic     » goto parent     » topic index » view thread      » older message » newer message

I got it down to 150 characters (after whitespace removed). Here's the whitespace version:

object t=and_bits(gets(0),#DF),L="LLAMA",X={},i=1 
 
while length(L) do 
  i=find(L[1],t,i) 
  if i=0 then 
    X={} 
    exit 
  else 
    L=L[2..$] 
    X&=i 
    i+=1 
  end if 
end while 
?X 

Edit: Shortened to 148:

object t=and_bits(gets(0),#DF),L="LLAMA",X={},i=1 
 
while length(L)do 
  i=find(L[1],t,i) 
  if i then 
    L=L[2..$] 
    X&=i 
    i+=1 
  else 
    X={} 
    exit 
  end if 
end while 
?X 

Edit2 Got it down to 147. Here is the short version:

object t=and_bits(gets(0),#DF),L="LLAMA",X={},i=1 
while length(L)do 
i=find(L[1],t,i)if i then L=L[2..$]X&=i i+=1 
else X={}exit 
end if 
end while 
?X 
new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu