Quasirandom sequences

The Unreasonable Effectiveness of Quasirandom Sequences

extremelearning.com.…asirandom-sequences/
youtu.be/psguej4w9cc

Log in to post a comment.

// Quasirandom sequences. Created by Reinder Nijhoff 2024 - @reindernijhoff
//
// https://turtletoy.net/turtle/5249e61c2a
//

const turtle = new Turtle();
const N = 100; // min=1, max=10000, step=1
const margin = 10; // min=0, max=50, step=1
const g = 1.324717957244746;     // Plastic Ratio https://en.wikipedia.org/wiki/Plastic_ratio

function walk(i) {
    const p = [(.5+g*i) % 1, (.5+g*g*i) % 1];
    const r = .5;
    
    turtle.jump( p[0]*(200-margin*2)-100+margin, p[1]*(200-margin*2)-100+margin-r);
    turtle.circle(r);
    
    return i < N-1;
}