Knight move sorted by yuki

main=interact$unlines.map(unwords.concat.f).lines
a%n=toEnum$n+fromEnum a
f(a:b:_)=zipWith g(map(a%)[-2,-2,-1,-1,1,1,2,2])(map(b%)[-1,1,-2,2,-2,2,-1,1])
g a b|or[a<'a',a>'h',b<'1',b>'8']=[]|0<1=[a:[b]]

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

To protect the system from spam, please input your favorite sport (hint: I believe its name must start with 'g', case insensitive)

download

return to the top page