Originally Posted by eXeCuTeR Run it, it's hard to explain. oh ok now I get it... ei, ej is where the current position is. and -1 is the offset that you are trying to move. the if else tree is for one of four possible moves.