Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions exercises/practice/alphametics/.docs/instructions.append.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# ignore me

## Input

Your script will receive the alphametic puzzle as a single string via
standard input (stdin). The puzzle string follows the format
`WORD1 + WORD2 + ... == RESULT`.

For example:

```text
SEND + MORE == MONEY
```

## Output

If the puzzle has a solution, print a single line consisting of
space-separated `LETTER=DIGIT` pairs, sorted alphabetically by letter.

For the example above, the output should be:

```text
D=7 E=5 M=1 N=6 O=0 R=8 S=9 Y=2
```

If the puzzle has multiple valid solutions, printing any one of them is
acceptable.

If the puzzle has no solution, print nothing (an empty line).
34 changes: 2 additions & 32 deletions exercises/practice/alphametics/.docs/instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,38 +22,8 @@ Replacing these with valid numbers gives:
1 0 6 5 2
```

This is correct because every letter is replaced by a different number and the
words, translated into numbers, then make a valid sum.
This is correct because every letter is replaced by a different number and the words, translated into numbers, then make a valid sum.

Each letter must represent a different digit, and the leading digit of a
multi-digit number must not be zero.

## Input

Your script will receive the alphametic puzzle as a single string via
standard input (stdin). The puzzle string follows the format
`WORD1 + WORD2 + ... == RESULT`.

For example:

```text
SEND + MORE == MONEY
```

## Output

If the puzzle has a solution, print a single line consisting of
space-separated `LETTER=DIGIT` pairs, sorted alphabetically by letter.

For the example above, the output should be:

```text
D=7 E=5 M=1 N=6 O=0 R=8 S=9 Y=2
```

If the puzzle has multiple valid solutions, printing any one of them is
acceptable.

If the puzzle has no solution, print nothing (an empty line).
Each letter must represent a different digit, and the leading digit of a multi-digit number must not be zero.

[alphametics]: https://en.wikipedia.org/wiki/Alphametics
4 changes: 1 addition & 3 deletions exercises/practice/alphametics/.meta/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,5 @@
".meta/example.awk"
]
},
"icon": "crossword",
"source": "Wikipedia",
"source_url": "https://en.wikipedia.org/wiki/Alphametics"
"icon": "crossword"
}