advent of code 2023 day 16: naive recursive impl?
This commit is contained in:
parent
ebda90a747
commit
9ee21ab71f
|
@ -20,14 +20,13 @@ const mirrors = {
|
|||
}
|
||||
}
|
||||
|
||||
let i = 0
|
||||
const solve = (input) => {
|
||||
const tiles = input.split('\n').map(line => line.split(''))
|
||||
const energized = []
|
||||
|
||||
const traverse = (pos, direction) => {
|
||||
i++
|
||||
if(pos[0] < 0 || pos[1] < 0 || pos[0] > tiles.length || pos[1] > tiles[0].length || i > 50)
|
||||
if(pos[0] < 0 || pos[1] < 0 || pos[0] > tiles.length || pos[1] > tiles[0].length)
|
||||
return
|
||||
const curr = tiles[pos[0]][pos[1]]
|
||||
|
||||
|
|
Loading…
Reference in New Issue