Use Arrow Keys. Don't touch the walls. Be careful - when you change direction, one step in a previous direction will be done.