Skip to content

Thoth's Gambit changes#1106

Open
IridescentVoid wants to merge 11 commits into
FallingColors:1.21from
IridescentVoid:feat_new_thoths
Open

Thoth's Gambit changes#1106
IridescentVoid wants to merge 11 commits into
FallingColors:1.21from
IridescentVoid:feat_new_thoths

Conversation

@IridescentVoid

@IridescentVoid IridescentVoid commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

This PR makes a number of changes to Thoth's Gambit:

  • Swap argument order to take data, code in that order.
  • Allow taking single patterns as code.
  • Change to a special handler with a different prefix + tail shape
  • Tail length now determines the number of iota moved into the context stack (used for each iteration). Iota that are not moved are stashed and restored at the end of all iterations.
  • Updated the hex notebook accordingly.
  • Updated ancient cypher hexes to use the new Thoth's Gambit pattern and argument order.

Closes #1091
Closes #385

@github-project-automation github-project-automation Bot moved this to 📋 Backlog in Hex Casting Jun 6, 2026
@IridescentVoid IridescentVoid changed the title Feat new thoths Thoth's Gambit changes Jun 6, 2026
@IridescentVoid IridescentVoid marked this pull request as ready for review June 7, 2026 01:44
@vgskye vgskye added the 1.21 label Jun 7, 2026

"for_each.1": "Remove a list of patterns and a list from the stack, then cast the given pattern over each element of the second list.",
"for_each.2": "More specifically, for each element in the second list, it will:$(li)Create a new stack, with everything on the current stack plus that element$(li)Draw all the patterns in the first list$(li)Save all the iotas remaining on the stack to a list$(br)Then, after all is said and done, pushes the list of saved iotas onto the main stack.$(br2)No wonder all the practitioners of this art go mad.",
"for_each.1": "Remove a list of values and pattern/list of patterns from the stack, then cast the pattern(s) over each element of the first list.",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Future issue: does this + eval deserve to be updated to mention continuations?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was planning to rewrite or rework the notebook sections as part of #1107, so I can add more information on continuations during that change. More specifically, I'm hoping it'll be after #1102 and #1103 are merged, so everything can be cleaned up in a single pass.

Comment thread CHANGELOG.md
@IridescentVoid

IridescentVoid commented Jun 10, 2026

Copy link
Copy Markdown
Contributor Author

NOTE: Due to rebasing onto latest 1.21 with treelist changes, Thoth's Gambit on this PR branch is bugged. This should be rectified once all 1.20 changes are cherry-picked onto 1.21.

Edit: No longer relevant.

@object-Object object-Object left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with two nits, though there are some merge conflicts to resolve now

Comment thread CHANGELOG.md
@IridescentVoid

Copy link
Copy Markdown
Contributor Author

I would like to modify/add Ancient Cyphers to better demonstrate Thoth's Gambit. Currently all three use Thoth's Gambit: 0 as a foreach, without capturing anything for context. However, finding suitable use cases is proving difficult.

@s5bug

s5bug commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

A magnet spell could be reasonable. Capture the player's position on the stack, then loop over entities?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: 📋 Backlog

Development

Successfully merging this pull request may close these issues.

5 participants