for loopified
This commit is contained in:
parent
199303ce82
commit
d28803dba6
1 changed files with 4 additions and 6 deletions
|
@ -27,14 +27,12 @@ class DayFour implements Solvable {
|
|||
let [b,a] = [0, mat[0].length - 1]
|
||||
const lines = []
|
||||
while (b < mat.length) {
|
||||
let [y,x] = [b,a]
|
||||
|
||||
|
||||
let line = ''
|
||||
// walk top left of diagonal to bottom right
|
||||
while (x < mat[y].length && y < mat.length - 1) {
|
||||
for (let [y,x] = [b,a]; x < mat[y].length && y < mat.length - 1; y++,x++)
|
||||
line += mat[y][x]
|
||||
y++
|
||||
x++
|
||||
}
|
||||
|
||||
lines.push(line.split(''))
|
||||
|
||||
if (a > 0) {
|
||||
|
|
Loading…
Reference in a new issue