Halton Sequence 2D

```// You can find the Turtle API reference here: https://turtletoy.net/syntax
Canvas.setpenopacity(0.6);

// drawing utilities
function line(x1,y1,x2,y2){turtle.penup();turtle.goto(x1,y1);turtle.pendown();turtle.goto(x2,y2);}
function rect(l,t,b,r){line(l,t,l,b);line(l,t,r,t);line(r,t,r,b);line(l,b,r,b);}

// Halton Sequence 1D
function Halton(index, base){
let result = 0;
let invBase = 1.0 / base;
let frac = 1;
while(index>0)
{
frac *= invBase;
result += frac*(parseInt(index)%parseInt(base));
index /= base;
}
return result;
}

// Generate Halton 2D point sequence.
function Halton2D(index,base1,base2,range){
let HaltonX = Halton(index,base1)*(-1) + 0.5;
let HaltonY = Halton(index,base2)*(-1) + 0.5;
let x = HaltonX * range;
let y = HaltonY * range;
return [x,y];
}

// constant variables
const circle_radius = 1;
const canvas_size = 180;
// Global code will be evaluated once.
const turtle = new Turtle();

const base1 = 2;
const base2 = 3;

let border_size = canvas_size + circle_radius*2;

let left = -0.5*border_size;
let right = 0.5*border_size;
let top = -0.5*border_size;
let bottom = 0.5*border_size;

rect(left,top,bottom,right);

// The walk function will be called until it returns false.
function walk(i) {
let A = Halton2D(i,base1,base2,canvas_size);
let x = A[0], y = A[1];