function pascalTriangle(n, context) {
const [[_, spacing], [showNumbers, showOdd]] = values;
for (let i = 0; i < n; ++i) {
for (let j = 0; j <= i; ++j) {
const x = -(i / 2) * spacing + j * spacing;
const y = i * (spacing / 2);
const binom = binomial(i, j);
if (showOdd && binom % 2 !== 0) {
circle([x + 5, y - 5, 5], context, { color: "red", fill: false });
context.fillStyle = "black";
}
if (showNumbers) {
context.fillText(binom, x, y);
}
}
}
}