Skip to content

Instantly share code, notes, and snippets.

@williame
Created September 19, 2014 11:16
Show Gist options
  • Save williame/77fbf6ff13d6ea0261fb to your computer and use it in GitHub Desktop.
Save williame/77fbf6ff13d6ea0261fb to your computer and use it in GitHub Desktop.
def s(h,n):
l=h.find('\n')+2;h+='\n'*l;L=len(h);i=L*8
while i:
i-=1;j=i;m=len(n)
for c in n:m-=c==h[j%L];j+=[-l,1-l,2-l,-1,1,l-2,l-1,l][i/L]
if m<1:return 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment