Minesweeper by leonid (2hrs)

s=open('../fd/0').read()
t=''
for x in s:t+=[x,`sum('*'<('.'*18+s)[len(t)+k%3+k/3*17:]<'.'for k in range(9))`]['*'<x]
print t

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

download

return top