Skip to main content
added 2057 characters in body
Source Link
Ven
  • 3.5k
  • 1
  • 19
  • 24

Uiua, 38 3737 36 bytes

⊏:⊂@ :⍥⊏⊙⊂⍥(⍉⊂⇌↘1.)2⊞(×↥⊙⊃=↥=1↧,,).+1⇡⧻.,@ 

-12 thanks to chunes.

Try it online! Explanation:

⊏⊙⊂⍥(⍉⊂⇌↘1.)2⊞(×↥⊙⊃=↥=1↧,,).+1⇡⧻,@ ⇌
                                   ⇌ # reverse the input string
                                 @   # put a space on the stack
                                ,    # over: copy the string back to the top of the stack
                              ⇡⧻     # range 1..length
                            +1       # add 1 so it's 1-indexed
                           .         # duplicate
             ⊞(           )          # for each combination (of the duplicates), this gives us a matrix row:column
                        ,,           # copy the 2 top values on the stack
                     =1↧             # is the minimum 1?
                 ⊙                   # store this result, temporarily remove it from the stack to...
                  ⊃                  # ...fork: do both operations to the same elements on the stack
                    ↥                # maximum
                   =                 # equal
                ↥                    # maximum of this fork
               ×                     # times the stored result
                                     # We now have the first quadrant
   ⍥(      )2                        # do twice
          .                          # copy the quadrant
        ↘1                           # drop the first element (because the middle would be duplicated otherwise)
       ⇌                             # reverse it (needs to be mirror)
      ⊂                              # append the quadrant with the mirror
     ⍉                               # transpose it so the pattern works on both sides
 ⊙                                   # store this result, temporarily remove it from the stack to...
  ⊂                                  # join the string with the space
⊏                                    # index into the strings with our matrix, zero being the empty space we just appended

Try it online!

Uiua, 38 37 bytes

⊏:⊂@ :⍥(⍉⊂⇌↘1.)2⊞(×↥⊙⊃=↥=1↧,,).+1⇡⧻.

-1 thanks to chunes.

Try it online!

Uiua, 38 37 36 bytes

⊏⊙⊂⍥(⍉⊂⇌↘1.)2⊞(×↥⊙⊃=↥=1↧,,).+1⇡⧻,@ 

-2 thanks to chunes.

Explanation:

⊏⊙⊂⍥(⍉⊂⇌↘1.)2⊞(×↥⊙⊃=↥=1↧,,).+1⇡⧻,@ ⇌
                                   ⇌ # reverse the input string
                                 @   # put a space on the stack
                                ,    # over: copy the string back to the top of the stack
                              ⇡⧻     # range 1..length
                            +1       # add 1 so it's 1-indexed
                           .         # duplicate
             ⊞(           )          # for each combination (of the duplicates), this gives us a matrix row:column
                        ,,           # copy the 2 top values on the stack
                     =1↧             # is the minimum 1?
                 ⊙                   # store this result, temporarily remove it from the stack to...
                  ⊃                  # ...fork: do both operations to the same elements on the stack
                    ↥                # maximum
                   =                 # equal
                ↥                    # maximum of this fork
               ×                     # times the stored result
                                     # We now have the first quadrant
   ⍥(      )2                        # do twice
          .                          # copy the quadrant
        ↘1                           # drop the first element (because the middle would be duplicated otherwise)
       ⇌                             # reverse it (needs to be mirror)
      ⊂                              # append the quadrant with the mirror
     ⍉                               # transpose it so the pattern works on both sides
 ⊙                                   # store this result, temporarily remove it from the stack to...
  ⊂                                  # join the string with the space
⊏                                    # index into the strings with our matrix, zero being the empty space we just appended

Try it online!

added 37 characters in body
Source Link
Ven
  • 3.5k
  • 1
  • 19
  • 24

Uiua, 38 38 37 bytes

⊏:⊂@ :⍥(⍉⊂⇌↘1.)2⊞(×↥⊃(=|=1↧|↥)×↥⊙⊃=↥=1↧,,).+1⇡⧻.⇌

-1 thanks to chunes.

Draws a quadrant, then replicates it. Since we count from 0, not 1, we need a +1 / -1, otherwise the center would be 0 as well (because multiplying the maximum of 0 and 0 is... 0), and it'd get transformed to a space.

Try it online!Try it online!

Uiua, 38 bytes

⊏:⊂@ :⍥(⍉⊂⇌↘1.)2⊞(×↥⊃(=|=1↧|↥)).+1⇡⧻.⇌

Draws a quadrant, then replicates it. Since we count from 0, not 1, we need a +1 / -1, otherwise the center would be 0 as well (because multiplying the maximum of 0 and 0 is... 0), and it'd get transformed to a space.

Try it online!

Uiua, 38 37 bytes

⊏:⊂@ :⍥(⍉⊂⇌↘1.)2⊞(×↥⊙⊃=↥=1↧,,).+1⇡⧻.⇌

-1 thanks to chunes.

Draws a quadrant, then replicates it. Since we count from 0, not 1, we need a +1 / -1, otherwise the center would be 0 as well (because multiplying the maximum of 0 and 0 is... 0), and it'd get transformed to a space.

Try it online!

deleted 12 characters in body
Source Link
Ven
  • 3.5k
  • 1
  • 19
  • 24

Uiua, 38 bytes

⊏:⊂@ :⍥(⍉⊂⇌↘1.)2⊞(×↥⊃(=|=1↧|↥)).+1⇡⧻.⇌

Draws a quadrant, then replicates it. Since we count from 0, not 1, we need a +1 / -1, otherwise the center would be 0 as well (because multiplying the maximum of 0 and 0 is... 0), and it'd get transformed to a space.

Try it online!Try it online!

Uiua, 38 bytes

⊏:⊂@ :⍥(⍉⊂⇌↘1.)2⊞(×↥⊃(=|=1↧|↥)).+1⇡⧻.⇌

Draws a quadrant, then replicates it. Since we count from 0, not 1, we need a +1 / -1, otherwise the center would be 0 as well (because multiplying the maximum of 0 and 0 is... 0), and it'd get transformed to a space.

Try it online!

Uiua, 38 bytes

⊏:⊂@ :⍥(⍉⊂⇌↘1.)2⊞(×↥⊃(=|=1↧|↥)).+1⇡⧻.⇌

Draws a quadrant, then replicates it. Since we count from 0, not 1, we need a +1 / -1, otherwise the center would be 0 as well (because multiplying the maximum of 0 and 0 is... 0), and it'd get transformed to a space.

Try it online!

added 1 character in body
Source Link
Ven
  • 3.5k
  • 1
  • 19
  • 24
Loading
Source Link
Ven
  • 3.5k
  • 1
  • 19
  • 24
Loading