From 4726f5141410ce16dd14be9e9209c7b716bbc776 Mon Sep 17 00:00:00 2001 From: omer-g Date: Mon, 1 Oct 2018 11:37:06 +0300 Subject: [PATCH] alphametics: v1.3.0 Add test for two digits carry Add test where result is longer than largest addendum by more than one digit. In solutions that sum each digit separately this could be useful to make sure final carry is handled correctly. For example: not treated as a single digit. Resolves: 1342 --- exercises/alphametics/canonical-data.json | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/exercises/alphametics/canonical-data.json b/exercises/alphametics/canonical-data.json index d9be250967..4ccff5cf4b 100644 --- a/exercises/alphametics/canonical-data.json +++ b/exercises/alphametics/canonical-data.json @@ -1,6 +1,6 @@ { "exercise": "alphametics", - "version": "1.2.0", + "version": "1.3.0", "cases": [ { "description": "Solve the alphametics puzzle", @@ -33,6 +33,18 @@ }, "expected": null }, + { + "description": "puzzle with two digits final carry", + "property": "solve", + "input": { + "puzzle": "A + A + A + A + A + A + A + A + A + A + A + B == BCC" + }, + "expected": { + "A": 9, + "B": 1, + "C": 0 + } + }, { "description": "puzzle with four letters", "property": "solve",