Skip to main content
Commonmark migration
Source Link

SOGL V0.12, 110 78 bytes

θKKι"LUOEPM”;W:A≤{B"⁶Μ↓§QΕņj“L─"¶Ζq«╝γDyΜ2¶S◄Μ$‘č¹I6nēwι{_Cb:ƧRA=┌*ΚKι=?aIc*»+

#SOGL V0.12, 110 78 bytes θKKι"LUOEPM”;W:A≤{B"⁶Μ↓§QΕņj“L─"¶Ζq«╝γDyΜ2¶S◄Μ$‘č¹I6nēwι{_Cb:ƧRA=┌ΚKι=?aIc»+ Try it Here!

#SOGL V0.12, 110 78 bytes θKKι"LUOEPM”;W:A≤{B"⁶Μ↓§QΕņj“L─"¶Ζq«╝γDyΜ2¶S◄Μ$‘č¹I6nēwι{_Cb:ƧRA=┌ΚKι=?aIc»+ Try it Here!

SOGL V0.12, 110 78 bytes

θKKι"LUOEPM”;W:A≤{B"⁶Μ↓§QΕņj“L─"¶Ζq«╝γDyΜ2¶S◄Μ$‘č¹I6nēwι{_Cb:ƧRA=┌*ΚKι=?aIc*»+

Try it Here!

explain?
Source Link
dzaima
  • 20.3k
  • 2
  • 42
  • 75

#SOGL V0.12, 110 78 bytes θKKι"LUOEPM”;W:A≤{B"⁶Μ↓§QΕņj“L─"¶Ζq«╝γDyΜ2¶S◄Μ$‘č¹I6nēwι{_Cb:ƧRA=┌ΚKι=?aIc»+ [Try it Here!][1]Try it Here!

Expects input all uppercase (prepend U to the program to test with any case)
CouldCould probably golf a byte or two from redoing everything [1]

Explanation: https://dzaima.github.io/SOGLOnline/?code=JXUwM0I4S0sldTAzQjklMjJMVU9FUE0ldTIwMUQlM0JXJTNBQSV1MjI2NCU3QkIlMjIldTIwNzYldTAzOUMldTIxOTMlQTdRJXUwMzk1JXUwMTQ2aiV1MjAxQ0wldTI1MDAlMjIlQjYldTAzOTZxJUFCJXUyNTVEJXUwM0IzRHkldTAzOUMyJUI2UyV1MjVDNCV1MDM5QyUyNCV1MjAxOCV1MDEwRCVCOUk2biV1MDExM3cldTAzQjklN0JfQ2IlM0EldTAxQTdSQSUzRCV1MjUwQyoldTAzOUFLJXUwM0I5JTNEJTNGYUljKiVCQis_,inputs=TW9uJTIwWm8lMjBJciUyME5ldGE_

θ            split on spaces
 K           pop the 1st item
  K          pop from the string the 1st character
   ι         remove the original string from stack
    "”;W     get the chars index in "LUOEPM"
        :A   save a copy to variable A
          ≤  put the power (used as the mana) on the bottom of the stack (with the thing above being the input array)

{            for the leftover items in the input do
 B             save the current name on B
  "..“         push 456779223467234567
      L─       base-10 decode it (yes, silly, but it converts it to an array of digits)
        ".‘    push "VEKIBGKRDN-SYVOFDZ"
               
      č        chop to characters
       ¹       create an array of those two
        I      rotate clockwise
         6n    group to an array with sub-arrays of length 6 (so each array in the array contains 3 items, corresponding to the categories, each with 6 arrays with the runes 1st letter (or "-" in the case of Ra) and base cost)
           ē   push variable e (default = user input number, which errors and defaults to 0) and after that increase it (aka `e++`)
            w  get that item in the array (the array is 1-indexed and the variable is not, so the array was created shifted (which somehow saves 0.9 ≈ 1 byte in the compression))

 ι             remove the original array
  {            for each in that (current category) array
   _             dump all contents on stack (so pushing the runes name and then base cost)
    C            save pop (base cost) on variable B
     b:          duplicate the name
       ƧRA=      push if pop = "RA"
           ┌*    get that many (so 0 or 1) dashes
             Κ   prepend the "" or "-" to the name
              K  pop the 1st letter of the name
               ι remove the modified name, leaving the 1st letter on the stack

         =?      if top 2 are equal (one of the dumped items and the 1st letter of the current inputs)
           a       push variable A (the power)
            I      increase it
             c     push variable C (the current base cost)
              *    multiply
               »   floor-divide by 2
                +  add that to the power

#SOGL V0.12, 110 78 bytes θKKι"LUOEPM”;W:A≤{B"⁶Μ↓§QΕņj“L─"¶Ζq«╝γDyΜ2¶S◄Μ$‘č¹I6nēwι{_Cb:ƧRA=┌ΚKι=?aIc»+ [Try it Here!][1]

Expects input all uppercase (prepend U to the program to test with any case)
Could probably golf a byte or two from redoing everything [1]: https://dzaima.github.io/SOGLOnline/?code=JXUwM0I4S0sldTAzQjklMjJMVU9FUE0ldTIwMUQlM0JXJTNBQSV1MjI2NCU3QkIlMjIldTIwNzYldTAzOUMldTIxOTMlQTdRJXUwMzk1JXUwMTQ2aiV1MjAxQ0wldTI1MDAlMjIlQjYldTAzOTZxJUFCJXUyNTVEJXUwM0IzRHkldTAzOUMyJUI2UyV1MjVDNCV1MDM5QyUyNCV1MjAxOCV1MDEwRCVCOUk2biV1MDExM3cldTAzQjklN0JfQ2IlM0EldTAxQTdSQSUzRCV1MjUwQyoldTAzOUFLJXUwM0I5JTNEJTNGYUljKiVCQis_,inputs=TW9uJTIwWm8lMjBJciUyME5ldGE_

#SOGL V0.12, 110 78 bytes θKKι"LUOEPM”;W:A≤{B"⁶Μ↓§QΕņj“L─"¶Ζq«╝γDyΜ2¶S◄Μ$‘č¹I6nēwι{_Cb:ƧRA=┌ΚKι=?aIc»+ Try it Here!

Could probably golf a byte or two from redoing everything

Explanation:

θ            split on spaces
 K           pop the 1st item
  K          pop from the string the 1st character
   ι         remove the original string from stack
    "”;W     get the chars index in "LUOEPM"
        :A   save a copy to variable A
          ≤  put the power (used as the mana) on the bottom of the stack (with the thing above being the input array)

{            for the leftover items in the input do
 B             save the current name on B
  "..“         push 456779223467234567
      L─       base-10 decode it (yes, silly, but it converts it to an array of digits)
        ".‘    push "VEKIBGKRDN-SYVOFDZ"
               
      č        chop to characters
       ¹       create an array of those two
        I      rotate clockwise
         6n    group to an array with sub-arrays of length 6 (so each array in the array contains 3 items, corresponding to the categories, each with 6 arrays with the runes 1st letter (or "-" in the case of Ra) and base cost)
           ē   push variable e (default = user input number, which errors and defaults to 0) and after that increase it (aka `e++`)
            w  get that item in the array (the array is 1-indexed and the variable is not, so the array was created shifted (which somehow saves 0.9 ≈ 1 byte in the compression))

 ι             remove the original array
  {            for each in that (current category) array
   _             dump all contents on stack (so pushing the runes name and then base cost)
    C            save pop (base cost) on variable B
     b:          duplicate the name
       ƧRA=      push if pop = "RA"
           ┌*    get that many (so 0 or 1) dashes
             Κ   prepend the "" or "-" to the name
              K  pop the 1st letter of the name
               ι remove the modified name, leaving the 1st letter on the stack

         =?      if top 2 are equal (one of the dumped items and the 1st letter of the current inputs)
           a       push variable A (the power)
            I      increase it
             c     push variable C (the current base cost)
              *    multiply
               »   floor-divide by 2
                +  add that to the power
golf
Source Link
dzaima
  • 20.3k
  • 2
  • 42
  • 75

#SOGL V0.12, 110 110 78 bytes θK"¹ν&○⅝⅓≥┌|χIH⁴‘θ;WθKKι"LUOEPM”;W:A≤{B"=ģ─°Sξ⅔∑√½9⁷√ī]Kι╚Ψf‚28Εc►‚Ψ}►⁹⁾εΙš∞░║l=⁄Jρ≥»¦cž¾⁷‘θ"⁶Μ↓§QΕņj“L─¹I6nēwιB"⁶Μ↓§QΕņj“L─"¶Ζq«╝γDyΜ2¶S◄Μ$‘č¹I6nēwι{_;Cb=?aIc*»+_Cb:ƧRA=┌ΚKι=?aIc»+ [Try it Here!][1]

SOGL was not designed for challenges like this but mehExpects input all uppercase :p(prepend U to the program to test with any case)
Could probably golf a byte or two from redoing everything [1]: https://dzaima.github.io/SOGLOnline/?code=JXUwM0I4SyUyMiVCOSV1MDNCRCUyNiV1MjVDQiV1MjE1RCV1MjE1MyV1MjI2NSV1MjUwQyU3QyV1MDNDN0lIJXUyMDc0JXUyMDE4JXUwM0I4JTNCVyUzQUEldTIyNjQlN0JCJTIyJTNEJXUwMTIzJXUyNTAwJUIwUyV1MDNCRSV1MjE1NCV1MjIxMSV1MjIxQSVCRDkldTIwNzcldTIyMUEldTAxMkIlNURLJXUwM0I5JXUyNTVBJXUwM0E4ZiV1MjAxQTI4JXUwMzk1YyV1MjVCQSV1MjAxQSV1MDNBOCU3RCV1MjVCQSV1MjA3OSV1MjA3RSV1MDNCNSV1MDM5OSV1MDE2MSV1MjIxRSV1MjU5MSV1MjU1MWwlM0QldTIwNDRKJXUwM0MxJXUyMjY1JUJCJUE2YyV1MDE3RSVCRSV1MjA3NyV1MjAxOCV1MDNCOCUyMiV1MjA3NiV1MDM5QyV1MjE5MyVBN1EldTAzOTUldTAxNDZqJXUyMDFDTCV1MjUwMCVCOUk2biV1MDExM3cldTAzQjklN0JfJTNCQ2IlM0QlM0ZhSWMqJUJCKw__,inputs=bW9uJTIwZGVzJTIwaXIlMjBzYXIhttps://dzaima.github.io/SOGLOnline/?code=JXUwM0I4S0sldTAzQjklMjJMVU9FUE0ldTIwMUQlM0JXJTNBQSV1MjI2NCU3QkIlMjIldTIwNzYldTAzOUMldTIxOTMlQTdRJXUwMzk1JXUwMTQ2aiV1MjAxQ0wldTI1MDAlMjIlQjYldTAzOTZxJUFCJXUyNTVEJXUwM0IzRHkldTAzOUMyJUI2UyV1MjVDNCV1MDM5QyUyNCV1MjAxOCV1MDEwRCVCOUk2biV1MDExM3cldTAzQjklN0JfQ2IlM0EldTAxQTdSQSUzRCV1MjUwQyoldTAzOUFLJXUwM0I5JTNEJTNGYUljKiVCQis_,inputs=TW9uJTIwWm8lMjBJciUyME5ldGE_

#SOGL V0.12, 110 78 bytes θKKι"LUOEPM”;W:A≤{B"⁶Μ↓§QΕņj“L─"¶Ζq«╝γDyΜ2¶S◄Μ$‘č¹I6nēwι{_Cb:ƧRA=┌ΚKι=?aIc»+ [Try it Here!][1]

Expects input all uppercase (prepend U to the program to test with any case)
Could probably golf a byte or two from redoing everything [1]: https://dzaima.github.io/SOGLOnline/?code=JXUwM0I4S0sldTAzQjklMjJMVU9FUE0ldTIwMUQlM0JXJTNBQSV1MjI2NCU3QkIlMjIldTIwNzYldTAzOUMldTIxOTMlQTdRJXUwMzk1JXUwMTQ2aiV1MjAxQ0wldTI1MDAlMjIlQjYldTAzOTZxJUFCJXUyNTVEJXUwM0IzRHkldTAzOUMyJUI2UyV1MjVDNCV1MDM5QyUyNCV1MjAxOCV1MDEwRCVCOUk2biV1MDExM3cldTAzQjklN0JfQ2IlM0EldTAxQTdSQSUzRCV1MjUwQyoldTAzOUFLJXUwM0I5JTNEJTNGYUljKiVCQis_,inputs=TW9uJTIwWm8lMjBJciUyME5ldGE_

Source Link
dzaima
  • 20.3k
  • 2
  • 42
  • 75
Loading