Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Challenges

Comments on Towering Cistercian Representation

Post

Towering Cistercian Representation

+3
−0

SE Sandbox Link, Codidact Sandbox Link

Inspired by this video.

Given a positive integer, draw its Cistercian representation as ascii art.

enter image description here

The Challenge

Cistercian numerals are a decimal-based number representation system which use simple line based drawings to represent 4-digit numerals. Their structure is as follows:

     Tens|Units
         |
Thousands|Hundreds

The digits are represented as follows (in the units place):

1   ⌷ 2   ⌷ 3   ⌷ 4   ⌷ 5   ⌷ 6    ⌷ 7    ⌷ 8    ⌷ 9    ⌷ 0 
___ ⌷     ⌷     ⌷     ⌷ ___ ⌷    . ⌷ ___. ⌷    . ⌷ ___. ⌷
    ⌷     ⌷ \   ⌷   / ⌷   / ⌷    | ⌷    | ⌷    | ⌷    | ⌷
    ⌷     ⌷  \  ⌷  /  ⌷  /  ⌷    | ⌷    | ⌷    | ⌷    | ⌷
    ⌷ ___ ⌷   \ ⌷ /   ⌷ /   ⌷    ' ⌷    ' ⌷ ___' ⌷ ___' ⌷

(all of these are 4 rows in height.)

As you can see, there are some repeating patterns within the symbols:

5 → 4 + 1
7 → 6 + 1
8 → 6 + 2
9 → 6 + 1 + 2

In order to represent a general Cistercian number, you will have to place the digits in the correct place for their value.

They should be mirrored horizontally if they are on the left.

They should be mirrored vertically if they are on the bottom i.e. the lines should be reversed, \ and / should be swapped, and . and ' should be swapped. Here's how they should look.

The fun part is when you stack a Cistercian representation on top of another one to accommodate more digits e.g.:

  T|U  
   |   
 Th|H  
   |   
Hth|Tth
   |   
 TM|M 

like a tower of sorts.

You will need to stack as many 4 part towers as the number requires, and you will need to prepend 0's to the input if it's length is not a multiple of 4.

Hence, given an input number, say, 12345, you should get the following:

00012345 → 5432,1000

which turns into:

4|5
 |
2|3
 |
0|1
 |
0|0

which becomes:

    |___
 \  |  /
  \ | /
   \|/
    |
    |
    |
    |
 ___|  /
    | /
    |/
    |
    |
    |
    |
    |
    |___
    |
    |
    |
    |
    |
    |
    |
    |
    |
    |
    |

Note that this is created by making two towers for the 4 digit numbers 2345 and 0001, stacking them, and adding a link of 4 | characters between them.

Scoring

This is code-golf. Shortest answer in each language wins.

History
Why does this post require moderator attention?
You might want to add some details to your flag.
Why should this post be closed?

1 comment thread

General comments (8 comments)
General comments
dzaima‭ wrote over 3 years ago

How does a vertically mirrored 5 look like?

Razetime‭ wrote over 3 years ago
dzaima‭ wrote over 3 years ago

So, just reverse vertically & swap / and \? Still ends up looking ugly. (and regardless, this should be fully specified in the challenge)

Razetime‭ wrote over 3 years ago · edited over 3 years ago

yes, 8 and 9 get butchered ⍨. not sure how to remedy that. I've specified the mirroring guideline

Moshi‭ wrote over 3 years ago

Could you use a character other than ⌷ to separate the graphics? (It's hard for me to tell which side they are 'attached' to)

Razetime‭ wrote over 3 years ago

They're in the units place. all of them adhere to the left side.

Hakerh400‭ wrote over 3 years ago

Shouldn't 12345 look like this?

Razetime‭ wrote over 3 years ago

Yes, correct. I've also modified the question from the suggestions on SE.