Update king.c

The program is still to slow. created functions: it might be able to do it in a even better and cleaner way.