I’m running into something very strange in the context of a larger script that means that I either misunderstand what Pxrand does, or there’s a bug or something …?
I’m testing the most basic Pxrand script and outputting to the post window:
var g = Pxrand.new([1,2,3,4,5,6,7,8,9,10], inf);
g.asStream.next
When I run this I can see that numbers from the list are repeated multiple times in a row, quite frequently. My understanding is that Pxrand is meant to avoid this exact behaviour so that that same item is never repeated consecutively.
Here’s what I’m seeing in the console:
-> a Pxrand
-> 9
-> 4
-> 1
-> 2
-> 4
-> 9
-> 3
-> 1
-> 5
-> 9
-> 5
-> 10
-> 2
-> 3
-> 9
-> 9
-> 5
-> 3
-> 3
-> 4
-> 8
-> 5
You can see that there’s a double 9 and a double 3 in there, sometimes it repeats even more often.
Am I misunderstanding something? Or is something else going on?
Thanks for any help!