Post History
Get ready for a comparatively dry question - this is intended to be one of the "the"s of the code-golfing dictionary. Create a program which inputs a base 10 non-negative whole number (without lea...
#2: Post edited
- Get ready for a comparatively dry question - this is intended to be one of the "the"s of the code-golfing dictionary.
Create a program which inputs a base 10 non-negative whole number (without leading 0s) and outputs something if the number is odd or something else if the number is even.- The odd and even outputs can be whatever you want, so long as the output for a specific parity will stay the same no matter what number of that parity is inputted.
- One of the outputs can be absolutely nothing (0 characters) so long as the other output isn't nothing - one or both of the outputs can be printed through STDERR as long as the erroring output is constant for its parity (doesn't change depending on what numbers of a parity you feed it).
- Shortest code following the rules wins.
- Get ready for a comparatively dry question - this is intended to be one of the "the"s of the code-golfing dictionary.
- Create a program which inputs a base 10 non-negative whole number (without leading 0s) and outputs something if the number is odd or something else if the number is even.
- You MUST input through STDIN unless your language doesn't have input facilities, in which case you may make a function for the purpose.
- The odd and even outputs can be whatever you want, so long as the output for a specific parity will stay the same no matter what number of that parity is inputted.
- One of the outputs can be absolutely nothing (0 characters) so long as the other output isn't nothing - one or both of the outputs can be printed through STDERR as long as the erroring output is constant for its parity (doesn't change depending on what numbers of a parity you feed it).
- Shortest code following the rules wins.
#1: Initial revision
Evens or Odds - you know this one
Get ready for a comparatively dry question - this is intended to be one of the "the"s of the code-golfing dictionary. Create a program which inputs a base 10 non-negative whole number (without leading 0s) and outputs something if the number is odd or something else if the number is even. The odd and even outputs can be whatever you want, so long as the output for a specific parity will stay the same no matter what number of that parity is inputted. One of the outputs can be absolutely nothing (0 characters) so long as the other output isn't nothing - one or both of the outputs can be printed through STDERR as long as the erroring output is constant for its parity (doesn't change depending on what numbers of a parity you feed it). Shortest code following the rules wins.