Skip to main content
deleted 207 characters in body
Source Link
Kevin Cruijssen
  • 131.4k
  • 13
  • 144
  • 384

MathGolf, 1010 8 bytes

8D*╠♂/e▬8D*╠e▬(*

Inputs in the order: \$v_{exhaust}, m_{end}\$, where \$v_{exhaust}\$ is taken as a floatfloat representing tenths (e.g. 24.0).

Try it online.Try it online.

Explanation:

8D*         # Multiply 8 by 14: 112
   ╠        # Divide it by the first (implicit) input-float (exhaust speed)
    ♂/      # Divide it byas 10tenths)
      e▬    # Push e (2.718281828459045) to the power this
        (   # Decrement it by 1
         *  # Multiply it to the second (implicit) input-integer (mass)
            # (after which the entire stack is output implicitly as resulting fuel mass)

NOTE : / is used for both integer division (if both arguments are integers) and regular division (if either or both arguments are floats). So I can't take the first input \$v_{exhaust}\$ "as integer representing tenths" as allowed in the challenge description to golf the ♂/, since it would result in integer-division. If I'm allowed to take the tenths as floats (e.g. 24.0 instead of 2.4), the ♂/ can be removed for -2 bytesan integer.

MathGolf, 10 bytes

8D*╠♂/e▬(*

Inputs in the order: \$v_{exhaust}, m_{end}\$, where \$v_{exhaust}\$ is taken as a float.

Try it online.

Explanation:

8D*         # Multiply 8 by 14: 112
   ╠        # Divide it by the first (implicit) input-float (exhaust speed)
    ♂/      # Divide it by 10
      e▬    # Push e (2.718281828459045) to the power this
        (   # Decrement it by 1
         *  # Multiply it to the second (implicit) input-integer (mass)
            # (after which the entire stack is output implicitly as resulting fuel mass)

NOTE: / is used for both integer division (if both arguments are integers) and regular division (if either or both arguments are floats). So I can't take the first input \$v_{exhaust}\$ "as integer representing tenths" as allowed in the challenge description to golf the ♂/, since it would result in integer-division. If I'm allowed to take the tenths as floats (e.g. 24.0 instead of 2.4), the ♂/ can be removed for -2 bytes.

MathGolf, 10 8 bytes

8D*╠e▬(*

Inputs in the order: \$v_{exhaust}, m_{end}\$, where \$v_{exhaust}\$ is taken as a float representing tenths (e.g. 24.0).

Try it online.

Explanation:

8D*       # Multiply 8 by 14: 112
   ╠      # Divide it by the first (implicit) input-float (exhaust speed as tenths)
    e▬    # Push e (2.718281828459045) to the power this
      (   # Decrement it by 1
       *  # Multiply it to the second (implicit) input-integer (mass)
          # (after which the entire stack is output implicitly as resulting fuel mass)

: / is used for both integer division (if both arguments are integers) and regular division (if either or both arguments are floats). So I can't take the first input \$v_{exhaust}\$ as tenths as an integer.

Source Link
Kevin Cruijssen
  • 131.4k
  • 13
  • 144
  • 384

MathGolf, 10 bytes

8D*╠♂/e▬(*

Inputs in the order: \$v_{exhaust}, m_{end}\$, where \$v_{exhaust}\$ is taken as a float.

Try it online.

Explanation:

8D*         # Multiply 8 by 14: 112
   ╠        # Divide it by the first (implicit) input-float (exhaust speed)
    ♂/      # Divide it by 10
      e▬    # Push e (2.718281828459045) to the power this
        (   # Decrement it by 1
         *  # Multiply it to the second (implicit) input-integer (mass)
            # (after which the entire stack is output implicitly as resulting fuel mass)

NOTE: / is used for both integer division (if both arguments are integers) and regular division (if either or both arguments are floats). So I can't take the first input \$v_{exhaust}\$ "as integer representing tenths" as allowed in the challenge description to golf the ♂/, since it would result in integer-division. If I'm allowed to take the tenths as floats (e.g. 24.0 instead of 2.4), the ♂/ can be removed for -2 bytes.