INDEX:
Math's Miscellanea
Math's Miscellanea
This thread is for any interesting small tidbits I find that aren't worthy of making an entire thread for. (Feel free to talk in the thread if you like - I'll be building an index of my posts here to make them easy to find while still allowing folks to talk.)
INDEX:
INDEX:
Last edited by Math321 on Sat Feb 18, 2023 6:39 am, edited 9 times in total.
hello world
Re: Math's Miscellanea
Optimized Archer's + Architect's raycast
The standard way of doing an "Archer's + Architect's" raycast (11 patterns):
Mind's Reflection, Compass' Purification, Mind's Reflection, Alidade's Purification, Archer's Distillation
Mind's Reflection, Compass' Purification, Mind's Reflection, Alidade's Purification, Architect's Distillation, Additive Distillation
An optimized version I figured out (9 patterns):
Mind's Reflection, Compass' Purification, Mind's Reflection, Alidade's Purification, Dioscuri Gambit
Archer's Distillation, Rotation Gambit II, Architect's Distillation, Additive Distillation
The standard way of doing an "Archer's + Architect's" raycast (11 patterns):
Mind's Reflection, Compass' Purification, Mind's Reflection, Alidade's Purification, Archer's Distillation
Mind's Reflection, Compass' Purification, Mind's Reflection, Alidade's Purification, Architect's Distillation, Additive Distillation
An optimized version I figured out (9 patterns):
Mind's Reflection, Compass' Purification, Mind's Reflection, Alidade's Purification, Dioscuri Gambit
Archer's Distillation, Rotation Gambit II, Architect's Distillation, Additive Distillation
hello world
Re: Math's Miscellanea
Bit Selector
Hexcasting's set operations do bitwise math if you apply them to numbers. Here's one practical way to use that in a hex.
Let's say you want a function which returns either True or False depending on what number you pass it, using this table:
0 = False
1 = False
2 = True
3 = True
4 = False
5 = True
6 = False
7 = True
First, you'll want to translate that table into binary, with bit 0 as the least significant bit (on the right). Then convert that number into decimal.
Binary: 10101100
Decimal: 172
From there, you can write some code that uses a bitmask to check whether the Nth bit of 172 is true or false.
Bit Selector (172)
num (selected bit) → bool
Numerical Reflection: 2, Jester's Gambit, Power Distillation, Numerical Reflection: 172
Intersection Distillation, Augur's Purification
If you'd rather not hardcode the number, you can simply omit it. In this case, you push the base number, then the number of the bit you want to check:
Bit Selector (Generalized)
num (base), num (selected bit) → bool
Numerical Reflection: 2, Jester's Gambit, Power Distillation
Intersection Distillation, Augur's Purification
This can be a powerful tool when used with Augur's Exaltation and Hermes'/Thoth's Gambit, though I'm sure other uses can be found.
Hexcasting's set operations do bitwise math if you apply them to numbers. Here's one practical way to use that in a hex.
Let's say you want a function which returns either True or False depending on what number you pass it, using this table:
0 = False
1 = False
2 = True
3 = True
4 = False
5 = True
6 = False
7 = True
First, you'll want to translate that table into binary, with bit 0 as the least significant bit (on the right). Then convert that number into decimal.
Binary: 10101100
Decimal: 172
From there, you can write some code that uses a bitmask to check whether the Nth bit of 172 is true or false.
Bit Selector (172)
num (selected bit) → bool
Numerical Reflection: 2, Jester's Gambit, Power Distillation, Numerical Reflection: 172
Intersection Distillation, Augur's Purification
If you'd rather not hardcode the number, you can simply omit it. In this case, you push the base number, then the number of the bit you want to check:
Bit Selector (Generalized)
num (base), num (selected bit) → bool
Numerical Reflection: 2, Jester's Gambit, Power Distillation
Intersection Distillation, Augur's Purification
This can be a powerful tool when used with Augur's Exaltation and Hermes'/Thoth's Gambit, though I'm sure other uses can be found.
hello world