guido = {
let col_top = ['#fff','#cfc','#696','#030','#363','#363','#474','#8a8','#aea','#cfc'];
let col_down = col_top;
const u = 5;
const wu = 158;
const hu = 158;
const margin = 4*u;
const board_height = hu*u + 2*margin;
const board_width = 109*u + 2*margin;
let data_top, data_down, new_top, new_down, r, l, x, y, digit_top, digit_down;
let shift = 2;
const { canvas, context } = createCanvas(board_width, board_height);
const pixelRatio = resize(canvas, board_width, board_height, );
context.scale(pixelRatio, pixelRatio);
context.globalAlpha = 1;
context.fillStyle = '#000';
context.fillRect(0, 0, board_width, board_height);
const base = get_pi_txt(wu+1);
data_top = [[]];
data_down = [[]];
data_top[0] = base;
data_down[0] = base;
for (let h = 1; h < hu; ++h){
data_top[h] = [];
data_down[h] = [];
for (let w = 0; w < wu-h; ++w) {
l = data_top[h-1][w];
r = data_top[h-1][w+1];
new_top = algo(l, r, 10);
data_top[h][w] = new_top;
data_down[h][w] = new_top;
}
}
for (let h = 0; h < hu; ++h){
for (let w = 0; w < wu-h; ++w) {
digit_top = (data_top[h][w]+shift)%10;
x = w*u + margin;
y = w*u + h*u + margin;
context.fillStyle = col_top[digit_top];
context.fillRect(x, y, u, u);
if(h!=0){
digit_down = (data_down[h][w] + 2)%10;
x = w*u + h*u + margin;
y = w*u + margin;
context.fillStyle = col_down[digit_down];
context.fillRect(x, y, u, u);
}
}
}
return canvas;
}