Skip to main content
4 of 4
Rollback to Revision 2
Kevin Cruijssen
  • 131.4k
  • 13
  • 144
  • 384

05AB1E (legacy), 30 29 bytes

'-×'/.ø©Ð„|.‡I.D®W'.:ÐW‡In.D»

Uses the legacy version of 05AB1E because it can take the minimum character of a string (based on its unicode value), saving 2 bytes over repushing the characters.

Try it online or verify all test cases.

Explanation:

'-×      '# Repeat "-" the (implicit) input amount of times as string
   '/.ø  '# Surround it with leading/trailing "/"
       ©  # Store this string in variable `®` (without popping)
Ð         # Triplicate it
 „|.‡     # Transliterate the "/" to "|" and "-" to "." in the other copy (the
          # transliterate ignores the trailing "…---/" since the strings are
          # of unequal length)
     I.D  # Duplicate it the input amount of times
®         # Push string `®`
 W        # Push the minimum (without popping): "-"
  '.:    '# Replace all "-" with "." in string `®`
Ð         # Triplicate it
 W        # Push the minimum (without popping): "."
  ‡       # Replace all "/" with "." (transliterate again ignores the trailing
          # "…---/")
   In     # Push the input, and square it
     .D   # Duplicate this string of "."s that many times
»         # Join all strings on the stack by newlines
          # (after which the result is output implicitly)
Kevin Cruijssen
  • 131.4k
  • 13
  • 144
  • 384