• 7

## Learning Opportunities

This puzzle can be solved using the following concepts. Practice using these concepts and improve your skills.

## Goal

The Cistercian order of monks have their own numeral system wherein any natural number less than 10,000 can be represented by a single ideograph composed of simple lines arranged in four quadrants around a "stem".

The following diagram shows the mapping between the decimal digits and their Cistercian counterparts:

0    1    2    3    4    5    6    7    8    9     __                  _         _         _|   |    |    |\   | /  | /  | |  | |  | |  | ||   |    |__  | \  |/   |/   | |  | |  |_|  |_|

These lines are mirrored (flipped horizontally and/or vertically) over the axes to represent place values other than units in the following way:

2|1
‒‒‒‒
4|3

1: ones, 2: tens, 3: hundreds, 4: thousands

As an example, here's 1337 as a Cistercian numeral:

   _ /| |/ | |  |  |  | /__|/

Just to crystal-clarify how the lines get reflected for each quadrant, here are the multiples of 1111 as Cistercian numerals:

__ __                        _ _           _ _           _ _  |      |     /|\   \ | /  \ | /  | | |  | | |  | | |  | | |  |    __|__  / | \   \|/    \|/   | | |  | | |  |_|_|  |_|_|  |      |      |      |      |      |      |      |      |  |    __|__    |      |      |      |      |     _|_    _|_  |      |    \ | /   /|\    /|\   | | |  | | |  | | |  | | |__|__    |     \|/   / | \  /_|_\  | | |  |_|_|  | | |  |_|_|

‒‒‒‒

Given a series of Cistercian numerals, display their sum (mod-10000, of course) as a Cistercian numeral.

Numberphile's "The Forgotten Number System" (the inspiration for this puzzle): https://www.youtube.com/watch?v=9p55Qgt7Ciw
The Ciphers of the Monks: http://www.davidaking.org/Ciphers.htm
Conversion utility: https://www.dcode.fr/cistercian-numbers
Input
7 lines of ASCII art, a series of Cistercian numerals
Output
the sum of the decimal numbers represented by the numerals as a Cistercian numeral

NOTE that although the input has been padded (all numerals are 5 wide by 7 high, separated by two spaces) to aid parsing, your output should be free of any excess whitespace.
Constraints
1 ≤ N ≤ 10, where N is the number of Cistercian numerals
Example
Input
   __     __
|      |
|      |
|      |
|      |
|      |
|      |  
Output
|
|__
|
|
|
|

A higher resolution is required to access the IDE

Join the CodinGame community on Discord to chat about puzzle contributions, challenges, streams, blog articles - all that good stuff!
Online Participants