Skip to main content
added 588 characters in body
Source Link
user41805
  • 13.2k
  • 6
  • 42
  • 88

V, 8 77 6 bytes

Àé1$òhDÀé1òhD

Try it online!Try it online!

Outputs 1 for odd numbers and nothing (an empty string) for even numbers.

Àé1                   " argument times insert a 1
                      " this converts input to unary
                      " and now the cursor is at the end of the line
   ò                  " recursively do:
    h                 "  move 1 to the left and
     D                "  delete everything from the cursor to the end of the line
                      "  this effectively removes 2 characters at once until
                      "  a breaking error occurs at which point
                      " implicit ending ò

V, 8 7 bytes

Àé1$òhD

Try it online!

Outputs 1 for odd numbers and nothing (an empty string) for even numbers.

V, 8 7 6 bytes

Àé1òhD

Try it online!

Outputs 1 for odd numbers and nothing (an empty string) for even numbers.

Àé1                   " argument times insert a 1
                      " this converts input to unary
                      " and now the cursor is at the end of the line
   ò                  " recursively do:
    h                 "  move 1 to the left and
     D                "  delete everything from the cursor to the end of the line
                      "  this effectively removes 2 characters at once until
                      "  a breaking error occurs at which point
                      " implicit ending ò
added 5 characters in body
Source Link
user41805
  • 13.2k
  • 6
  • 42
  • 88

V, 88 7 bytes

Àé1$òhDòÀé1$òhD

Try it online!Try it online!

Outputs 1 for odd numbers and nothing (an empty string) for even numbers.

V, 8 bytes

Àé1$òhDò

Try it online!

Outputs 1 for odd numbers and nothing (an empty string) for even numbers.

V, 8 7 bytes

Àé1$òhD

Try it online!

Outputs 1 for odd numbers and nothing (an empty string) for even numbers.

Source Link
user41805
  • 13.2k
  • 6
  • 42
  • 88

V, 8 bytes

Àé1$òhDò

Try it online!

Outputs 1 for odd numbers and nothing (an empty string) for even numbers.