# Accepting numeric inputs in mixed decimal and unary bases

There seems to be agreement that numeric input is by default accepted in either decimal or unary bases.

The linked meta-question doesn't address the issue of whether separate inputs of the same program can use different bases. For example, consider a program or function that accepts two inputs. Can the first input be in decimal and the second in unary?

The reationale is that choosing the base of each input independently can lead to more efficient programs, or to reduced length in code golf.

• Please don't use meta as a simple poll by posting all the possible opinions. Post yours and let someone who can actually argue for the opposite side actually make a case for it. Feb 3 '16 at 12:11
• @MartinBüttner Sorry. I change that in a minute Feb 3 '16 at 12:12

## No

The rationale for allowing unary input is that for some languages unary is the natural representation of natural numbers. Obvious examples include string-based or tape-based languages. Allowing them to use their natural representation for input reduces unconscious bias against such languages.

That rationale cannot reasonably stretch to mixed input. The argument that taking input in a mixture of forms, some of them "unnatural", allows you to golf your answer better logically extends to arguing that the input format should be such that your program just needs to be eval(input()), and should be treated with the same derision that the latter deserves.

• Allowing an input format that reduces the program to eval is very different from allowing unary. What I'm proposing is let the programmer choose among two, numeric formats. An hypothetical format that only needs to be eval'ed implies letting the programmer choose among an infinite set of non-numeric "formats" Feb 3 '16 at 14:11
• @LuisMendo I think what Peter is saying is that it's a slippery slope, and allowing different bases goes beyond "using a language's natural representation" towards "outsourcing some preprocessing of the data into the input format". Feb 3 '16 at 18:23

# By default, mixed input bases can be used, BUT...

...only if using mixed bases doesn't trivialize0 the problem, and only if the input bases are constant1. My answer is very similar to the common consensus, having the same sort of logic (i.e. wishing to allow esoteric languages to compete but not ruining the challenge entirely) behind it.

0 - trivialize meaning "make the problem a simple task, where the code in question can be thought of as 'abusive' (using a loophole similar to the standard loopholes) or as 'trolling', akin to taking the challenge too literally, solving a considerable amount of work i.e. base conversion by having the user do it, etc.

1 - constant meaning that if you take two arguments a and b in bases c and d, c and d must not change when running the program with different inputs, unless the nature of the problem is to have multi-base inputs.

• What do you mean by constant? Can you ellaborate? Also, "trivialize the problem" is a dangerous term. Someone's "trivializing" may be someone else's "more efficient code" Feb 3 '16 at 12:22
• @LuisMendo constant meaning that if you take two arguments a and b in base s c and d, c and d must bit change when running the program with different inputs, unless the nature of the problem is to have multi base inputs Feb 3 '16 at 12:27
• Got it. I agree with the "constant" part. I suggest you ellaborate in the answer for clarity Feb 3 '16 at 12:30
• It's not at all the same logic. Feb 3 '16 at 13:24
• @CᴏɴᴏʀO'Bʀɪᴇɴ Peter already explained this claim in this answer. Feb 3 '16 at 15:24
• This answer has neither my upvote nor my downvote. Feb 3 '16 at 15:28

# Yes, each input can use a different base (decimal or unary) by default

Of course, the challenge can always override this default.