Skip to main content
added 12 characters in body
Source Link
cleblanc
  • 3.5k
  • 10
  • 16

C (gcc), 3434 29 bytes

f(n){return n%2n=n%2?n==1:f(n?n/-2:2);}

Try it online!Try it online!

C (gcc), 34 bytes

f(n){return n%2?n==1:f(n?n/-2:2);}

Try it online!

C (gcc), 34 29 bytes

f(n){n=n%2?n==1:f(n?n/-2:2);}

Try it online!

deleted 2 characters in body
Source Link
cleblanc
  • 3.5k
  • 10
  • 16

C (gcc), 3534 bytes

f(n){return n%2?n==1:f(n?n/=-2:2);}

Try it online!Try it online!

C (gcc), 35 bytes

f(n){return n%2?n==1:f(n?n/=-2:2);}

Try it online!

C (gcc), 34 bytes

f(n){return n%2?n==1:f(n?n/-2:2);}

Try it online!

deleted 1 character in body
Source Link
cleblanc
  • 3.5k
  • 10
  • 16

C (gcc), 3635 bytes

f(n){return n==0|n%2n%2?n==1:f(n?n/=-2:2);}

Try it online!Try it online!

C (gcc), 36 bytes

f(n){return n==0|n%2?n==1:f(n/=-2);}

Try it online!

C (gcc), 35 bytes

f(n){return n%2?n==1:f(n?n/=-2:2);}

Try it online!

deleted 4 characters in body
Source Link
cleblanc
  • 3.5k
  • 10
  • 16
Loading
deleted 41 characters in body
Source Link
cleblanc
  • 3.5k
  • 10
  • 16
Loading
edited body
Source Link
cleblanc
  • 3.5k
  • 10
  • 16
Loading
Source Link
cleblanc
  • 3.5k
  • 10
  • 16
Loading