scrabble by twobit

x=30
i=0
g=[x*[" "]for _ in" "*60]
d=map(ord,["\x02\0\x14\0\x1e\x09$\x09\x142S\0","$\x15\x09\x12$\x12\x14E\n)\0\x1d+\x04\r\x12\x7f\x04","\x02\x05\x03\x09)\x01#\n\x1c-\x18-\x137$-$) \0S\x05"][id(0)%3])
y=d.pop()
a=raw_input()
q=d.pop()
a=(a[:q]+"l"+a[q+1:]).split()
for q in[0]+d:y,x=x+q/9,y-q%9;w=(a+[""])[i];g[y][x:x+len(w)]=w;g=map(list,zip(*g));i+=1
for l in zip(*g):
\x09w="".join(l).rstrip()
\x09if w:print w
print"\n/* error with %s */"%a[i]

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

download

return to the top page