Take the 2-minute tour ×
Programming Puzzles & Code Golf Stack Exchange is a question and answer site for programming puzzle enthusiasts and code golfers. It's 100% free, no registration required.

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:


share|improve this question
Now that stupid song is in my head. –  user973810 Aug 1 at 20:31
@Sparr, EXACTLY ONCE –  Malachi Aug 1 at 20:32
@rybo111 oh, didn't notice that... –  Malachi Aug 1 at 21:01
@rybo111 (and Sparr) ONCE was not enough? –  edc65 Aug 1 at 21:08
Is it ok if the program output more than the full text? Ie. enclosing the lyric in parens. –  Sylwester Aug 2 at 17:59

46 Answers 46

Brainfuck 1923 bytes



Standard Loop Holes

share|improve this answer
Does not include the five words. –  nwp Aug 1 at 21:41
Perhaps scroll right, however i'll edit the post so you don't have too... –  Joshpbarron Aug 1 at 21:43
I did scroll but somehow missed the words, sorry. –  nwp Aug 1 at 21:45
NOW it's clear! –  edc65 Aug 1 at 21:52
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 –  Malachi Aug 4 at 13:03

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).

share|improve this answer
I mistakenly downvoted this one. Sorry. (If you make any change I think I can remove the downvote) –  edc65 Aug 1 at 17:26
@edc65: Thanks for the honesty :) I edited the answer. –  nneonneo Aug 1 at 18:39
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") –  feersum Aug 19 at 8:37

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
share|improve this answer
@MartinBüttner Excellent suggestions. Thanks :-) –  squeamish ossifrage Aug 1 at 16:04
You can omit the last ; too. –  Thaylon Aug 1 at 16:26
Love the "All you other 1s" part –  William Barbosa Aug 1 at 16:28
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 –  Thaylon Aug 1 at 16:32
@Thaylon Thanks! –  squeamish ossifrage Aug 1 at 16:50

Python 2.7 (too many bytes)

Fun fact: Mr. Mathers realised the original draft of the song was too formal. So I helped him quickly do find and replace to make it easier on the ears.

print """I am Marshall Mathers. Yes, I am the authentic Mathers.
All you other Marshall Matherss are just imitating.
So, won't the authentic Marshall Mathers please rise?
Please rise. Please rise.""".replace("Marshall","Slim").replace("Mathers","Shady").replace("rise","stand up").replace("I am","I'm").replace("authentic","real")
share|improve this answer
The word real is used twice. Perhaps you should substitute it with proper or something similar? –  Fors Aug 4 at 14:14
@Fors Thanks for pointing that out. "Real" is now "authentic". –  Lego Stormtroopr Aug 4 at 23:18
This is pretty hilarious. Also, I like the unavoidable "Matherss". –  codebreaker Aug 6 at 17:07
+1 for creativity –  professorfish Aug 7 at 16:32

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. ;)

share|improve this answer
You can save some characters: #{h+a} is shorter than "+h+a+", and #{d+h+a} is shorter than "+d+h+a+". –  ProgramFOX Aug 1 at 15:26
@ProgramFOX o.O ... I'm ashamed to say I only thought of #{h}#{a}. –  Martin Büttner Aug 1 at 15:27
Can save a few more with h=" Slim"+a=" Shady", and one by replacing puts with $><<. –  histocrat Aug 1 at 21:57
@histocrat thanks! –  Martin Büttner Aug 1 at 22:04
154 with .gsub(/\d/){%W{I'm \ Slim \ Shady \ the\ real lease\ stand\ up}[$&.hex]} –  Ventero Aug 3 at 15:31

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]))
share|improve this answer
crazy shit, i like it –  john Smith Aug 5 at 13:35

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

share|improve this answer
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. –  Dennis Aug 2 at 3:28
@Dennis Thanks a lot! I edited my answer. –  ProgramFOX Aug 4 at 6:50

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.

share|improve this answer
Oh, ?P in immediate window I see, +1 –  Alex Aug 1 at 21:21
you should get rid of a = "." I think you could shave off a few Bytes –  Malachi Aug 1 at 21:39
Actually, on second thought, I think it's more readable with the line seperators vs new lines... –  ckuhn203 Aug 1 at 23:52

PHP - 151 bytes

<?="I'm Slim Shady".gzinflate("]Œ1
„0E{Á;üÎFr…ÅÒNHe9à°F&‰d&,Þ~Avmßûï;̬=Æ.ÂVFaø•–ÃµÍ ‚#WäÓx    ñR


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

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];


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
share|improve this answer

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 "|"

share|improve this answer
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 –  Dennis Aug 2 at 15:43
Completely off topic: Thanks for the new features in version 0.6.2! I just used one of them in another challenge. –  Dennis Aug 2 at 15:46

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...

share|improve this answer

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."


share|improve this answer

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"
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,".")
share|improve this answer

VBA 343 bytes

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
share|improve this answer
Very Nice implementation –  Malachi Aug 1 at 20:41
Thanks Malachi, can't skip this golf as an old fans of Eminem. –  Alex Aug 1 at 20:42
I am working on one right now. –  Malachi Aug 1 at 20:42
It's great to see someone golfing in VBA. Can't you print to the immediate window with ? though? –  ckuhn203 Aug 1 at 21:01
@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! –  Alex Aug 1 at 21:02

Python: 126 122 119

from urllib import*;d=urlopen('http://qr.net/Fm5Q').read();"Slim""Shady""real""stand";i=d.find("I'm");print d[i:i+167]
share|improve this answer
That's clever and obeys the rules. No reason to downvote –  edc65 Aug 2 at 6:53
using data from URL was clever... about 20 years ago. –  vaxquis Aug 2 at 12:03
loophole abuse :-) meta.codegolf.stackexchange.com/a/1062/8288 –  Eoin Campbell Aug 2 at 12:40

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.

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);}
share|improve this answer

No Alnum Javascript: 77,545 bytes

(Inspired by the BF answers)
Prints to the javascript console


share|improve this answer

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+".");}}
share|improve this answer

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

share|improve this answer
You could probably save some more chars by moving spaces from format string to replacements, like WriteLine("{0}{1}","I'm ","Slim "). –  NightElfik Aug 2 at 0:09
Thank you @NightElfik –  Malachi Aug 2 at 3:06
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. –  Bob Aug 2 at 11:35
thank you @Bob that saved me another 4 byes! even on my VB answer too! –  Malachi Aug 3 at 0:17
This does not compile for me, because the Main() method doesn't have a return type. –  ProgramFOX Aug 4 at 7:52

VB 253 249 245 241 244 285

I hate New Line termination

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

Now with proper Capitalization And Newlines in the output

Thank you VB for vbCrLf

share|improve this answer
I wonder if this will run without the tabs and new lines????? –  Malachi Aug 4 at 12:58
it won't let me in Visual Studio 2013 –  Malachi Aug 4 at 12:59

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 ");}}
share|improve this answer
you missed some spots where you can remove a bunch of characters, check mine out. codegolf.stackexchange.com/a/35557/9435 –  Malachi Aug 1 at 21:03

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);}}
share|improve this answer
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 –  edc65 Aug 1 at 21:05
@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. –  tim Aug 1 at 21:40

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,".");
share|improve this answer

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
share|improve this answer

Matlab 206 bytes

i='I''m ';s='Slim ';h='Shady';r=' real ';t=' stand ';p=['Please' t 'up. '];sprintf([i s h '. Yes, ' i 'the' r h '.\nAll you other ' s h 's are just imitating.\nSo, won''t the' r s h ' please' t 'up?.\n' p p])
share|improve this answer
Found a typo: h ' are should become h 's are. -- You could also save a little by changing up. to up. so you don't need the ' ' near the end. –  Dennis Jaheruddin Aug 4 at 11:47
Thanks, I updated it=) –  flawr Aug 4 at 13:16

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"")))
share|improve this answer

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".

share|improve this answer
Interesting. A bit shorter with "not a word boundary": s/\B([A-Z])/ \L\1/g; –  Thaylon Aug 4 at 9:31
Thanks @Thaylon. \B is something I'm going to have to read about. It's weird. –  comperendinous Aug 5 at 6:36

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+'.'
share|improve this answer
move please into the variable holding stand up and get rid of your g variable, and possibly remove /n you don't need them –  Malachi Aug 1 at 21:34
If I remove the \n the newlines will be gone, and I presume those are necessary for the output. –  Batman Aug 5 at 13:02

Groovy - 196 chars

Pretty basic solution:

p="lease stand up"
r="the real"
f={println it}
f "$i $l $s. Yes, $i $r $s."
f "All you other $l ${s}s are just imitating."
f "So, won't $r $l $s p$p?"
f "$q $q"
share|improve this answer

Python: 175

Just a small change to the answer by nneonneo, but i can't comment and there don't seem to be private messages on this website so i'll post it this way.

a="Slim Shady"
print"{0}{1}. Yes, {0}{3}{2}.\nAll you other {1}s are just imitating.\nSo, won't {3}{1} p{4}?\nP{4}. P{4}.".format("I'm ",a,a[5:],"the real ","lease stand up")
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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