Forum Discussion
Patrick2788
Jan 25, 2024Silver Contributor
Utilizing Excel's turing capabilities to create Conway's 'Game of Life'
The Background It's been said with Lambda (and LET and a wealth of functions in 365) Excel has become 'turing-complete'. To quote the article linked below: "You can now, in principle, write any co...
Patrick2788
May 29, 2025Silver Contributor
One way to sharpen the sword is to devise a solution for an invented problem.
This is some fooling around with "Flood Fill":
FloodFillλ =
LAMBDA(grid, current_colors, new_colors,
LET(
h, ROWS(grid),
w, COLUMNS(grid),
x, {-1; -1; -1; 0; 1; 1; 1; 0},
y, {-1; 0; 1; 1; 1; 0; -1; -1},
new_colors, XLOOKUP(grid, current_colors, new_colors, ""),
change_colors,LAMBDA(i, j,
LET(
active, INDEX(grid, i, j),
connected, OR(active = INDEX(grid, i + x, j + y)),
new, INDEX(new_colors, i, j),
swap, (connected) * (OR(active = current_colors)),
fill, IF(
active = "",
"",
IF(swap, new, active)
),
fill
)
),
return, MAKEARRAY(h,w,change_colors),
return
)
);