42
\$\begingroup\$

Echo the following in as few bytes as possible:

I'm Slim Shady. Yes, I'm the real Shady.
All you other Slim Shadys are just imitating.
So, won't the real Slim Shady please stand up?
Please stand up. Please stand up.

The following five words must appear EXACTLY ONCE in your code:

I'm
Slim
Shady
real
stand

\$\endgroup\$
5
  • 33
    \$\begingroup\$ Now that stupid song is in my head. \$\endgroup\$ Commented Aug 1, 2014 at 20:31
  • \$\begingroup\$ Is it ok if the program output more than the full text? Ie. enclosing the lyric in parens. \$\endgroup\$
    – Sylwester
    Commented Aug 2, 2014 at 17:59
  • \$\begingroup\$ @Sylwester As long as it follows the rules, you can code it how you want. \$\endgroup\$
    – rybo111
    Commented Aug 3, 2014 at 10:04
  • \$\begingroup\$ do we have to have new lines in the same places you have them in the example output? \$\endgroup\$
    – Malachi
    Commented Aug 7, 2014 at 15:23
  • \$\begingroup\$ @Malachi it must match the output exactly, yes. \$\endgroup\$
    – rybo111
    Commented Aug 7, 2014 at 15:27

66 Answers 66

29
\$\begingroup\$

Python: 176

print"{0}{1}{2}. Yes, {0}{3}{2}.\nAll you other {1}{2}s are just imitating.\nSo, won't {3}{1}{2} p{4}?\nP{4}. P{4}.".format("I'm ","Slim ","Shady","the real ","lease stand up")

Naturally, the same idea as other compression solutions (though independently obtained).

\$\endgroup\$
3
  • 1
    \$\begingroup\$ I mistakenly downvoted this one. Sorry. (If you make any change I think I can remove the downvote) \$\endgroup\$
    – edc65
    Commented Aug 1, 2014 at 17:26
  • \$\begingroup\$ @edc65: Thanks for the honesty :) I edited the answer. \$\endgroup\$
    – nneonneo
    Commented Aug 1, 2014 at 18:39
  • \$\begingroup\$ You can shave off 3 bytes just by reusing the spaces.print"{0}{1}{2}. Yes, {0}{3}{2}.\nAll you other{1}{2}s are just imitating.\nSo, won't{3}{1}{2} p{4}?\nP{4}. P{4}.".format("I'm"," Slim"," Shady"," the real","lease stand up") \$\endgroup\$
    – feersum
    Commented Aug 19, 2014 at 8:37
25
\$\begingroup\$

Brainfuck 1923 bytes

Enjoy...

-[------->+<]>.+[-->+<]>++.---[->+++<]>+.
[->+++++<]>-.>-[--->+<]>--.--[--->++++<]
>.---.++++.[->+++++<]>-.>-[--->+<]>--.>+
[----->+++<]>+.-------.+++.+[--->+<]>++.
-----[++>---<]>.++[--->++<]>.--[->+++<]>-.
[->++++<]>+.[--->+<]>----.-[++>---<]>+.
------------.++++[->++<]>+.+[-->+<]>++.---
[->+++<]>+.[->+++++<]>-.---[->++++<]
>.------------.---.--[--->+<]>-.---[----->++<]
>.-------------.----.+++++++++++.[++>---<]
>--.>-[--->+<]>--.>+[----->+++<]>+.-------.
+++.+[--->+<]>++.-----[++>---<]>.>
++++++++++.+++[->+++++<]>.[--->+<]>+..
[++>---<]>--.--[->++++<]>+.----------.++++++.-
[---->+<]>+++.+++++[->+++<]
>.+++++.------------.---.+++++++++++++.
[-->+++++<]>+++.>-[--->+<]>--.--
[--->++++<]>.---.++++.[->+++++<]>-.>-
[--->+I'm<]>--.>+[----->+++<]>+.-------.+++.+
[--->+<]>++.------.+[---->+<]>+++.[->+++<]>+.--
[--->+<]>---.-------------.--[--->+<]>-.-
[--->++<]>.+++++++++++.--.+.
[---Slim->+<]>+++.-[--->++<]>-.++++.----.
+++++++++++.+[->+++<]>++.--[--->+<]
>-.-----------.+++++.-------.--[->+++<]>-.
>++++++++++.>-[--->+<]>--.[--->+<]>--.
[->+++++<]>+.------------.--[->++++<]>-.
--------.-.[++>---<]>++.[->+++<]>-.[---->+
<]>+++.---[->++++<]>.------------.---.--[---
>+<]>-.---[----->Shady++<]>.-------------.-
---.+++++++++++.[++>---<]>--.>-[--->+<]
>--.--[--->++++<]>.---.++++.[->+++++<]
>-.>-[--->+<]>--.>+[----->+++<]>+.-------.
+++.+[--->+<]>++.-[---->+<]>++.[-->+++++++<]
>.----.-------.----.--[--->+<]>--.++++[->+++<]
>.--[--->+<]>-.---[->++++<]>-.+.+[->+++<]
>++.+++++++++++++.----------.-[--->+<]
>-.---[->++++<]>+.-----.[--->++++<]>-.>
++++++++++.[->++++++++<]>.+[--->++++<]
>.---real----.----.--[--->+<]>--.++++[->+++<]
>.--[--->+<]>-.---[->++++<]>-.+.+[->+++<]
>++.+++++++++++++.----------.-[--->+<]>-.---
[->++++<]>+.-----.[->+++++<]>--.++[--->++<]
>.[-->stand+++++<]>.+[--->++++<]>
.-------.----.--[--->+<]>--.++++[->+++<]
>.--[--->+<]>-.---[->++++<]>-.+.+[->+++<]
>++.+++++++++++++.----------.-[--->+<]
>-.---[->++++<]>+.-----.[->+++++<]>--.

Standard Loop Holes

\$\endgroup\$
6
  • \$\begingroup\$ Does not include the five words. \$\endgroup\$
    – nwp
    Commented Aug 1, 2014 at 21:41
  • 6
    \$\begingroup\$ Perhaps scroll right, however i'll edit the post so you don't have too... \$\endgroup\$
    – Sarima
    Commented Aug 1, 2014 at 21:43
  • \$\begingroup\$ I did scroll but somehow missed the words, sorry. \$\endgroup\$
    – nwp
    Commented Aug 1, 2014 at 21:45
  • \$\begingroup\$ how many bytes? \$\endgroup\$
    – Malachi
    Commented Aug 1, 2014 at 22:06
  • 1
    \$\begingroup\$ I came up with 1918 characters, I don't know that any of these characters are outside the norm where they would tack on extra bytes. I don't know another way of counting Bytes yet so I would say 1918 \$\endgroup\$
    – Malachi
    Commented Aug 4, 2014 at 13:03
17
\$\begingroup\$

Perl, 155

With improvements by Martin Büttner and Thaylon:

$_="01. Yes, 02X.
All you other1s are just imitating.
So, won't21 p3?
P3. P3.";s/\d/("I'm"," SlimX"," the real","lease stand up")[$&]/ge;s/X/ Shady/g;print
\$\endgroup\$
6
  • \$\begingroup\$ @MartinBüttner Excellent suggestions. Thanks :-) \$\endgroup\$
    – r3mainer
    Commented Aug 1, 2014 at 16:04
  • \$\begingroup\$ You can omit the last ; too. \$\endgroup\$
    – Thaylon
    Commented Aug 1, 2014 at 16:26
  • 2
    \$\begingroup\$ Love the "All you other 1s" part \$\endgroup\$ Commented Aug 1, 2014 at 16:28
  • \$\begingroup\$ Shifting around the " " for 157: $_="01. Yes, 032. All you other1s are just imitating. So, won't31 p4? P4. P4.";s/0/I'm/g;s/1/ Slim2/g;s/2/ Shady/g;s/3/ the real/g;s/4/lease stand up/g;print \$\endgroup\$
    – Thaylon
    Commented Aug 1, 2014 at 16:32
  • \$\begingroup\$ Mines so similar now, and I was later, so Ill just delete it. You can get another 2 Byte with: $_="01. Yes, 02X. All you other1s are just imitating. So, won't21 p3? P3. P3.";s/\d/("I'm"," SlimX"," the real","lease stand up")[$&]/ge;s/X/ Shady/g;print \$\endgroup\$
    – Thaylon
    Commented Aug 1, 2014 at 16:57
13
\$\begingroup\$

Ruby, 154 bytes

$><<"012. Yes, 032.
All you other12s are just imitating.
So, won't312 p4?
P4. P4.".gsub(/\d/){%W{I'm \ Slim \ Shady \ the\ real lease\ stand\ up}[$&.hex]}

After helping out a few people with how to split up the filler strings I decided to give their replacement callback idea a go. ;)

\$\endgroup\$
5
  • 1
    \$\begingroup\$ You can save some characters: #{h+a} is shorter than "+h+a+", and #{d+h+a} is shorter than "+d+h+a+". \$\endgroup\$
    – ProgramFOX
    Commented Aug 1, 2014 at 15:26
  • 1
    \$\begingroup\$ @ProgramFOX o.O ... I'm ashamed to say I only thought of #{h}#{a}. \$\endgroup\$ Commented Aug 1, 2014 at 15:27
  • \$\begingroup\$ Can save a few more with h=" Slim"+a=" Shady", and one by replacing puts with $><<. \$\endgroup\$
    – histocrat
    Commented Aug 1, 2014 at 21:57
  • \$\begingroup\$ 154 with .gsub(/\d/){%W{I'm \ Slim \ Shady \ the\ real lease\ stand\ up}[$&.hex]} \$\endgroup\$
    – Ventero
    Commented Aug 3, 2014 at 15:31
  • \$\begingroup\$ @Ventero thanks! :) \$\endgroup\$ Commented Aug 3, 2014 at 18:00
10
\$\begingroup\$

JavaScript (E6) 165

Just the same in another language

alert("012. Yes, 05326All you other12s are just imitating6So, won't5312 p4?\nP4. P4."
.replace(/\d/g,x=>"I'm1 Slim1 Shady1real1lease stand up1 the 1.\n".split(1)[x]))

Explanation: replace each single digit in the first string with the corresponding string in the array ["I'm"," Slim"," Shady","real","lease stand up"," the ",".\n"]

Revised with the new rules here at PPCG (output returned from a function, no constraints about features newer than the challenge), this could be 158. See the snippet

F=
_=>`012. Yes, 0532.
All you other12s are just imitating.
So, won't5312 p4?
P4. P4.`.replace(/\d/g,x=>"I'm, Slim, Shady,real,lease stand up, the ".split`,`[x])

console.log(F())

\$\endgroup\$
6
  • \$\begingroup\$ Nice implementation :) You can save a byte by using a template literal in the replace function and replacing \n with an actual newline. \$\endgroup\$
    – Shaggy
    Commented Apr 18, 2017 at 15:20
  • \$\begingroup\$ @Shaggy I could do better with template literals, but they where not implemented in any browser at time (Aug 2014) \$\endgroup\$
    – edc65
    Commented Apr 18, 2017 at 19:14
  • \$\begingroup\$ Ah, I see. Does that invalidate my answer, so, seeing as this question was posted before the spec that defines template literals was standardised? \$\endgroup\$
    – Shaggy
    Commented Apr 18, 2017 at 19:33
  • \$\begingroup\$ @Shaggy your answer is not invalid: if there was no acceptable/legal interpreter for the language at the time the question was written, an answer may be submitted as non-competing. (codegolf.meta.stackexchange.com/a/7990/21348) \$\endgroup\$
    – edc65
    Commented Apr 19, 2017 at 8:57
  • 1
    \$\begingroup\$ @JacobPersi have a look \$\endgroup\$
    – edc65
    Commented Jan 2, 2018 at 23:14
6
\$\begingroup\$

CJam - 133

"I'm| Slim| Shady| the real|lease stand up|432. Yes, 412.
All you other32s are just imitating.
So, won't132 p0?
P0. P0."'|/~5,{`/\*}/

Try it at http://cjam.aditsu.net/

I think it also works in GolfScript if you replace '| with "|"

\$\endgroup\$
1
  • 7
    \$\begingroup\$ All you other thirty-twos are just imitating. So, won't one three two pee ze-ro? Pee ze-ro. Pee ze-ro. That's how it's gonna sound in my head from now on. :P \$\endgroup\$
    – Dennis
    Commented Aug 2, 2014 at 15:43
6
\$\begingroup\$

GolfScript, 162 154 152 144 bytes

"I'm ":i"Slim ":|"Shady":y". Yes, "i"the real ":!y".
All you other "|y"s are just imitating.
So, won't "!|y" p""lease stand up":l"?
P"l". P"l"."

Test online

\$\endgroup\$
3
  • 3
    \$\begingroup\$ You can save 8 bytes by replacing \n and n with an actual linefeeds and choosing non-alphanumeric variable names (e.g., &) to eliminate the whitespace around them. \$\endgroup\$
    – Dennis
    Commented Aug 2, 2014 at 3:28
  • \$\begingroup\$ @Dennis Thanks a lot! I edited my answer. \$\endgroup\$
    – ProgramFOX
    Commented Aug 4, 2014 at 6:50
  • \$\begingroup\$ The war has begun. \$\endgroup\$ Commented Nov 1, 2014 at 23:13
5
\$\begingroup\$

VBA 343 bytes

Sub EMINEM()
e = "Slim "
m = "Shady"
i = "I'm "
n = "lease stand up"
em = "real "

MsgBox i & e & m & ". Yes, " & i & "the " & em & m & "." & Chr(10) & "All you other " & e & m & "s are just imitating." & Chr(10) & "So, won't the " & em & e & m & " p" & n & Chr(10) & "P" & n & ". P" & n & "."

End Sub
\$\endgroup\$
9
  • 1
    \$\begingroup\$ Very Nice implementation \$\endgroup\$
    – Malachi
    Commented Aug 1, 2014 at 20:41
  • \$\begingroup\$ Thanks Malachi, can't skip this golf as an old fans of Eminem. \$\endgroup\$
    – Alex
    Commented Aug 1, 2014 at 20:42
  • \$\begingroup\$ I am working on one right now. \$\endgroup\$
    – Malachi
    Commented Aug 1, 2014 at 20:42
  • 2
    \$\begingroup\$ It's great to see someone golfing in VBA. Can't you print to the immediate window with ? though? \$\endgroup\$
    – RubberDuck
    Commented Aug 1, 2014 at 21:01
  • 1
    \$\begingroup\$ @ckuhn203 "?" changes to 'print' but i'll need debug.print so it screw up everytime i use "?". Feel free to point out if I can do it here, thanks! \$\endgroup\$
    – Alex
    Commented Aug 1, 2014 at 21:02
5
\$\begingroup\$

VBA 307 Bytes

And obfuscated with line separators (just for fun). Based on this answer

Function p()
e = "Slim ": m = "Shady": i = "I'm ": n = "lease stand up": s = "real ": a = "."
p = i & e & m & ". Yes, " & i & "the " & s & m & a & Chr(10) & "All you other " & e & m & "s are just imitating." & Chr(10) & "So, won't the " & s & e & m & " p" & n & Chr(10) & "P" & n & ". P" & n & a
End Function

Called from the immediate window with ?p.

The 307 includes the ?p.

\$\endgroup\$
7
  • 1
    \$\begingroup\$ Oh, ?P in immediate window I see, +1 \$\endgroup\$
    – Alex
    Commented Aug 1, 2014 at 21:21
  • \$\begingroup\$ you should get rid of a = "." I think you could shave off a few Bytes \$\endgroup\$
    – Malachi
    Commented Aug 1, 2014 at 21:39
  • \$\begingroup\$ Actually, on second thought, I think it's more readable with the line seperators vs new lines... \$\endgroup\$
    – RubberDuck
    Commented Aug 1, 2014 at 23:52
  • \$\begingroup\$ can't you get rid of the spaces between operators? \$\endgroup\$
    – Malachi
    Commented Sep 29, 2015 at 19:48
  • 1
    \$\begingroup\$ @Malachi according to the spec, yes, but actual implementations force the whitespace on you. If I did it in VBScript instead I could probably shorten it up a bit. \$\endgroup\$
    – RubberDuck
    Commented Sep 29, 2015 at 20:00
5
\$\begingroup\$

PHP - 151 bytes

<?="I'm Slim Shady".gzinflate("]Œ1
„0E{Á;üÎFr…ÅÒNHe9à°F&‰d&,Þ~Avmßûï;̬=Æ.ÂVFaø•–ÃµÍ ‚#WäÓx    ñR
*Œ­ª!Ä`d!½Ï¹Ï=>9uöót7Ø…Ij”ÔýÕ6Ó?qx‚/");@realstand;

hexdump:

0000000 3f3c 223d 2749 206d 6c53 6d69 5320 6168
0000010 7964 2e22 7a67 6e69 6c66 7461 2865 5d22
0000020 318c 840a 1030 7b45 3bc1 cefc 7246 c585
0000030 4ed2 6548 e039 46b0 8926 2664 de2c 057e
0000040 7641 df6d effb cc3b 3dac 2ec6 56c2 6146
0000050 f812 9695 b5c3 20cd 2382 e457 14d3 0978
0000060 52f1 2a0a ad8c 21aa 60c4 2164 cfbd cfb9
0000070 3e3d 7539 f3f6 3774 85d8 1949 946a d416
0000080 d5fd d336 713f 8278 222f 3b29 7240 6165
0000090 736c 6174 646e 003b
0000097

Another answer without using gzinflate (228 bytes):

Reads shorts (16 bits), extracts 3 5-bit integers as indices of a lookup table.

<?$a=str_split(" .Yes,AlyouthrajimngSw'pP?
")+[27=>"I'm ",'Slim ',@Shady,'the real ','lease stand up'];$b=unpack(@v26,'o…~:tç       (ƒ-4€t£9ê`0BË-SBT $2U`Y{ÿXg |ác');foreach($b as$c)echo$a[$c>>10],$a[$c>>5&31],$a[$c&31];

hexdump:

0000000 3f3c 6124 733d 7274 735f 6c70 7469 2228
0000010 2e20 6559 2c73 6c41 6f79 7475 7268 6a61
0000020 6d69 676e 7753 7027 3f50 220a 2b29 325b
0000030 3d37 223e 2749 206d 2c22 5327 696c 206d
0000040 2c27 5340 6168 7964 272c 6874 2065 6572
0000050 6c61 2720 272c 656c 7361 2065 7473 6e61
0000060 2064 7075 5d27 243b 3d62 6e75 6170 6b63
0000070 4028 3276 2c36 9d27 026f 8504 7e0c 3a03
0000080 e774 0918 0901 8328 1c2d 8034 a374 ea39
0000090 6001 3011 cb42 532d 5442 a007 3224 6055
00000a0 9d59 ff7b 5802 2067 e17c 2763 3b29 6f66
00000b0 6572 6361 2868 6224 6120 2473 2963 6365
00000c0 6f68 6124 245b 3e63 313e 5d30 242c 5b61
00000d0 6324 3e3e 2635 3133 2c5d 6124 245b 2663
00000e0 3133 3b5d
00000e4
\$\endgroup\$
5
\$\begingroup\$

C, 374

By moving memory

Not the shortest but can it get any faster?

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
char *s;
void m (int d, int f, int p)
{
    memmove (s+p+f, s+p, strlen(s)-p+1); // Shift a part of the string to make room for our insertion
    memcpy (s+p, s+d, f); // Copy the desired reference in place
}
int main ()
{
    s = malloc (168);
    strcpy (s,"I'm Slim Shady. Yes, the real.\nAll you others are just imitating.\nSo, won't the please stand up?\nP. ");

    m (0, 4, 21);
    m (8, 6, 33);
    m (3, 11, 54);
    m (28, 5, 100);
    m (3, 11, 105);
    m (118, 14, 135);
    m (134, 16, 151);
    puts (s);
}

It's 374 chars long after minification.

#include<stdio.h>
#include<stdlib.h>
#include<string.h>
char*s;void m(int d,int f,int p){memmove(s+p+f,s+p,strlen(s)-p+1);memcpy(s+p,s+d,f);}int main(){s=malloc(168);strcpy(s,"I'm Slim Shady. Yes, the real.\nAll you others are just imitating.\nSo, won't the please stand up?\nP. ");m(0,4,21);m(8,6,33);m(3,11,54);m(28,5,100);m(3,11,105);m(118,14,135);m(134,16,151);puts(s);}
\$\endgroup\$
1
  • 1
    \$\begingroup\$ Nice, but you can golf it down to 278 bytes: char s[168]="I'm Slim Shady. Yes, the real.\nAll you others are just imitating.\nSo, won't the please stand up?\nP. ";m(d,f,p){memmove(s+p+f,s+p,strlen(s)-p+1);memcpy(s+p,s+d,f);}main(){m(0,4,21);m(8,6,33);m(3,11,54);m(28,5,100);m(3,11,105);m(118,14,135);m(134,16,151);puts(s);} \$\endgroup\$
    – jdt
    Commented Apr 18, 2017 at 16:20
5
\$\begingroup\$

Java, 247

My first code golf, while learning Java. Posted it because it beats the other (fully functional) Java entry and the Haskell entry.

class S{public static void main(String[]a){String s="I'm",t=" Slim",u=" Shady",v=" the real",w="lease stand up";System.out.print(s+t+u+". Yes, "+s+v+u+".\nAll you other"+t+u+"s are just imitating.\nSo, won't"+v+t+u+" p"+w+"?\nP"+w+". P"+w+".");}}
\$\endgroup\$
5
\$\begingroup\$

C# 209 205 201 197 209 212 217

class P{static void Main(){System.Console.Write("{0}{1}{2}. Yes, {0}{3}{2}.\nAll you other {1}{2}s are just imitating.\nSo, won't {3}{1}{2} p{4}?\nP{4}. P{4}.", "I'm ","Slim ","Shady","the real ","lease stand up");}}

Now with Proper Capitalization and New Lines

\$\endgroup\$
5
  • 1
    \$\begingroup\$ You could probably save some more chars by moving spaces from format string to replacements, like WriteLine("{0}{1}","I'm ","Slim "). \$\endgroup\$
    – NightElfik
    Commented Aug 2, 2014 at 0:09
  • 1
    \$\begingroup\$ The ending newline doesn't seem to be a requirement, so consider using .Write() instead of .WriteLine(). Even if it's required, .Write() with a \n is shorter. \$\endgroup\$
    – Bob
    Commented Aug 2, 2014 at 11:35
  • \$\begingroup\$ thank you @Bob that saved me another 4 byes! even on my VB answer too! \$\endgroup\$
    – Malachi
    Commented Aug 3, 2014 at 0:17
  • \$\begingroup\$ You don't have capital P's on the Please Stand up twice \$\endgroup\$
    – IEatBagels
    Commented Aug 7, 2014 at 14:53
  • \$\begingroup\$ @TopinFrassi, I fixed it on this answer and on my VB answer as well. I was also missing a space. I am asking about the new lines in the output right now... \$\endgroup\$
    – Malachi
    Commented Aug 7, 2014 at 15:24
5
\$\begingroup\$

VB 253 249 245 241 244 285 259 223

I hate New Line termination

Module M
Sub Main
Console.Write("{0}{1}{2}. Yes, {0}{3}{2}.{5}All you other {1}{2}s are just imitating.{5}So, won't {3}{1}{2} p{4}?{5}P{4}. P{4}.","I'm ","Slim ","Shady","the real ","lease stand up",vbCr)
End Sub
End Module

Now with proper Capitalization And Newlines in the output, and no Tabs *

Thank you VB for vbCrLf

Thank you, @Taylor Scott!

\$\endgroup\$
5
  • \$\begingroup\$ I wonder if this will run without the tabs and new lines????? \$\endgroup\$
    – Malachi
    Commented Aug 4, 2014 at 12:58
  • \$\begingroup\$ it won't let me in Visual Studio 2013 \$\endgroup\$
    – Malachi
    Commented Aug 4, 2014 at 12:59
  • 1
    \$\begingroup\$ 223 Bytes \$\endgroup\$ Commented Jan 2, 2018 at 18:17
  • 1
    \$\begingroup\$ @TaylorScott, apparently it will allow you to code it without the indentations now. or maybe that is just Mono for you \$\endgroup\$
    – Malachi
    Commented Jan 4, 2018 at 22:11
  • \$\begingroup\$ As far as I am aware, yes, what the compiler can parse is heavily dependent on what version you are on - especially heading back to VB 6.0 and prior \$\endgroup\$ Commented Jan 4, 2018 at 22:13
4
\$\begingroup\$

PowerShell 194 189 164

"{0}{1}{2}. Yes, {0}{3}{2}.`nAll you other {1}{2}s are just imitating.`nSo, won't {3}{1}{2} p{4}?`nP{4}. P{4}."-f"I'm ","Slim ","Shady","the real ","lease stand up"

Somehow my answer ened up resembling @nneonneo's a lot, even though it wasn't my original intent...

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

PHP - 196 171

<?$S="Shady";$P="lease stand up";$R="the real ";$I="I'm ";$s="Slim ";echo"$I$s$S. Yes, $I$R$S
All you other $s$S"."s are just imitating.
So, won't $R$s$S p$P?
P$P. P$P."

;

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

Lua 201 193 188 178

h=" Shady"i="I'm"s=" Slim"..h r=" the real"u="lease stand up"io.write(i,s,". Yes, ",i,r,h,".\nAll you other",s,"s are just imitating.\nSo, won't",r,s," p",u,"?\nP",u,". P",u,".")

Ungolfed & expanded some

h=" Shady"
i="I'm"
s=" Slim"..h
r=" the real"
u="lease stand up"
io.write(i,s,". Yes, ",i,r,h,".\nAll you other",s,"s are just imitating.\nSo, won't",r,s," p",u,"?\nP",u,". P",u,".")
\$\endgroup\$
3
\$\begingroup\$

Common Lisp, 197

(let((a"I'm ")(b"Slim ")(c"Shady")(d"real ")(e"lease stand up"))(format t"~{~A~}"(list a b c". Yes, "a"the "d c".
All you other "b c"s are just imitating.
So, won't the "d b c" p"e"?
P"e". P"e"")))
\$\endgroup\$
3
\$\begingroup\$

Perl, 161 164 bytes

Not quite as short as squeamish ossifrage's answer, but I wanted to share the CamelCaseCompression, which no one else has used and allows the removal of many spaces and quotation marks.

It does need a slightly longer text to become truly beneficial, though.

$_="0 1 2. Yes, 03 2.
AllYouOther 1 2sAreJustImitating.
So, won't3 1 24?
4. 4.";s/\d/qw(I'm Slim Shady TheReal PleaseStandUp)[$&]/ge;s/\B([A-Z])/ \L\2/g;print

Edit: Following Thaylon's suggestion, the s/(\S)([A-Z])/\1 \L\2/g substitution has been shortened by four characters. That doesn't pick up on comma-capital digraphs, though, so an extra space had to be inserted before "won't".

\$\endgroup\$
2
  • \$\begingroup\$ Interesting. A bit shorter with "not a word boundary": s/\B([A-Z])/ \L\1/g; \$\endgroup\$
    – Thaylon
    Commented Aug 4, 2014 at 9:31
  • \$\begingroup\$ Thanks @Thaylon. \B is something I'm going to have to read about. It's weird. \$\endgroup\$ Commented Aug 5, 2014 at 6:36
3
\$\begingroup\$

PYTHON: 198 193 bytes

i,s,h,r,t="I'm ","Slim ","Shady","real ","lease stand up"
print i+s+h+". Yes, "+i+"the "+r+h+".\nAll you other "+s+h+"s are just imitating.\nSo, won't the "+r+s+h+" p"+t+"?\n"+"P"+t+'. P'+t+'.'
\$\endgroup\$
2
  • \$\begingroup\$ move please into the variable holding stand up and get rid of your g variable, and possibly remove /n you don't need them \$\endgroup\$
    – Malachi
    Commented Aug 1, 2014 at 21:34
  • \$\begingroup\$ If I remove the \n the newlines will be gone, and I presume those are necessary for the output. \$\endgroup\$
    – RageCage
    Commented Aug 5, 2014 at 13:02
3
\$\begingroup\$

Golfscript - 140 (tweetable)

"I'm"" Slim"" Shady"". Yes, "3$" the real"3$".
All you other"6$2$"s are just imitating.
So won't"5$3$3$" p""lease stand up""?
P"1$". P"1$"."

I'm Slim Shady. Yes, 3 the real 3.

All you other 62s are just imitating.

So won't 533 please stand up?

P1. P1.

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

JavaScript (ES6), 165 163 bytes

f=

_=>`${a="I'm"}${b=` Slim${c=` Shady`}`}. Yes, ${a+(d=" the real")+c}.
All you other${b}s are just imitating.
So, won't${d+b} p${e="lease stand up"}?
P${e}. P${e}.`

console.log(f());

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

///, 131 bytes

/0/ Shady//1/lease stand up//2/ the real//3/ Slim0//4/I'm/43. Yes, 420.
All you other3s are just imitating.
So, won't23 p1?
P1. P1.

Try it online!

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

Rust (full program), 183 180 178 173 172 bytes

178 -> 173 bytes, thanks to Sara J

fn main(){print!("{}{}{}. Yes, {0}{}{2}.
All you other{1}{2}s are just imitating.
So, won't{3}{1}{2} p{}?
P{4}. P{4}.","I'm"," Slim"," Shady"," the real","lease stand up")}

Try it online!

\$\endgroup\$
2
  • \$\begingroup\$ 173 bytes \$\endgroup\$
    – Sara J
    Commented Jul 22, 2019 at 15:34
  • \$\begingroup\$ @SaraJ Ofc, obviously! Thanks :) \$\endgroup\$
    – ruohola
    Commented Jul 22, 2019 at 15:41
3
\$\begingroup\$

Zsh, 140 bytes

<<.
${1=I'm}${3= Slim ${2=Shady}}. Yes, $1${4= the real$3}.
All you other$3s are just imitating.
So, won't$4 p${5=lease stand up}?
P$5. P$5.

Attempt This Online!

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

C# 226

class P{static void Main(){System.Console.Write("{0}{1}{2}. Yes, {0} the{3} {2}.All you other{1}{2}s are just imitating.So, won't the{3}{1}{2} please{4}up?Please{4}up. Please{4}up.","I'm"," Slim ","Shady"," real"," stand ");}}
\$\endgroup\$
1
2
\$\begingroup\$

Java, 308 301 298 292 258

Java is a bit verbose, but here is my try:

class P{public static void main(String[]c){String s=" Shady",t=" the real",l="lease stand up",i=" Slim",m="I'm";System.out.format("%s%s%s. Yes, %s%s%s.\nAll you other%s%ss are just imitating.\nSo, won't%s%s%s p%s?\nP%s. P%s.",m,i,s,m,t,s,i,s,t,i,s,l,l,l);}}
\$\endgroup\$
2
  • 1
    \$\begingroup\$ You can 1-merge 'real' and 'the', they're always together 2-move some blanks out of the big format string 3-above all: use more single variables, the a array is of no use. All in all you can go to ~270 \$\endgroup\$
    – edc65
    Commented Aug 1, 2014 at 21:05
  • \$\begingroup\$ @edc65 I didn't know that I could declare multiple strings in Java without writing String multiple times. That's why I had the array for all but one variable. Thanks a lot for the hints. \$\endgroup\$
    – tim
    Commented Aug 1, 2014 at 21:40
2
\$\begingroup\$

MySQL: 273 267

set @i="I'm", @s="Slim", @h="Shady", @r="real", @t="stand", @p="lease stand up";select concat(@i," ",@s," ",@h,". Yes, ",@i," the ",@r," ",@h,".\r\nAll you other ",@s," ",@h,"s are just imitating.\r\nSo, won't the ",@r," ",@s," ",@h," p",@p,"?\r\nP",@p,". P",@p,".");
\$\endgroup\$
2
\$\begingroup\$

Ruby: 211

This one is impressive since simply printing the text is more efficient, but this is way cooler.

puts Zlib.inflate("eJxdjDEKwzAQBHu9Yjs3Rl8ILt0FVKU88GErnCWhO2H8e6sIwUmzxQyz87AjSOyz0XJ6vFhHzB3axqhM8hFuEsGZG3IX9ZYoqDLeTQ1xj0YW0+pdyCOOnAa7/XwTFGFShhqlBa083PMXePyDC15NOP8=".unpack("m0")[0])#I'mSlimShadyrealstand
\$\endgroup\$
2
\$\begingroup\$

JavaScript 259 240 238 bytes

Not that good but might as well post an answer.

b=String.prototype,b.a=b.replace,alert("123. Yes, 16537All you other 23s are just imitating7So, won't 6523 p4?\nP4. P4.".a(/1/g,"I'm ").a(/2/g,"Slim ").a(/3/g,"Shady").a(/4/g,"lease stand up").a(/5/g,"real ").a(/6/g,"the ").a(/7/g,".\n"))

More readable version :

b=String.prototype
b.a=b.replace
alert("123. Yes, 16537All you other 23s are just imitating7So, won't 6523 p4?\nP4. P4."
    .a(/1/g,"I'm ")
    .a(/2/g,"Slim ")
    .a(/3/g,"Shady")
    .a(/4/g,"lease stand up")
    .a(/5/g,"real ")
    .a(/6/g,"the ")
    .a(/7/g,".\n")
    )
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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