My first attempt was an idea to break the center block, then use trig to rotate a vector in a circle perpendicular to the block face, breaking the other 8 blocks. I was able to get down to 40 patterns using this method.
Spoiler
Code: Select all
// rotary hammer
{
// get the pos and side
Mind's Reflection
Compass' Purification
Mind's Reflection
Alidade's Purification
Dioscuri Gambit
Archer's Distillation
Rotation Gambit II
Architect's Distillation
// break the center block
Prospector's Gambit
Break Block
// get the vectors that define the normal of the side
Gemini Decomposition
Vector Disintegration
Rotation Gambit
Vector Exaltation
Undertaker's Gambit
Division Distillation
// rotate about the center and break
{
Muninn's Reflection
Additive Distillation
Undertaker's Gambit
Gemini Decomposition
Huginn's Gambit
Sine Purification
Multiplicative Distillation
Rotation Gambit II
Cosine Purification
Multiplicative Distillation
Additive Distillation
Additive Distillation
Break Block
}
Numerical Reflection: 5.5 // roughly equal to pi * 7/4
Numerical Reflection: 9
Gemini Gambit // make 9 copies
Huginn's Gambit // save an initial angle to the ravenmind
Numerical Reflection: 8
Flock's Gambit
Thoth's Gambit
}
Spoiler
Code: Select all
// slinger's hammer
{
// get the pos and side
Mind's Reflection
Compass' Purification
Mind's Reflection
Alidade's Purification
Dioscuri Gambit
Archer's Distillation
Rotation Gambit II
Architect's Distillation
// get the vectors that define the normal of the side
Gemini Decomposition
Vector Disintegration
Rotation Gambit
Vector Exaltation
Undertaker's Gambit
Division Distillation
// create the iteration list
Numerical Reflection: -1
Numerical Reflection: 0
Numerical Reflection: 1
Numerical Reflection: 3
Flock's Gambit
Undertaker's Gambit
{
Multiplicative Distillation
Rotation Gambit II
{
Multiplicative Distillation
Additive Distillation
Additive Distillation
Break Block
}
Jester's Gambit
Thoth's Gambit
}
Jester's Gambit
Thoth's Gambit
}
Spoiler
Code: Select all
// wasteful hammer
{
Mind's Reflection
Compass' Purification
Mind's Reflection
Alidade's Purification
Dioscuri Gambit
Archer's Distillation
Rotation Gambit II
Architect's Distillation
{
{
{
Vector Exaltation
Division Distillation
Additive Distillation
Break Block
}
Numerical Reflection: 4
Fisherman's Gambit
Thoth's Gambit
}
Rotation Gambit
Thoth's Gambit
}
Numerical Reflection: -1
Numerical Reflection: 0
Numerical Reflection: 1
Numerical Reflection: 3
Flock's Gambit
Undertaker's Gambit
Undertaker's Gambit
Thoth's Gambit
}
Thinking about that last idea, I realized that if I had 9 vectors that form a square when flattened in the x, y, or z directions, I could produce a normal media cost hammer with very few patterns. It turns out that such a set of vectors does exist, and are connected to a mathematical concept called Latin Squares.
https://www.youtube.com/watch?v=Cnhr6VaQKlg
I tested this idea using an embedded list of vectors, and It worked perfectly. Math321 pointed out that it was possible to use the solution of a Sudoku puzzle to produce the 81 vectors required for creating a 9x9 hammer with this method as every Sudoku solution is a Latin Square, so we started calling these sets of vectors the "Sudoku vectors" of the hammer.
The last step to completion of the spell was removing the overhead of having to use Kirin's Ruler to produce the Sudoku vectors.
Because there must be one vector in every row, column, and stack, I can iterate over the rows and columns, and use some function to determine how high on the stack the vector should be.
It turns out that if I use the sum of the row and column index for the stack index, I get a shape that nearly works. The only issue is when both the row and column index is -1 or +1, resulting in a stack index of -2 or +2, which is outside the bounds of the 3x3x3.
To remedy this, -2 must be wrapped to +1, and +2 must be wrapped to -1. Instead of using the modulo pattern for this, I found a more compact method using the trig functions. It turns out that the function f(x) = sin(tan(x)) preserves -1, 0, and 1, but maps -2 to +0.817, and +2 to -0.817. It's okay that the function isn't super precise because when we call break block, it'll work if the vector is anywhere within the block volume (It always floors the vector to the block coordinate).
Putting it all together, the resulting spell:
Sage's Hammer (31 patterns)
Code: Select all
// sage hammer
{
// get the block coordinate, and the face normal
Mind's Reflection
Compass' Purification
Mind's Reflection
Alidade's Purification
Dioscuri Gambit
Archer's Distillation
Rotation Gambit II
Architect's Distillation
{
{
// build the sudoku vector
Dioscuri Gambit
Additive Distillation
Tangent Purification
Sine Purification
Vector Exaltation
// cross the sudoku vector with the face normal
Division Distillation
// add the coordinate offset, and break the block
Additive Distillation
Break Block
}
// inner loop
Rotation Gambit
Thoth's Gambit
}
// build the iteration list
Numerical Reflection: -1
Numerical Reflection: 0
Numerical Reflection: 1
Numerical Reflection: 3
Flock's Gambit
// copy it for the inner loop
Undertaker's Gambit
// start the outer loop
Thoth's Gambit
}