Skip to main content
use °⊏
Source Link
noodle person
  • 10.3k
  • 1
  • 22
  • 76

Uiua, 18 17 bytes

/◇⊂⍜▽¯◿2⊛.⊜□≠@A⌵◇⊂⍜▽¯◿2°⊏⊜□≠@A⌵.

Try itTry it

/◇⊂⍜▽¯◿2⊛.⊜□≠@A⌵◇⊂⍜▽¯◿2°⊏⊜□≠@A⌵.­⁡​‎⁠⁠⁠‎⁡⁠⁢⁡⁡‏⁠‎⁡⁠⁢⁡⁢‏‏​⁡⁠⁡‌⁢​‎‎⁡⁠⁤⁢‏⁠‎⁡⁠⁤⁣‏⁠‎⁡⁠⁤⁤‏‏​⁡⁠⁡‌⁣​‎‎⁡⁠⁣⁤‏⁠‎⁡⁠⁤⁡‏‏​⁡⁠⁡‌⁤​‎‎⁡⁠⁣⁡‏⁠‎⁡⁠⁣⁢‏⁠‎⁡⁠⁣⁣‏‏​⁡⁠⁡‌⁢⁡​‎‎⁡⁠⁢⁣‏⁠‎⁡⁠⁢⁤‏‏​⁡⁠⁡‌⁢⁢​‎‎⁡⁠⁤‏⁠‎⁡⁠⁢⁡‏⁠‎⁡⁠⁢⁢‏‏​⁡⁠⁡‌⁢⁣​‎‎⁡⁠⁡‏⁠‎⁡⁠⁢‏⁠‎⁡⁠⁣‏‏​⁡⁠⁡‌­
               ⌵.  # ‎⁡Push an uppercase copy
            ≠@A    # ‎⁢Mask of those not equal to A
          ⊜□       # ‎⁣Partition, boxing each string
        ⊛.°⊏         # ‎⁤Copy, push the range 0 to its length
      ◿2           # Modulo 2 (alternating 0s and 1s)
   ⍜▽¯             # ‎⁢⁢At positions with 1s, swapcase
/◇⊂                # ‎⁢⁣Reduce by joining each unboxed string
💎

Created with the help of Luminespire.

I don't like formatting Uiua explanations like this since it's hard to explain everything on one line (especially because I like to do pretty in-depth explanations). Particularly for Uiua it can feel awkward reading the code down and to the left while reading the explanation all the way to the right. But, there's a clear tradeoff, doing explanations this way takes much less time, and I don't have that much time right now so this'll do.

Uiua, 18 17 bytes

/◇⊂⍜▽¯◿2⊛.⊜□≠@A⌵.

Try it

/◇⊂⍜▽¯◿2⊛.⊜□≠@A⌵.­⁡​‎⁠⁠⁠‎⁡⁠⁢⁡⁡‏⁠‎⁡⁠⁢⁡⁢‏‏​⁡⁠⁡‌⁢​‎‎⁡⁠⁤⁢‏⁠‎⁡⁠⁤⁣‏⁠‎⁡⁠⁤⁤‏‏​⁡⁠⁡‌⁣​‎‎⁡⁠⁣⁤‏⁠‎⁡⁠⁤⁡‏‏​⁡⁠⁡‌⁤​‎‎⁡⁠⁣⁡‏⁠‎⁡⁠⁣⁢‏⁠‎⁡⁠⁣⁣‏‏​⁡⁠⁡‌⁢⁡​‎‎⁡⁠⁢⁣‏⁠‎⁡⁠⁢⁤‏‏​⁡⁠⁡‌⁢⁢​‎‎⁡⁠⁤‏⁠‎⁡⁠⁢⁡‏⁠‎⁡⁠⁢⁢‏‏​⁡⁠⁡‌⁢⁣​‎‎⁡⁠⁡‏⁠‎⁡⁠⁢‏⁠‎⁡⁠⁣‏‏​⁡⁠⁡‌­
               ⌵.  # ‎⁡Push an uppercase copy
            ≠@A    # ‎⁢Mask of those not equal to A
          ⊜□       # ‎⁣Partition, boxing each string
        ⊛.         # ‎⁤Copy, push the range 0 to its length
      ◿2           # Modulo 2 (alternating 0s and 1s)
   ⍜▽¯             # ‎⁢⁢At positions with 1s, swapcase
/◇⊂                # ‎⁢⁣Reduce by joining each unboxed string
💎

Created with the help of Luminespire.

I don't like formatting Uiua explanations like this since it's hard to explain everything on one line (especially because I like to do pretty in-depth explanations). Particularly for Uiua it can feel awkward reading the code down and to the left while reading the explanation all the way to the right. But, there's a clear tradeoff, doing explanations this way takes much less time, and I don't have that much time right now so this'll do.

Uiua, 18 17 bytes

/◇⊂⍜▽¯◿2°⊏⊜□≠@A⌵.

Try it

/◇⊂⍜▽¯◿2°⊏⊜□≠@A⌵.­⁡​‎⁠⁠⁠‎⁡⁠⁢⁡⁡‏⁠‎⁡⁠⁢⁡⁢‏‏​⁡⁠⁡‌⁢​‎‎⁡⁠⁤⁢‏⁠‎⁡⁠⁤⁣‏⁠‎⁡⁠⁤⁤‏‏​⁡⁠⁡‌⁣​‎‎⁡⁠⁣⁤‏⁠‎⁡⁠⁤⁡‏‏​⁡⁠⁡‌⁤​‎‎⁡⁠⁣⁡‏⁠‎⁡⁠⁣⁢‏⁠‎⁡⁠⁣⁣‏‏​⁡⁠⁡‌⁢⁡​‎‎⁡⁠⁢⁣‏⁠‎⁡⁠⁢⁤‏‏​⁡⁠⁡‌⁢⁢​‎‎⁡⁠⁤‏⁠‎⁡⁠⁢⁡‏⁠‎⁡⁠⁢⁢‏‏​⁡⁠⁡‌⁢⁣​‎‎⁡⁠⁡‏⁠‎⁡⁠⁢‏⁠‎⁡⁠⁣‏‏​⁡⁠⁡‌­
               ⌵.  # ‎⁡Push an uppercase copy
            ≠@A    # ‎⁢Mask of those not equal to A
          ⊜□       # ‎⁣Partition, boxing each string
        °⊏         # ‎⁤Copy, push the range 0 to its length
      ◿2           # Modulo 2 (alternating 0s and 1s)
   ⍜▽¯             # ‎⁢⁢At positions with 1s, swapcase
/◇⊂                # ‎⁢⁣Reduce by joining each unboxed string
💎

Created with the help of Luminespire.

I don't like formatting Uiua explanations like this since it's hard to explain everything on one line (especially because I like to do pretty in-depth explanations). Particularly for Uiua it can feel awkward reading the code down and to the left while reading the explanation all the way to the right. But, there's a clear tradeoff, doing explanations this way takes much less time, and I don't have that much time right now so this'll do.

deleted 3 characters in body
Source Link
noodle person
  • 10.3k
  • 1
  • 22
  • 76

Uiua, 1818 17 bytes

/◇⊂⍜▽¯◿2⇡⧻◇⊂⍜▽¯◿2⊛.⊜□≠@A⌵.

Try itTry it

/◇⊂⍜▽¯◿2⇡⧻◇⊂⍜▽¯◿2⊛.⊜□≠@A⌵.­⁡​‎⁠⁠⁠‎⁡⁠⁢⁡⁡‏⁠‎⁡⁠⁢⁡⁢‏‏​⁡⁠⁡‌⁢​‎‎⁡⁠⁤⁢‏⁠‎⁡⁠⁤⁣‏⁠‎⁡⁠⁤⁤‏‏​⁡⁠⁡‌⁣​‎‎⁡⁠⁣⁤‏⁠‎⁡⁠⁤⁡‏‏​⁡⁠⁡‌⁤​‎‎⁡⁠⁣⁡‏⁠‎⁡⁠⁣⁢‏⁠‎⁡⁠⁣⁣‏‏​⁡⁠⁡‌⁢⁡​‎‎⁡⁠⁢⁣‏⁠‎⁡⁠⁢⁤‏‏​⁡⁠⁡‌⁢⁢​‎‎⁡⁠⁤‏⁠‎⁡⁠⁢⁡‏⁠‎⁡⁠⁢⁢‏‏​⁡⁠⁡‌⁢⁣​‎‎⁡⁠⁡‏⁠‎⁡⁠⁢‏⁠‎⁡⁠⁣‏‏​⁡⁠⁡‌­
                ⌵.  # ‎⁡Push an uppercase copy
             ≠@A    # ‎⁢Mask of those not equal to A
           ⊜□       # ‎⁣Partition, boxing each string
        ⇡⧻.         # ‎⁤Copy, push the range 0 to its length
      ◿2            # Modulo 2 (alternating 0s and 1s)
   ⍜▽¯              # ‎⁢⁢At positions with 1s, swapcase
/◇⊂                 # ‎⁢⁣Reduce by joining each unboxed string
💎

Created with the help of Luminespire.

I don't like formatting Uiua explanations like this since it's hard to explain everything on one line (especially because I like to do pretty in-depth explanations). Particularly for Uiua it can feel awkward reading the code down and to the left while reading the explanation all the way to the right. But, there's a clear tradeoff, doing explanations this way takes much less time, and I don't have that much time right now so this'll do.

Uiua, 18 bytes

/◇⊂⍜▽¯◿2⇡⧻.⊜□≠@A⌵.

Try it

/◇⊂⍜▽¯◿2⇡⧻.⊜□≠@A⌵.­⁡​‎⁠⁠⁠‎⁡⁠⁢⁡⁡‏⁠‎⁡⁠⁢⁡⁢‏‏​⁡⁠⁡‌⁢​‎‎⁡⁠⁤⁢‏⁠‎⁡⁠⁤⁣‏⁠‎⁡⁠⁤⁤‏‏​⁡⁠⁡‌⁣​‎‎⁡⁠⁣⁤‏⁠‎⁡⁠⁤⁡‏‏​⁡⁠⁡‌⁤​‎‎⁡⁠⁣⁡‏⁠‎⁡⁠⁣⁢‏⁠‎⁡⁠⁣⁣‏‏​⁡⁠⁡‌⁢⁡​‎‎⁡⁠⁢⁣‏⁠‎⁡⁠⁢⁤‏‏​⁡⁠⁡‌⁢⁢​‎‎⁡⁠⁤‏⁠‎⁡⁠⁢⁡‏⁠‎⁡⁠⁢⁢‏‏​⁡⁠⁡‌⁢⁣​‎‎⁡⁠⁡‏⁠‎⁡⁠⁢‏⁠‎⁡⁠⁣‏‏​⁡⁠⁡‌­
                ⌵.  # ‎⁡Push an uppercase copy
             ≠@A    # ‎⁢Mask of those not equal to A
           ⊜□       # ‎⁣Partition, boxing each string
        ⇡⧻.         # ‎⁤Copy, push the range 0 to its length
      ◿2            # Modulo 2 (alternating 0s and 1s)
   ⍜▽¯              # ‎⁢⁢At positions with 1s, swapcase
/◇⊂                 # ‎⁢⁣Reduce by joining each unboxed string
💎

Created with the help of Luminespire.

I don't like formatting Uiua explanations like this since it's hard to explain everything on one line (especially because I like to do pretty in-depth explanations). Particularly for Uiua it can feel awkward reading the code down and to the left while reading the explanation all the way to the right. But, there's a clear tradeoff, doing explanations this way takes much less time, and I don't have that much time right now so this'll do.

Uiua, 18 17 bytes

/◇⊂⍜▽¯◿2⊛.⊜□≠@A⌵.

Try it

/◇⊂⍜▽¯◿2⊛.⊜□≠@A⌵.­⁡​‎⁠⁠⁠‎⁡⁠⁢⁡⁡‏⁠‎⁡⁠⁢⁡⁢‏‏​⁡⁠⁡‌⁢​‎‎⁡⁠⁤⁢‏⁠‎⁡⁠⁤⁣‏⁠‎⁡⁠⁤⁤‏‏​⁡⁠⁡‌⁣​‎‎⁡⁠⁣⁤‏⁠‎⁡⁠⁤⁡‏‏​⁡⁠⁡‌⁤​‎‎⁡⁠⁣⁡‏⁠‎⁡⁠⁣⁢‏⁠‎⁡⁠⁣⁣‏‏​⁡⁠⁡‌⁢⁡​‎‎⁡⁠⁢⁣‏⁠‎⁡⁠⁢⁤‏‏​⁡⁠⁡‌⁢⁢​‎‎⁡⁠⁤‏⁠‎⁡⁠⁢⁡‏⁠‎⁡⁠⁢⁢‏‏​⁡⁠⁡‌⁢⁣​‎‎⁡⁠⁡‏⁠‎⁡⁠⁢‏⁠‎⁡⁠⁣‏‏​⁡⁠⁡‌­
               ⌵.  # ‎⁡Push an uppercase copy
            ≠@A    # ‎⁢Mask of those not equal to A
          ⊜□       # ‎⁣Partition, boxing each string
        .         # ‎⁤Copy, push the range 0 to its length
      ◿2           # Modulo 2 (alternating 0s and 1s)
   ⍜▽¯             # ‎⁢⁢At positions with 1s, swapcase
/◇⊂                # ‎⁢⁣Reduce by joining each unboxed string
💎

Created with the help of Luminespire.

I don't like formatting Uiua explanations like this since it's hard to explain everything on one line (especially because I like to do pretty in-depth explanations). Particularly for Uiua it can feel awkward reading the code down and to the left while reading the explanation all the way to the right. But, there's a clear tradeoff, doing explanations this way takes much less time, and I don't have that much time right now so this'll do.

added 1003 characters in body
Source Link
noodle person
  • 10.3k
  • 1
  • 22
  • 76

Uiua, 18 bytes

/◇⊂⍜▽¯◿2⇡⧻.⊜□≠@A⌵.

Try it

/◇⊂⍜▽¯◿2⇡⧻.⊜□≠@A⌵.­⁡​‎⁠⁠⁠‎⁡⁠⁢⁡⁡‏⁠‎⁡⁠⁢⁡⁢‏‏​⁡⁠⁡‌⁢​‎‎⁡⁠⁤⁢‏⁠‎⁡⁠⁤⁣‏⁠‎⁡⁠⁤⁤‏‏​⁡⁠⁡‌⁣​‎‎⁡⁠⁣⁤‏⁠‎⁡⁠⁤⁡‏‏​⁡⁠⁡‌⁤​‎‎⁡⁠⁣⁡‏⁠‎⁡⁠⁣⁢‏⁠‎⁡⁠⁣⁣‏‏​⁡⁠⁡‌⁢⁡​‎‎⁡⁠⁢⁣‏⁠‎⁡⁠⁢⁤‏‏​⁡⁠⁡‌⁢⁢​‎‎⁡⁠⁤‏⁠‎⁡⁠⁢⁡‏⁠‎⁡⁠⁢⁢‏‏​⁡⁠⁡‌⁢⁣​‎‎⁡⁠⁡‏⁠‎⁡⁠⁢‏⁠‎⁡⁠⁣‏‏​⁡⁠⁡‌­
                ⌵.  # ‎⁡Push an uppercase copy
             ≠@A    # ‎⁢Mask of those not equal to A
           ⊜□       # ‎⁣Partition, boxing each string
        ⇡⧻.         # ‎⁤Copy, push the range 0 to its length
      ◿2            # Modulo 2 (alternating 0s and 1s)
   ⍜▽¯              # ‎⁢⁢At positions with 1s, swapcase
/◇⊂                 # ‎⁢⁣Reduce by joining each unboxed string
💎

Create a maskCreated with the help of nonLuminespire.

I don't like formatting Uiua explanations like this since it's hard to explain everything on one line (especially because I like to do pretty in-a/A, partitiondepth explanations). Particularly for Uiua it can feel awkward reading the code down and to the left while reading the explanation all the way to the right. But, create length range mod 2there's a clear tradeoff, at swap case at positions with 1sdoing explanations this way takes much less time, join togetherand I don't have that much time right now so this'll do.

Uiua, 18 bytes

/◇⊂⍜▽¯◿2⇡⧻.⊜□≠@A⌵.

Try it

Create a mask of non-a/A, partition, create length range mod 2, at swap case at positions with 1s, join together.

Uiua, 18 bytes

/◇⊂⍜▽¯◿2⇡⧻.⊜□≠@A⌵.

Try it

/◇⊂⍜▽¯◿2⇡⧻.⊜□≠@A⌵.­⁡​‎⁠⁠⁠‎⁡⁠⁢⁡⁡‏⁠‎⁡⁠⁢⁡⁢‏‏​⁡⁠⁡‌⁢​‎‎⁡⁠⁤⁢‏⁠‎⁡⁠⁤⁣‏⁠‎⁡⁠⁤⁤‏‏​⁡⁠⁡‌⁣​‎‎⁡⁠⁣⁤‏⁠‎⁡⁠⁤⁡‏‏​⁡⁠⁡‌⁤​‎‎⁡⁠⁣⁡‏⁠‎⁡⁠⁣⁢‏⁠‎⁡⁠⁣⁣‏‏​⁡⁠⁡‌⁢⁡​‎‎⁡⁠⁢⁣‏⁠‎⁡⁠⁢⁤‏‏​⁡⁠⁡‌⁢⁢​‎‎⁡⁠⁤‏⁠‎⁡⁠⁢⁡‏⁠‎⁡⁠⁢⁢‏‏​⁡⁠⁡‌⁢⁣​‎‎⁡⁠⁡‏⁠‎⁡⁠⁢‏⁠‎⁡⁠⁣‏‏​⁡⁠⁡‌­
                ⌵.  # ‎⁡Push an uppercase copy
             ≠@A    # ‎⁢Mask of those not equal to A
           ⊜□       # ‎⁣Partition, boxing each string
        ⇡⧻.         # ‎⁤Copy, push the range 0 to its length
      ◿2            # Modulo 2 (alternating 0s and 1s)
   ⍜▽¯              # ‎⁢⁢At positions with 1s, swapcase
/◇⊂                 # ‎⁢⁣Reduce by joining each unboxed string
💎

Created with the help of Luminespire.

I don't like formatting Uiua explanations like this since it's hard to explain everything on one line (especially because I like to do pretty in-depth explanations). Particularly for Uiua it can feel awkward reading the code down and to the left while reading the explanation all the way to the right. But, there's a clear tradeoff, doing explanations this way takes much less time, and I don't have that much time right now so this'll do.

Source Link
noodle person
  • 10.3k
  • 1
  • 22
  • 76
Loading