Skip to main content
added 1283 characters in body
Source Link
lyxal
  • 34.3k
  • 2
  • 64
  • 141

I'll explain later, but .•3и½:∍äaŠ• is a compressed string. -5 thanks to @Kevin

Explained

Original: lε.•3и½:∍äaŠ•sk>4%„ݧuyåi(]O
Uncompressed: lε"anm vzw cso u"sk>4%"cosu"yåi(]O

l               | Take the implicit input and lowercase it.
ε               | Map the following to this input to find the sharpness of each letter:
"anm vzw cso u" |   Push the string "anm vzw cso u", representing the sharpness of each
                |   letter. They are arranged in a way such the index of the character
                |   is retrivable via mathematical caluclation.
                |
sk              |   Swap this string, and the mapping item, and find the index of the
                |   item within the big string
                |
>4%             |   Increment the value, and then modulo 4 it in order to find the "raw"
                |   sharpness of the string. The result will be in the range [0, 3]
                |
"cosu"          |   Now comes the part where we determine if the sharpness needs to be
                |   negated or not. First, we push a string containing all letters that
                |   have negative sharpness
                |
yå              |   We now push the letter being mapped, and test to see if it is in the
                |   aforementioned string
                |
i(]             |   If it is in the string, negate the sharpness value. After that,
                |   close the if-statement and the loop
                |
O               | Summate the stack and implicitly output the total sharpness.

I'll explain later, but .•3и½:∍äaŠ• is a compressed string. -5 thanks to @Kevin

-5 thanks to @Kevin

Explained

Original: lε.•3и½:∍äaŠ•sk>4%„ݧuyåi(]O
Uncompressed: lε"anm vzw cso u"sk>4%"cosu"yåi(]O

l               | Take the implicit input and lowercase it.
ε               | Map the following to this input to find the sharpness of each letter:
"anm vzw cso u" |   Push the string "anm vzw cso u", representing the sharpness of each
                |   letter. They are arranged in a way such the index of the character
                |   is retrivable via mathematical caluclation.
                |
sk              |   Swap this string, and the mapping item, and find the index of the
                |   item within the big string
                |
>4%             |   Increment the value, and then modulo 4 it in order to find the "raw"
                |   sharpness of the string. The result will be in the range [0, 3]
                |
"cosu"          |   Now comes the part where we determine if the sharpness needs to be
                |   negated or not. First, we push a string containing all letters that
                |   have negative sharpness
                |
yå              |   We now push the letter being mapped, and test to see if it is in the
                |   aforementioned string
                |
i(]             |   If it is in the string, negate the sharpness value. After that,
                |   close the if-statement and the loop
                |
O               | Summate the stack and implicitly output the total sharpness.
added 32 characters in body
Source Link
lyxal
  • 34.3k
  • 2
  • 64
  • 141

05AB1E, 39 38 36 34 3333 28 bytes

lεDV.•3и½:∍äaŠ•sk>4%"cuso"Yåi∍äaŠ•sk>4%„ݧuyåi(}}O]O

Try it online!Try it online! or Verify all test cases (as arranged by @sporeball)Verify all test cases (as arranged by @sporeball)

I'll explain later, but .•3и½:∍äaŠ• is a compressed string. -5 thanks to @Kevin

05AB1E, 22 bytes

.•7ùZ9£nDн•#εXlSk>}O®β

Try it online!

A port of the Jelly answer suggested by @Kevin.

05AB1E, 39 38 36 34 33 bytes

lεDV.•3и½:∍äaŠ•sk>4%"cuso"Yåi(}}O

Try it online! or Verify all test cases (as arranged by @sporeball)

I'll explain later, but .•3и½:∍äaŠ• is a compressed string.

05AB1E, 39 38 36 34 33 28 bytes

.•3и½:∍äaŠ•sk>4%„ݧuyåi(]O

Try it online! or Verify all test cases (as arranged by @sporeball)

I'll explain later, but .•3и½:∍äaŠ• is a compressed string. -5 thanks to @Kevin

05AB1E, 22 bytes

.•7ùZ9£nDн•#εXlSk>}O®β

Try it online!

A port of the Jelly answer suggested by @Kevin.

added 403 characters in body
Source Link
lyxal
  • 34.3k
  • 2
  • 64
  • 141

05AB1E, 39 38 36 34 33 bytes

lεDV.•3и½:∍äaŠ•sk>4%"cuso"Yåi(}}O

Try it online! or Verify all test cases (as arranged by @sporeball)

I'll explain later, but .•3и½:∍äaŠ• is a compressed string.

@Kevin, how do I make it "verify all test cases"?

05AB1E, 39 38 36 34 33 bytes

lεDV.•3и½:∍äaŠ•sk>4%"cuso"Yåi(}}O

Try it online!

I'll explain later, but .•3и½:∍äaŠ• is a compressed string.

@Kevin, how do I make it "verify all test cases"?

05AB1E, 39 38 36 34 33 bytes

lεDV.•3и½:∍äaŠ•sk>4%"cuso"Yåi(}}O

Try it online! or Verify all test cases (as arranged by @sporeball)

I'll explain later, but .•3и½:∍äaŠ• is a compressed string.

deleted 47 characters in body
Source Link
lyxal
  • 34.3k
  • 2
  • 64
  • 141
Loading
deleted 47 characters in body
Source Link
lyxal
  • 34.3k
  • 2
  • 64
  • 141
Loading
Source Link
lyxal
  • 34.3k
  • 2
  • 64
  • 141
Loading