15
4
Given the following C# program outputting False
, inject a 'malicious' line of code such that the program outputs True
.
class Program
{
static void Main()
{
System.Console.Write("False");
;
}
}
Your answer should consist of a string that replaces the second semicolon, and causes the program to output True
, the whole True
and nothing but True
(not even a newline). It must do this if stdout is printed to the console, and if stdout is redirected to a file.
The shortest answer wins.
What's your objective winning criterion? – J B – 2014-01-03T14:14:21.787
@JB Do puzzles need a winning criterion? Will edit. – Kendall Frey – 2014-01-03T14:15:13.773
I'm mostly reacting to the code-golf remark, but the point stands: which will be the accepted answer? – J B – 2014-01-03T14:16:16.580
@JB Shortest answer is best answer. – Kendall Frey – 2014-01-03T14:16:57.437
Well it is code-golf, then, isn't it? – J B – 2014-01-03T14:18:23.903
@JB That's kind of a secondary goal, but I suppose I should add the tag. – Kendall Frey – 2014-01-03T14:19:16.240
I've added an additional criterion and changed it to
Write
instead ofWriteLine
– Kendall Frey – 2014-01-03T15:09:51.823