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

Two bytes saved by using mirrors
Source Link
Not a tree
  • 3.2k
  • 1
  • 13
  • 24

><>, 24(削除) 24 (削除ここまで) 22 bytes

-2 bytes thanks to @Aaron

I'm trying a new language (since my Mathematica licence expired...)

01v>01\{=n;
1$<^!?(}!\1ドル+:{@*:*@{:+}(

Try it online, or at the fish playground

Assumes the input number is already on the stack, and returns 0 or 1. It works by multiplying together the first n numbers until that stops being less than the input, and then printing 1 if it equals the input, and 0 if it doesn't.

><>, 24 bytes

I'm trying a new language (since my Mathematica licence expired...)

01v>{=n;
1$<^!?(}:{:*@:+

Try it online, or at the fish playground

Assumes the input number is already on the stack, and returns 0 or 1. It works by multiplying together the first n numbers until that stops being less than the input, and then printing 1 if it equals the input, and 0 if it doesn't.

><>, (削除) 24 (削除ここまで) 22 bytes

-2 bytes thanks to @Aaron

I'm trying a new language (since my Mathematica licence expired...)

01\{=n;
?!\1ドル+:@*:{:}(

Try it online, or at the fish playground

Assumes the input number is already on the stack, and returns 0 or 1. It works by multiplying together the first n numbers until that stops being less than the input, and then printing 1 if it equals the input, and 0 if it doesn't.

Source Link
Not a tree
  • 3.2k
  • 1
  • 13
  • 24

><>, 24 bytes

I'm trying a new language (since my Mathematica licence expired...)

01v>{=n;
1$<^!?(}:{:*@:+

Try it online, or at the fish playground

Assumes the input number is already on the stack, and returns 0 or 1. It works by multiplying together the first n numbers until that stops being less than the input, and then printing 1 if it equals the input, and 0 if it doesn't.

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