Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

Return to Answer

bugfix
Source Link
Neil
  • 184.4k
  • 12
  • 76
  • 290

Charcoal, 3236 bytes

×ばつθ⊖η⊖ζ−ζ‹ηζ×ばつθ⊖η⊖ζ−ζ∧‹ηζ›ζ2

Try it online! Try it online! Link is to verbose version of code. Explanation: Not sure that thisNow uses @xnor's correction F<B>2 (my previous correction F<B didn't work in some cases) which is correct but it seemsstill a byte golfier than special-casing F=B; this now makes my answer equivalent to pass alla port of the test caseshis golf to @loopywalt's answer.

Nθ Input `d` as a number
 Nη Input `f` as a number
 Nζ Input `b` as a number
 ζ Input `b`
 X Raised to power
 θ Input `d`
 ×ばつ Multiplied by
 η Input `f`
 ⊖ Decremented
 ÷ Integer divided by
 ζ Input `b`
 ⊖ Decremented
 ⊕ Incremented
 ÷ Integer divided by
 ζ Input `b`
 − Subtract
 η Input `f`
 ‹ Is less than
 ζ Input `b`
 ∧ Logical And
 ζ Input `b`
 › Is greater than
 2 Literal integer `2`
 ×ばつ Multiplied by
 θ Input `d`
 ×ばつ Multiplied by
 η Input `f`
 ⊖ Decremented
 % Modulo
 ζ Input `b`
 ⊖ Decremented
 ⊕ Incremented
 I Cast to string
 Implicitly print

Charcoal, 32 bytes

×ばつθ⊖η⊖ζ−ζ‹ηζ

Try it online! Link is to verbose version of code. Explanation: Not sure that this is correct but it seems to pass all of the test cases.

Nθ Input `d` as a number
 Nη Input `f` as a number
 Nζ Input `b` as a number
 ζ Input `b`
 X Raised to power
 θ Input `d`
 ×ばつ Multiplied by
 η Input `f`
 ⊖ Decremented
 ÷ Integer divided by
 ζ Input `b`
 ⊖ Decremented
 ⊕ Incremented
 ÷ Integer divided by
 ζ Input `b`
 − Subtract
 η Input `f`
 ‹ Is less than
 ζ Input `b`
 ×ばつ Multiplied by
 θ Input `d`
 ×ばつ Multiplied by
 η Input `f`
 ⊖ Decremented
 % Modulo
 ζ Input `b`
 ⊖ Decremented
 ⊕ Incremented
 I Cast to string
 Implicitly print

Charcoal, 36 bytes

×ばつθ⊖η⊖ζ−ζ∧‹ηζ›ζ2

Try it online! Link is to verbose version of code. Explanation: Now uses @xnor's correction F<B>2 (my previous correction F<B didn't work in some cases) which is still a byte golfier than special-casing F=B; this now makes my answer equivalent to a port of his golf to @loopywalt's answer.

Nθ Input `d` as a number
 Nη Input `f` as a number
 Nζ Input `b` as a number
 ζ Input `b`
 X Raised to power
 θ Input `d`
 ×ばつ Multiplied by
 η Input `f`
 ⊖ Decremented
 ÷ Integer divided by
 ζ Input `b`
 ⊖ Decremented
 ⊕ Incremented
 ÷ Integer divided by
 ζ Input `b`
 − Subtract
 η Input `f`
 ‹ Is less than
 ζ Input `b`
 ∧ Logical And
 ζ Input `b`
 › Is greater than
 2 Literal integer `2`
 ×ばつ Multiplied by
 θ Input `d`
 ×ばつ Multiplied by
 η Input `f`
 ⊖ Decremented
 % Modulo
 ζ Input `b`
 ⊖ Decremented
 ⊕ Incremented
 I Cast to string
 Implicitly print
Source Link
Neil
  • 184.4k
  • 12
  • 76
  • 290

Charcoal, 32 bytes

×ばつθ⊖η⊖ζ−ζ‹ηζ

Try it online! Link is to verbose version of code. Explanation: Not sure that this is correct but it seems to pass all of the test cases.

Nθ Input `d` as a number
 Nη Input `f` as a number
 Nζ Input `b` as a number
 ζ Input `b`
 X Raised to power
 θ Input `d`
 ×ばつ Multiplied by
 η Input `f`
 ⊖ Decremented
 ÷ Integer divided by
 ζ Input `b`
 ⊖ Decremented
 ⊕ Incremented
 ÷ Integer divided by
 ζ Input `b`
 − Subtract
 η Input `f`
 ‹ Is less than
 ζ Input `b`
 ×ばつ Multiplied by
 θ Input `d`
 ×ばつ Multiplied by
 η Input `f`
 ⊖ Decremented
 % Modulo
 ζ Input `b`
 ⊖ Decremented
 ⊕ Incremented
 I Cast to string
 Implicitly print

AltStyle によって変換されたページ (->オリジナル) /