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

Vyxal, 24, 18 bytes

₌≬k+iE₍ht‛(]f=+÷rΠ

Try it Online!

I'm actually really proud of this answer, because it uses the new modifier parsing of 2.6.

With syntax highlighting:

syntax highlighted version

Explained

₌≬k+iE₍ht‛(]f=+÷rΠ
₌                  # Apply the following to the same stack:
 ≬                 #   The next 3 elements as a single lambda, taking argument n:
  k+iE             #     eval(n[1:-1]) - the two numbers separated by a comma
₌                  #   and
      ₍ht          #   [n[0], n[-1]] - the range brackets
         ‛(]f=     # Does the first bracket equal "(" and does the last bracket equal "]" - this determines how much to offset the range; because the two numbers in the original input will be passed to Vyxal's range function which acts like python's range() function
              +    # add those offsets: an exclusive range start means the first number needs to be incremented because range() includes the first argument. an inclusive range start means the last number needs to be incremented because range() stops before the last argument.
               ÷r  # push the range between the two numbers + their offsets
                 Π # and take the product

Vyxal, 24, 18 bytes

₌≬k+iE₍ht‛(]f=+÷rΠ

Try it Online!

I'm actually really proud of this answer, because it uses the new modifier parsing of 2.6.

Vyxal, 24, 18 bytes

₌≬k+iE₍ht‛(]f=+÷rΠ

Try it Online!

I'm actually really proud of this answer, because it uses the new modifier parsing of 2.6.

With syntax highlighting:

syntax highlighted version

Explained

₌≬k+iE₍ht‛(]f=+÷rΠ
₌                  # Apply the following to the same stack:
 ≬                 #   The next 3 elements as a single lambda, taking argument n:
  k+iE             #     eval(n[1:-1]) - the two numbers separated by a comma
₌                  #   and
      ₍ht          #   [n[0], n[-1]] - the range brackets
         ‛(]f=     # Does the first bracket equal "(" and does the last bracket equal "]" - this determines how much to offset the range; because the two numbers in the original input will be passed to Vyxal's range function which acts like python's range() function
              +    # add those offsets: an exclusive range start means the first number needs to be incremented because range() includes the first argument. an inclusive range start means the last number needs to be incremented because range() stops before the last argument.
               ÷r  # push the range between the two numbers + their offsets
                 Π # and take the product
deleted 13 characters in body
Source Link
lyxal
  • 34.3k
  • 2
  • 64
  • 141

Vyxal, 2424, 18 bytes

₌≬k+iE₍ht‛(]f=k₁₌*e*+÷rΠ]f=+÷rΠ

Try it Online!Try it Online!

I'm actually really proud of this answer, because it uses the new modifier parsing of 2.6.

Vyxal, 24 bytes

₌≬k+iE₍ht‛(]f=k₁₌*e*+÷rΠ

Try it Online!

I'm actually really proud of this answer, because it uses the new modifier parsing of 2.6.

Vyxal, 24, 18 bytes

₌≬k+iE₍ht‛(]f=+÷rΠ

Try it Online!

I'm actually really proud of this answer, because it uses the new modifier parsing of 2.6.

Source Link
lyxal
  • 34.3k
  • 2
  • 64
  • 141

Vyxal, 24 bytes

₌≬k+iE₍ht‛(]f=k₁₌*e*+÷rΠ

Try it Online!

I'm actually really proud of this answer, because it uses the new modifier parsing of 2.6.