10
3
This programming puzzle is inspired by another question which has been asked here yesterday but which was deleted by the author...
The challenge:
Create an executable binary (Windows .EXE or Linux binary) using Visual C# (or your favorite C# IDE) which prints the following text to the standard output:
Main() is the main method of C# programs!
... without using the 4 consecutive letters M-A-I-N appearing in any source file!
Notes:
- If your source code contains the text
remainder
(for example) it contains the 4 consecutive letters M-A-I-N, however if it containsmxain
the 4 letters would not be consecutive any more somxain
would be allowed. You are not allowed to run any programs but the C# IDE nor change the settings of the C# IDE to run other programs (but the ones it would normally run such as the C# compiler).
Otherwise you could simply say: "I write a Pascal program using the C# IDE and invoke the Pascal compiler in the 'pre-build' steps of my C# project".
This would be too simple.
Users of an IDE that can be extending using "plug-ins" (or similar) or that have built-in binary file editors (hex-editors) would have a too large advantage over users of other C# IDEs.
Therefore these featrues should also not be used.
- Using the other non-ASCII-Editors (such as the dialog window editor) is explicitly allowed!
- The user asking the original question proposed using the backslash in function names just like this:
static void M\u0061in()
Because this answer has already been read by other users it will not be accepted any more! - A user asked if it would be allowed to simply type in an .EXE file into the source code editor and to save the file as ".exe" instead of ".cs". Answer: I doub't that this is possible because both valid Windows and Linux binaries contain NUL bytes. However if you find a valid binary that can be created this way you have a valid solution.
The name of this site is "Programming Puzzles & Code Golf" - this is a "Programming Puzzle", not "Code Golf": The challenge is to find a working solution before all other users, not to find a solution shorter than all other solutions.
Therefore the first post describing a working solution wins!
Good luck!
By the way: I have a solution working under Visual C# Express 2010.
2What stops me from using my C# IDE as a text (or binary) editor to directly type out an executable? – feersum – 2016-10-19T20:05:10.490
2Which answer wins the challenge? The first valid answer? You should specify the winning condition – James – 2016-10-19T20:07:03.463
If the IDE contains some hexadecimal editor or similar this would NOT be allowed. If you manage to use the ASCII text editor to type in a valid binary file this would be allowed. Note that a valid binary file contains bytes in the range 0x00 to 0x1F! – Martin Rosenau – 2016-10-19T20:08:05.137
@MartinRosenau Then you are disallowing newlines – TuxCrafting – 2016-10-19T20:15:32.367
@TùxCräftîñg 1) Why did you delete your answer? It was not my solution but it was correct! 2) Why disallowing newlines? – Martin Rosenau – 2016-10-19T20:23:33.653
@MartinRosenau It was not deleted by me, others deleted it – TuxCrafting – 2016-10-19T20:24:42.343
2
I think this is overall an interesting challenge. "Write a C# program without main". However, most of the rules are about which tools/IDEs to use and banning certain approaches. I'd love to see more programming puzzles, (as opposed to code-golf) but this one is underspecified. I'd recommend using the sandbox next time.
– James – 2016-10-19T20:24:56.883@MartinRosenau I voted to delete the answer, as it was explicitly against your rules. – AdmBorkBork – 2016-10-19T20:25:52.417
@TimmyD As far as I remember TùxCräftîñg was one of the users discussing about the question yesterday and not the user asking it. Was I wrong? – Martin Rosenau – 2016-10-19T20:30:06.963
@MartinRosenau
\n
is codepoint 0xA – TuxCrafting – 2016-10-19T20:31:59.2704
...Consider the sandbox next time.
– cat – 2016-10-19T21:53:53.720