- You can have as many lines as you want within method
M()
- No single line can be longer than 100 chars
- To get your score, divide the '# of expanded lines' by the '# of original line(s)'
- Based on the default output formatting of https://sharplab.io, no re-formatting allowed!!
- But you can format the intput however you want, i.e. make use of the full 100 chars
- Must compile with no warnings on https://sharplab.io (allows C# 7 features)
- But doesn't have to do anything sensible when run
- You cannot modify the code that is already there, i.e.
public class C {}
andpublic void M()
- Cannot just add
async
topublic void M()
, that's too easy!!
- Cannot just add
- You can add new
using ...
declarations, these do not count towards the line count
using System;
public class C {
public void M() {
// Only allowed to change the code in here
// CAN'T make M() async, that's too easy!!
}
}
If you want to, paste your sharplab.io links below along with the score
Available on sharplab.io
using System;
public class C {
public void M() {
Func<string> test = () => "blah"?.ToString();
}
}
This counts as 1 line of original code (only code inside method M()
is counted)
This expands to 23 lines (again only lines of code inside the braces ({
, }
) of class C
are counted, as formatted by sharplab.io)
Giving a score of 23 / 1 = 23
public class C
{
[CompilerGenerated] // <-- START counting from this line
[Serializable]
private sealed class <>c
{
public static readonly C.<>c <>9;
public static Func<string> <>9__0_0;
static <>c()
{
// Note: this type is marked as 'beforefieldinit'.
C.<>c.<>9 = new C.<>c();
}
internal string <M>b__0_0()
{
return "blah";
}
}
public void M()
{
if (C.<>c.<>9__0_0 == null)
{
C.<>c.<>9__0_0 = new Func<string>(C.<>c.<>9.<M>b__0_0);
}
} // <-- STOP counting at this line
}
I can only get 7.22 in vb 😢
https://sharplab.io/#f:vb>vb/JIWwDg9gTgLgzgAgMoE84wKYgHQGEIA2BGAxjAJYQB2c2A4hlRlOSQLABQoksiq6WbABlyVAI7YAogA8wUDHDiUanbtHjI0mEKvDq+WwQBUAFvICGAE1EBzbEfNwA1nE4AFAK4AjAqwS4CR0RcTgQwhE8fPyQTc3lLZG8EAFlzUQAKAEpQ8NyjKBQc3OKEABFyEAR5OAAGBABeMvSAeQAzZBgWKhtM7AAhdIAiAEFB7I4SsNxzGBITBAxpBGHEGRIMMApqBAB1E0YEOoA+BABGIsmw0ygIAHc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