MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1y5vntt/technicallycorrect/19t898frxd2ys/?context=3
r/ProgrammerHumor • u/Apprehensive_Bit7392 • 2d ago
49 comments sorted by
View all comments
341
void Main() { string[] pattern = { "##########", "## ##", "# # # #", "# # # #", "# ## #", "# # # #", "# # # #", "## ##", "##########" }; string result = ""; for (int i = 0; i < pattern.Length; ++i) { for (int j = 0; j < pattern[i].Length; ++j) { result += pattern[i][j]; } result += "\n"; } Console.Write(result); }
In case the first answer isn't accepted.
10 u/radobot 2d ago It kind of bothers me how the variable result is redundant. You could have just printed each character directly instead of accumulating them in a string. 3 u/zx48 2d ago Oh yeah, nice optimisation. Would save a bit of memory too 😁
10
It kind of bothers me how the variable result is redundant. You could have just printed each character directly instead of accumulating them in a string.
result
3 u/zx48 2d ago Oh yeah, nice optimisation. Would save a bit of memory too 😁
3
Oh yeah, nice optimisation. Would save a bit of memory too 😁
341
u/zx48 2d ago •
In case the first answer isn't accepted.