commit
6877683c95
|
|
@ -246,11 +246,11 @@ var generateMatrix = function(n) {
|
||||||
res[row][col] = count++;
|
res[row][col] = count++;
|
||||||
}
|
}
|
||||||
// 下行从右到左(左闭右开)
|
// 下行从右到左(左闭右开)
|
||||||
for (; col > startX; col--) {
|
for (; col > startY; col--) {
|
||||||
res[row][col] = count++;
|
res[row][col] = count++;
|
||||||
}
|
}
|
||||||
// 左列做下到上(左闭右开)
|
// 左列做下到上(左闭右开)
|
||||||
for (; row > startY; row--) {
|
for (; row > startX; row--) {
|
||||||
res[row][col] = count++;
|
res[row][col] = count++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue