knight function

Generating function for a chess knight and king