Skip to main content
added 88 characters in body
Source Link
Kevin Cruijssen
  • 136.3k
  • 14
  • 155
  • 395

05AB1E, 67 62 62 59 bytes

4*<U₄RX∍2ì3«©4DjRXÌ∍®3LÂ6+‡‚I·<∍`®3L564*<U₄RX∍2ì3«©4DjRXÌ∍®āžm‡‚I·<∍`®ā56(‡»žm(•dÃи“·”.•29вŽb[+ç‡

Try it onlineTry it online or verify all test casesverify all test cases.

4*         # Multiply the (implicit) input-integer by 4
  <        # Decrease it by 1
   U       # Pop and store this input*4-1 in variable `X`
₄          # Push 1000
 R         # Reverse it: "0001"
  X∍       # Extend/shorten it to length `X`
    2ì3«   # Prepend a 2 and append a 3
        ©  # Store it in variable `®` (without popping)
4          # Push 4
 D         # Duplicate it
  j        # Pad leading spaces to make it that length: "   4"
   R       # Reverse it: "4   "
    XÌ∍    # Extend/shorten it to length `X+2` (aka input*4+1)
®          # Push string `®`
 3Lā         # Push list [1,2,3]
   Â    a list in #the Bifurcaterange it[1, short for Duplicate &length] Reverse(without copypopping): [3[1,2,1]3,...]
  žm  6+     # Add 6 to eachPush value:constant [9,8,7]9876543210
          # Transliterate 1,2,3 to 9,8,7 in string `®`
           # (the other values that aren't present in `®` are no-ops)
‚          # Pair the top two strings together
 I·<∍      # Extend/shorten this list to length input*2-1
     `     # Pop and push all strings separately to the stack
®          # Push string `®` again
 3Lā         # Push a list in the range [1,2,3]length] (without popping) again
   56(      # Push -56
      # Transliterate 1,2,3 to "-",5,6 in string `®`
           # (the other integers that aren't present in `®` are no-ops again)
»          # Join all strings on the stack with newline delimiter
žm         # Push constant 9876543210
  (        # Negate it: -9876543210
•dÃи“·”.•  # Push compressed integer 10932220548783273
  29в      # Convert it to base-29 as list: [25,28,16,19,13,10,1,7,4,22,0]
     Žb[   # Push compressed integer 9552
        +  # Add it to each value in the list:
           #  [9577,9580,9568,9571,9565,9562,9553,9559,9556,9574,9552]
         ç # Convert each to a character with that unicode value:
           #  ["╩","╬","╠","╣","╝","╚","║","╗","╔","╦","═"]
‡          # Transliterate the "-","9","8",... to "╩","╬","╠",...
           # (after which the result is output implicitly)

05AB1E, 67 62 bytes

4*<U₄RX∍2ì3«©4DjRXÌ∍®3LÂ6+‡‚I·<∍`®3L56(‡»žm(•dÃи“·”.•29вŽb[+ç‡

Try it online or verify all test cases.

4*         # Multiply the (implicit) input-integer by 4
  <        # Decrease it by 1
   U       # Pop and store this input*4-1 in variable `X`
₄          # Push 1000
 R         # Reverse it: "0001"
  X∍       # Extend/shorten it to length `X`
    2ì3«   # Prepend a 2 and append a 3
        ©  # Store it in variable `®` (without popping)
4          # Push 4
 D         # Duplicate it
  j        # Pad leading spaces to make it that length: "   4"
   R       # Reverse it: "4   "
    XÌ∍    # Extend/shorten it to length `X+2` (aka input*4+1)
®          # Push string `®`
 3L        # Push list [1,2,3]
   Â       # Bifurcate it, short for Duplicate & Reverse copy: [3,2,1]
    6+     # Add 6 to each value: [9,8,7]
          # Transliterate 1,2,3 to 9,8,7 in string `®`
‚          # Pair the top two strings together
 I·<∍      # Extend/shorten this list to length input*2-1
     `     # Pop and push all strings separately to the stack
®          # Push string `®` again
 3L        # Push list [1,2,3] again
   56(     # Push -56
      ‡    # Transliterate 1,2,3 to "-",5,6 in string `®`
»          # Join all strings on the stack with newline delimiter
žm         # Push constant 9876543210
  (        # Negate it: -9876543210
•dÃи“·”.•  # Push compressed integer 10932220548783273
  29в      # Convert it to base-29 as list: [25,28,16,19,13,10,1,7,4,22,0]
     Žb[   # Push compressed integer 9552
        +  # Add it to each value in the list:
           #  [9577,9580,9568,9571,9565,9562,9553,9559,9556,9574,9552]
         ç # Convert each to a character with that unicode value:
           #  ["╩","╬","╠","╣","╝","╚","║","╗","╔","╦","═"]
‡          # Transliterate the "-","9","8",... to "╩","╬","╠",...
           # (after which the result is output implicitly)

05AB1E, 67 62 59 bytes

4*<U₄RX∍2ì3«©4DjRXÌ∍®āžm‡‚I·<∍`®ā56(‡»žm(•dÃи“·”.•29вŽb[+ç‡

Try it online or verify all test cases.

4*         # Multiply the (implicit) input-integer by 4
  <        # Decrease it by 1
   U       # Pop and store this input*4-1 in variable `X`
₄          # Push 1000
 R         # Reverse it: "0001"
  X∍       # Extend/shorten it to length `X`
    2ì3«   # Prepend a 2 and append a 3
        ©  # Store it in variable `®` (without popping)
4          # Push 4
 D         # Duplicate it
  j        # Pad leading spaces to make it that length: "   4"
   R       # Reverse it: "4   "
    XÌ∍    # Extend/shorten it to length `X+2` (aka input*4+1)
®          # Push string `®`
 ā         # Push a list in the range [1,length] (without popping): [1,2,3,...]
  žm       # Push constant 9876543210
          # Transliterate 1,2,3 to 9,8,7 in string `®`
           # (the other values that aren't present in `®` are no-ops)
‚          # Pair the top two strings together
 I·<∍      # Extend/shorten this list to length input*2-1
     `     # Pop and push all strings separately to the stack
®          # Push string `®` again
 ā         # Push a list in the range [1,length] (without popping) again
  56(      # Push -56
     ‡     # Transliterate 1,2,3 to "-",5,6 in string `®`
           # (the other integers that aren't present in `®` are no-ops again)
»          # Join all strings on the stack with newline delimiter
žm         # Push constant 9876543210
  (        # Negate it: -9876543210
•dÃи“·”.•  # Push compressed integer 10932220548783273
  29в      # Convert it to base-29 as list: [25,28,16,19,13,10,1,7,4,22,0]
     Žb[   # Push compressed integer 9552
        +  # Add it to each value in the list:
           #  [9577,9580,9568,9571,9565,9562,9553,9559,9556,9574,9552]
         ç # Convert each to a character with that unicode value:
           #  ["╩","╬","╠","╣","╝","╚","║","╗","╔","╦","═"]
‡          # Transliterate the "-","9","8",... to "╩","╬","╠",...
           # (after which the result is output implicitly)
added 88 characters in body
Source Link
Kevin Cruijssen
  • 136.3k
  • 14
  • 155
  • 395

05AB1E, 67 67 62 bytes

4*<UŽ4#X∍2ì3«4DjRXÌ∍Ž4%X∍8ì0«‚I·<∍`7b4*<U₄RX∍2ì3«©4DjRXÌ∍®3LÂ6+‡‚I·<∍`®3L56(RX∍5ì6«»žm‡»žm(•dÃ∊Ѫžθ•29вŽb[+燕dÃи“·”.•29вŽb[+ç‡

Try it onlineTry it online or verify all test casesverify all test cases.

4*         # Multiply the (implicit) input-integer by 4
  <        # Decrease it by 1
   U       # Pop and store this input*4-1 in variable `X`
Ž4#        # Push compressed1000
 integerR 1117
        # Reverse it: "0001"
  X∍       # Extend/shorten it to length `X`
     2ì3«   # Prepend a 2 and append a 3
        ©  # Store it in variable `®` (without popping)
4          # Push 4
 D         # Duplicate it
  j        # Pad leading spaces to make it that length: "   4"
   R       # Reverse it: "4   "
    XÌ∍    # Extend/shorten it to length `X+2` (aka input*4+1)
Ž4%®          # Push compressedstring integer`®`
 11193L        # Push list [1,2,3]
   X∍Â       # Extend/shortenBifurcate it, toshort lengthfor `X`Duplicate & Reverse copy: [3,2,1]
    6+ 8ì0«    # PrependAdd an6 to each value: [9,8,7]
 and append a 0  ‡    # Transliterate 1,2,3 to 9,8,7 in string `®`
‚          # Pair the top two strings together
 I·<∍      # Extend/shorten this list to length input*2-1
     `     # Pop and push all strings separately to the stack
7®          # Push 7
 b         # Convert it to a binary string: "111"
`®` again
 (3L        # Negate it:Push -111
list [1,2,3] again
 R  56(     # Reverse it:Push "111-"56
    X∍      # Extend/shortenTransliterate it1,2,3 to length `X`
      5ì6« # Prepend a "-",5 and,6 appendin astring 6`®`
»          # Join all strings on the stack with newline delimiter
žm         # Push constant 9876543210
  (        # Negate it: -9876543210
•dÃ∊Ѫžθ••dÃи“·”.•  # Push compressed integer 1093227229841158110932220548783273
  29в      # Convert it to base-29 as list: [25,28,16,2219,13,10,1,7,4,022,19]0]
     Žb[   # Push compressed integer 9552
        +  # Add it to each value in the list:
           #  [9577,9580,9568,95749571,9565,9562,9553,9559,9556,95529574,9571]9552]
         ç # Convert each to a character with that unicode value:
           #  ["╩","╬","╠","╦""╣","╝","╚","║","╗","╔","═""╦","╣"]"═"]
‡          # Transliterate the "-","9","8",... to "╩","╬","╠",...
           # (after which the result is output implicitly)

See this 05AB1E tip of mine (sections How to compress large integers? and How to compress integer lists?) to understand why Ž4# is 1117; Ž4% is 1119; •dÃ∊Ѫžθ••dÃи“·”.• is 1093227229841158110932220548783273; and •dÃ∊Ѫžθ•29в•dÃи“·”.•29в is [25,28,16,2219,13,10,1,7,4,022,19]0]; and Žb[ is 9552.

05AB1E, 67 bytes

4*<UŽ4#X∍2ì3«4DjRXÌ∍Ž4%X∍8ì0«‚I·<∍`7b(RX∍5ì6«»žm(•dÃ∊Ѫžθ•29вŽb[+ç‡

Try it online or verify all test cases.

4*         # Multiply the (implicit) input-integer by 4
  <        # Decrease it by 1
   U       # Pop and store this input*4-1 in variable `X`
Ž4#        # Push compressed integer 1117
   X∍      # Extend/shorten it to length `X`
     2ì3«  # Prepend a 2 and append a 3
4          # Push 4
 D         # Duplicate it
  j        # Pad leading spaces to make it that length: "   4"
   R       # Reverse it: "4   "
    XÌ∍    # Extend/shorten it to length `X+2` (aka input*4+1)
Ž4%        # Push compressed integer 1119
   X∍      # Extend/shorten it to length `X`
     8ì0«  # Prepend an 8 and append a 0
‚          # Pair the top two strings together
 I·<∍      # Extend/shorten this list to length input*2-1
     `     # Pop and push all strings separately to the stack
7          # Push 7
 b         # Convert it to a binary string: "111"
  (        # Negate it: -111
   R       # Reverse it: "111-"
    X∍     # Extend/shorten it to length `X`
      5ì6« # Prepend a 5 and append a 6
»          # Join all strings on the stack with newline delimiter
žm         # Push constant 9876543210
  (        # Negate it: -9876543210
•dÃ∊Ѫžθ•  # Push compressed integer 10932272298411581
  29в      # Convert it to base-29 as list: [25,28,16,22,13,10,1,7,4,0,19]
     Žb[   # Push compressed integer 9552
        +  # Add it to each value in the list:
           #  [9577,9580,9568,9574,9565,9562,9553,9559,9556,9552,9571]
         ç # Convert each to a character with that unicode value:
           #  ["╩","╬","╠","╦","╝","╚","║","╗","╔","═","╣"]
‡          # Transliterate the "-","9","8",... to "╩","╬","╠",...
           # (after which the result is output implicitly)

See this 05AB1E tip of mine (sections How to compress large integers? and How to compress integer lists?) to understand why Ž4# is 1117; Ž4% is 1119; •dÃ∊Ѫžθ• is 10932272298411581; and •dÃ∊Ѫžθ•29в is [25,28,16,22,13,10,1,7,4,0,19].

05AB1E, 67 62 bytes

4*<U₄RX∍2ì3«©4DjRXÌ∍®3LÂ6+‡‚I·<∍`®3L56(‡»žm(•dÃи“·”.•29вŽb[+ç‡

Try it online or verify all test cases.

4*         # Multiply the (implicit) input-integer by 4
  <        # Decrease it by 1
   U       # Pop and store this input*4-1 in variable `X`
        # Push 1000
 R         # Reverse it: "0001"
  X∍       # Extend/shorten it to length `X`
    2ì3«   # Prepend a 2 and append a 3
        ©  # Store it in variable `®` (without popping)
4          # Push 4
 D         # Duplicate it
  j        # Pad leading spaces to make it that length: "   4"
   R       # Reverse it: "4   "
    XÌ∍    # Extend/shorten it to length `X+2` (aka input*4+1)
®          # Push string `®`
 3L        # Push list [1,2,3]
   Â       # Bifurcate it, short for Duplicate & Reverse copy: [3,2,1]
    6+     # Add 6 to each value: [9,8,7]
      ‡    # Transliterate 1,2,3 to 9,8,7 in string `®`
‚          # Pair the top two strings together
 I·<∍      # Extend/shorten this list to length input*2-1
     `     # Pop and push all strings separately to the stack
®          # Push string `®` again
 3L        # Push list [1,2,3] again
   56(     # Push -56
          # Transliterate 1,2,3 to "-",5,6 in string `®`
»          # Join all strings on the stack with newline delimiter
žm         # Push constant 9876543210
  (        # Negate it: -9876543210
•dÃи“·”.•  # Push compressed integer 10932220548783273
  29в      # Convert it to base-29 as list: [25,28,16,19,13,10,1,7,4,22,0]
     Žb[   # Push compressed integer 9552
        +  # Add it to each value in the list:
           #  [9577,9580,9568,9571,9565,9562,9553,9559,9556,9574,9552]
         ç # Convert each to a character with that unicode value:
           #  ["╩","╬","╠","╣","╝","╚","║","╗","╔","╦","═"]
‡          # Transliterate the "-","9","8",... to "╩","╬","╠",...
           # (after which the result is output implicitly)

See this 05AB1E tip of mine (sections How to compress large integers? and How to compress integer lists?) to understand why •dÃи“·”.• is 10932220548783273; •dÃи“·”.•29в is [25,28,16,19,13,10,1,7,4,22,0]; and Žb[ is 9552.

Source Link
Kevin Cruijssen
  • 136.3k
  • 14
  • 155
  • 395

05AB1E, 67 bytes

4*<UŽ4#X∍2ì3«4DjRXÌ∍Ž4%X∍8ì0«‚I·<∍`7b(RX∍5ì6«»žm(•dÃ∊Ѫžθ•29вŽb[+ç‡

Try it online or verify all test cases.

Explanation:

4*         # Multiply the (implicit) input-integer by 4
  <        # Decrease it by 1
   U       # Pop and store this input*4-1 in variable `X`
Ž4#        # Push compressed integer 1117
   X∍      # Extend/shorten it to length `X`
     2ì3«  # Prepend a 2 and append a 3
4          # Push 4
 D         # Duplicate it
  j        # Pad leading spaces to make it that length: "   4"
   R       # Reverse it: "4   "
    XÌ∍    # Extend/shorten it to length `X+2` (aka input*4+1)
Ž4%        # Push compressed integer 1119
   X∍      # Extend/shorten it to length `X`
     8ì0«  # Prepend an 8 and append a 0
‚          # Pair the top two strings together
 I·<∍      # Extend/shorten this list to length input*2-1
     `     # Pop and push all strings separately to the stack
7          # Push 7
 b         # Convert it to a binary string: "111"
  (        # Negate it: -111
   R       # Reverse it: "111-"
    X∍     # Extend/shorten it to length `X`
      5ì6« # Prepend a 5 and append a 6
»          # Join all strings on the stack with newline delimiter
žm         # Push constant 9876543210
  (        # Negate it: -9876543210
•dÃ∊Ѫžθ•  # Push compressed integer 10932272298411581
  29в      # Convert it to base-29 as list: [25,28,16,22,13,10,1,7,4,0,19]
     Žb[   # Push compressed integer 9552
        +  # Add it to each value in the list:
           #  [9577,9580,9568,9574,9565,9562,9553,9559,9556,9552,9571]
         ç # Convert each to a character with that unicode value:
           #  ["╩","╬","╠","╦","╝","╚","║","╗","╔","═","╣"]
‡          # Transliterate the "-","9","8",... to "╩","╬","╠",...
           # (after which the result is output implicitly)

See this 05AB1E tip of mine (sections How to compress large integers? and How to compress integer lists?) to understand why Ž4# is 1117; Ž4% is 1119; •dÃ∊Ѫžθ• is 10932272298411581; and •dÃ∊Ѫžθ•29в is [25,28,16,22,13,10,1,7,4,0,19].