44
\$\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\$
  • 32
    \$\begingroup\$ Now that stupid song is in my head. \$\endgroup\$ – Darth Egregious Aug 1 '14 at 20:31
  • \$\begingroup\$ Is it ok if the program output more than the full text? Ie. enclosing the lyric in parens. \$\endgroup\$ – Sylwester Aug 2 '14 at 17:59
  • \$\begingroup\$ @Sylwester As long as it follows the rules, you can code it how you want. \$\endgroup\$ – rybo111 Aug 3 '14 at 10:04
  • \$\begingroup\$ Is this really kolmogorov-complexity? It's true that any program which has the correct output bounds the Kolmogorov complexity above, but the extra constraint seems likely to force a non-optimal program. \$\endgroup\$ – Peter Taylor Aug 5 '14 at 15:15
  • \$\begingroup\$ @PeterTaylor you may be right - I'll leave it to the community to edit or not. \$\endgroup\$ – rybo111 Aug 5 '14 at 16:28

63 Answers 63

2
\$\begingroup\$

PHP, 179 Bytes

<?
$i="I'm";
$s=" Slim";
$h=" Shady";
$p="lease stand up";
$r=" the real";
echo"$i$s$h. Yes, $i$r$h.\nAll you other$s$h"."s are just imitating.\nSo, won't$r$s$h p$p?\nP$p. P$p.";

And golfed

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

Python 3.6, 166 bytes

a,b,c,d="I'm","Slim Shady","the real","lease stand up"
print(a,b+". Yes,",a,c,b[5:]+".\nAll you other",b+"s are just imitating.\nSo, won't",c,b,f"p{d}?\nP{d}. P{d}.")

Try it online!

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

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])
\$\endgroup\$
  • \$\begingroup\$ 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. \$\endgroup\$ – Dennis Jaheruddin Aug 4 '14 at 11:47
1
\$\begingroup\$

F#, 197 bytes

printf"%A"<|System.String.Format("{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")

F#, 210 bytes (alternate method)

let a,b,c,d,e="I'm ","Slim ","Shady","the real ","lease stand up"
printf"%s"<|a+b+c+". Yes, "+a+d+c+".\nAll you other "+b+c+"s are just imitating.\nSo, won't "+d+b+c+" p"+e+"?\nP"+e+". P"+e+"."
\$\endgroup\$
1
\$\begingroup\$

Java - 204

Ungolfed:

String i = "I'm", s = " Slim", h = " Shady", r = " the real", t = "lease stand up";
System.out.printf(i + s + h + ". Yes, " + i + r + h + ".%n"
        + "All you other " + s + h + "s are just imitating.%n"
        + "So, won't" + r + h + " p" + t + "?%n"
        + "P" + t + ". P" + t + ".");

Golfed:

String i="I'm",s=" Slim",h = " Shady",r =" the real",t="lease stand up";System.out.printf(i+s+h+". Yes, "+i+r+h+".%nAll you other"+s+h+"s are just imitating.%nSo, won't"+r+h+" p"+t+"?%nP"+t+". P"+t+".");
\$\endgroup\$
1
\$\begingroup\$

Python3 - 233 219

d,s="i'm|slim|shady|real|stand|yes|the|all you other|are just imitating|so,won't|please|up",'A B C.F,A G D C.H B Cs I.J G D B C K E L?K E L.K E L.'
for w in'ABCDEFGHIJKL':s=s.replace(w,d.split('|')[ord(w)-65])
print(s)

Late night entry, I think there's still some room for optimization, feel free to suggest.

\$\endgroup\$
  • \$\begingroup\$ This entry is unfortunately invalid - as it produces the wrong output as can be seen here perhaps you could try this or this for 195 Bytes \$\endgroup\$ – Taylor Scott Jan 6 '18 at 5:43
1
\$\begingroup\$

Clojure - 255 chars

Simple solution from a Clojure newbie. Golfed:

(defn p[f & x](println(apply format f x)))(let[i "I'm" s "Shady" l "Slim" e "lease stand up" r "the real"](p "%s %s %s. Yes, %s %s %s." i l s i r s)(p "All you other %s %ss are just imitating." l s)(p "So, won't %s %s %s p%s?" r l s e)(p "P%s. P%s." e e))

Ungolfed:

(defn p [f & x] (println (apply format f x)))
(let [i "I'm" s "Shady" l "Slim" e "lease stand up" r "the real"]
    (p "%s %s %s. Yes, %s %s %s." i l s i r s)
    (p "All you other %s %ss are just imitating." l s)
    (p "So, won't %s %s %s p%s?" r l s e)
    (p "P%s. P%s." e e))
\$\endgroup\$
1
\$\begingroup\$

Javascript, 191

Pretty basic attempt:

alert((a="I'm")+(b=" Slim")+(c=" Shady")+". Yes, "+a+" the "+(d="real")+c+".\nAll you other"+b+c+"s are just imitating.\nSo, won't the "+d+b+c+" p"+(e="lease stand up")+"?\nP"+e+". P"+e+".");
\$\endgroup\$
1
\$\begingroup\$

VBA, 165

Paste directly in the intermediate pane.

i="I'm":s=" Slim Shady":r=" the real":p="lease stand up":?i+s". Yes, "i+r+mid(s,6)".":?"All you other"s"s are just imitating.":?"So, won't"r+s" p"p"?":?"P"p". P"p"."

Major golfing comes from the quirky properties of VBA's intermediate pane's ? command. You can place a string variable followed immediately by a string literal and they will concatenate with no spaces.

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

Pure bash, 156 bytes

Nothing especially exciting here:

f()(echo "$1$2$3. Yes, $1$4$3.
All you other $2$3s are just imitating.
So, won't $4$2$3 ${5,}?
$5. $5.")
f "I'm " Slim\  Shady "the real " "Please stand up"
\$\endgroup\$
1
\$\begingroup\$

Haskell, 250 221 bytes

Hell it beats the java version, so I'm posting. Is this really as good as it gets, or is there some secret function or monad or something that would make this task easier to complete succinctly?

Edit: I used intercalcate " " instead of unwords...

putStr$let i="I'm";s="Slim";h="Shady";r="the real";p="lease stand up";d=".";n='\n';in unwords[i,s,h++d,"Yes,",i,r,h++d,n:"All you other",s,h++"s","are just imitating"++d,n:"So, won't",r,s,h,'p':p++"?",n:'P':p++d,'P':p++d]
\$\endgroup\$
  • \$\begingroup\$ I just posted a Java entry which beats your Haskell entry. Thought you might want to know ;) \$\endgroup\$ – CoolWilly Aug 5 '14 at 8:54
1
\$\begingroup\$

Dart - 178 characters

Plain string interpolation and variables.

main({i:"I'm ",r:"the real ",s:"Slim ",z:"Shady",t:"lease stand up"}){print("$i$s$z. Yes, $i$r$z.\nAll you other $s${z}s are just imitating.\nSo, won't $r$s$z p$t?\nP$t. P$t.");}

Fiddling with whitespace can get it down to 176:

main({i:"I'm",r:" the real",s:" Slim",z:" Shady",t:"lease stand up"}){print("$i$s$z. Yes, $i$r$z.\nAll you other$s${z}s are just imitating.\nSo, won't$r$s$z p$t?\nP$t. P$t.");}
\$\endgroup\$
1
\$\begingroup\$

C (gcc), 186 181 bytes

-5 bytes thanks to ceilingcat.

f(){char*a=" Slim Shady",*c="I'm the real";printf("%.3s%s. Yes, %s%s.\nAll you other%ss are just imitating.\nSo, won't%s%s p%s?\nP%8$s. P%8$s.",c,a,c,a+5,a,c+3,a,"lease stand up");}

Try it online!

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

Stax, 116 115 112 97 bytes

═Φ-cgvUV;Mc╔&♠◘Aτö,↔↕■∙o→¬▬⌡♪╓B▒ε,æO5≤,╝2Æ;╗)▀ìc)E]«╬ôÅ∩╖╚d:☻╔╩2Ñs*çφIBë╕gpÜI'mSlimShadyrealstand

Run and debug it

All credit to this answer to Khuldraeseth na'Barya. I originally had a solution, but it's been completely re-written with none of the original now.

Stax programs have two representations. Pure ASCII and "packed". Packed stax uses all 256 byte values, and thus is smaller than ASCII, which uses only 95. This solution is particularly clever because it's packed code that contains the required words. When unpacked, the I'mSlimShadyrealstand roughly becomes "j|ksRfwb)ys\\GP*vOyn@[<a\\"d which is a no-op. The rest of the program is pretty straight-forward compressed string literals.

\$\endgroup\$
  • 1
    \$\begingroup\$ Compress the whole darn thing and use a comment for 112 bytes. \$\endgroup\$ – Khuldraeseth na'Barya Aug 19 at 22:06
  • \$\begingroup\$ Wow, That's so simple. I love it. \$\endgroup\$ – recursive Aug 19 at 23:37
  • \$\begingroup\$ Kinda makes me wonder. The site doesn't allow packing of tabs, but some meddling with TS yields a packing of "\t<c>" that unpacks to "h<c-1>". Might it be possible to pack a tab in such a way that unpacking preserves it and that arbitrary characters can be inserted somewhere in the packed version? \$\endgroup\$ – Khuldraeseth na'Barya Aug 20 at 3:09
  • \$\begingroup\$ @Khuldraesethna'Barya: I think you're on to something. Two ascii programs with the same length that share some suffix will share a prefix in their packed representation. I don't think tabs are going to be able to help, but I think it might be possible to embed the words in the midst of an ignored string literal when unpacked. Here is the unpacking code used by the "web app". \$\endgroup\$ – recursive Aug 20 at 14:39
  • 1
    \$\begingroup\$ Got it! This can likely be shortened by removing the d, but it's an improvement nevertheless. \$\endgroup\$ – Khuldraeseth na'Barya Aug 20 at 15:03
0
\$\begingroup\$

Groovy - 196 chars

Pretty basic solution:

i="I'm"
s="Shady"
l="Slim"
p="lease stand up"
q="P$p."
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"
\$\endgroup\$
0
\$\begingroup\$

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")
\$\endgroup\$
0
\$\begingroup\$

FASM 212 bytes

z fix equ
A z "I'm "
C z "Shady"
D z "the real "
E z "Slim ",C
F z "Please stand up"
N=$A
L z ". "
display A,E,L,"Yes, ",A,D,C,L,N,"All you other ",E,"s are just imitating.",N,"So, won't ",D,E," ",F,"?",N,F,L,F,L 
\$\endgroup\$
  • \$\begingroup\$ Wouldn't this capitalise the first Please as well? \$\endgroup\$ – Martin Ender Aug 2 '14 at 13:06
0
\$\begingroup\$

Extended BrainFuck - 195

{S~&I'm&}{I~& Slim&&M}{M~& Shady&}{P~& the real&}{L~&Please&&E~&.&}{E~& stand up&}>&S&I~&. Yes, &&S&P&M~&.
All you other&&I~&s are just imitating.
So, won't&&P&I~& please&&E~&?
&&L~& &&L<[<]>[.>]

Everything pure BF is BF. {name ...} is a macro, &name applies macro and ~"string" stores string in current position." can be any char so I choose & to obfuscate it a little.

\$\endgroup\$
  • \$\begingroup\$ What's the point of extending Brainfuck? Doesn't that make it inherently less useful? \$\endgroup\$ – feersum Aug 19 '14 at 7:20
  • \$\begingroup\$ @feersum No, It allows for more abstraction. I made it as an exercise in bootstrapping so the compiler is written in itself and it compiles the code to BF. This was just a step towards the ultimate goal to make LISP run on BrainFuck and it only took 3 summers from planning to something working. EBF wasn't designed to be used for golfing but I found out that some of it's features allow for compact code. If I ever make new versions it would be to support a kind of switch-case/if-else and not make it a better golf language. \$\endgroup\$ – Sylwester Aug 19 '14 at 7:38
0
\$\begingroup\$

PHP: 176

Thought I might as well give it a shot, nothing fancy though

$b="I'm ";$c="Slim";$d="Shady";$e="$c $d";$f="the real ";$g="lease stand up";echo"$b$e. Yes, $b$f$d.\nAll you other $e"."s are just imitating.\nSo, won't $f$e p$g?\nP$g. P$g.";
\$\endgroup\$
0
\$\begingroup\$

Cobra - 188

class P
    def main
        s,p=" Slim Shady","lease stand up"
        l,p="I'm[s]. Yes, I'm the real[s[5:]].\nAll you other[s]s are just imitating.\nSo, won't the real[s] p[p]?\n","P[p]."
        print l+p,p
\$\endgroup\$
  • \$\begingroup\$ Please explain how the code works. \$\endgroup\$ – isaacg Aug 4 '14 at 4:02
0
\$\begingroup\$

JavaScript - 196 182

s="I'm ",l="Slim Shady",m="the real ",r="lease stand up";alert(s+l+". Yes, "+s+m+l.slice(5)+".\nAll you other "+l+"s are just imitating.\nSo, won't "+m+l+" p"+r+"?\nP"+r+". P"+r+".")

If you want a explanation, just comment.

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

Javascript 185

alert((i="I'm")+(s=" Slim"+(h=" Shady"))+". Yes, "+i+(r=" the real")+h+".\n"+"All you other "+s+"s are just imitating.\n"+"So, won't"+r+s+" p"+(p="lease stand up")+"?\n"+"P"+p+". P"+p+".")
\$\endgroup\$
0
\$\begingroup\$

///, 131 132 135 bytes

/!/lease stand up//#/ Shady//@/ Slim#//$/ real//%/I'm/%@. Yes, % the$#.
All you other@s are just imitating.
So, won't the$@ p!?
P!. P!.

Try it online!

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

c, 214 byte

main(){char*k[]={"I'm ","Slim ","Shady","the real ","lease stand up"},*w="012. Yes, 032.\nAll you other 12s are just imitating.\nSo, won't 312 p4?\nP4. P4.",c;for(;*w;)c=*w++,c>47&&c<58?printf(k[c-48]):putchar(c);}

Try it online

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

C, 220 bytes

char*s="I'm",*h="Slim",*a="Shady",*d="real",*y="lease stand up";f(){printf("%s %s %s. Yes, %s the %s %s.\nAll you other %s %ss are just imitating.\nSo, won't the %s %s %s p%s?\nP%s. P%s.",s,h,a,s,d,a,h,a,d,d,h,a,y,y,y);}

Detailed Live

#include <stdio.h>

char  *  s  =  "I'm"             ;
char  *  h  =  "Slim"            ;
char  *  a  =  "Shady"           ;
char  *  d  =  "real"            ;
char  *  y  =  "lease stand up"  ;

f(){printf("%s %s %s. Yes, %s the %s %s.\n\\
All you other %s %ss are just imitating.\n\\
So, won't the %s %s %s p%s?\nP%s. P%s.",

    s,
        h,
            a,
    s,
                d,
            a,
        h,
            a,
                d,
                d,
        h,
            a,
                    y,
                    y,
                    y

);}int main(){f();return 0;}
\$\endgroup\$
0
\$\begingroup\$

VBA, 164 Bytes

Anonymous VBE immediate window function that take no input and outputs to the VBE immediate window.

l=" Slim Shady":i="I'm":r=" the real":t="lease stand up":?i;s". Yes, "i;r;Mid(s,6)".":?"All you other"s" are just imitating.":?"So, won't"r;s" p"t"?":?"P"t". P"t".
\$\endgroup\$
0
\$\begingroup\$

PHP, 166 bytes:

<?=($i="I'm"),($l=" Slim".$s=" Shady"),". Yes, $i",($r="  the real"),"$s.
All you other${l}s are just imitating.
So, won't$r$l p",($p="lease stand up"),"?
P$p. P$p.";
\$\endgroup\$
0
\$\begingroup\$

J, 152 151 bytes

echo(0 :0)rplc'12345';"0'\'cut' Slim\ Shady\lease stand up\ the real\I''m'
512. Yes, 542.
All you other12s are just imitating.
So, won't412 p3?
P3. P3.

Try it online!

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

Java 8, 181 bytes (function)

v->"".format("%s%s%s. Yes, %1$s%s%3$s.%nAll you other %2$s%3$ss are just imitating.%nSo, won't %4$s%2$s%3$s p%s?%nP%5$s. P%5$s.","I'm ","Slim ","Shady","the real ","lease stand up")

Try it online.

Java 8, 229 bytes (full program)

interface M{static void main(String[]a){System.out.printf("%s%s%s. Yes, %1$s%s%3$s.%nAll you other %2$s%3$ss are just imitating.%nSo, won't %4$s%2$s%3$s p%s?%nP%5$s. P%5$s.","I'm ","Slim ","Shady","the real ","lease stand up");}}

Try it online.

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

ink, 177 bytes

VAR i="I'm"
~temp s=" Slim"+w
VAR w=" Shady"
VAR r=" the real"
VAR l="lease stand up"
{i+s}. Yes, {i+r+w}.
All you other{s}s are just imitating.
So, won't{r+s} p{l}?
P{l}. P{l}.

Try it online!

\$\endgroup\$

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.