From de6a1f376c9d3df5c7f7bd7d9c2de77d2cbe3900 Mon Sep 17 00:00:00 2001 From: Peter Tseng Date: Thu, 31 Mar 2022 18:44:22 +0000 Subject: [PATCH] pascals-triangle: format each row as one line suggested as a follow-up action to format-array being merged, on at least two separate occasions: https://github.com/exercism/problem-specifications/pull/1968#discussion_r811642919 https://github.com/exercism/problem-specifications/pull/1966#discussion_r808714254 The reason for the suggestion is that helps visualise the human-readable form of the triangle that we are used to seeing. --- bin/format-array.rb | 3 ++ .../pascals-triangle/canonical-data.json | 30 +++++++++++++++---- 2 files changed, 28 insertions(+), 5 deletions(-) diff --git a/bin/format-array.rb b/bin/format-array.rb index 24b5fdbf59..a742614f48 100644 --- a/bin/format-array.rb +++ b/bin/format-array.rb @@ -61,6 +61,9 @@ 'ocr-numbers' => { 'rows' => :multi_line, }, + 'pascals-triangle' => { + 'expected' => :multi_line, + }, 'rectangles' => { 'strings' => :multi_line_unless_single, }, diff --git a/exercises/pascals-triangle/canonical-data.json b/exercises/pascals-triangle/canonical-data.json index be586b0615..4397b6b993 100644 --- a/exercises/pascals-triangle/canonical-data.json +++ b/exercises/pascals-triangle/canonical-data.json @@ -21,7 +21,9 @@ "input": { "count": 1 }, - "expected": [[1]] + "expected": [ + [1] + ] }, { "uuid": "a6e5a2a2-fc9a-4b47-9f4f-ed9ad9fbe4bd", @@ -30,7 +32,10 @@ "input": { "count": 2 }, - "expected": [[1], [1, 1]] + "expected": [ + [1], + [1, 1] + ] }, { "uuid": "97206a99-79ba-4b04-b1c5-3c0fa1e16925", @@ -39,7 +44,11 @@ "input": { "count": 3 }, - "expected": [[1], [1, 1], [1, 2, 1]] + "expected": [ + [1], + [1, 1], + [1, 2, 1] + ] }, { "uuid": "565a0431-c797-417c-a2c8-2935e01ce306", @@ -48,7 +57,12 @@ "input": { "count": 4 }, - "expected": [[1], [1, 1], [1, 2, 1], [1, 3, 3, 1]] + "expected": [ + [1], + [1, 1], + [1, 2, 1], + [1, 3, 3, 1] + ] }, { "uuid": "06f9ea50-9f51-4eb2-b9a9-c00975686c27", @@ -57,7 +71,13 @@ "input": { "count": 5 }, - "expected": [[1], [1, 1], [1, 2, 1], [1, 3, 3, 1], [1, 4, 6, 4, 1]] + "expected": [ + [1], + [1, 1], + [1, 2, 1], + [1, 3, 3, 1], + [1, 4, 6, 4, 1] + ] }, { "uuid": "c3912965-ddb4-46a9-848e-3363e6b00b13",