Skip to main content
added 29 characters in body
Source Link
Razetime
  • 27.4k
  • 3
  • 29
  • 72

APL (Dyalog Unicode)APL (Dyalog Extended), 5238 - 10 = 4228 chars

' ▗▖▄▝▐▞▟▘▚▌▙▀▜▛█'[{2⊥∊⍵}⌺(2 2⍴2)⊢↑{⍵,0/⍨2|≢⍵}' '≠⎕]≠⎕⍪0]

Try it online!Try it online!

-10 bytes for an explanation? Count me in!

-14 bytes from Adám.

Takes input as a list of lines from STDIN.

Explanation

' ▗▖▄▝▐▞▟▘▚▌▙▀▜▛█'[{2⊥∊⍵}⌺(2 2⍴2)⊢↑{2|≢⍵:⍵,0⋄⍵}' '≠⎕]
                                                   ⎕  take input
                                               ' '≠   convert spaces to 0, 1 otherwise
                                   {2|≢⍵:⍵,0⋄⍵}       if there are an odd number of rows, append a 0 to each column
                                  ⊢↑                  convert to matrix, apply the following:
                          ⌺(2 2⍴2)                    cut the matrix into 2x2 pieces, apply the following to them:
                    {2⊥∊⍵}                            enlist, decode from base 2
' ▗▖▄▝▐▞▟▘▚▌▙▀▜▛█'[                                 ] index those numbers into the box drawing characters

APL (Dyalog Unicode), 52 - 10 = 42 chars

' ▗▖▄▝▐▞▟▘▚▌▙▀▜▛█'[{2⊥∊⍵}⌺(2 2⍴2)⊢↑{⍵,0/⍨2|≢⍵}' '≠⎕]

Try it online!

-10 bytes for an explanation? Count me in!

Takes input as a list of lines from STDIN.

Explanation

' ▗▖▄▝▐▞▟▘▚▌▙▀▜▛█'[{2⊥∊⍵}⌺(2 2⍴2)⊢↑{2|≢⍵:⍵,0⋄⍵}' '≠⎕]
                                                   ⎕  take input
                                               ' '≠   convert spaces to 0, 1 otherwise
                                   {2|≢⍵:⍵,0⋄⍵}       if there are an odd number of rows, append a 0 to each column
                                  ⊢↑                  convert to matrix, apply the following:
                          ⌺(2 2⍴2)                    cut the matrix into 2x2 pieces, apply the following to them:
                    {2⊥∊⍵}                            enlist, decode from base 2
' ▗▖▄▝▐▞▟▘▚▌▙▀▜▛█'[                                 ] index those numbers into the box drawing characters

APL (Dyalog Extended), 38 - 10 = 28 chars

' ▗▖▄▝▐▞▟▘▚▌▙▀▜▛█'[{2⊥∊⍵}⌺(2 2⍴2)≠⎕⍪0]

Try it online!

-10 bytes for an explanation? Count me in!

-14 bytes from Adám.

Takes input as a list of lines from STDIN.

Explanation

' ▗▖▄▝▐▞▟▘▚▌▙▀▜▛█'[{2⊥∊⍵}⌺(2 2⍴2)⊢↑{2|≢⍵:⍵,0⋄⍵}' '≠⎕]
                                                   ⎕  take input
                                               ' '≠   convert spaces to 0, 1 otherwise
                                   {2|≢⍵:⍵,0⋄⍵}       if there are an odd number of rows, append a 0 to each column
                                  ⊢↑                  convert to matrix, apply the following:
                          ⌺(2 2⍴2)                    cut the matrix into 2x2 pieces, apply the following to them:
                    {2⊥∊⍵}                            enlist, decode from base 2
' ▗▖▄▝▐▞▟▘▚▌▙▀▜▛█'[                                 ] index those numbers into the box drawing characters
deleted 3 characters in body
Source Link
Razetime
  • 27.4k
  • 3
  • 29
  • 72

APL (Dyalog Unicode), 5352 - 10 = 4542 chars

' ▗▖▄▝▐▞▟▘▚▌▙▀▜▛█'[{2⊥∊⍵}⌺(2 2⍴2)⊢↑{2|≢⍵:⍵,0⋄⍵0/⍨2|≢⍵}' '≠⎕]

Try it online!Try it online!

-10 bytes for an explanation? Count me in!

Takes input as a list of lines from STDIN.

Explanation

' ▗▖▄▝▐▞▟▘▚▌▙▀▜▛█'[{2⊥∊⍵}⌺(2 2⍴2)⊢↑{2|≢⍵:⍵,0⋄⍵}' '≠⎕]
                                                   ⎕  take input
                                               ' '≠   convert spaces to 0, 1 otherwise
                                   {2|≢⍵:⍵,0⋄⍵}       if there are an odd number of rows, append a 0 to each column
                                  ⊢↑                  convert to matrix, apply the following:
                          ⌺(2 2⍴2)                    cut the matrix into 2x2 pieces, apply the following to them:
                    {2⊥∊⍵}                            enlist, decode from base 2
' ▗▖▄▝▐▞▟▘▚▌▙▀▜▛█'[                                 ] index those numbers into the box drawing characters

APL (Dyalog Unicode), 53 - 10 = 45 chars

' ▗▖▄▝▐▞▟▘▚▌▙▀▜▛█'[{2⊥∊⍵}⌺(2 2⍴2)⊢↑{2|≢⍵:⍵,0⋄⍵}' '≠⎕]

Try it online!

-10 bytes for an explanation? Count me in!

Takes input as a list of lines from STDIN.

Explanation

' ▗▖▄▝▐▞▟▘▚▌▙▀▜▛█'[{2⊥∊⍵}⌺(2 2⍴2)⊢↑{2|≢⍵:⍵,0⋄⍵}' '≠⎕]
                                                   ⎕  take input
                                               ' '≠   convert spaces to 0, 1 otherwise
                                   {2|≢⍵:⍵,0⋄⍵}       if there are an odd number of rows, append a 0 to each column
                                  ⊢↑                  convert to matrix, apply the following:
                          ⌺(2 2⍴2)                    cut the matrix into 2x2 pieces, apply the following to them:
                    {2⊥∊⍵}                            enlist, decode from base 2
' ▗▖▄▝▐▞▟▘▚▌▙▀▜▛█'[                                 ] index those numbers into the box drawing characters

APL (Dyalog Unicode), 52 - 10 = 42 chars

' ▗▖▄▝▐▞▟▘▚▌▙▀▜▛█'[{2⊥∊⍵}⌺(2 2⍴2)⊢↑{⍵,0/⍨2|≢⍵}' '≠⎕]

Try it online!

-10 bytes for an explanation? Count me in!

Takes input as a list of lines from STDIN.

Explanation

' ▗▖▄▝▐▞▟▘▚▌▙▀▜▛█'[{2⊥∊⍵}⌺(2 2⍴2)⊢↑{2|≢⍵:⍵,0⋄⍵}' '≠⎕]
                                                   ⎕  take input
                                               ' '≠   convert spaces to 0, 1 otherwise
                                   {2|≢⍵:⍵,0⋄⍵}       if there are an odd number of rows, append a 0 to each column
                                  ⊢↑                  convert to matrix, apply the following:
                          ⌺(2 2⍴2)                    cut the matrix into 2x2 pieces, apply the following to them:
                    {2⊥∊⍵}                            enlist, decode from base 2
' ▗▖▄▝▐▞▟▘▚▌▙▀▜▛█'[                                 ] index those numbers into the box drawing characters
Source Link
Razetime
  • 27.4k
  • 3
  • 29
  • 72

APL (Dyalog Unicode), 53 - 10 = 45 chars

' ▗▖▄▝▐▞▟▘▚▌▙▀▜▛█'[{2⊥∊⍵}⌺(2 2⍴2)⊢↑{2|≢⍵:⍵,0⋄⍵}' '≠⎕]

Try it online!

-10 bytes for an explanation? Count me in!

Takes input as a list of lines from STDIN.

Explanation

' ▗▖▄▝▐▞▟▘▚▌▙▀▜▛█'[{2⊥∊⍵}⌺(2 2⍴2)⊢↑{2|≢⍵:⍵,0⋄⍵}' '≠⎕]
                                                   ⎕  take input
                                               ' '≠   convert spaces to 0, 1 otherwise
                                   {2|≢⍵:⍵,0⋄⍵}       if there are an odd number of rows, append a 0 to each column
                                  ⊢↑                  convert to matrix, apply the following:
                          ⌺(2 2⍴2)                    cut the matrix into 2x2 pieces, apply the following to them:
                    {2⊥∊⍵}                            enlist, decode from base 2
' ▗▖▄▝▐▞▟▘▚▌▙▀▜▛█'[                                 ] index those numbers into the box drawing characters