93
19
It's been a rough few months at work and I feel like I just want to scream right to my boss' face. I am, however, not one to directly confront people I have a problem with. I also don't want to lose my job.
So here's an idea: I want to be able to insult him, without him ever finding out. And I realized the perfect way: I need some sort of software that encodes an insult inside an otherwise perfectly fine message. And seeing as how he's known to not see forests for trees, I think I know just how:
Write me a program that takes as input a string of unknown length, but containing no line breaks. This will be the raw message I want to send.
If possible, return the string formatted such that the message "DIE IN A GREASE FIRE" makes up the entire left column. With new paragraphs where spaces in between words should go. Now, as I am very angry, it is equally important that every letter is in upper case.
You may not modify the string in any other way, i.e. you may not turn all of the string into upper case characters.
If the string in question cannot be formatted in this way, you are to return the original string. Read input from standard input.
Normal rules apply: No HTTP requests, no consulting Marvin from THGTTG, etc.
Example input:
Dear Boss, how are things? It has come to my attention that I received all the blame for the mishap last Friday. Not just the majority of it. Every last bit of it. Is it wrong for me to think that the rest of the team were at least in part responsible? After all, all six of us were involved from the get-go. Not that I think I should stand without blame. Not at all. All I'm saying is this: I do my best. I try hard. I improve constantly. And I am constantly taking responsibility. Generally speaking, I am very okay with taking full responsibility for my actions. But after this spring, it seems I get more than I deserve. Remember the Flakenhauser contract? Everything went down just about as smooth as one could have hoped. Or so it seemed at first. It was just at the very last minute that things fell apart. All of the team agreed that it was more akin to a freak accident than sloppy planning or mismanaged resources. Still, I - alone - took blame for it. Even though I said nothing then, my tolerance level for taking the blame took a serious dent then. From that point on, I have felt it necessary to always try twice as hard, just to escape scrutiny. And still, here we are again. In spite of all my accomplishments. Right where we always seem to end up these days. Every single project. It's becoming unbearable.
Example output:
Dear Boss, how are things?
It has come to my attention that I received all the blame for the mishap last Friday. Not just the majority of it.
Every last bit of it.Is it wrong for me to think that the rest of the team were at least in part responsible? After all, all six of us were involved from the get-go.
Not that I think I should stand without blame. Not at all.All I'm saying is this: I do my best. I try hard. I improve constantly. And I am constantly taking responsibility.
Generally speaking, I am very okay with taking full responsibility for my actions. But after this spring, it seems I get more than I deserve.
Remember the Flakenhauser contract.
Everything went down just about as smooth as one could have hoped. Or so it seemed at first. It was just at the very last minute that things fell apart.
All of the team agreed that it was more akin to a freak accident than sloppy planning or mismanaged resources.
Still, I - alone - took blame for it.
Even though I said nothing then, my tolerance level for taking the blame took a serious dent then.From that point on, I have felt it necessary to always try twice as hard, just to escape scrutiny. And still, here we are again.
In spite of all my accomplishments.
Right where we always seem to end up these days.
Every single project. It's becoming unbearable.
This is code golf. Shortest code wins.
Can we assume that there will be no control characters at all in the string? – Titus – 2016-12-20T01:23:55.597
4Do the line breaks have to occur only after sentence-ending punctuation? Or could I have a line break, before some proper now or maybe even within an abbreviation, as long as the following letter is upper case? That being said, insult-related challenges didn't fare well here in the past, but you might be able to get away, because you didn't ask for the participants' creativity in coming up with new obscenities. – Martin Ender – 2014-06-19T09:43:18.403
1Line breaking before proper nouns is perfectly fine. – Christofer Ohlsson – 2014-06-19T09:46:41.753
Just to make sure, does that line break apply also to new paragraphs (for a space in the hidden sentence)? Could that
I
in the wordIN
come from the middle of a sentence? – Tal – 2014-06-19T09:48:13.767The I in IN can come from the middle of a sentence, as long as the I was in upper case in the original input. – Christofer Ohlsson – 2014-06-19T09:53:33.527
I really hope that your boss is as incapable of "seeing the forest through the trees" as you say, because that insult is not that well hidden. – Nzall – 2014-06-19T10:08:44.620
3@NateKerkhofs I think it's backwards: since the secret message is just a few characters in an entire message, I think that the insult is the trees, and the message is the forest. We really hope that the boss sees the forest, not the trees. – Joshua Taylor – 2014-06-19T16:40:39.013
11
Was Arnold Schwarzenegger's letter your inspiration?
– 200_success – 2014-06-19T19:46:16.640Can we break words? For example, could "FIFA" be used for its "I"? – Dennis – 2014-06-19T22:23:50.777
@Dennis No. This is part of what I meant by not modifying the original string in any other way. – Christofer Ohlsson – 2014-06-20T05:59:11.013
@200_success good old Arnie did spring to mind! – Christofer Ohlsson – 2014-06-20T05:59:38.313
57I must admit I did a bit of a double-take when I saw this in the Hot Questions list. When I saw it was PCG and not The Workplace...well...I won't say I wasn't a little disappointed. – BenM – 2014-06-20T07:21:47.920
@ChristoferOlsson: I initially interpreted your question that way, but it only says "format", not how, and at least one other answer interpreted it differently. Thanks for clearing that up.
– Dennis – 2014-06-20T16:53:15.197@Dennis: I did ponder these things somewhat before posting, but it seems I didn't do that enough. A lesson for future golfing questions I might ask. – Christofer Ohlsson – 2014-06-21T08:57:17.763