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

1 2
3
0
\$\begingroup\$

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

| improve this answer | |
\$\endgroup\$
  • 1
    \$\begingroup\$ You can get 229 bytes by moving some more words into the variables and shuffling the spaces around a bit. \$\endgroup\$ – Sara J Aug 19 '19 at 23:25
  • \$\begingroup\$ 181 bytes by changing to using the Visual Interactive Compiler. By the way, class stuff and the main method are usually not counted toward the bytes anyway. \$\endgroup\$ – Malivil Nov 22 '19 at 13:12
0
\$\begingroup\$

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

Try it online!

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ Using `[`, we can get to 160 \$\endgroup\$ – Giuseppe Nov 21 '19 at 20:14
  • \$\begingroup\$ @Giuseppe It must be your life goal to improve on every answer I give... Oh well. I'll update it. \$\endgroup\$ – Sumner18 Nov 21 '19 at 20:32
  • \$\begingroup\$ No, I was just not very active on CCGC for a while, so I've been trying to catch up by going through the profiles of the R golfers I know to look for neat tricks, suggest improvements, and help foster community. :-) \$\endgroup\$ – Giuseppe Nov 21 '19 at 20:34
  • \$\begingroup\$ Ah, so that's why I was able to actually get some answers posted before the real master showed up. \$\endgroup\$ – Sumner18 Nov 21 '19 at 20:37
0
\$\begingroup\$

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

| improve this answer | |
\$\endgroup\$
1 2
3

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.