38
6
Write a script that works fine when a blank line is present in the flow of program logic, but breaks or causes unexpected behaviour when that line is removed.
Avoid standard loopholes and stupid answers. Your program should do something "useful," even if all it does is add a few integers.
Removing an empty line from a multiline string doesn't count, unless the expected output from that multiline string shouldn't technically change (ie: if you're removing all blank lines matching ^$
).
Whitespace foolery isn't allowed either; don't do weird things with carriage returns, tabs, spaces, etc.
3
I'm voting to close this question as off-topic because underhanded challenges are no longer on-topic on this site. http://meta.codegolf.stackexchange.com/a/8326/20469
– cat – 2016-04-18T02:28:38.2632Are empty lines inside multiline strings counted? – seequ – 2014-06-12T18:39:51.050
11I think you should exclude Whitespace. – nneonneo – 2014-06-12T18:40:23.283
17I think that Whitespace is a "standard loophole" – core1024 – 2014-06-12T18:42:25.383
Updated the question with qualifications. – Naftuli Kay – 2014-06-12T18:43:40.550
5
nneonneo is talking about Whitespace, which is a language that uses only spaces as its syntax.
– Kyle Kanos – 2014-06-12T18:48:43.287Is there any blank line that doesn't match
^$
?! – aditsu quit because SE is EVIL – 2014-06-12T19:03:37.417@aditsu No there is not. – seequ – 2014-06-12T19:12:17.827
@TheRare so that means removing an empty line from a multiline string doesn't count... unless it's a blank line? o_O – aditsu quit because SE is EVIL – 2014-06-12T19:14:45.900
@aditsu My thought exactly. – seequ – 2014-06-12T19:16:02.420
1I'd love to see a solution using Brainfuck. – Nzall – 2014-06-13T09:44:47.003
4"unexpected functionality" is a very good phrase. – Kaz – 2014-06-13T19:16:52.190
"Whitespace foolery isn't allowed either; don't do weird things with carriage returns, tabs, spaces, etc." What's a blank line except but a newline character following another (or other character(s), depending on platform)? – Joshua Taylor – 2014-06-13T20:01:56.980
Acme::Bleach, anyone? – MarnixKlooster ReinstateMonica – 2014-06-15T20:20:20.470
@JoshuaTaylor, if you remove a line in your program that matches
^$
and observe different functionality, that's what we're looking for. A blank line is NOT^\s+$
. – Naftuli Kay – 2014-06-16T17:59:29.987@NaftuliTzviKay It was tongue in cheek response, but the point was that a blank line is something that has to two with whitespace. If removing a blank line makes a difference, then just about by definition it's "whitespace foolery". The
\<newline>
behavior in C, for instance only works when\
is followed by a newline (which is a whitespace) character. It's whitespace foolery. :) – Joshua Taylor – 2014-06-16T18:08:31.427