Knight Move by mute

for a in {a..h}{1..8};do b+=($a);done
while read s||((${#s}));do
m=()
((p=8*(26#${s%?}-10)+${s#?}-1))
for c in -6 10 17 15 6 -10 -17 -15;do
((v=p%8-(p+c)%8))
((p+c>0&&${v#-}<3))&&m+=(${b[p+c]})
done
echo ${m[*]}
done

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

download

return to the top page