Patterns
A list of all the patterns I've discovered, as well as what they do.
Matrices
Matrices are a helpful tool for manipulating vectors to do as I wish, able to represent any linear transformation that can be applied to a vector. Of note with these patterns is that many are forgiving with their inputs, accepting in place of matrices things that can be easily mapped to matrices, namely numbers and vectors.
For example, attempting to multiply a 3x3 matrix with a vector, rather than mishapping, will return a new vector. For more information on how to make use of matrices to their fullest potential, the below is a helpful resource.
3blue1brown
Transformation Purification (num | vec | list → mat)
Converts the iota on top of the stack into a matrix. This iota can be a number, vector, or list.
If it is a number, it becomes a 1x1 matrix. If it's a vector, it becomes a 3x1 matrix. If it's a list, it must be a list of purely numbers, purely vectors, or purely lists of numbers (each of which must be the same length). If it's a list of numbers it'll be 1 by n, if it's a list of vectors it'll be 3 by n, and if it's a list of lists it'll be n by m, where n is the inner list length and m is the outer list length.
Restoration Purification (mat → num | vec | list)
Converts the iota on top of the stack back from a matrix into a number, vector, or list depending on the vector's size.
A 1x1 matrix will become a number. A 1x3 or 3x1 matrix will become a vector. A 3 by n or n by 3 matrix will become a list of vectors, and any matrix not covered by the previous will become a list of list of numbers, with each inner list being one column of the matrix.
Identity Purification (int ≥ 0 → mat)
Accepts a positive integer n, and returns an n by n matrix with 1 along the diagonal and 0 elsewhere.
Zero Distillation (int ≥ 0, int ≥ 0 → mat)
Accepts positive integers n and m, and returns an n by m matrix of zeros.
Rotation Distillation (vec, num → mat)
Accepts a vec v and number θ, and returns a matrix representing rotating by θ radians around v.
Addition Distillation: Matrix (mat, mat → mat)
Adds two matrices together; they must have the same number of columns and rows.
Multiplication Distillation: Matrix (mat, mat → mat)
Multiplies the first n by m matrix with an m by p matrix.
Transpose Purification (mat → mat)
Accepts an n by m matrix and returns an m by n matrix where every entry has been flipped along the diagonal.
Inverse Purification (mat → mat)
Accepts an n by n matrix and returns the n by n matrix such that in*out = identity.
Determinant Purification (mat → num)
Accepts a square matrix and returns the determinant of that matrix. Mishaps for matrices larger than 4x4.
Tower Distillation (mat, mat → mat)
Accepts an n by m matrix and an n by p matrix and produces an n by (m+p) matrix by putting the first matrix on top of the second.
Sprawling Distillation (mat, mat → mat)
Accepts an m by n matrix and a p by n matrix and produces an (m+p) by n matrix by putting the first matrix to the left of the second.
Toppling Gambit (mat, num → mat, mat)
Accepts an n by m matrix and an int from 0 to n, and returns two matrices created by splitting the input matrix vertically at the inputted int.
Mitosis Gambit (mat, num → mat, mat)
Accepts an n by m matrix and an int from 0 to m, and returns two matrices created by splitting the input matrix horizontally at the inputted int.
Strings
Concatenation Distillation (str, str → str)
Removes the top two strings from the stack and combines them together.
Separation Distillation (str, str → [str])
Removes the top two strings from the stack and splits the first string, using the second string as the delimiter and returning as a list.
Input Purification (str → num | null)
Removes a string from the top of the stack and returns the number that string parses as (or null if it doesn't parse).
Discoverer's Distillation (str, str → num)
Removes two strings from the top of the stack, and returns the first index of the first string where the second string is a substring.
Winnowing Distillation (str, num, num → str)
Removes a string and two positive integers from the top of the stack, and returns the substring from the first to the second (inclusive first, exclusive second).
Spacing Reflection (→ str)
Add a blank space string to the stack, useful for combining with other strings.
Breaking Reflection (→ str)
Add a string to the stack representing a break between lines, useful for combining with other strings.
Sifter's Gambit (str | null →)
Accepts a string; All future chat messages starting with that string won't be seen by others, and only messages prefixed with that string can be read by Whisper Reflection.
Reader's Purification (vec → str | [str])
Removes a vector from the stack. If that vector is pointing at a sign or lectern, it returns that sign or lectern's text to the stack. Otherwise, it returns null.
Write (vec, str | [str] →)
Removes a vector and a string from the stack. If that vector is pointing at a sign or lectern, it writes that string to that sign or lectern. Costs a hundredth of an Amethyst Dust.
Patternmaster's Purification (pattern → str | null)
Converts the pattern on top of the stack into the string for that pattern's name. If there is no action associated with that pattern, or if the associated pattern is a Great Spell, it returns null.
Moniker Purification (entity → str)
Takes an entity and returns that entity's name. If it is an item entity, return the item's name.
Name (str, entity →)
Takes a string and an entity, and sets that entities name to the given string. If the entity is an item entity, also set the item's name. Costs a hundredth of an Amethyst Dust.
Case Distillation (str, bool | null → str)
Removes a string and a bool or null. If it was true, return the string in upper case. If false, lowercase. If null, toggle each character's case.