The question Find i^n, given n does not clearly state whether the solution must be a compilable program or can be an expression, neither does it identify where the input shall come from.

This leads to answers like this, which are a mixture of both and neither short nor compilable.

For verbose languages like C#, are LinqPad C# expressions encouraged in ? If so, how to get the needed input?

A solution like

"i,-1,-i,1".Split(',')[n%4]


is nice and short and can compete with several other answers. But n would need to be replaced by the actual number, which increases the length. Is that allowed and by definition we count n just as 1 character?

Edit

There are 38 LinqPad answers already, applying the rules more or less lax. From the top-voted ones:

• This one might be ok, because it does not need input, but prints output to the LinqPad STDOUT if you like
• That uses a string as input but does not count it as characters
• This follows my example above
• Another approach seems to be a function that uses LinqPad specific methods (.Dump())
• This takes advantage of missing usingstatements in LinqPad
• Related: Code Golf Input Output Methods Mar 5 '15 at 22:31
• You've just answered your own question with that link. The other relevant poll was this one. We've got accepted defaults on these matters, which are also listed on the code-golf tag wiki. Any answer may overrule these defaults, but if it doesn't then they apply. In particular, the current consensus is that snippets are not allowed. Mar 5 '15 at 22:33
• @MartinBüttner: If it is a function, I guess it does not need the access modifier like in the linked i^n answer. Mar 5 '15 at 22:37
• Does it not? Is it a mandatory part of a function definition in C#? Mar 5 '15 at 22:40
• @MartinBüttner: By default it is private, but you can still call it from within your own program. Mar 5 '15 at 22:43
• Yes, I'd say that's fine then. Mar 5 '15 at 22:44