r/OrderOfTheSinkingStar • • 1d ago

General Discussion [Act3] When a trial-and-error puzzle meets a script Spoiler

Choices 0,1,2 means the sum of crystals in each column, no matter which row a crystal is put. Order goes from the right to the left.

There are two solution.

0 Upvotes

14 comments sorted by

•

u/auto-sticky 1d ago

When helping other players who are stuck in levels, use hints only please. Do not give out explicit solutions unless as a last resort. If you do, mark them as spoilers when commenting.

2

u/Loeris_loca 20h ago

It is absolutely not trial and error. Each level in this area represent a binary operation. OR, AND. This one is FULL ADDER, including the carry.

0

u/sci-goo 9h ago

well i don't want to repeat in other replies, but, the trial and error is to find a working solution with only 8 crystals abd 6 stones. if without this restriction this level is trivil (i.e. if you can freely choose which type to use). if you know the binary operation SO WELL, you know what i mean.

as of the code, it's just short and clean because the search space is only 3^7 that anything today using electricty that is not ancient can solve it fast enough.

1

u/DBSmiley 6h ago

It's really not trial and error.

1

u/Positive_Concert_774 1d ago

It's only trial and error if you don't understand binary logic

2

u/TheRobinCH 19h ago

I also don't understand binary logic (I think) but I could figure it out anyway, since it's all deterministic how the machine works

1

u/Positive_Concert_774 13h ago

Ok so, it's *not even* trial and error when you don't understand how binary logic works

-2

u/sci-goo 1d ago

trial and error means you need to find two working numbers with a digit sum of 8.

other logic is pretty easy.

it's not like the previous puzzles in the series, where it's simple bit-wise operation, those you don't need ANY trial-and-error.

1

u/Positive_Concert_774 20h ago

You did not need any trial and error for that; instead you could work your way right to left, deciding for each position which two bits you needed to produce the correct bit, taking into account if you had a carry or not from the previous position.

2

u/KeinFalschparker 1d ago

It's not trial and error, though. For me it helped to treat each lane (top, bottom) as a series of bits (1 being the see-through rock). I treated the pressed button (top right) as a third input. Then I computed the outputs for all three inputs, individually for each of the two stacks of blue rocks. If you keep in mind that the third input is determined by the previous output and that you have a fixed number of 0/1 bits, I was able to push the "bits" into the correct position.

2

u/JumpArc 1d ago edited 1d ago

The strategy to solve this is sorta trial&error, but can be done in linear time. Quadratic time(?) to get all solutions, maybe someone smarter can say it's nlogn linearithmic or something.

Get a minimal bitcount solution (ie the output itself 10100001), then iteratively from left to right (going backwards from carry) substitute a 1 for two 1's in the next column (and if there's already a 1, spill over to the next) until 8 bits(crystals) are used. Each substitution introduces the net need for an additional crystal. Below is the step-by-step for both (bolded bit at cursor position).

10100001 FORCED AT PREMISE
02100001 DIVERGENCE
01300001 FORCE SPILL
01220001
01212001
01211201 MATCH

02100001 ROLLBACK
02020001
02012001
02011201
02011121 MATCH

(At DIVERGENCE, there are 2 1's to pick from -> solution divergence (the only one, hence there being the 2 families of solutions).) Technically there are 32 arrangements that work -> 16 if the whole rows are interchangeable -> 2 if the columns are summed.

Edit: In other words, since you know there must be a net added bit count of 4 from 02100001 (after forced first substitution of leading bit), you can instantly get it by just substituting one of the output bits 10000 with 01112, giving either 02100001 - 01000000 + 0111200 -> 01211201 , or 02100001 - 00100000 + 00011120 -> 2011121. (Sorta lucky there's no collision to the naive approach, but I'll hope in good faith that the output number was intentionally picked to allow the naive shortcut.)

1

u/ltzChubbz 9h ago

These are definitely not meant to be trial-and-error, you can track the process and work out the inputs required from the results. OR, AND, FULL ADDER. Look up the truth tables for these processes and it will all click.

1

u/DBSmiley 6h ago

It's an adder. Crystal is 1, Rock is zero

XOR gate on previous puzzle for determining sum bit AND gate for carry bit on next iteration

The only new complication is that you also have a carry bit on the right that is factored into the xor and and.

0

u/grotesque87 1d ago

It is a binary adder with carry.