Open krowter opened 2 years ago
Choosing svg as the output format results in double spaces
Comparison
PS I used the web version, havent tried sending a POST request
Edited (1 Oct 2023): Not reproducible anymore :/
My code at the time
function pascalsTriangle(size) { const result = [[1]]; for (let i = 0; i < size; i++) { const row = []; for (let j = 0; j <= i + 1; j++) { row.push((result[i][j] ?? 0) + (result[i][j - 1] ?? 0)); } result.push(row); } return result; } function formatTriangle(triangle) { const SPACE = ' '; const size = triangle.length; for (let rowIndex = 0; rowIndex < size; rowIndex++) { let row = ''; const leftPadding = size - rowIndex; row += SPACE.repeat(leftPadding); row += triangle[rowIndex].map(num => num.toString().padStart(SPACE.length * 2)).join(''); console.log(row); } } formatTriangle(pascalsTriangle(10));
Choosing svg as the output format results in double spaces
Comparison
PS I used the web version, havent tried sending a POST request
Edited (1 Oct 2023): Not reproducible anymore :/
My code at the time