48
\$\begingroup\$

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

\$\endgroup\$
17
  • 64
    \$\begingroup\$ When I saw the title / tags I thought that the output would be developers developers ... \$\endgroup\$
    – Rod
    Jun 1 '17 at 12:30
  • 15
    \$\begingroup\$ tcl, 25while 1 {puts developers}demo \$\endgroup\$
    – sergiol
    Jun 1 '17 at 13:29
  • 8
    \$\begingroup\$ braingolf, 23 - 1"developers "[!@11 1>] :P \$\endgroup\$
    – Mayube
    Jun 1 '17 at 13:31
  • 16
    \$\begingroup\$ And I thought of xkcd's Ballmer Peak \$\endgroup\$
    – ojdo
    Jun 1 '17 at 15:51
  • 6
    \$\begingroup\$ yes, 14yes developers \$\endgroup\$
    – sergiol
    Jun 6 '17 at 0:12

54 Answers 54

28
\$\begingroup\$

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!

\$\endgroup\$
0
19
\$\begingroup\$

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
\$\endgroup\$
7
  • \$\begingroup\$ Oh nice, managed to use dictionary compression for everything but Ballmer? \$\endgroup\$
    – Mayube
    Jun 1 '17 at 12:29
  • \$\begingroup\$ @Mayube: Yeah. I got it partially now (ball) to save a byte by restructuring the original string :) \$\endgroup\$
    – Emigna
    Jun 1 '17 at 12:31
  • \$\begingroup\$ looks much better now, if only you could compress that mer \$\endgroup\$
    – Mayube
    Jun 1 '17 at 12:35
  • \$\begingroup\$ @Mayube: I could hide it by compressing me but unfortunately that wouldn't save any bytes :/ \$\endgroup\$
    – Emigna
    Jun 1 '17 at 14:13
  • 2
    \$\begingroup\$ @StigHemmer: It is 44 bytes in the 05AB1E code page \$\endgroup\$
    – Emigna
    Jun 2 '17 at 11:04
17
\$\begingroup\$

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.

\$\endgroup\$
16
\$\begingroup\$

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.

\$\endgroup\$
2
  • 3
    \$\begingroup\$ You only need to match on <space>w and replace with .¶$`$&. \$\endgroup\$
    – Neil
    Jun 1 '17 at 13:00
  • \$\begingroup\$ @Neil Oh, that's really neat, thank you. :) \$\endgroup\$ Jun 1 '17 at 13:01
9
\$\begingroup\$

///, 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!

\$\endgroup\$
4
  • 1
    \$\begingroup\$ You can save a bit more by moving the previous prefix into each substitution: tio.run/… \$\endgroup\$ Jun 1 '17 at 13:06
  • \$\begingroup\$ @MartinEnder That's particularly clever. Thanks! \$\endgroup\$
    – steenbergh
    Jun 1 '17 at 13:08
  • 1
    \$\begingroup\$ Oh, and another 5 by dropping 4 altogether: tio.run/##DcLRDcMgDAXA/… \$\endgroup\$ Jun 1 '17 at 13:10
  • 5
    \$\begingroup\$ @MartinEnder "Yes, I'll have a nr. 3 with mobile, please." \$\endgroup\$
    – steenbergh
    Jun 1 '17 at 13:11
9
\$\begingroup\$

PHP, 104 95 94 bytes

<?=$a="Steve Ballmer still does not know",$a=".
$a what he did",$a.=" wrong",$a?> with mobile.
\$\endgroup\$
1
  • 1
    \$\begingroup\$ Missing "what"? \$\endgroup\$ Jun 1 '17 at 13:04
7
\$\begingroup\$

05AB1E, 46 bytes

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

Try it online!

\$\endgroup\$
2
  • \$\begingroup\$ This is 98 bytes by my count. \$\endgroup\$ Jun 2 '17 at 9:46
  • \$\begingroup\$ @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. \$\endgroup\$ Jun 2 '17 at 12:06
7
\$\begingroup\$

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!

\$\endgroup\$
7
\$\begingroup\$

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.

\$\endgroup\$
10
  • 1
    \$\begingroup\$ Hope you don't mind that I stole your idea, it's much better than my looping approach. \$\endgroup\$ Jun 1 '17 at 12:38
  • \$\begingroup\$ @TheLethalCoder No problem at all, since I see you've credited me. :) Btw, string can't be var in your C# lambda? \$\endgroup\$ Jun 1 '17 at 12:40
  • \$\begingroup\$ No because I'm declaring multiple at once. \$\endgroup\$ Jun 1 '17 at 12:42
  • \$\begingroup\$ @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. \$\endgroup\$ Jun 1 '17 at 12:45
  • 1
    \$\begingroup\$ Konstantin Ch suggests changing the "+d at the end to ." to save a byte as the final linefeed is optional. \$\endgroup\$ Jun 2 '17 at 10:53
6
\$\begingroup\$

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.

\$\endgroup\$
2
  • \$\begingroup\$ By my count this is 97 bytes. \$\endgroup\$ Jun 2 '17 at 9:42
  • \$\begingroup\$ @StigHemmer In UTF-8, it would be. However, Jelly also supports this single-byte character set. \$\endgroup\$
    – Dennis
    Jun 2 '17 at 11:48
6
\$\begingroup\$

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>

\$\endgroup\$
3
  • \$\begingroup\$ Nice approach I have "borrowed" it for my C# answer. \$\endgroup\$ Jun 1 '17 at 13:15
  • 1
    \$\begingroup\$ Maybe 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? \$\endgroup\$
    – Paul
    Jun 4 '17 at 18:46
  • \$\begingroup\$ @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. \$\endgroup\$ Feb 20 '18 at 16:43
5
\$\begingroup\$

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.

\$\endgroup\$
3
  • \$\begingroup\$ 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 \$\endgroup\$
    – Mayube
    Jun 1 '17 at 12:37
  • \$\begingroup\$ @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.) \$\endgroup\$
    – Neil
    Jun 1 '17 at 19:00
  • \$\begingroup\$ Ugh, this is still worse than @Leo's Retina Kolmogorov golfer, which finds an 82-byte answer. \$\endgroup\$
    – Neil
    Dec 27 '20 at 18:01
5
\$\begingroup\$

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!

\$\endgroup\$
1
  • \$\begingroup\$ You can remove the spaces between A and B, and the strings that define them. \$\endgroup\$
    – Dennis
    Jun 1 '17 at 20:16
4
\$\begingroup\$

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.

\$\endgroup\$
7
  • \$\begingroup\$ As an aside, it's worth noting that this only works for C# >= 6 as earlier versions don't have interpolated strings \$\endgroup\$
    – Mayube
    Jun 1 '17 at 12:30
  • \$\begingroup\$ @Mayube True, but I'm golfing this to use Kevin's approach at the moment as that is a lot better than mine haha \$\endgroup\$ Jun 1 '17 at 12:32
  • \$\begingroup\$ Gotta golf 2 more bytes so you can beat the java answer D: \$\endgroup\$
    – Mayube
    Jun 1 '17 at 12:40
  • \$\begingroup\$ @Mayube The Java answers usually beat C# because they don't include a trailing semi-colon. Is always annoying! \$\endgroup\$ Jun 1 '17 at 12:42
  • \$\begingroup\$ @Mayube Done it, for the time being at least... \$\endgroup\$ Jun 1 '17 at 12:50
3
\$\begingroup\$

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!

\$\endgroup\$
3
\$\begingroup\$

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>

\$\endgroup\$
3
\$\begingroup\$

CJam, 79 bytes

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

Try it online!

\$\endgroup\$
1
  • \$\begingroup\$ wow, interesting pattern find \$\endgroup\$ Jun 1 '17 at 23:57
3
\$\begingroup\$

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.

\$\endgroup\$
3
\$\begingroup\$

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.

\$\endgroup\$
3
  • \$\begingroup\$ Could you add an explanation? \$\endgroup\$
    – Shaggy
    Jun 1 '17 at 18:15
  • \$\begingroup\$ @Shaggy will do \$\endgroup\$
    – Mayube
    Jun 2 '17 at 7:50
  • \$\begingroup\$ You can compress the top a lot more: 209 bytes. \$\endgroup\$
    – KSmarts
    Dec 11 '17 at 16:05
3
\$\begingroup\$

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.

\$\endgroup\$
1
  • \$\begingroup\$ 99 bytes: for i in " ,2>":"Steve Ballmer still does not know what he did wrong with mobile"[0..i.int].echo"." \$\endgroup\$
    – xigoi
    Mar 21 at 7:29
3
\$\begingroup\$

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 "."
\$\endgroup\$
4
  • 1
    \$\begingroup\$ Nice. 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). \$\endgroup\$ Jun 1 '17 at 15:40
  • \$\begingroup\$ 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. \$\endgroup\$
    – Shaggy
    Jun 1 '17 at 15:50
  • 1
    \$\begingroup\$ You may be better off if you remove the splitting and joining, and instead do £P±X +'.}R at the end \$\endgroup\$ Jun 1 '17 at 16:08
  • \$\begingroup\$ @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 :) \$\endgroup\$
    – Shaggy
    Jun 1 '17 at 16:13
2
\$\begingroup\$

Jelly, 49 bytes

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

Try it online!

\$\endgroup\$
0
2
\$\begingroup\$

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!

\$\endgroup\$
2
\$\begingroup\$

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)
\$\endgroup\$
9
  • \$\begingroup\$ 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. \$\endgroup\$ Jun 1 '17 at 13:43
  • \$\begingroup\$ 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 \$\endgroup\$
    – dzaima
    Jun 1 '17 at 13:45
  • \$\begingroup\$ Tried to run your code, but it doesn't have any output... ./processing-java --sketch=../SOGL/P5Parser --run p.sogl "" \$\endgroup\$ Jun 6 '17 at 14:39
  • \$\begingroup\$ 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. \$\endgroup\$
    – dzaima
    Jun 6 '17 at 14:50
  • \$\begingroup\$ This is the output for me, separated into STDOUT and STDERR. \$\endgroup\$ Jun 6 '17 at 14:55
2
\$\begingroup\$

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.

\$\endgroup\$
1
  • \$\begingroup\$ You can get 92 bytes by removing the second two \.s \$\endgroup\$
    – H.PWiz
    Jan 19 '19 at 17:33
2
\$\begingroup\$

Bash, 92 91 bytes

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

Try it online!

\$\endgroup\$
2
\$\begingroup\$

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!

\$\endgroup\$
2
\$\begingroup\$

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.

\$\endgroup\$
2
\$\begingroup\$

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

\$\endgroup\$
2
\$\begingroup\$

C (gcc), 113 112 bytes

-1 bytes thanks to ceilingcat.

f(c){for(c=0;write(1,"Steve Ballmer still does not know what he did wrong with mobile","!-3?"[c++]);puts("."));}

Try it online!

\$\endgroup\$
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.