The Curious Case of Steve Ballmer

46

5

Steve Ballmer is the ex-CEO of Microsoft, and in a recent article, claimed that he "still does not know what he did wrong with mobile".

As CodeProject's newsletter pointed out, "That article's title could be ended at so many spots and still be accurate".

Given no input, output the following:

Steve Ballmer still does not know.
Steve Ballmer still does not know what he did.
Steve Ballmer still does not know what he did wrong.
Steve Ballmer still does not know what he did wrong with mobile.

This must be outputted exactly as shown, and must be the only output of your program. You may include a single trailing newline.

This is so fewest bytes in each language wins

Skidsdev

Posted 2017-06-01T12:19:45.920

Reputation: 9 656

59When I saw the title / tags I thought that the output would be developers developers ... – Rod – 2017-06-01T12:30:41.373

15tcl, 25while 1 {puts developers}demo – sergiol – 2017-06-01T13:29:09.227

8braingolf, 23 - 1"developers "[!@11 1>] :P – Skidsdev – 2017-06-01T13:31:09.307

16

And I thought of xkcd's Ballmer Peak

– ojdo – 2017-06-01T15:51:44.813

Can we output a multiline string containing that? i.e. the actual output of our program is "Steve Ballmer still does not know.\n...Steve Ballmer still does not know what he did wrong with mobile.\n" – Rɪᴋᴇʀ – 2017-06-01T17:11:18.970

I don't suppose you'd allow a leading space on each line? – Shaggy – 2017-06-01T18:19:56.237

@Riker sure you can – Skidsdev – 2017-06-02T15:05:59.717

@Shaggy nope, no trailing whitespace – Skidsdev – 2017-06-02T15:06:06.317

But what about leading, Mayube?! ;) – Shaggy – 2017-06-02T15:11:00.680

@Shaggy I was already going to say no, but now you get a triple no for that godaweful pun. – Skidsdev – 2017-06-02T15:12:51.903

@Mayube Is there an optional trailing new-line, or is it required? – wizzwizz4 – 2017-06-03T18:40:31.190

@wizzwizz4 optional – Skidsdev – 2017-06-03T20:22:37.650

1I'm surprised there's no MS powershell attempt. – Criggie – 2017-06-04T01:08:02.743

5yes, 14yes developers – sergiol – 2017-06-06T00:12:21.643

pyth, 13 -- #"developers – Tornado547 – 2017-12-12T02:56:36.253

actually you need p to print sans trailing newlines #p"developers so 14 bytes – Tornado547 – 2017-12-12T02:59:15.930

1@tfbninja it wasn't a codeproject article, just a general tech news article they sent out in their daily newsletter a few months back. They always add a witty little subtitle beneath the titles of all the articles in the newsletter, that's the source of the challenge – Skidsdev – 2017-12-12T21:45:36.917

Answers

26

Python 3, 100 99 99 97 bytes

-1 byte thanks to ovs
-1 byte thanks to Jonathan Allan
-1 byte thanks to Dennis

for i in b'!-3?':print('Steve Ballmer still does not know what he did wrong with mobile'[:i]+'.')

Try it online!

Rod

Posted 2017-06-01T12:19:45.920

Reputation: 17 588

17

05AB1E, 50 49 45 44 bytes

4 bytes saved with inspiration from Kevin's Java answer

„€Ž†©'–Ñ…€À€½ƒ§“mer„â‚à€–ƒ€“”™¸ïß”[Žì'.«=¨ð«

Try it online!

Explanation

„€Ž†©                                         # push "with mobile"
     '–Ñ                                      # push "wrong"
        …€À€½ƒ§                               # push "what he did"
               “mer„â‚à€–ƒ€“                  # push "mer still does not know"
                            ”™¸ïß”            # push "Steve Ball"
                                  [Ž          # loop until stack is empty
                                    ì         # prepend the top string to the 2nd top string
                                     '.«      # append a dot
                                        =     # print without popping
                                         ¨    # remove the dot
                                          ð«  # append a space

Emigna

Posted 2017-06-01T12:19:45.920

Reputation: 50 798

Oh nice, managed to use dictionary compression for everything but Ballmer? – Skidsdev – 2017-06-01T12:29:57.963

@Mayube: Yeah. I got it partially now (ball) to save a byte by restructuring the original string :) – Emigna – 2017-06-01T12:31:25.767

looks much better now, if only you could compress that mer – Skidsdev – 2017-06-01T12:35:22.263

@Mayube: I could hide it by compressing me but unfortunately that wouldn't save any bytes :/ – Emigna – 2017-06-01T14:13:33.003

This is 97 bytes by my count. – Stig Hemmer – 2017-06-02T09:45:20.160

2

@StigHemmer: It is 44 bytes in the 05AB1E code page

– Emigna – 2017-06-02T11:04:55.757

what about compressing mermaid and then subtracting maid? – NH. – 2020-02-25T15:45:43.440

17

Haskell, 96 bytes

(++".\n")=<<scanl(++)"Steve Ballmer still does not know"[" what he did"," wrong"," with mobile"]

Try it online!

scanl is like foldl (or reduce as it is called in other languages) except it returns a list of all intermediate results instead of just the final one. Each intermediate result is appended with ".\n" and all of them are concatenated into a single string.

nimi

Posted 2017-06-01T12:19:45.920

Reputation: 34 639

15

Retina, 82 75 bytes

Thanks to Neil for saving 7 bytes.

Byte count assumes ISO 8859-1 encoding.


Steve Ballmer still does not know what he did wrong with mobile.
 w
.¶$`$&

Try it online!

Explanation


Steve Ballmer still does not know what he did wrong with mobile.

Initialise the working string to the full headline.

 w
.¶$`$&

As pointed out by Neil, all three truncations are made before a word starting with w, and there are no other words starting with w. So we match a space followed by a w to find the truncation points. At these points, we insert the following:

  • , a period and a linefeed to truncate the sentence and begin a new one.
  • $`, the entire string in front of the match, so that the next sentence starts over from the beginning.
  • $&, the space and w again, so that they're also part of the next sentence.

We don't need to match the mobile explicitly, because that will simply be what's left over on the third match.

Martin Ender

Posted 2017-06-01T12:19:45.920

Reputation: 184 808

3You only need to match on <space>w and replace with .¶$`$&. – Neil – 2017-06-01T13:00:35.437

@Neil Oh, that's really neat, thank you. :) – Martin Ender – 2017-06-01T13:01:18.033

9

PHP, 104 95 94 bytes

<?=$a="Steve Ballmer still does not know",$a=".
$a what he did",$a.=" wrong",$a?> with mobile.

user63956

Posted 2017-06-01T12:19:45.920

Reputation: 1 571

1Missing "what"? – TheLethalCoder – 2017-06-01T13:04:16.653

8

///, 88 bytes

8 bytes saved by @MartinEnder!

/1/Steve Ballmer still does not know//2/1 what he did//3/2 wrong/1.
2.
3.
3 with mobile.

Try it online!

steenbergh

Posted 2017-06-01T12:19:45.920

Reputation: 7 772

1

You can save a bit more by moving the previous prefix into each substitution: https://tio.run/##BcHBDcMgEATAP1VsBawAV5AWUgEWp4B8BsmHTPlkxjRbFdubgd8pr@CTVW95YLOpogwx9DFx9bHIyIBV80QVlFbIxIj1jP4jDyasNivucTYVBu@id8m7w@/9Bw

– Martin Ender – 2017-06-01T13:06:35.960

@MartinEnder That's particularly clever. Thanks! – steenbergh – 2017-06-01T13:08:43.303

5@MartinEnder "Yes, I'll have a nr. 3 with mobile, please." – steenbergh – 2017-06-01T13:11:51.343

7

Java 8, 127 126 bytes

()->{String t="Steve Ballmer still does not know",d=".\n";return t+d+(t+=" what he did")+d+(t+=" wrong")+d+t+" with mobile.";}

-1 byte thanks to @KonstantinCh.

Try it here.

Kevin Cruijssen

Posted 2017-06-01T12:19:45.920

Reputation: 67 575

1Hope you don't mind that I stole your idea, it's much better than my looping approach. – TheLethalCoder – 2017-06-01T12:38:04.393

@TheLethalCoder No problem at all, since I see you've credited me. :) Btw, string can't be var in your C# lambda? – Kevin Cruijssen – 2017-06-01T12:40:50.657

No because I'm declaring multiple at once. – TheLethalCoder – 2017-06-01T12:42:16.230

@TheLethalCoder Ah of course, my bad.. And ()=>{var t="Steve Ballmer still does not know";return t+".\n"+(t+=" what he did")+".\n"+(t+=" wrong")+".\n"+t+" with mobile"+".";}; is unfortunately three bytes longer. – Kevin Cruijssen – 2017-06-01T12:45:13.277

True but see my new version, you can probably make use of it too to save some bytes. – TheLethalCoder – 2017-06-01T12:49:26.587

Can you use verbatim strings like @Shaggy's answer to save bytes? – TheLethalCoder – 2017-06-01T13:16:25.250

@TheLethalCoder Nope, verbatism-Strings aren't not possible in Java without String.format. As for your previous comment, I could do (124 bytes): ()->m.c(33)+m.c(45)+m.c(51)+m.c(63)n->"Steve Ballmer still does not know what he did wrong with mobile".substring(0,n)+".\n" (where m is the anonymous function's interface), but if I'm not mistaken I've read in Meta that you aren't allowed to have > 1 anonymous function. So it would be ()->c(33)+c(45)+c(51)+c(63)String c(int n){"Steve Ballmer still does not know what he did wrong with mobile".substring(0,n)+".\n";} instead, which is 131 bytes. – Kevin Cruijssen – 2017-06-01T13:24:21.190

Have you got a link to that meta post? I've used multiple anonymous methods in answers a few times. – TheLethalCoder – 2017-06-01T13:25:44.553

Let us continue this discussion in chat.

– Kevin Cruijssen – 2017-06-01T13:33:00.083

1Konstantin Ch suggests changing the "+d at the end to ." to save a byte as the final linefeed is optional. – Martin Ender – 2017-06-02T10:53:00.757

7

05AB1E, 46 bytes

”™¸ïßme”“r„â‚à€–ƒ€“«…€À€½ƒ§'–Ñ„€Ž†©).pvyðý'.«»

Try it online!

Erik the Outgolfer

Posted 2017-06-01T12:19:45.920

Reputation: 38 134

This is 98 bytes by my count. – Stig Hemmer – 2017-06-02T09:46:08.367

@StigHemmer 05AB1E uses its own code-page with 256 bytes, which encodes each character to a single byte. Hence the 46 bytes, even though it's a lot more bytes in basic UTF-8 encoding.

– Kevin Cruijssen – 2017-06-02T12:06:03.313

6

Jelly, 52 46 bytes

“ṬċḌ)⁹œḃṣ⁷Ṅḋ%W3Œƭ;ḷẓ“£Ṿ⁴'Þḣ~ẉ“¥Ị)“Ṡ8gÐ/»;\p”.Y

Credits for ṬċḌ)⁹œḃṣ⁷Ṅḋ%W3Œƭ;ḷẓ go to @EriktheOutgolfer, who used it in his answer.

Try it online!

How it works

The lion share of the work is done by Jelly's dictionary compression here.

ṬċḌ)⁹œḃṣ⁷Ṅḋ%W3Œƭ;ḷẓ

encodes

Steve| Ball|mer| still| do|es| no|t| know

there | indicates boundaries between words that where fetched from the dictionary and strings that were encoded character by character (mer, es, and t).

Similarly, £Ṿ⁴'Þḣ~ẉ encodes  what| he| did (surprisingly, he does not come from the dictionary), ¥Ị) encodes  wrong, and Ṡ8gÐ/ encodes  with| mobile.

“ṬċḌ)⁹œḃṣ⁷Ṅḋ%W3Œƭ;ḷẓ“£Ṿ⁴'Þḣ~ẉ“¥Ị)“Ṡ8gÐ/»

thus yields the string array

“Steve Ballmer still does not know“ what he did“ wrong“ with mobile”

;\ cumulatively reduces by concatenation, building the phrases on each line.

Finally, p”. computes the Cartesian product of these phrases and the dot character, and Y separates the resulting sentences by linefeeds.

Dennis

Posted 2017-06-01T12:19:45.920

Reputation: 196 637

By my count this is 97 bytes. – Stig Hemmer – 2017-06-02T09:42:12.373

@StigHemmer In UTF-8, it would be. However, Jelly also supports this single-byte character set.

– Dennis – 2017-06-02T11:48:56.087

6

JavaScript (ES6), 102 bytes

_=>(s="Steve Ballmer still does not know")+`.
${s+=" what he did"}.
${s+=" wrong"}.
${s} with mobile.`

Try it

o.innerText=(
_=>(s="Steve Ballmer still does not know")+`.
${s+=" what he did"}.
${s+=" wrong"}.
${s} with mobile.`
)()
<pre id=o>

Shaggy

Posted 2017-06-01T12:19:45.920

Reputation: 24 623

Nice approach I have "borrowed" it for my C# answer. – TheLethalCoder – 2017-06-01T13:15:14.603

1Maybe I don't understand the rules of the game, but this function only works correctly if you're in a browser and using the pre tag innertext like you did. So isn't that more than 102 bytes, since it depends on the o.innerText= and the <pre id="o"> and actually getting ahold of the element? – Paul – 2017-06-04T18:46:33.793

@Paul I know this is old but, an anonymous function is acceptable form of I/O as an entry, so as long as it returns the expected data, it doesn't need to display it directly. – Dom Hastings – 2018-02-20T16:43:27.273

6

C (gcc), 112 bytes

f(){printf("%.33s.\n%1$.45s.\n%1$s.\n%1$s with mobile.","Steve Ballmer still does not know what he did wrong");}

Try it online!

Dennis

Posted 2017-06-01T12:19:45.920

Reputation: 196 637

5

C (gcc), 124 122 bytes

#define A"Steve Ballmer still does not know"
#define B".\n"A" what he did"
f(){puts(A B B" wrong"B" wrong with mobile.");}

Try it online!

Giacomo Garabello

Posted 2017-06-01T12:19:45.920

Reputation: 1 419

You can remove the spaces between A and B, and the strings that define them. – Dennis – 2017-06-01T20:16:03.787

4

Retina, 95 86 bytes

:`
Steve Ballmer still does not know.
:`.$
 what he did.
:`.$
 wrong.
.$
 with mobile.

Try it online! Edit: Saved 9 bytes by switching from outputting parts of the whole string to building up the string in pieces. The :` is needed on the first three stages to make them output.

Neil

Posted 2017-06-01T12:19:45.920

Reputation: 95 035

ooh that's clever, deleting everything between the w and e, then deleting everything between the wr and e, then wi and e. Not super golfy due to Retina's newline-iness, but definitely cool nontheless – Skidsdev – 2017-06-01T12:37:04.970

@Mayube Turned out to be not very golfy at all, so I've switched methods. (Still not as cool as Martin Ender's answer though.) – Neil – 2017-06-01T19:00:58.570

3

C#, 158 128 120 114 bytes

()=>{var s="Steve Ballmer still does not know";return s+$@".
{s+=" what he did"}.
{s+=" wrong"}.
 with mobile.";};

Saved 30 bytes thanks to @KevinCruijssen.
Saved 6 bytes thanks to @Shaggy.


Version using sub-stringing for 120 bytes:

s=n=>"Steve Ballmer still does not know what he did wrong with mobile".Substring(0,n)+".\n";()=>s(33)+s(45)+s(51)+s(63);

Version borrowed from @KevinCruijssen for 128 bytes:

()=>{string t="Steve Ballmer still does not know",d=".\n";return t+d+(t+=" what he did")+d+(t+=" wrong")+d+t+" with mobile"+d;};

Version using looping for 158 bytes:

()=>{var r="";for(int i=0;++i<5;)r+=$"Steve Ballmer still does not know{(i>1?$" what he did{(i>2?$" wrong{(i>3?" with mobile":"")}":"")}":"")}.\n";return r;};

Simple approach using ternary statements to in a loop to append the new parts onto the string each time.

TheLethalCoder

Posted 2017-06-01T12:19:45.920

Reputation: 6 930

As an aside, it's worth noting that this only works for C# >= 6 as earlier versions don't have interpolated strings – Skidsdev – 2017-06-01T12:30:59.533

@Mayube True, but I'm golfing this to use Kevin's approach at the moment as that is a lot better than mine haha – TheLethalCoder – 2017-06-01T12:32:42.573

Gotta golf 2 more bytes so you can beat the java answer D: – Skidsdev – 2017-06-01T12:40:55.573

@Mayube The Java answers usually beat C# because they don't include a trailing semi-colon. Is always annoying! – TheLethalCoder – 2017-06-01T12:42:51.103

@Mayube Done it, for the time being at least... – TheLethalCoder – 2017-06-01T12:50:26.563

@TheLethalCoder Nice approach +1. I don't think I can outgolf this in Java, because you can do ()=> as inner method, and I have to define the entire lambda as well which raises the byte-count by a lot. – Kevin Cruijssen – 2017-06-01T12:52:40.653

@KevinCruijssen Well I'm compiling to two separate anonymous functions where one just calls the other, I'd assume you could use that idea too. – TheLethalCoder – 2017-06-01T12:54:19.150

3

Bash, 111 109 107 bytes

a=(Steve Ballmer still does not know "what he did" wrong with\ mobile)
for i in {6..9};{ echo ${a[@]::i}.;}

Try it online!

DrnglVrgs

Posted 2017-06-01T12:19:45.920

Reputation: 145

3

Japt, 70 68 65 61 60 59 bytes

Contains a few characters that won't display here; follow the link below to see the full code.

`Sve Ba¥´r Ð]l º not know
 Ø  ¹d
 Ùg
 ØP ¶ßè`£'.iP±X}R

Try it online

  • 3 4 bytes saved thanks to ETH, plus another 4 with some prompting.

Explanation

Everything between the 2 backticks is a compressed string of the following:

Steve Ballmer still does not know
 what he did
 wrong
 with mobile
`...`             :Decompress the string.
     £       }R   :Map over the each line X in the string
         P±X      :   Append X to P (initially the empty string)
      '.i         :   Prepend that to the string "."

Shaggy

Posted 2017-06-01T12:19:45.920

Reputation: 24 623

1Nice. You can save some bytes by doing [`Sve Ba¥´r Ð]l º not know`` Ø ¹d`` Ùg`` ØP ¶ßè.`]m@P+=X}, then a couple more bytes that involves removing the [ and ] (I'll let you figure that one out). – ETHproductions – 2017-06-01T15:40:04.070

Nice one, @ETHproductions. Took me a couple of minutes to decipher that between the compression and characters SE doesn't display but I got there and now I think I see the other saving you're hinting at too. – Shaggy – 2017-06-01T15:50:41.100

1You may be better off if you remove the splitting and joining, and instead do £P±X +'.}R at the end – ETHproductions – 2017-06-01T16:08:11.130

@ETHproductions, it still comes in at 61 bytes, but it's definitely neater; gets rid of the need for the trailing newline. EDIT: Oh, wait, no, I can save 1 byte with that approach :) – Shaggy – 2017-06-01T16:13:29.157

3

Fission, 299 291 269 bytes

MN"."                             ]              ]        ]
                                  W$]            W$$]     W$$$]
R"Steve Ballmer still does not know"%[" what he did"%[" wrong"%[" with mobile.";
                                    [W              [W        [W

Try it online!

Finally a 2D language I understand!

Explanation

Program spawns an atom with 1 mass and 0 energy (a 1:0 atom)at the R on line 3, and begins moving to the right.

"Steve Ballmer still does not know" prints each character.

% moves the atom up if it has 0 energy, or decrements it's energy and moves it down.

] moves the atom to the left, $ increments the atom's energy, W moves the atom up.

Once the atom is on the top row, it moves to the left, until it reaches ".", which prints a period, N, which prints a newline, and finally M, which moves the atom down to the R again, which subsequently moves the atom to the right.

Each loop the atom's energy is one higher, meaning it will pass through one more %. After the 4th loop it reaches the ; at the end of the third line, which destroys the atom. The program terminates once all atoms are destroyed.

Skidsdev

Posted 2017-06-01T12:19:45.920

Reputation: 9 656

Could you add an explanation? – Shaggy – 2017-06-01T18:15:08.780

@Shaggy will do – Skidsdev – 2017-06-02T07:50:43.013

You can compress the top a lot more: 209 bytes.

– KSmarts – 2017-12-11T16:05:29.067

3

Vim, 79 keystrokes

iSteve Ballmer still does not know.<CR><C-x><C-l><Backspace> what he did.<CR><C-x><C-l><Backspace> wrong.<CR><C-x><C-l><Left> with mobile

<C-x><C-l> auto-completes with the previous line. Alternatively you can replace every occurrence of <CR><C-x><C-l> with <Esc>o<C-a>

BlackCap

Posted 2017-06-01T12:19:45.920

Reputation: 3 576

3

CJam, 79 bytes

4{)"Steve Ballmer still does not know
hat he did
rong
ith mobile"N/<" w"*'.+N}%

Try it online!

Erik the Outgolfer

Posted 2017-06-01T12:19:45.920

Reputation: 38 134

wow, interesting pattern find – Destructible Lemon – 2017-06-01T23:57:24.457

3

Ruby, 94 bytes

"!-3Z".bytes{|i|puts"Steve Ballmer still does not know what he did wrong with mobile"[0,i]+?.}

Iterates through the 4 characters in the first string, converting each to its ascii value n and outputting the first n characters of the second string each time. It really does not matter what the last character of the first string is, so long as its ascii value is equal or greater than the length of the second string.

Level River St

Posted 2017-06-01T12:19:45.920

Reputation: 22 049

2

PHP, 116 Bytes

for(;$i<4;)echo"Steve Ballmer still does not know",["",$t=" what he did",$t.=" wrong","$t with mobile"][+$i++],".

";

Try it online!

Jörg Hülsermann

Posted 2017-06-01T12:19:45.920

Reputation: 13 026

2

SOGL, 42 bytes

⁹⁴<>‘υG‘Γω/w¹‘O‛Æw▓½0H(æ█◄K∆2Ξgh‘4{Tļ.@+;+

Explanation:

..‘                    push "with mobile"
   ..‘                 push "wrong"
      ..‘              push "what he did"
         ..‘           push "Steve Ballmer still does not know"
            4{         4 times do
              T          output, not popping the top of stack
               ļ.        output "."
                 @+      append a space to the top thing in stack
                   ;+    reverse add (adding the next part to the top thing in stack)

dzaima

Posted 2017-06-01T12:19:45.920

Reputation: 19 048

How do you use SOGL? I have installed Processing and all of the versions, although I can't figure out how you would run it. – Erik the Outgolfer – 2017-06-01T13:43:13.153

open up the "P5Parser" with no version labels, and in it's folder in data/p.sogl paste the code. Then running the processing code should run it and the output should be in the console – dzaima – 2017-06-01T13:45:28.357

Tried to run your code, but it doesn't have any output... ./processing-java --sketch=../SOGL/P5Parser --run p.sogl "" – Erik the Outgolfer – 2017-06-06T14:39:04.640

It works for me. Try giving it the full path instead of p.sogl. if there's nothing in STDOUT or P5Parser/output.txt, I don't know. – dzaima – 2017-06-06T14:50:48.213

This is the output for me, separated into STDOUT and STDERR. – Erik the Outgolfer – 2017-06-06T14:55:44.300

Content of file /home/erik/Desktop.bak/Desktop/SOGL/P5Parser/data/p.sogl is ⁹⁴<>‘υG‘Γω/w¹‘O‛Æw▓½0H(æ█◄K∆2Ξgh‘4{Tļ.@+;+. /home/erik/Desktop is symlink to /home/erik/Desktop.bak/Desktop. Oh and preprocessor actually contains the code, output is different from that of an empty file. – Erik the Outgolfer – 2017-06-06T15:08:35.797

Let us continue this discussion in chat.

– Erik the Outgolfer – 2017-06-06T15:21:04.863

What encoding do you save the file in? I did store it in UTF8 and it is 73 Bytes. Therefore I have to count your claim to have only 73 bytes as wrong. – Arne – 2017-06-14T11:48:24.427

@Arne You'd have to save it in SOGLs encoding. With it there is a 1-to-1 from a byte to a character. Trough right now there isn't a converter

– dzaima – 2017-06-14T11:56:10.317

2

Jelly, 49 bytes

“ṬċḌ)⁹œḃṣ⁷Ṅḋ%W3Œƭ;ḷẓ“¡=~Ṃ©N|ȯ“¡ṭṂ“CṬṀWỌ»ḣJK;¥€”.Y

Try it online!

Erik the Outgolfer

Posted 2017-06-01T12:19:45.920

Reputation: 38 134

2

Go, 140 127 bytes

import."fmt"
func f(){for _,i:=range"!-3?"{Println("Steve Ballmer still does not know what he did wrong with mobile"[:i]+".")}}

Try it online!

totallyhuman

Posted 2017-06-01T12:19:45.920

Reputation: 15 378

2

Sed, 96

s/^/Steve Ballmer still does not know./p
s/\./ what he did./p
s/\./ wrong./p
s/\./ with mobile./

Try it online.

Implicit newline input given, as per this meta-question.

Digital Trauma

Posted 2017-06-01T12:19:45.920

Reputation: 64 644

You can get 92 bytes by removing the second two \.s – H.PWiz – 2019-01-19T17:33:21.150

2

Nim, 100 bytes

for i in " ,2>":echo "Steve Ballmer still does not know what he did wrong with mobile"[0..i.int],"."

here the same in more readable code:

const str = "Steve Ballmer still does not know what he did wrong with mobile"

for i in [32, 44, 50, 62]:
  echo(str[0..i], ".")

The language has string slicing and inclusive upper bounds. The rest should explain itself if you know programming.

Arne

Posted 2017-06-01T12:19:45.920

Reputation: 121

1

Charcoal, 71 69 bytes

A⟦⟧βF⪪”↓/‘ZQ≔'Wε}÷&’/↗∧μ~⎇²~ηρπ‖¢β\`σuσI⌀δ#″:§▶¬QγγQZ–” w⁺⪫⊞Oβι w¦.¶

Try it online! Link is to verbose version of code, with some separators omitted because deverbosifier can't do it automatically. This is basically a port of @KevinCruijssen's answer.

Neil

Posted 2017-06-01T12:19:45.920

Reputation: 95 035

1

Mathematica, 108 104 bytes

"Steve Ballmer still does not know what he did wrong with mobile"~StringTake~#~Print~"."&/@{33,45,51,63}


Try it online!

-4 bytes from Martin

J42161217

Posted 2017-06-01T12:19:45.920

Reputation: 15 931

1

><>, 135 bytes

".wonk ton seod llits remllaB evetS"\
l?!\o99+2*1./"h tahw  "32p10pao     \
52p\".did e"/"   "53p33p
  /\".gnorw"/
1p/\".elibom htiw;"3

This basically goes through the string, prints then replaces the fullstop and conditionals with spaces to keep moving along the code.

It may be best to visualise it using the below ><> pond link;

><> pond!

Try it online!

Teal pelican

Posted 2017-06-01T12:19:45.920

Reputation: 1 338

1It never occurred to me that know spelled backwards is wonk. – Digital Trauma – 2017-06-01T15:40:06.550

8@DigitalTrauma Well, now you wonk – ETHproductions – 2017-06-01T15:40:49.807

1

><>, 126 bytes

 \"elibom htiw \"10p";"15p
  "gnorw  "10p
  "did eh tahw \"11p
 \"wonk ton seod llits remllaB evetS\"12p04.
  l?!vo
oo00.>a"."

AGourd

Posted 2017-06-01T12:19:45.920

Reputation: 271

1

Octave, 126 bytes

Two approaches, same length:

printf('%s.\n',(s={'Steve Ballmer still does not know',' what he did',' wrong',' with mobile'}){1},[s{1:2}],[s{1:3}],[s{1:4}])

Try it online!

s={'Steve Ballmer still does not know',' what he did',' wrong',' with mobile'};printf('%s.\n',s{1},[s{1:2}],[s{1:3}],[s{1:4}])

Try it online!

I could make it 21 bytes shorter, if I steal Rod's approach, but that's no fun.

for i=[33,45,51,63],disp(['Steve Ballmer still does not know what he did wrong with mobile'(1:i),46]),end

Stewie Griffin

Posted 2017-06-01T12:19:45.920

Reputation: 43 471

1

MATLAB / Octave - 120 bytes

a=[];s={'Steve Ballmer still does not know',' what he did',' wrong',' with mobile'};for i=s,a=[a i{1}];disp([a '.']);end

Logic is to start off with an empty string, then we have a cell array that contains the base string as the first element followed by the additions for the other elements. Note that each additional component has a space prepended. We then iterate through the cell array, and at each iteration we concatenate with a component and display the string to the user adding a period at the end.

We get:

>> a=[];s={'Steve Ballmer still does not know',' what he did',' wrong',' with mobile'};for i=s,a=[a i{1}];disp([a '.']);end
Steve Ballmer still does not know.
Steve Ballmer still does not know what he did.
Steve Ballmer still does not know what he did wrong.
Steve Ballmer still does not know what he did wrong with mobile.

Try it online!

http://www.tutorialspoint.com/execute_octave_online.php?PID=0Bw_CjBb95KQMRGZoWFJ1Z3NaNTQ

rayryeng - Reinstate Monica

Posted 2017-06-01T12:19:45.920

Reputation: 1 521

1

Bash, 92 91 bytes

printf 'Steve Ballmer still does not %s.
' know{,' what he did'{,\ wrong{,\ with\ mobile}}}

Try it online!

Dennis

Posted 2017-06-01T12:19:45.920

Reputation: 196 637

1

JavaScript (ES6, no browser dependencies) 154 Bytes

(s='Steve Ballmer still does not know what he did wrong with mobile.')=>{
  let l=s.slice.bind(s)
  return `${l(0,33).\n${l(0,45)}.\n${l(0,51)}.\n${s}`
}

The other ES6 solution requires (and doesn't account for) the use of html and html element APIs.

Paul

Posted 2017-06-01T12:19:45.920

Reputation: 111

1

Retina, 82 bytes


ABCC with mobile.
C
B wrong
B
.¶A what he did
A
Steve Ballmer still does not know

Try it online!

ovs

Posted 2017-06-01T12:19:45.920

Reputation: 21 408

1

Rust, 145 bytes

||{for i in b"!-3?"{println!("{}.",&"Steve Ballmer still does not know what he did wrong with mobile".to_owned().get(..*i as usize).unwrap());}};

Inspired by this solution.

Try it online!

Wakawakamush

Posted 2017-06-01T12:19:45.920

Reputation: 121

1

APL (Dyalog Unicode), 81 bytesSBCS

↑1⌽¨,\'.Steve Ballmer still does not know' ' what he did' ' wrong' ' with mobile'

Try it online!

One the very right, we have a list of strings.

,\ cumulative concatenation

1⌽¨ cyclically rotate each one step left (puts the periods at the ends)

 mix the list of strings into a character matrix

Adám

Posted 2017-06-01T12:19:45.920

Reputation: 37 779

0

Braingolf, 139 108 bytes

"Steve Ballmer still does not know
."VRMM!&@v!&@R" what he did"!&@v!&@R" wrong"!&@v!&@R " with mobile"&@v&@R

Skidsdev

Posted 2017-06-01T12:19:45.920

Reputation: 9 656

0

QBIC, 95 bytes

?@Steve Ballmer still does not know`+@.`?A+@ what he did`+B?A+C+@ wrong`+B?A+C+D+@ with mobile.

This makes every part of the output into a separate string literal, where 'A$' holds Steve Ballmer still does not know, and then repeatedly prints 'A$', followed by 'B$' (a period) or the next literal.

Chopping the original string into substrings takes just a byte more (96 bytes):

?B,34|+@.`?_sB,46|+A?_sB,52|+A?@Steve Ballmer still does not know what he did wrong with mobile.

Here, 'B$' holds the entire thing, and parts of it are subsequently shown using substring ('_s...|`). Note that 'A$' now holds the period. This allows the full sentence to be moved to the end of the program, so we can drop the closing backtick.

steenbergh

Posted 2017-06-01T12:19:45.920

Reputation: 7 772

0

Tcl, 115 bytes

puts [set S "Steve Ballmer still does not know"].\n[set h "$S what he did"].\n[set w $h\ wrong].\n$w\ with\ mobile.

Try it online!

sergiol

Posted 2017-06-01T12:19:45.920

Reputation: 3 055

0

Powershell, 101 bytes

0..3|%{-join("Steve Ballmer still does not know"," what he did"," wrong"," with mobile")[0..$_]+"."}

Danko Durbić

Posted 2017-06-01T12:19:45.920

Reputation: 10 241

0

REXX, 123 bytes

s='Steve Ballmer still does not know what he did wrong with mobile'
w=6 9 10 12
do i=1 to 4
say subword(s,1,word(w,i)).
end

idrougge

Posted 2017-06-01T12:19:45.920

Reputation: 641

0

Perl 6, 90 bytes

"$_.".say for [\,] 'Steve Ballmer still does not know','what he did','wrong','with mobile'

Sean

Posted 2017-06-01T12:19:45.920

Reputation: 4 136

0

MSX-BASIC, 123 bytes

1s$="Steve Ballmer still does not know what he did wrong with mobile":forx=1to4:readl:?left$(s$,l);".":next:data33,45,51,64

Konamiman

Posted 2017-06-01T12:19:45.920

Reputation: 291

0

Clojure(script), 122 bytes

(print(apply str(interpose"\n"(reductions str"Steve Ballmer still does not know"[" what he did"" wrong"" with mobile"]))))

madstap

Posted 2017-06-01T12:19:45.920

Reputation: 141

0

Perl, 98 bytes

for('Steve Ballmer still does not know',' what he did',' wrong',' with mobile'){$s.=$_;say "$s."}

(Run via perl -M5.10.1 ... so that "say" will be recognized)

user1711878

Posted 2017-06-01T12:19:45.920

Reputation: 61

According to J B's tip, you can rewrite it as say$s.="$_."for'Steve Ballmer ….

– manatwork – 2017-06-08T16:09:11.483

You can shrink to 89 bytes with this, but can't think of much more to do to shrink it! – Dom Hastings – 2018-02-20T16:41:34.313

0

Pyth - 98

K." w!ZÑ`±§ÑÔæý^àV;KæM×ü1A_4ÿ"J" what he did"A," wrong"" with mobile"=N\.+KN++KJNs[KJGN)s[KJGHN

The first string is a packed string

Tornado547

Posted 2017-06-01T12:19:45.920

Reputation: 389

0

C (gcc), 113 bytes

f(c){for(c=4;c--;)printf("%.*s.\n","?3-!"[c],"Steve Ballmer still does not know what he did wrong with mobile");}

Try it online!

gastropner

Posted 2017-06-01T12:19:45.920

Reputation: 3 264

0

Fission 2, 109 107 bytes

R"Steve Ballmer still does not know"J2~~$$" what he did"J1~$" wrong"J0" with mobile."*
/0C+$$J1C+$$J2C@"."N

Try it online!

I was a little annoyed at the amount of whitespace in the previous Fission answer, so I decided to see if I could make it smaller.

Jo King

Posted 2017-06-01T12:19:45.920

Reputation: 38 234

0

Julia 0.6, 99 bytes

Generate the 4 desired strings with cumprod (* is string concatenation). Tack on a period with a broadcasted string concatenation .* and print all elements in the list with a broadcasted call println..

println.(cumprod(["Steve Balmer still does not know"," what he did"," wrong"," with mobile"]).*".")

Try it online!

gggg

Posted 2017-06-01T12:19:45.920

Reputation: 1 715