Page 3 of 5

Binomial Distillation

Posted: Sun May 21, 2023 12:47 am
by [object Object]
Binomial Distillation
num, numnum
Given two numbers n and i, calculates the binomial coefficient nCi.
wdwaqawdw
Patterns
qqqaadadaawwddwwawdedwawaawddwawdedwawwaqawaawddwawdedwawaawddwdedweee

Code: Select all

#define Binomial Distillation (NORTH_EAST wdwaqawdw) = num, num -> num
// n, i -> nCi
{
    Dioscuri Gambit
    Subtractive Distillation
    Factorial Purification
    
    Jester's Gambit
    Factorial Purification
    Multiplicative Distillation
    
    Jester's Gambit
    Factorial Purification
    Jester's Gambit
    Division Distillation
}

Re: Macro Megathread

Posted: Sun May 21, 2023 12:53 am
by [object Object]
Bezier's Distillation
[vec], numvec
Macros used: Perfect Counter's Queue, Numerical Zipper Distillation, Muninn's Purification, Power Distillation II, Binomial Distillation

Calculates a point on a Bezier curve given a list of control points and a number between 0 and 1. Uses as many meta-eval levels as there are control points.

An example is below. It was produced by casting Counter's Queue 50, mapping it to Bezier(i/50) with Thoth, and casting Particles on the resulting list.
Image
eeeqqq
Patterns
qqqqeewdweddwddqddaawddaadaaaqaeaqaadaaNumerical Reflection: 1wddwddqdddadaddwqaawdddawaqawadqqqqwaeawqeqqqqqddqddaadadaawwddwddqddddqaawdwaqawdwddqddNumerical Reflection: 5ddadddqaaaawddwedewaddqddNumerical Reflection: 1aawddwddwaawddwedewawaqawwaqawwaqawqqqqqqeewdweddwdwwaaweqqwawqaaweeeaawdddadadBookkeeper's Gambit: Drop 3qeewdweddwaawddeqqwawqaaweee

Code: Select all

#define Bezier's Distillation (NORTH_EAST eeeqqq) = [vec], num -> vec
// P, t -> B(t), where 0 <= t <= 1
// meta-eval: len(P)
{
    Muninn's Reflection
    Rotation Gambit II

    // find n and n+1
    Jester's Gambit
    Gemini Decomposition
    Abacus Purification

    Gemini Decomposition
    Numerical Reflection: 1
    Subtractive Distillation // P contains n+1 vectors, so subtract 1 from len(P)
    Rotation Gambit II
    
    // zip indices and control points
    Perfect Counter's Queue
    Jester's Gambit
    Numerical Zipper Distillation

    // calculate the summation
    {
        // unzip index and control point
        Flock's Disintegration
        Vector Exaltation

        // n-i
        Rotation Gambit II
        Dioscuri Gambit
        Subtractive Distillation

        // nCi
        Rotation Gambit II
        Undertaker's Gambit
        Binomial Distillation
        
        // t^i
        Rotation Gambit II
        Numerical Reflection: 5
        Fisherman's Gambit
        Undertaker's Gambit
        Jester's Gambit
        Power Distillation II
        
        // (1-t)^(n-i)
        Rotation Gambit II
        Numerical Reflection: 1
        Jester's Gambit
        Subtractive Distillation
        Jester's Gambit
        Power Distillation II
        
        // add (nCi * t^i * (1-t)^(n-i) * P) to the running total
        Multiplicative Distillation
        Multiplicative Distillation
        Multiplicative Distillation
        
        Vector Reflection Zero
        Muninn's Purification
        Additive Distillation
        Huginn's Gambit
    }
    Jester's Gambit
    Thoth's Gambit
    Bookkeeper's Gambit: vvv
    Muninn's Reflection

    Jester's Gambit
    Huginn's Gambit
}

Re: Macro Megathread

Posted: Mon May 22, 2023 5:24 pm
by beholderface
Angular Distillation
vec, vecnum
Takes two vectors and returns the angle between them, in radians. To find the plane that this angle is on, just use the cross product of the two vectors.
EDIT: This does not tell you which direction you'd need to rotate a vector in in order to match another vector.
eqqqqqd
(credit to object for the pattern)
Patterns
qqqaadadaawqeeeeeNumerical Reflection: 4ddadqeeeeeNumerical Reflection: 50qaawddewaqawddqddwaqawNumerical Reflection: 22qaawddewaqawwaawwaawddqddNumerical Reflection: 2wedewqeeeeewaawwaawNumerical Reflection: 0.5wedewaawddNumerical Reflection: 2wedewqeeeeewaawwaawNumerical Reflection: 0.5wedewwaqawwdedwadeeeeeeee

Code: Select all

{
    //expected stack state, bottom to top (not including irrelevant iotas below vec a): vec a, vec b
    Dioscuri Gambit
    Vector Disintegration
    Numerical Reflection: 4
    Fisherman's Gambit
    Vector Disintegration
    //arrange vector components
    //initial state: e=y1, d=z1, c=x2, b=y2, a=z2 (f, or x1, doesn't have to be included because it's at the bottom and doesn't move)
    //desired state: e=x2, d=y1, c=y2, b=z1, a=z2
    //necessary permutation: cebda/50
    Numerical Reflection: 50
    Swindler's Gambit
    //multiply and add them
    Multiplicative Distillation
    Rotation Gambit II
    Multiplicative Distillation
    Numerical Reflection: 22
    Swindler's Gambit
    Multiplicative Distillation
    Additive Distillation
    Additive Distillation //stack state: vec a, vec b, num (xa​*xb​+ya*​yb​+za*​zb​)
    Rotation Gambit II
    Numerical Reflection: 2
    Power Distillation
    Vector Disintegration
    Additive Distillation
    Additive Distillation
    Numerical Reflection: 0.5
    Power Distillation
    Jester's Gambit
    Numerical Reflection: 2
    Power Distillation
    Vector Disintegration
    Additive Distillation
    Additive Distillation
    Numerical Reflection: 0.5
    Power Distillation
    Multiplicative Distillation
    Division Distillation
    Inverse Cosine Purification
}

Re: Macro Megathread

Posted: Mon Jul 03, 2023 6:10 pm
by beholderface
Isolation Gambit
ManyAny

Deletes all but the uppermost iota on the stack, for cleaning stuff up inside of a thoth iteration.
dedqdeq
Patterns
qwaeawqaeaqaewdqdweqqqaedeNumerical Reflection: 0deeed

Code: Select all

Flock's Reflection
Flock's Gambit
Retrograde Purification
Numerical Reflection: 0
Selection Distillation
Anchor Purification
Location-anchored gateVec

Takes an location-anchored gate, and returns the coordinates it is bound to.
qaqeedewdd
Patterns
wawqwawawawdwaawwaqwaqaNumerical Reflection: 2Numerical Reflection: 5qaeaqwdedqqqdedqdeqqaaqwaqaqwaeawqeeeaawdddadadqwaeawqBookkeeper's Gambit: Drop 1, Keep 1, Drop 1, Keep 1Numerical Reflection: 0aaeddwaqaeaqNumerical Reflection: 1wddwaqwwaqwaadaaeaaNumerical Reflection: 1aaeddwaqaeaqaqwwaqwaadddqddNumerical Reflection: 3ewdqdweqqqdedqdeqaqwaqeeeaawdddadadqwaeawqeqqqqq

Code: Select all

Scrivener's Purification
Spacing Reflection
Separation Distillation
Numerical Reflection: 2
Numerical Reflection: 5
Selection Exaltation
{
    Isolation Gambit
    Comma Reflection
    Separation Distillation
    Flock's Disintegration
}
Jester's Gambit
Thoth's Gambit
Flock's Disintegration
Bookkeeper's Gambit: v-v-
Numerical Reflection: 0
Prospector's Gambit
Length Distillation: Str
Numerical Reflection: 1
Subtractive Distillation
Winnowing Distillation
Rotation Gambit
Numerical Reflection: 1
Prospector's Gambit
Length Distillation: Str
Winnowing Distillation
Rotation Gambit II
Numerical Reflection: 3
Flock's Gambit
{
    Isolation Gambit
    Input Purification
}
Jester's Gambit
Thoth's Gambit
Flock's Disintegration
Vector Exaltation

Quine function builder

Posted: Tue Jul 04, 2023 10:36 am
by kristi fristi
Quinio
[pattern]
loops a pattern list forever and hides itself in the execution stack
loop can be broken by using flow control in the input function
edqawq
Patterns
aadaaaqaeaqNumerical Reflection: 1waawddqaaqqqqqqBookkeeper's Gambit: Keep 1Bookkeeper's Gambit: Keep 1eeeqwaeawqaaeddwqaeaqwdeaqqeeeNumerical Reflection: 2aaeaawqaeaqwqaeaqddqaawqaeaqwdeaqq

Code: Select all

//list -->
//repeats forever
Gemini Decomposition
Abacus Purification
Numerical Reflection: 1
Additive Distillation
Undertaker's Gambit					//num, [f], num
{
	{
		Bookkeeper's Gambit: -
		Bookkeeper's Gambit: -
	}
	Flock's Disintegration
	Prospector's Gambit
	Surgeon's Exaltation
	Hermes' Gambit
}
Numerical Reflection: 2
Rotation Gambit
Surgeon's Exaltation				//num, [f], [loop+num]
Combination Distillation			//num,  [loop+num+f]
Undertaker's Gambit
Surgeon's Exaltation
Hermes' Gambit

stack scoping

Posted: Mon Jul 10, 2023 10:32 am
by kristi fristi
Thoth's padded cell
[pattern][any],any
Executes a pattern list like Hermes, but also uses Thoth's own stack, and its own ravenmind as well. Pushes the resulting ravenmind and restores the original after executing the pattern list. Useful for dealing with multiple hex pieces that interact with the ravenmind and stack in an obtrusive way, and can be nested.
wawadadad
Patterns
qeewdweddwqqqBookkeeper's Gambit: Drop 2eeeaaeaaqaeaqdadeeeddadadqeewdweddwaaeaaeqqwawqaaw

Code: Select all

Muninn's Reflection
{
	Bookkeeper's Gambit: vv
}
Rotation Gambit
Combination Distillation
Nullary Reflection
Single's Purification
Thoth's Gambit
Muninn's Reflection
Rotation Gambit
Huginn's Gambit

Re: Macro Megathread

Posted: Mon Aug 07, 2023 2:09 pm
by Twisted_Code
Flock's Reveal
AnyAny
Prints a list containing your stack, without changing it. Just like Reveal, but the whole stack.

qwaeawqwde
Patterns
qwaeawqaeaqaewdqdwedeqwaeawq

Code: Select all

Flock's Reflection
Flock's Gambit
Reveal
Flock's Disintegration

Re: Macro Megathread

Posted: Mon Aug 14, 2023 10:09 pm
by beholderface
Cartographer's Purification

Takes a string (formatted as "x,y,z", or "5,8,-2" for example) and converts it into a vector.

wawqwawad
Pattern images
qaaqwaqaqwaeawqaqwaqaawddaqwaqaawddaaeaaaqwaqddqddeqqqqq

Code: Select all

Comma Reflection
Separation Distillation
Flock's Disintegration
Input Purification
Jester's Gambit
Input Purification
Jester's Gambit
Rotation Gambit
Input Purification
Rotation Gambit II
Vector Exaltation

wisp navigation

Posted: Tue Aug 15, 2023 10:50 am
by kristi fristi
vacillate
vec, vec
macro for a wisp to constantly travel between two positions
the hex looks a bit weird but basically it's first checking whether it has a destination, if it does the second conditional will just return that. If it doesn't it will compare the wisp's position to the second vector input and will decide a destination based on that.
adaqwqwawqaw
Patterns
aadaaNumerical Reflection: 3ewdqdweewdwewdewNumerical Reflection: 4aadaadaaNumerical Reflection: 3ewdqdwedadddqddawddqwaeawqdedwqqwdedwqqawaaadddqddawddawqwawqaw

Code: Select all

Gemini Decomposition
Numerical Reflection: 3
Flock's Gambit
Pathfinder's Reflection
Numerical Reflection: 4
Gemini Gambit
Numerical Reflection: 3
Flock's Gambit
Jester's Gambit
Nullary Reflection
Equality Distillation
Rotation Gambit II
Augur's Exaltation
Flock's Disintegration
Identity Reflection
Compass' Purification
Equality Distillation
Rotation Gambit II
Augur's Exaltation
Pathfinder's Gambit

tour
[vec]
Takes a list of vectors and makes the wisp move through each of them, looping back to the first when it reaches the last position in the list.
Uses a similar conditional structure, except of course finding which position it needs to go to in the list instead of switching.
dqdeeawqwawqaw
Patterns
ewdwewdewaadaaadeeedaawdddadddqddaadaadedwqqwdedwqqawaadedqdeNumerical Reflection: 1waawaawdddaaawddNumerical Reflection: 0deeedawqwawqaw

Code: Select all

Pathfinder's Reflection
Gemini Decomposition
Single's Purification
Jester's Gambit
Nullary Reflection
Equality Distillation
Rotation Gambit II
Augur's Exaltation
Gemini Decomposition
Identity Reflection
Compass' Purification
Locator's Distillation
Numerical Reflection: 1
Additive Distillation
Dioscuri Gambit
Jester's Gambit
Abacus Purification
Inequality Distillation
Jester's Gambit
Numerical Reflection: 0
Augur's Exaltation
Selection Distillation
Pathfinder's Gambit

minangle

Posted: Fri Aug 25, 2023 6:22 pm
by kristi fristi
Searchlight Exaltation
vec, vec, [entity]entity
Takes position, a direction, and a list of entities. Finds the entity of which the vector from the given position to it has the smallest angle with the unit vector.
To give an example in the style of the book, if I used my position and my look direction, and a list of all entities excluding me, which entity would be closest to my crosshair? (as you might guess it's very useful for making aim assist)
Mishaps if one of the entities in the list is exactly at the given position.
weqaeaq
Patterns
qeewdweddwNumerical Reflection: 18qaawddedadeeedNumerical Reflection: 2edqdeeqqwawqaawqqqddqddNumerical Reflection: 2aadaaawddwaadaawqaqwwdedwwaqawaadaaqeewdweddwNumerical Reflection: 1deeedqddqddNumerical Reflection: 2ewdqdweqeewdweddwawddeqqwawqaaweeeaawdddadadBookkeeper's Gambit: Drop 3qeewdweddwNumerical Reflection: 0deeedaawddeqqwawqaaw

Code: Select all

Muninn's Reflection				//pos, dir, list, raven
Numerical Reflection: 18
Swindler's Gambit				//raven, dir, pos, list
Nullary Reflection
Single's Purification
Numerical Reflection: 2			//dummy value
Integration Distillation
Huginn's Gambit
{	//look, cpos, entity
	Rotation Gambit II
	Numerical Reflection: 2
	Fisherman's Gambit II
	Compass' Purification
	Subtractive Distillation
	Gemini Decomposition
	Length Purification
	Division Distillation
	Multiplicative Distillation	//entity, score
	Gemini Decomposition
	Muninn's Reflection
	Numerical Reflection: 1
	Selection Distillation		//entity, score, score, pscore
	Minimus Distillation
	Rotation Gambit II
	Numerical Reflection: 2
	Flock's Gambit
	Muninn's Reflection
	Augur's Exaltation
	Huginn's Gambit					//smallest angle goes back to ravenmind
}
Jester's Gambit
Thoth's Gambit						//raven, dir, pos, list
Bookkeeper's Gambit: vvv
Muninn's Reflection
Numerical Reflection: 0
Selection Distillation
Jester's Gambit
Huginn's Gambit