This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Make sure you have enough Fertilizer before starting. | |
| def do_maze(iterations=1): | |
| # Define some geometry help for later | |
| opp = {North: South, East: West, | |
| South: North, West: East} | |
| dx = {North: 0, East: 1, South: 0, West: -1} | |
| dy = {North: 1, East: 0, South: -1, West: 0} | |
| # Start a Maze. | |
| harvest() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| solver=LAMBDA(grid, | |
| LET( | |
| numbers, SEQUENCE(9), | |
| numgrid, SEQUENCE(9,9,0), | |
| vgrid, TOCOL(grid*1), | |
| pos, XMATCH(0,vgrid)-1, | |
| IF( | |
| ISNA(pos), grid, | |
| LET( | |
| i,INT(pos/9), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //ref: https://codereview.stackexchange.com/q/199771 | |
| solver=LAMBDA(grid, | |
| LET(numbers,SEQUENCE(9), | |
| numgrid,SEQUENCE(9,9,0), | |
| pos,XMATCH(0,TOCOL(grid*1))-1, | |
| IF(ISNA(pos), | |
| grid, | |
| LET(i,INT(pos/9), | |
| j,MOD(pos,9), |