update main.cpp : add function row_column_move_amount

add function row_column_move_amount
count number of rows or columns would move on certain direction
Merge pull request #7 from fwpp/patch-7

update main.cpp : add function row_column_move_amount