The problem is the turbo zapping loop.
If the range is 1-100, and the first random zap is 1 sat, and the next random value chosen is 2 sats, we don’t multiply by 10 because that loop only executes if zapN-1 >= zapN.
I’ll patch in a second.
This is more tricky than it seems because the range grows exponentially with the bounds. And, if the upper bound starts as more than a power of 10 greater than the lower bound, the lower bound of the next zap range LBN+1 will be exponentially less than upper bound of the current range UBN (as N grows) which is extra counterintuitive.
reply
Well now I feel bad for clearly not going through turbo zapping with enough detail for this change
reply
It's fun discovering unexpected consequences.
reply
No doubt, definitely part of the fun!
reply
411 sats \ 2 replies \ @k00b OP 4 Aug
Deployed with ranges that don't intersect, e.g. 1-21,22-210,211-2100
reply
Looking good
reply
Thank you 🙏
reply
It's always fun when seemingly simple problems turn out to be a bit thorny.
If people want to get really wild, you could only scale the upper bound.
reply
Either that or make sure the ranges don't intersect. Rather than: 1-21,10-210,100-2100. Do: 1-21,22-210,211-2100.
reply
That's neat.
reply
Or maybe just scaling the lower bound: 1-21,10-31,100-121,1000-1021
Or scaling the lower bound faster (still preventing overlap): 1-21,22-100,101-210,1000-2100
reply
If I understand the second one, there should be a 211-1000. That seems fun, too. The first option seems lame.
reply
Yeah, I messed that one up. The case where the upper bound is larger than 10x the lower bound is weird.
I like the randomness increasing slightly slower though.
reply
reply