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

Post History

60%
+1 −0
Challenges Print the Great Numeric Pyramid

BQN, 33 bytesSBCS >(⌽(⊑¨55↑+˜⊸+⊔'0'+⌽⊸⌊⊸⌊)¨˜1↓↑)↕28 Run online! Minimum of barycentric coordinates placed according to a skew transformation on two of them. So, the min(i,j,27-i-j) thing pr...

posted 3y ago by Marshall Lochbaum‭

Answer
#1: Initial revision by user avatar Marshall Lochbaum‭ · 2021-05-03T18:52:09Z (over 3 years ago)
# [BQN](https://mlochbaum.github.io/BQN/), 33 bytes<sup>[SBCS](https://github.com/mlochbaum/BQN/blob/master/commentary/sbcs.bqn)</sup>

```
>(⌽(⊑¨55↑+˜⊸+⊔'0'+⌽⊸⌊⊸⌊)¨˜1↓↑)↕28
```

[Run online!](https://mlochbaum.github.io/BQN/try.html#code=PijijL0o4oqRwqg1NeKGkSvLnOKKuCviipQnMCcr4oy94oq44oyK4oq44oyKKcKoy5wx4oaT4oaRKeKGlTI4)

Minimum of [barycentric coordinates](https://en.wikipedia.org/wiki/Barycentric_coordinate_system) placed according to a skew transformation on two of them. So, the `min(i,j,27-i-j)` thing pretty much. The result is a character matrix.

The three coordinates are height, distance from left, and distance from right, and always sum to 27. In row `i` the height is `27-i`, and the possible values for the other two coordinates range from `0` to `i`. So reversing (`⌽`) `↕28` gives the height and non-empty [Prefixes](https://mlochbaum.github.io/BQN/doc/prefixes.html) (`↑`) are the horizontal coordinates. The location of a number is the height plus *twice* the distance from the left. [Group](https://mlochbaum.github.io/BQN/doc/group.html) (`⊔`) places each character at its location, giving a list of lists of characters—always zero or one of them in this case.

```
>(⌽(⊑¨55↑+˜⊸+⊔'0'+⌽⊸⌊⊸⌊)¨˜1↓↑)↕28
                              ↕28  # Range 0…27
 (⌽                       1↓↑)     # Function train
                            ↑      # Prefixes of ↕28
                          1↓       #   but not the first (empty) one
  ⌽                                # Reversed range 27…0
                         ˜         # Exchange the order
   (                   )¨          # On each pair (e.g. 𝕨=3…27 and 𝕩=25)
                  ⌽⊸⌊⊸⌊            # Min-with-reverse 𝕨; min with 𝕩
              '0'+                 # Digit character from number
         +˜⊸+                      # Locations (2×𝕨)+𝕩
             ⊔                     # Put characters at locations
      55↑                          # Extend to length 55
    ⊑¨                             # First at each location, or space
>                                  # Merge axes to give a matrix
```

It's tacit: see [trains](https://mlochbaum.github.io/BQN/doc/train.html) and [Before](https://mlochbaum.github.io/BQN/tutorial/combinator.html#before-and-after) as usual.