| ▲ | kelseyfrog 3 hours ago | ||||||||||||||||
I meant the C++ definition of collatz that would verify the precondition. | |||||||||||||||||
| ▲ | tyromaniac 3 hours ago | parent [-] | ||||||||||||||||
I haven't tried it and am afk rn but I'd imagine you just define a constexpr function that implements collatz and use that in your contract. (Edit: if the input is constexpr itself) Its also quire easy to think about specializing a few templates and doing it that way. If you look up an example of the fib sequence in c++ templates you'll get the general idea. | |||||||||||||||||
| |||||||||||||||||