Skip to content

Add stock Mazelams: MAZELAM_DIAG and MAZELAM_ELEV#188

Merged
jimmytacks merged 1 commit into
mainfrom
lambda-mazelams
May 20, 2026
Merged

Add stock Mazelams: MAZELAM_DIAG and MAZELAM_ELEV#188
jimmytacks merged 1 commit into
mainfrom
lambda-mazelams

Conversation

@jimmytacks
Copy link
Copy Markdown
Collaborator

@jimmytacks jimmytacks commented May 20, 2026

Summary

Two ready-to-use callbacks for MAZE's Mazelam slot:

  • 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 cost 1 + 2·rise; downhill 1 + 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:

=MAZE(mp, "C3", , , , , , , MAZELAM_DIAG)
=MAZE(elevation, "C3", elevation, , , , , , MAZELAM_ELEV)

Two purposes (per the user spec)

  1. Directly useful — both ship with sensible defaults (1.5× and 2×/0.5× respectively) drawn from the issue prose.
  2. Copy-and-edit templates — bodies are small, the 9-arg Mazelam contract is pre-wired with the correct param names, and constants are obvious to tweak. Drop a copy in your own library and edit the inner formula.

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 — succeeded
  • dotnet 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)
  • Integration test: MAZE(theMap, "C3", , "E5", FALSE, , , , MAZELAM_DIAG) returns 3, matching the existing inline-LAMBDA case
  • Array-lift confirmation: passing ={1;2;3} as costTo to either Mazelam returns the expected vertical 3-element result via the calc engine's natural broadcasting (no dispatcher needed)
  • Tim to spot-check in Excel that the named-reference call style feels right

Related: #184

🤖 Generated with Claude Code

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>
@jimmytacks jimmytacks merged commit 62cf254 into main May 20, 2026
1 check passed
@jimmytacks jimmytacks deleted the lambda-mazelams branch May 20, 2026 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant