Page 1 of 1

Math's Miscellanea

Posted: Sat Feb 18, 2023 12:54 am
by Math321
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:

Re: Math's Miscellanea

Posted: Sat Feb 18, 2023 12:54 am
by Math321
Optimized Archer's + Architect's raycast


The standard way of doing an "Archer's + Architect's" raycast (11 patterns):
qaq aa qaq wa wqaawdd

qaq aa qaq wa weddwaa waaw

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):

qaq aa qaq wa aadadaaw

wqaawdd ddqdd weddwaa waaw

Mind's Reflection, Compass' Purification, Mind's Reflection, Alidade's Purification, Dioscuri Gambit

Archer's Distillation, Rotation Gambit II, Architect's Distillation, Additive Distillation

Re: Math's Miscellanea

Posted: Sat Feb 18, 2023 2:51 am
by Math321
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 aawdd wedew Numerical Reflection: 172
wdweaqa aw

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 aawdd wedew
wdweaqa aw

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.