Macro Megathread

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.
Master_Bw3
Posts: 7
Joined: Mon Dec 26, 2022 9:49 pm

Inverse Bookkeeper's

Post by Master_Bw3 »

Inverse Bookkeeper's
many, patternmany
Given a valid bookkeeper's pattern, replaces the stack with what would've been removed by evaluating that pattern.
qd
Patterns
qqqFlock's ReflectionFlock's GambitGemini DecompositionFlock's DisintegrationHermes' GambitFlock's ReflectionNumerical Reflection: -1Additive DistillationFlock's GambitExclusionary DistillationGemini DecompositionAbacus PurificationNumerical Reflection: -1Additive DistillationExcisor's DistillationFlock's Disintegrationeee

Code: Select all

{
    Flock's Reflection
    Flock's Gambit
    Gemini Decomposition
    Flock's Disintegration
    Hermes' Gambit
    Flock's Reflection
    Numerical Reflection: -1
    Additive Distillation
    Flock's Gambit
    Exclusionary Distillation
    Gemini Decomposition
    Abacus Purification
    Numerical Reflection: -1
    Additive Distillation
    Excisor's Distillation
    Flock's Disintegration
}
Master_Bw3
Posts: 7
Joined: Mon Dec 26, 2022 9:49 pm

Sandbox

Post by Master_Bw3 »

Sandbox
Integer
Stores the entire stack below the top n elements into the ravenmind, without deleting the ravenmind's contents. This is useful for macros and hexes that utilize Thoth's Gambit.
waa
Patterns
qqqFlock's GambitFlock's ReflectionFlock's GambitRetrograde PurificationSpeaker's DecompositionJester's GambitMuninn's ReflectionSpeaker's DistillationHuginn's GambitFlock's Disintegrationeee

Code: Select all

{
    Flock's Gambit
    Flock's Reflection
    Flock's Gambit
    Retrograde Purification
    Speaker's Decomposition
    Jester's Gambit
    Muninn's Reflection
    Speaker's Distillation
    Huginn's Gambit
    Flock's Disintegration
}
Master_Bw3
Posts: 7
Joined: Mon Dec 26, 2022 9:49 pm

Un-SandBox

Post by Master_Bw3 »

Un-Sandbox
Takes a sandboxed ravenmind, then restores the original ravenmind value and places the stored stack underneath the current stack.
ddw
Patterns
qqqFlock's ReflectionFlock's GambitMuninn's ReflectionSpeaker's DecompositionHuginn's GambitRetrograde PurificationJester's GambitCombination DistillationFlock's Disintegrationeee

Code: Select all

{
    Flock's Reflection
    Flock's Gambit
    Muninn's Reflection
    Speaker's Decomposition
    Huginn's Gambit
    Retrograde Purification
    Jester's Gambit
    Combination Distillation
    Flock's Disintegration
}
Master_Bw3
Posts: 7
Joined: Mon Dec 26, 2022 9:49 pm

Map

Post by Master_Bw3 »

Map
List, Pattern ListList
Thoth's Gambit, but the inputs are reversed and the rest of the stack is ignored.
Macros used: Sandbox, Un-Sandbox
dadaddww
Patterns
qqqNumerical Reflection: 2waaJester's GambitThoth's Gambitddweee

Code: Select all

{
    Numerical Reflection: 2
    Sandbox
    Jester's Gambit //remove if you don't want the inputs to be reversed
    Thoth's Gambit
    UnSandbox
}
Master_Bw3
Posts: 7
Joined: Mon Dec 26, 2022 9:49 pm

Map II

Post by Master_Bw3 »

Map II
List, List, Pattern ListList
For each element in the first list, put the element of that index from both lists onto the stack, then evaluate the pattern list.
Note: the first list must be ≤ the length of the second list.
Macros used: Sandbox, Un-Sandbox, Uncapped Counter's Queue II
dadadaddwww
Patterns
qqqNumerical Reflection: 3waaRotation Gambit IIJester's GambitGemini DecompositionAbacus PurificationqqqqawNumerical Reflection: 4Fisherman's GambitqqqGemini DecompositionRotation Gambit IISelection DistillationRotation Gambit IISelection DistillationeeeJester's GambitCombination DistillationJester's GambitThoth's GambitBookkeeper's Gambit: Drop 2, Keep 1ddweee

Code: Select all

{
    Numerical Reflection: 3
    Sandbox
    Rotation Gambit II
    Jester's Gambit
    Gemini Decomposition
    Abacus Purification
    Counter's Queue
    Numerical Reflection: 4
    Fisherman's Gambit
    {
        Gemini Decomposition
        Rotation Gambit II
        Selection Distillation
        Rotation Gambit II
        Selection Distillation
    }
    Jester's Gambit
    Combination Distillation
    Jester's Gambit
    Thoth's Gambit
    Bookkeeper's Gambit: vv-
    UnSandbox
}
Master_Bw3
Posts: 7
Joined: Mon Dec 26, 2022 9:49 pm

Complex Multiplicative Distillation

Post by Master_Bw3 »

Complex Multiplicative Distillation
vector, vectorvector
Takes 2 vectors representing complex numbers and multiplies them together, with the result being in the form of a vector. The Z component of the vectors is ignored.
ewaqawe
Patterns
qqqqeeeeeBookkeeper's Gambit: Drop 1aaeaaqeeeeeBookkeeper's Gambit: Drop 1aaeaaNumerical Reflection: 4ewdqdweaadaaqwaeawqwaqawddqddwaqawaawddwddwaawddqwaeawqaaeaawaqawddqddwaqawwaawNumerical Reflection: 0eqqqqqeee

Code: Select all

{
    Vector Disintegration
    Bookkeeper's Gambit: v
    Rotation Gambit
    Vector Disintegration
    Bookkeeper's Gambit: v
    Rotation Gambit
    Numerical Reflection: 4
    Flock's Gambit
    Gemini Decomposition
    Flock's Disintegration
    Multiplicative Distillation
    Rotation Gambit II
    Multiplicative Distillation
    Jester's Gambit
    Subtractive Distillation
    Jester's Gambit
    Flock's Disintegration
    Rotation Gambit
    Multiplicative Distillation
    Rotation Gambit II
    Multiplicative Distillation
    Additive Distillation
    Numerical Reflection: 0
    Vector Exaltation
}
User avatar
[object Object]
Posts: 70
Joined: Fri Dec 02, 2022 12:37 am

Perfect Counter's Queue

Post by [object Object] »

Perfect Counter's Queue
num[num]
Yet another Counter's Queue. Given an integer n, generates a list of all integers from 0 to n-1. This version uses no meta-eval.
wwaadada
Patterns
qqqqeewdweddwaawddaadaaeqqwawqaawNumerical Reflection: 1aawddaadaadaaqeewdweddwewdqdweNumerical Reflection: 0Numerical Reflection: 0wqaeaqwaeaaawddeqqwawqaaweee

Code: Select all

#define Perfect Counter's Queue (NORTH_EAST wwaadada) = num -> [num]
// 0..n
{
    Muninn's Reflection
    Jester's Gambit
    Gemini Decomposition
    Huginn's Gambit
    
    Numerical Reflection: 1
    Jester's Gambit
    Gemini Gambit
    Muninn's Reflection
    Flock's Gambit
    
    Numerical Reflection: 0
    Numerical Reflection: 0
    Surgeon's Exaltation
    
    Running Sum Purification
    Jester's Gambit
    Huginn's Gambit
}
Perfect Counter's Queue II
num[num]
As above, but generates integers from 1 to n.
dadaddww
Patterns
qqqqeewdweddwaawddaadaaeqqwawqaawNumerical Reflection: 1aawddaadaadaaqeewdweddwewdqdweaeaaawddeqqwawqaaweee

Code: Select all

#define Perfect Counter's Queue II (NORTH_EAST dadaddww) = num -> [num]
// 1..=n
{
    Muninn's Reflection
    Jester's Gambit
    Gemini Decomposition
    Huginn's Gambit
    
    Numerical Reflection: 1
    Jester's Gambit
    Gemini Gambit
    Muninn's Reflection
    Flock's Gambit
    
    Running Sum Purification
    Jester's Gambit
    Huginn's Gambit
}
User avatar
[object Object]
Posts: 70
Joined: Fri Dec 02, 2022 12:37 am

Numerical Zipper Distillation

Post by [object Object] »

Numerical Zipper Distillation
[num/vec], [num/vec][[num]]
Zips two lists using no meta-eval, by converting them to matrices, stacking them, and then converting the resulting matrix back. Mishaps if any of those intermediate matrices wouldn't be rectangular, or if there are any non-numerical iotas (ie. anything other than numbers or vectors) in the lists. For example:

Code: Select all

A=[num], B=[num] -> [[A1, B1], [A2, B2], ...]
A=[vec], B=[num] -> [[A1x, A1y, A1z, B1], [A2x, A2y, A2z, B2], ...]
A=[num], B=[vec] -> [[A1, B1x, B1y, B1z], [A2, B2x, B2y, B2z], ...]
A=[vec], B=[vec] -> [[A1x, A1y, A1z, B1x, B1y, B1z], [A2x, A2y, A2z, B2x, B2y, B2z], ...]
dawaqawad
Patterns
qqqaadaaaqaeaqNumerical Reflection: 3adddqddawwaeawwaadwaaawddawwaeawwaadwaaawddawwaeawwawawdedwaaaeddqqqdwwdqdwwdwdwaqawdBookkeeper's Gambit: Drop 1, Keep 1eeeqwaeawqawddaaedddwwdqdwwddawdaqaeaqNumerical Reflection: 1awwaeawwaddqdddeaqqdwwdqdwwddawdaawddqqqaaqwqaadeeeqwaeawqawdddeaqqBookkeeper's Gambit: Drop 1eee

Code: Select all

#define Numerical Zipper Distillation (SOUTH_EAST dawaqawad) = [num/vec], [num/vec] -> [[num]]
// A=[num], B=[num] -> [[A1, B1], [A2, B2], ...]
// A=[vec], B=[num] -> [[A1x, A1y, A1z, B1], [A2x, A2y, A2z, B2], ...]
// A=[num], B=[vec] -> [[A1, B1x, B1y, B1z], [A2, B2x, B2y, B2z], ...]
// A=[vec], B=[vec] -> [[A1x, A1y, A1z, B1x, B1y, B1z], [A2x, A2y, A2z, B2x, B2y, B2z], ...]
// mishaps if the corresponding matrix wouldn't be rectangular
{
    // check if the lists are 3 items long
    Gemini Decomposition
    Abacus Purification
    Numerical Reflection: 3
    Equality Distillation
    Rotation Gambit II

    // zip the lists
    Transformation Purification
    Jester's Gambit
    Transformation Purification
    Jester's Gambit
    Tower Distillation

    // if n==3, add an extra column at the start so it doesn't convert to a list of vectors
    // talia why do i have to do this :(
    Prospector's Gambit
    {
        Sprawling Distillation
        Bookkeeper's Gambit: v-
    }
    Flock's Disintegration
    Augur's Exaltation

    // make the column 1xN - we don't know N statically because there could be 0, 1, or 2 vectors
    Prospector's Gambit
    Restoration Purification
    Abacus Purification
    Numerical Reflection: 1

    Zero Distillation
    Rotation Gambit II
    Hermes' Gambit
    
    // convert back to a list, and remove the extra entry if n==3
    Restoration Purification
    Jester's Gambit
    {
        Speaker's Decomposition
        Nullary Reflection
    }
    Flock's Disintegration
    Augur's Exaltation
    Hermes' Gambit
    Bookkeeper's Gambit: v
}
User avatar
[object Object]
Posts: 70
Joined: Fri Dec 02, 2022 12:37 am

Ravenmind Defaults

Post by [object Object] »

Muninn's Purification
anyany
Reads the ravenmind, or returns a default value if the ravenmind is null.
qeewdweddwdw
Patterns
qqqqeewdweddwaadaadadddqddawddeee

Code: Select all

#define Muninn's Purification (NORTH_EAST qeewdweddwdw) = any -> any
// reads the ravenmind or a default value
{
    Muninn's Reflection
    Gemini Decomposition
    Nullary Reflection
    Equality Distillation
    Rotation Gambit II
    Augur's Exaltation
}
Huginn's Gambit II
any
If the ravenmind is null, sets its value.
eqqwawqaawaw
Patterns
qqqqeewdweddwdweqqwawqaaweee

Code: Select all

#define Huginn's Gambit II (NORTH_WEST eqqwawqaawaw) = any ->
// sets a default value for the ravenmind
{
    Muninn's Purification
    Huginn's Gambit
}
User avatar
[object Object]
Posts: 70
Joined: Fri Dec 02, 2022 12:37 am

Power Distillation II

Post by [object Object] »

Power Distillation II
num, numnum
Power Distillation, but 0^0 is defined as 1 instead of causing a mishap.
wedewa
Patterns
qqqaadadaawadaaeddNumerical Reflection: 0adwdwdwaaeaaNumerical Reflection: 1awddaawddwedeweee

Code: Select all

#define Power Distillation II (NORTH_WEST wedewa) = num, num -> num
// b, x -> b^x, where 0^0 = 1
{
    Dioscuri Gambit
    Equality Distillation
    
    Prospector's Gambit
    Numerical Reflection: 0
    Equality Distillation
    
    Conjunction Distillation
    Negation Purification
    Rotation Gambit
    Numerical Reflection: 1
    Augur's Exaltation
    
    Jester's Gambit
    Power Distillation
}