Skip to main content
added 50 characters in body
Source Link
Esolanging Fruit
  • 15.5k
  • 4
  • 49
  • 92

><>, 3030 28 bytes

-2 bytes thanks to lanlock4

Assumes input is on the stack. Outputs either a 1 or 0.

1v0v
 <+1~v1<~v!?(}:{:,2*+1::+
 ;n=n={<<;

This was fun. I'm new to ><>, and I'd welcome any suggestions for golfing.

This starts with n=1, then continually increments n while n(n-1)/2 is less than the input number. Once the loop terminates, it prints 1 if n(n-1)/2 is equal to the input number, 0 otherwise.

><>, 30 bytes

Assumes input is on the stack. Outputs either a 1 or 0.

1v
 <+1~v!?(}:{:,2*+1::
 ;n={<

This was fun. I'm new to ><>, and I'd welcome any suggestions for golfing.

This starts with n=1, then continually increments n while n(n-1)/2 is less than the input number. Once the loop terminates, it prints 1 if n(n-1)/2 is equal to the input number, 0 otherwise.

><>, 30 28 bytes

-2 bytes thanks to lanlock4

Assumes input is on the stack. Outputs either a 1 or 0.

0v
1<~v!?(}:{:,2*+1::+
n={<;

This was fun. I'm new to ><>, and I'd welcome any suggestions for golfing.

This starts with n=1, then continually increments n while n(n-1)/2 is less than the input number. Once the loop terminates, it prints 1 if n(n-1)/2 is equal to the input number, 0 otherwise.

Source Link
Esolanging Fruit
  • 15.5k
  • 4
  • 49
  • 92

><>, 30 bytes

Assumes input is on the stack. Outputs either a 1 or 0.

1v
 <+1~v!?(}:{:,2*+1::
 ;n={<

This was fun. I'm new to ><>, and I'd welcome any suggestions for golfing.

This starts with n=1, then continually increments n while n(n-1)/2 is less than the input number. Once the loop terminates, it prints 1 if n(n-1)/2 is equal to the input number, 0 otherwise.