Re: Euphoria sucks at golfing

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

Whittled down to 141:

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

Nice! You can make it even shorter using or to convert to lowercase instead of and to upper, here's one i was using to test:

object t=or_bits(gets(0),32),s="llama",z=1,r={} 
for i=1 to length(t) do 
	if z<6 and t[i]=s[z] then 
		r&=i 
		z+=1 
	end if 
end for	 
if z<6 then r={} end if 
new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu