| Bytes | Lang | Time | Link |
|---|---|---|---|
| 140 | Zsh | 240121T185607Z | pxeger |
| 175 | Python | 140802T062018Z | DykgNUtR |
| 133 | /// | 240911T190559Z | autumn |
| 096 | Stax | 240910T211313Z | Khuldrae |
| 147 | Bubblegum | 240911T093636Z | Themooni |
| 122 | 05AB1E | 191122T094955Z | Kevin Cr |
| 160 | R | 190820T141303Z | Sumner18 |
| 097 | Stax | 180416T193204Z | recursiv |
| 255 | C# .NET 211 + class stuff etc = | 190819T225629Z | canttalk |
| 181 | C gcc | 171231T153719Z | gastropn |
| 177 | ink | 190722T162324Z | Sara J |
| 172 | Rust full program | 190722T143129Z | ruohola |
| 166 | Python 3.6 | 180117T111816Z | landfill |
| 131 | /// | 180117T114541Z | Erik the |
| 181 | Java 8 | 180116T142544Z | Kevin Cr |
| 151 | J | 180106T083256Z | FrownyFr |
| 166 | PHP | 180106T072315Z | Titus |
| 179 | PHP | 140819T031223Z | Brobin |
| 223 | VB | 140801T205453Z | Malachi |
| 165 | JavaScript | 140801T171842Z | edc65 |
| 163 | JavaScript ES6 | 170418T151440Z | Shaggy |
| 164 | VBA | 171231T155713Z | Taylor R |
| 220 | C | 170418T163854Z | Khaled.K |
| 214 | c | 170418T154557Z | jdt |
| 135 | /// | 161009T212422Z | acrolith |
| 178 | Dart | 140807T111636Z | lrn |
| nan | Haskell | 140805T013732Z | DrJPeppe |
| nan | 141101T222535Z | Josiah W | |
| 156 | Pure bash | 141031T213848Z | Digital |
| 185 | Javascript | 141031T201316Z | MegaTom |
| 165 | VBA | 140819T133525Z | JesterBL |
| 191 | Javascript | 140819T013105Z | Rhubarb |
| 255 | Clojure | 140819T000028Z | Michael |
| 217 | C# | 140801T204950Z | Malachi |
| 204 | Java | 140804T212005Z | Barracud |
| 193 | PYTHON | 140801T153009Z | RageCage |
| 247 | Java | 140805T085324Z | CoolWill |
| 161 | Perl | 140802T030537Z | comperen |
| 197 | Common Lisp | 140804T231005Z | fstamour |
| 197 | F# | 140804T174748Z | Ken |
| 206 | Matlab | 140801T151703Z | flawr |
| 182 | JavaScript | 140804T074751Z | izlin |
| 144 | GolfScript | 140801T151438Z | ProgramF |
| 242 | F# | 140803T201745Z | Mark Pat |
| 238 | JavaScript | 140804T024032Z | Zaenille |
| 188 | Cobra | 140804T034149Z | Οurous |
| 374 | C | 140804T023820Z | marctrem |
| 154 | Ruby | 140801T150710Z | Martin E |
| 176 | PHP | 140803T155557Z | Peter |
| 195 | Extended BrainFuck | 140803T152135Z | Sylweste |
| 1923 | Brainfuck | 140801T171555Z | Sarima |
| 211 | Ruby | 140802T185407Z | Automati |
| 267 | MySQL | 140801T204027Z | g.carval |
| 212 | FASM | 140802T130227Z | user3008 |
| 133 | CJam | 140802T060656Z | aditsu q |
| 151 | PHP | 140802T035124Z | es1024 |
| 196 | Groovy | 140802T015619Z | Michael |
| nan | Java | 140801T185801Z | tim |
| 164 | PowerShell | 140801T210552Z | DarkAjax |
| 307 | VBA 307 Bytes | 140801T211543Z | RubberDu |
| 343 | VBA | 140801T204058Z | Alex |
| 178 | Lua | 140801T152415Z | Kyle Kan |
| 226 | C# | 140801T200026Z | CheeZe5 |
| 155 | Perl | 140801T154936Z | r3mainer |
| 176 | Python | 140801T163455Z | nneonneo |
| 171 | PHP | 140801T170533Z | Arctican |
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.
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")
///, 133 bytes
/@/ Slim//#/ Shady//$/lease stand up//_/ the real//&/I'm/&@#. Yes, &_#.
All you other@#s are just imitating.
So, won't_@# p$?
P$. P$.
Possibly a bit more golfable. I beat Bubblegum of all things! Might try porting this to Retina.
Stax, 96 bytes
é2Å╤▲╟[â;ILxΩp≤◄↑ú-◄δ╢ù‼↓╛Θäε>╧9«∞▓m╓♫çµΦ╝∞↑▼πKjPDπ ╖═Gy┬H/▄ä╖R╕~≈EGí⌐◄≈┌@*realShadyI'mSlimstand
Run and debug it at staxlang.xyz!
Wow, it's been a while. I'm taking credit this time :) Same idea as this 97-byter, but it saves a byte in the unpacked program at the cost of making a suitable packed one harder to find. Unpacks to a nonsense no-op G...} followed by the actual program. There are more at 96 bytes that follow this pattern; this one is just the first I found.
Near miss for 95 bytes: Anto haipcu'rsefl.?L
Bubblegum, 147 bytes
most bytes aren't printable, xxd dump:
00000000: 5d00 0000 04ff ffff ffff ffff ff00 2489 ].............$.
00000010: c9a2 02b2 e380 59c2 a6ba 55a5 fb4a a48a ......Y...U..J..
00000020: 6850 81e0 d9ac 039c 94b1 0718 d77d a86d hP...........}.m
00000030: 2f00 dc58 6a68 fbfc 874d 21ce 1127 f210 /..Xjh...M!..'..
00000040: 2d92 8589 8cbe fd5e e370 b615 53bf c7b6 -......^.p..S...
00000050: 6457 3a54 84f0 552e af4b 547d a2c5 d65c dW:T..U..KT}...\
00000060: a8cd 3c97 566d d235 517d 1f6c a9fd 0ba6 ..<.Vm.5Q}.l....
00000070: d5f4 484c 759e 6733 5fff c2a5 5000 4927 ..HLu.g3_...P.I'
00000080: 6d53 6c69 6d53 6861 6479 7265 616c 7374 mSlimShadyrealst
00000090: 616e 64 and
This is a (mostly) valid LZMA 2 stream encoded with the extreme 9 preset, and no crc checks. Bubblegum is a (joke) language that will decompress its source if it is a valid LZMA 2 stream and output it to stdout.
but how did you get a compressed stream to contain the words that must be in your source?
I didn't. The stream is valid and I appended "garbage" (as far as the decoder is concerned), but because I disabled CRC checks, the decoder can't tell until it has already reached the end of the valid stream, at which point it will crash, but the text will have already been printed out.
05AB1E, 124 122 bytes
"real"“‚µ stand€¾“"Shady""Slim"…I'm)•AΘ¥в‚Y•Sè`“ÿ ÿ ÿ.…Ü, ÿ€€ ÿ ÿ.
All€î€¶ ÿ ÿs€™‚‰ imitating.
So,¢²'t€€ ÿ ÿ ÿ ÿ?
ÿ. ÿ.“.ª
Try it online or verify that it's correct.
Explanation:
"real" # Push string "real"
“‚µ stand€¾“ # Push dictionary string "please stand up"
"Shady" # Push string "Shady"
"Slim" # Push string "Slim"
…I'm '# Push string "I'm"
) # Wrap all strings on the stack into a list:
# ["real","please stand up","Shady","Slim","I'm"]
•AΘ¥в‚Y• # Push compressed integer 11123023204234
S # Converted to a list of digits: [1,1,1,2,3,0,2,3,2,0,4,2,3,4]
è # Index each into the string-list:
# ["please stand up","please stand up","please stand up","Shady","Slim",
# "real","Shady","Slim","Shady","real","I'm","Shady","Slim","I'm"]
` # Pop and push these strings separated to the stack
“ÿ ÿ ÿ.…Ü, ÿ€€ ÿ ÿ. # Push dictionary string "ÿ ÿ ÿ. yes, ÿ the ÿ ÿ.\n
All€î€¶ ÿ ÿs€™‚‰ imitating.
# All you other ÿ ÿs are just imitating.\n
So,¢²'t€€ ÿ ÿ ÿ ÿ? '# So, won't the ÿ ÿ ÿ ÿ?\n
ÿ. ÿ.“ # ÿ. ÿ."
# where the `ÿ` are automatically filled with the strings of the stack
.ª # And sentence capitalize every sentence
# (without disturbing existing uppercase letters)
# (after which the result is output implicitly)
See this 05AB1E tip of mine (sections How to use the dictionary? and How to compress large integers?) to understand why “‚µ stand€¾“ is "please stand up"; •AΘ¥в‚Y• is 11123023204234; and “ÿ ÿ ÿ.…Ü, ÿ€€ ÿ ÿ.\nAll€î€¶ ÿ ÿs€™‚‰ imitating.\nSo,¢²'t€€ ÿ ÿ ÿ ÿ?\nÿ. ÿ.“ is "ÿ ÿ ÿ. yes, ÿ the ÿ ÿ.\nAll you other ÿ ÿs are just imitating.\nSo, won't the ÿ ÿ ÿ ÿ?\nÿ. ÿ.".
R, 168 160 bytes
-8 bytes thanks to Giuseppe
`[`=gsub;cat(1["I'm",2[" Slim ",3["Shady",4[" the real",5["lease stand up","123. Yes, 14 3.
All you other23s are just imitating.
So, won't423 p5?
P5. P5."]]]]])
Stax, 116 115 112 97 bytes
═Φ-cgvUV;Mc╔&♠◘Aτö,↔↕■∙o→¬▬⌡♪╓B▒ε,æO5≤,╝2Æ;╗)▀ìc)E]«╬ôÅ∩╖╚d:☻╔╩2Ñs*çφIBë╕gpÜI'mSlimShadyrealstand
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.
C# .NET 211 + class stuff etc = 255 bytes
public class p{public static void Main(){System.Console.WriteLine(@"{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 ");}}
This is probably as {1} as it gets ;)
I just the @ string tag instead of \r\n because thats 1 byte instead of 12 (3 * \r\n)
EDIT: Didn't know you needed the full class so here
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");}
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}.
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")}
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}.")
///, 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.
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")
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");}}
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.
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.";
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.";
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
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())
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());
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".
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;}
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);}
///, 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!.
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.");}
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]
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.
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"
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+".")
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.
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+".");
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))
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
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+".");
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+'.'
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+".");}}
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".
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"")))
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+"."
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])
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.
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"."
F#, 250 242
[1..21]|>List.iter((function|1|5->"I'm "|2|9|13->"Slim "|4->". Yes, "|6|12->"the real "|8->".\nAll you other "|11->"s are just imitating.\nSo won't "|15->" p"|16|18|20-> "lease stand up"|17->"?\nP"|19->". P"|21->"."|_->"Shady")>>printf "%s")
More readable version with line breaks:
[1..21]|>List.iter((function
|1|5->"I'm "
|2|9|13->"Slim "
|4->". Yes, "
|6|12->"the real "
|8->".\nAll you other "
|11->"s are just imitating.\nSo won't "
|15->" p"
|16|18|20-> "lease stand up"
|17->"?\nP"
|19->". P"
|21->"."
|_->"Shady")>>printf "%s")
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")
)
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
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);}
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. ;)
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.";
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.
Brainfuck 1923 bytes
Enjoy...
-[------->+<]>.+[-->+<]>++.---[->+++<]>+.
[->+++++<]>-.>-[--->+<]>--.--[--->++++<]
>.---.++++.[->+++++<]>-.>-[--->+<]>--.>+
[----->+++<]>+.-------.+++.+[--->+<]>++.
-----[++>---<]>.++[--->++<]>.--[->+++<]>-.
[->++++<]>+.[--->+<]>----.-[++>---<]>+.
------------.++++[->++<]>+.+[-->+<]>++.---
[->+++<]>+.[->+++++<]>-.---[->++++<]
>.------------.---.--[--->+<]>-.---[----->++<]
>.-------------.----.+++++++++++.[++>---<]
>--.>-[--->+<]>--.>+[----->+++<]>+.-------.
+++.+[--->+<]>++.-----[++>---<]>.>
++++++++++.+++[->+++++<]>.[--->+<]>+..
[++>---<]>--.--[->++++<]>+.----------.++++++.-
[---->+<]>+++.+++++[->+++<]
>.+++++.------------.---.+++++++++++++.
[-->+++++<]>+++.>-[--->+<]>--.--
[--->++++<]>.---.++++.[->+++++<]>-.>-
[--->+I'm<]>--.>+[----->+++<]>+.-------.+++.+
[--->+<]>++.------.+[---->+<]>+++.[->+++<]>+.--
[--->+<]>---.-------------.--[--->+<]>-.-
[--->++<]>.+++++++++++.--.+.
[---Slim->+<]>+++.-[--->++<]>-.++++.----.
+++++++++++.+[->+++<]>++.--[--->+<]
>-.-----------.+++++.-------.--[->+++<]>-.
>++++++++++.>-[--->+<]>--.[--->+<]>--.
[->+++++<]>+.------------.--[->++++<]>-.
--------.-.[++>---<]>++.[->+++<]>-.[---->+
<]>+++.---[->++++<]>.------------.---.--[---
>+<]>-.---[----->Shady++<]>.-------------.-
---.+++++++++++.[++>---<]>--.>-[--->+<]
>--.--[--->++++<]>.---.++++.[->+++++<]
>-.>-[--->+<]>--.>+[----->+++<]>+.-------.
+++.+[--->+<]>++.-[---->+<]>++.[-->+++++++<]
>.----.-------.----.--[--->+<]>--.++++[->+++<]
>.--[--->+<]>-.---[->++++<]>-.+.+[->+++<]
>++.+++++++++++++.----------.-[--->+<]
>-.---[->++++<]>+.-----.[--->++++<]>-.>
++++++++++.[->++++++++<]>.+[--->++++<]
>.---real----.----.--[--->+<]>--.++++[->+++<]
>.--[--->+<]>-.---[->++++<]>-.+.+[->+++<]
>++.+++++++++++++.----------.-[--->+<]>-.---
[->++++<]>+.-----.[->+++++<]>--.++[--->++<]
>.[-->stand+++++<]>.+[--->++++<]>
.-------.----.--[--->+<]>--.++++[->+++<]
>.--[--->+<]>-.---[->++++<]>-.+.+[->+++<]
>++.+++++++++++++.----------.-[--->+<]
>-.---[->++++<]>+.-----.[->+++++<]>--.
Standard Loop Holes
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
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,".");
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
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 "|"
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
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"
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);}}
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...
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.
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
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,".")
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 ");}}
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
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).
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."
;