silvia = {
const col_top = ['#fff',
'#910A67',
'#F28585',
'#FFCF96',
'#F7DCB9',
'#d8f8e0',
'#50B020',
'#D5ED9F',
'#FfFfF9',
'#DCFFB7'
];
const col_bottom = ['#000',
'#3ABEF9',
'#A7E6FF',
'#A7f0a6',
'#FFD18E',
'#E92074',
'#FFB096',
'#ee9070',
'#FFDBB5',
'#fff'];
const u = 1;
const wu = 1000;
const hu = 1000;
const margin = 10;
const board_height = hu*u + 2*margin;
const board_width = wu*u + 2*margin;
let data_top, new_top, r, l, x, y, digit_top;
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 = '#fff';
context.fillRect(0, 0, board_height, board_width);
const base = get_pi_txt(wu+1);
data_top = [[]];
data_top[0] = base;
for (let h = 1; h < hu; ++h){
data_top[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_silvia(l, r);
data_top[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];
x = w*u + margin;
y = w*u + h*u + margin;
context.fillStyle = col_bottom[digit_top];
context.fillRect(x, y, u, u);
}
}
for (let h = 0; h < hu; ++h){
for (let w = 0; w < wu-h; ++w) {
if(h!=0){
digit_top = data_top[h][w];
x = w*u + h*u + margin;
y = w*u + margin;
context.fillStyle = col_top[digit_top];
context.fillRect(x, y, u, u);
}
}
}
return canvas;
}