Published
Edited
Jul 7, 2021
4 stars
Insert cell
Insert cell
Insert cell
Insert cell
Plot.cell(plotgrid, {
x: 'x', y: 'y', fill: 'z', inset: -1,
}).plot({
width: 810, height: 800,
x: {round: 0, axis: 'top', ticks},
y: {round: 0, axis: 'left', ticks}
})
Insert cell
Insert cell
grid = {
let grid = [];
for (let i = 0; i < N; i++) {
grid[i] = [];
for (let j = 0; j < N; j++) {
grid[i][j] = [];
for (let k = 0; k < N; k++) {
grid[i][j][k] = +!test(i, j, k, grid);
}
}
}
return grid
}
Insert cell
test = (I, J, K, grid) => {
if (misère && I + J + K === 0) return 1;
let losses = 0;
for (let i = 0; i < I; ++i) losses += grid[i][J][K];
for (let j = 0; j < J; ++j) losses += grid[I][j][K];
for (let k = 0; k < K; ++k) losses += grid[I][J][k];
return losses;
}
Insert cell
ticks = [0, 1, 2, 4, 8, 16, 32, 64, N-1].filter(x => x < N)
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more