Surveyor's Gambit (1.20.1)

Post your coolest Hexcasting creations here.

New topics are NOT for chatting or asking help, put those in the comments of a post or in a different forum.
Clione
Posts: 2
Joined: Sun Apr 21, 2024 10:31 pm

Surveyor's Gambit (1.20.1)

Post by Clione »

A version of Archer's Distillation and Architect's Distillation using sentinel walking for arbitrary range, inspired/based on Long Steps, Scout's Exaltation, and Sentinel Snipe. It uses Hex Casting 1.20.1's Iris's Gambit to (hopefully) simplify breaking out of the loop.

Surveyor's Gambit
vector, vector, numbervector, vector | null
Arguments: position, direction, approximate range
Returns: block position, block face or null
Patterns
qqqeqqwawqaawaawddwaeawaeqqqwqwqqwqqqqwaeawaedeaaeaaaadadaawwqaawddaadaaawqqqddqddweddwaaaaeaaBookkeeper's Gambit: Drop 1, Keep 3deaqqeeeqqaeaaeawdddeaqqBookkeeper's Gambit: Drop 1ddqaaNumerical Reflection: 15waqawaadaawqaqwqeewdweddwaawddwddwaadaaNumerical Reflection: 0qqqqBookkeeper's Gambit: Drop 1, Keep 1, Drop 4daawdddeaqqeeeqqaeaaeawdddeaqqeqqwawqaawwaawwaeawaeqqqwqwqqwqaawddNumerical Reflection: 2aadadeaqqeeeddqaaqwaqdeeee

Code: Select all

#define Surveyor's Gambit (EAST wqaawddeeddwaa) = vector, vector, number -> vector, vector | null
{                                       // pos, dir, acc
    Huginn's Gambit                     // pos, dir (acc)
    Jester's Gambit                     // dir, pos
    Summon Greater Sentinel             // dir
    {                                   // *[pattern], dir, JUMP
        Locate Sentinel                 // dir, JUMP, pos
        Rotation Gambit                 // JUMP, pos, dir
        Dioscuri Gambit                 // JUMP, pos, dir, pos, dir
        Archer's Distillation           // JUMP, pos, dir, pos?
        Gemini Decomposition            // JUMP, pos, dir, pos?, pos?
        Augur's Purification            // JUMP, pos, dir, pos?, bool
        {                               // JUMP, pos, dir, pos
            Rotation Gambit II          // JUMP, pos, pos, dir
            Architect's Distillation    // JUMP, pos, face
            Rotation Gambit             // pos, face, JUMP
            Bookkeeper's Gambit: v---
            Hermes' Gambit
        }
        Vacant Reflection
        Augur's Exaltation              // JUMP, pos, dir, pos?, [pattern]
        Hermes' Gambit                  // JUMP, pos, dir, null
        Bookkeeper's Gambit: v          // JUMP, pos, dir
        Undertaker's Gambit             // JUMP, dir, pos, dir
        Numerical Reflection: 15        // JUMP, dir, pos, dir, 15
        Multiplicative Distillation     // JUMP, dir, pos, vec
        Gemini Decomposition            // JUMP, dir, pos, vec, vec
        Length Purification             // JUMP, dir, pos, vec, len
        Muninn's Reflection             // JUMP, dir, pos, vec, len, acc
        Jester's Gambit                 // JUMP, dir, pos, vec, acc, len
        Subtractive Distillation        // JUMP, dir, pos, vec, acc
        Gemini Decomposition            // JUMP, dir, pos, vec, acc, acc
        Numerical Reflection: 0         // JUMP, dir, pos, vec, acc, acc, 0
        Minimus Distillation            // JUMP, dir, pos, vec, acc, bool
        {                               // JUMP, dir, pos, vec, acc
            Bookkeeper's Gambit: v-vvvv // JUMP
            Nullary Reflection          // JUMP, null
            Jester's Gambit             // null, JUMP
            Hermes' Gambit
        }
        Vacant Reflection
        Augur's Exaltation              // JUMP, dir, pos, vec, acc, [pattern]
        Hermes' Gambit                  // JUMP, dir, pos, vec, acc
        Huginn's Gambit                 // JUMP, dir, pos, vec (acc)
        Additive Distillation           // JUMP, dir, pos
        Summon Greater Sentinel         // JUMP, dir
        Jester's Gambit                 // *[pattern], dir, JUMP
        Numerical Reflection: 2         // [pattern], dir, JUMP, 2
        Fisherman's Gambit II           // [pattern], dir, JUMP, [pattern]
        Hermes' Gambit
    }                                   // dir, [pattern]
    Undertaker's Gambit                 // [pattern], dir, [pattern]
    Iris's Gambit                       // vector, vector | null
}
This is my first hex using loops and my first anything using Iris's, so it can almost certainly be improved, and I'd love to hear any suggestions. And please don't mind my weird comments/stack trace, maybe they'll be useful to someone and I didn't feel like editing them out. (The *[pattern] thing just means that I didn't want to write [pattern] every line going forward, but it's still there.)

Edit: Huge thanks to Robotgiggle!
Also, there has to be a way to automatically generate those fancy pattern lists, right? I'm blind and couldn't find it and I really do not want to enter all those pattern codes by hand. If there is, I'll edit the pretty patterns in.
Last edited by Clione on Mon Apr 22, 2024 3:07 am, edited 1 time in total.
User avatar
Robotgiggle
Posts: 23
Joined: Fri Dec 02, 2022 12:38 am

Re: Surveyor's Gambit (1.20.1)

Post by Robotgiggle »

To generate the fancy pattern list, select all of your code in VSCode, go to View -> Command Palette -> Hex Casting: Copy Selection as BBCode, then paste what you get from that into a forum post. For a big spell, it's probably a good idea to wrap the whole thing in a spoiler block so it can be collapsed if necessary.
Clione
Posts: 2
Joined: Sun Apr 21, 2024 10:31 pm

Re: Surveyor's Gambit (1.20.1)

Post by Clione »

New day, same hex. I tried Scout's Exaltation's Thoth's method instead of my previous Iris's method and ended up with a shorter and simpler hex. But it uses Derivation Distillation, so it's still novel! It even preserves the raven mind! I also dropped the Architect's Distillation part of the hex to make it easier to swap Archer's out for Scout's. You can always follow up with Architect's if you want it.

As a warning, this hex doesn't clear the stack after each Thoth's iteration, since only the last value in the resulting list is kept, so if you have a lot of junk on the stack, you might want to do some cleanup inside the iterations.

Surveyor's Exaltation
vector, vector, numbervector | null
Arguments: position, direction, approximate range
Returns: block position
Patterns
qqqNumerical Reflection: 15wdedwewqaadaaaadaadaaaadaaewdqdweaaeaawaeawaeqqqwqwqqwqqqqBookkeeper's Gambit: Drop 1waeawaedeaawddaadadaawwqaawddaadaaawqqqBookkeeper's Gambit: Drop 2, Keep 1aqdeeeeeqqqBookkeeper's Gambit: Drop 1Numerical Reflection: 15waqawwaawwaeawaeqqqwqwqqwqdeeeawdddeaqqeeeaawdddadadqaeaqBookkeeper's Gambit: Drop 2, Keep 1eee

Code: Select all

#define Surveyor's Exaltation (EAST wqaawddeeddwaa) = vector, vector, number -> vector | null
{                                       // pos, dir, range
    Numerical Reflection: 15            // pos, dir, range, 15
    Division Distillation               // pos, dir, steps
    Floor Purification                  // pos, dir, steps
    Gemini Decomposition                // pos, dir, steps, steps
    Gemini Gambit                       // pos, dir, steps, ...
    Gemini Decomposition                // pos, dir, steps, ..., steps
    Flock's Gambit                      // pos, dir, [steps]
    Rotation Gambit                     // dir, [steps], pos
    Summon Greater Sentinel             // dir, [steps]
    {                                   // dir, steps
        Bookkeeper's Gambit: v          // dir
        Locate Sentinel                 // dir, pos
        Jester's Gambit                 // pos, dir
        Dioscuri Gambit                 // pos, dir, pos, dir
        Archer's Distillation           // pos, dir, pos?
        Gemini Decomposition            // pos, dir, pos?, pos?
        Augur's Purification            // pos, dir, pos?, bool
        {                               // pos, dir, pos
            Bookkeeper's Gambit: vv-    // pos
            Charon's Gambit
        }
        {                               // pos, dir, null
            Bookkeeper's Gambit: v      // pos, dir
            Numerical Reflection: 15    // pos, dir, 15
            Multiplicative Distillation // pos, off
            Additive Distillation       // pos
            Summon Greater Sentinel
            Nullary Reflection          // null
        }
        Augur's Exaltation
        Hermes' Gambit
    }                                   // dir, [steps], [pattern]
    Jester's Gambit                     // dir, [pattern], [steps]
    Thoth's Gambit                      // [..., pos?]
    Derivation Distillation             // [...], pos?
    Bookkeeper's Gambit: vv-            // pos?
}