georgette = {
const col_top = ['#000','#f60','#cff','#f6f','#f09','#060','#099','#f33','#aef','#3c0'];
const col_down = ['#000','#333','#666','#f0f','#000','#930','#c63','#000','#f00','#c00'];
const u = 10;
const wu = 800;
const hu = 800;
const width = wu*u;
const height = hu*u;
const margin = width/20;
const board_height = height/2.4 + 2*margin;
const board_width = width/2.4 + 2*margin;
let data_top, data_down, new_top, new_down, r, l, x, y, digit_top, digit_down, tx, ty;
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_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; ++w) {
if(w < h){
new_top = 0;
new_down = 0;
} else {
r = data_top[h-1][w];
l = data_top[h-1][w-1];
new_top = alg_top(l, r);
r = data_down[h-1][w];
l = data_down[h-1][w-1];
new_down = alg_top(l, r);
}
data_top[h][w] = new_top;
data_down[h][w] = new_down;
}
}
for (let h = 0; h < hu; ++h){
for (let w = 0; w < wu; ++w) {
context.resetTransform();
context.globalAlpha = 1;
digit_top = data_top[h][w];
if(digit_top != 0){
x = w*u - h*u/2 + u/2 + margin;
y = height/2 - h*u/2 - u/2 + margin;
context.translate(x, y);
context.rotate(Math.PI / 4);
context.translate(-1*x, -1*y);
context.fillStyle = col_top[digit_top];
context.fillRect(x, y, u*0.7071, u*0.7071);
context.resetTransform();
}
context.globalAlpha = 0.4;
digit_down = data_down[h][w];
if(digit_down != 0 & h > 0){
x = w*u - h*u/2 + u/2 + margin;
y = height/2 + h*u/2 - u/2 + margin;
context.translate(x, y);
context.rotate(Math.PI / 4);
context.translate(-1*x, -1*y);
context.fillStyle = col_down[digit_down];
context.fillRect(x, y, u*0.7071, u*0.7071);
context.resetTransform();
}
}
}
return canvas;
}