Practice only makes habit, only perfect practice makes perfect.—every music teacher ever
Practice mindfully by doing the right things and doing things right.— Junilu
[How to Ask Questions] [How to Answer Questions]
That is exactly what you are looking for. An algorithm written out nice and simply, so you can implement it. Of course the algorithm starts with the magic word recursion. Recursion isn't quite witchcraft, but if you want a happy life, don't try to work out how recursion works. Just trust that it does workJunilu Lacar wrote:. . . To get H(8), . . . to get H(4), . . . To get H(2), ...
Junilu Lacar wrote:I would try to use some recursion. To get H(8), fill first three quadrants with H(4), then invert H(4) to get the fourth quadrant. Recursively, to get H(4), you'd fill first three quadrants with H(2), then invert H(2) to get the fourth quadrant. To get H(2), ...
Ryan McGuire wrote:Orrr... Is there a way to calculate a given array value from just the indexes? For instance, without working the entire H(128) matrix out, I would bet that H(128)[42, 95] is T. Can anyone confirm or refute that?
Campbell Ritchie wrote:There probably is. You will have to search for algorithms.
Ryan McGuire wrote:
Campbell Ritchie wrote:There probably is. You will have to search for algorithms.
Search for? Figure the algorithm out your own darn self. It's just a bunch of Ts and Fs in a fairly regular pattern. How hard can it be?
Piet Souris wrote:If you have such a direct formula, then I would love to see it.
Piet Souris wrote:Anyone who has a recursive solution knows this reasoning. That''s not the problem. I am looking for a non recursive formula without any ifs and whiles, just a plain simple formula like:
H512(345, 261) =( 512 ^([261 / n!] (floor function) % 2 == 0) && H1(1,1)
Do you have such a function? I do not need to know it, but if you do I'll have another try.
If you settle for what they are giving you, you deserve what you get. Fight for this tiny ad!
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database
https://coderanch.com/t/704633/RavenDBOpenSourceNoSQLDatabase
