Knight move sorted by

import sys
while 1:i=raw_input();l=ord(i[0]);m=int(i[1]);print' '.join(chr(l+j)+`m+k`for j,k in((-2,-1),(-2,1),(-1,-2),(-1,2),(1,-2),(1,2),(2,-1),(2,1))if 105>l+j>96>0<m+k<9)

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)


return to the top page