Add stock Mazelams: MAZELAM_DIAG and MAZELAM_ELEV#188
Merged
Conversation
Two ready-to-use callbacks for MAZE's Mazelam slot, both shaped as
direct 9-arg LAMBDAs so callers can pass them by name:
=MAZE(mp, "C3", , , , , , , MAZELAM_DIAG)
=MAZE(elevation, "C3", elevation, , , , , , MAZELAM_ELEV)
MAZELAM_DIAG — diagonals cost 1.5x the destination Cost, cardinals 1x.
The canonical "realistic distance over a uniform map"
callback from issue #184.
MAZELAM_ELEV — treats Cost as elevation. Uphill steps cost
1 + 2*rise; downhill 1 + 0.5*drop (drop negative, so
downhill is cheaper than flat); flat steps cost 1.
Both lambdas double as copy-edit templates: the body is small,
constants are obvious, and the 9-arg Mazelam contract is pre-wired so
callers don't have to remember the param order.
Tests: 5 functional cases per Mazelam plus help, including an
array-of-destinations case to confirm natural element-wise lifting
through Excel's calc engine. MAZE.tests.yaml gains an integration
case that passes MAZELAM_DIAG by name and asserts the same result
(3) as the inline-LAMBDA case alongside it.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two ready-to-use callbacks for
MAZE'sMazelamslot:MAZELAM_DIAG— diagonals cost 1.5× the destination's Cost, cardinals cost 1×. The canonical "realistic distance over a uniform map" callback from LAMBDA idea: BFSMaze (pathfinding) #184.MAZELAM_ELEV— treats Cost as elevation. Uphill steps cost1 + 2·rise; downhill1 + 0.5·drop(drop is negative, so downhill is cheaper than flat); flat steps cost 1.Both ship as direct 9-arg LAMBDAs (not factories), so usage is a single name reference:
Two purposes (per the user spec)
Scope note
Four of the six patterns in #184 (turn penalty +5, budget=50, blockrow=15, fatigue=0.05) were omitted by design — their hard-coded constants are too case-specific to be "directly useful" on purpose 1, and the two shipped here demonstrate the contract well enough to serve as copy templates for the others.
Test plan
dotnet build addin/lambda-boss.slnx— succeededdotnet test addin/lambda-boss.Tests/lambda-boss.Tests.csproj --filter "FullyQualifiedName~LambdaFormatTests"— 448/448 passed (16 new format-test cases for the two Mazelams)dotnet test addin/lambda-boss.AddinTests/lambda-boss.AddinTests.csproj --filter "FullyQualifiedName~LambdaHarnessTests.LambdaTest"— 472/472 passed (13 new harness tests)MAZE(theMap, "C3", , "E5", FALSE, , , , MAZELAM_DIAG)returns3, matching the existing inline-LAMBDA case={1;2;3}ascostToto either Mazelam returns the expected vertical 3-element result via the calc engine's natural broadcasting (no dispatcher needed)Related: #184
🤖 Generated with Claude Code