$0 = 1 $1 = 1 while( $0 <= W) if(A[$1,$0]!=B[$1,$0]) return ($1,$0) end $0=$0+1 if($0==W+1) $0=0; $1=$1+1 end if($1==H+1) $0=W+5 end end