0
\$\begingroup\$

Recently, there have been some challenges involving the OEIS. Specifically, when given an index as input, the challenge spec involves output the item in the OEIS at that index. However, for constant sequences, there have been answers that discard the input because it is not needed to calculate the result.

Are answers allowed to not take input that is in the spec?

\$\endgroup\$
10
  • \$\begingroup\$ They should take input and ignore it / not use it \$\endgroup\$
    – Mr. Xcoder
    Commented Aug 8, 2017 at 20:42
  • \$\begingroup\$ @Mr.Xcoder that is my question. Do they actually have to take the input? If you are implementing A000012 in Python, do you ever have to call input()? Because some answers were saying "no" since they ignore it anyway and it's golfier not to. \$\endgroup\$
    – Stephen
    Commented Aug 8, 2017 at 20:44
  • \$\begingroup\$ @StepHen Just pretend it takes the input as argument and don't use it :p \$\endgroup\$
    – dzaima
    Commented Aug 8, 2017 at 20:46
  • \$\begingroup\$ @dzaima ok, but generally? What about languages without command line arguments, or something like this fiddle? \$\endgroup\$
    – Stephen
    Commented Aug 8, 2017 at 20:47
  • 1
    \$\begingroup\$ Whether a program takes input or not is a non-observable requirement. \$\endgroup\$
    – Riley
    Commented Aug 8, 2017 at 20:48
  • \$\begingroup\$ Related. \$\endgroup\$ Commented Aug 8, 2017 at 20:49
  • \$\begingroup\$ @StepHen I was debating whether to add two examples, the other being JS without function parameter :p I see no reason why that would be invalid ever really, and it can be accessed with arguments[0] anyway. \$\endgroup\$
    – dzaima
    Commented Aug 8, 2017 at 20:51
  • \$\begingroup\$ related. I think this is a dupe but I'm still looking for the post. \$\endgroup\$
    – Wheat Wizard Mod
    Commented Aug 8, 2017 at 21:00
  • \$\begingroup\$ @WheatWizard it's the opposite (I think) \$\endgroup\$
    – Stephen
    Commented Aug 8, 2017 at 21:02
  • 1
    \$\begingroup\$ here it is \$\endgroup\$
    – Wheat Wizard Mod
    Commented Aug 8, 2017 at 21:05

1 Answer 1

1
\$\begingroup\$

No, answers do not need to explicitly take input.

If the output of the program matches the desired result for the given input (even though the program does not make a call to the input (e.g: input() in Python), the answer is correct. Unless specified otherwise (i.e, a spec like the programs must use the given input in some way), every submission that gives correct results should be considered valid.

\$\endgroup\$
1
  • \$\begingroup\$ Here is an answer for which this applies (and is well-received). \$\endgroup\$
    – Mr. Xcoder
    Commented Aug 8, 2017 at 20:51

Not the answer you're looking for? Browse other questions tagged .