17
\$\begingroup\$

Challenge:

Your task is to use any language to output that language's name times the number of character's in its name.

  • Use the common name or acronym of the language.
  • If there are multiple versions of a language, you need not include the version number.
  • The capitalization matters.

Examples:

PHP -> PHPPHPPHP
Java -> JavaJavaJavaJava
C++ -> C++C++C++
Python 3 -> PythonPythonPythonPythonPythonPython
JavaScript -> JavaScriptJavaScriptJavaScriptJavaScriptJavaScriptJavaScriptJavaScriptJavaScriptJavaScriptJavaScript
\$\endgroup\$
24
  • 31
    \$\begingroup\$ Tasks that depend on a language's name are a form of disadvantaging some languages by arbitrary criteria. \$\endgroup\$ Commented Dec 17, 2017 at 15:08
  • 18
    \$\begingroup\$ I think this challenge would have been a lot more interesting if the repetition count was supposed to be our bytecount... \$\endgroup\$
    – Maya
    Commented Dec 17, 2017 at 16:53
  • 15
    \$\begingroup\$ And because it hasn't been said yet: Welcome to PPCG! I hope you stick around despite your probably confusing first impression of people telling you that this is not a good challenge while one answer after the other arrives. \$\endgroup\$
    – Laikoni
    Commented Dec 17, 2017 at 21:06
  • 3
    \$\begingroup\$ @DonielF is that shortest though? \$\endgroup\$
    – Quintec
    Commented Dec 18, 2017 at 20:09
  • 4
    \$\begingroup\$ IMO this is unclear. Use the common name suggests that, for example, JS could be used for JavaScript. But what's to stop me saying that my language "Language" is more commonly known as "L"? \$\endgroup\$
    – FlipTack
    Commented Dec 24, 2017 at 19:25

97 Answers 97

1 2 3
4
0
\$\begingroup\$

Ruby, 12 bytes

$><<"Ruby"*4
\$\endgroup\$
1
0
\$\begingroup\$

Bash, 83 bytes

For the whole version string:

while read -n1;do echo -n `bash --version|head -1`;done< <(bash --version|head -1)

Returns (on my machine):

GNU bash, version 4.4.7(1)-release (x86_64-pc-linux-gnu)GNU bash, version 4.4.7(1)-release (x86_64-pc-linux-gnu)GNU bash, version 4.4.7(1)-release (x86_64-pc-linux-gnu)GNU bash, version 4.4.7(1)-release (x86_64-pc-linux-gnu)GNU bash, version 4.4.7(1)-release (x86_64-pc-linux-gnu)GNU bash, version 4.4.7(1)-release (x86_64-pc-linux-gnu)GNU bash, version 4.4.7(1)-release (x86_64-pc-linux-gnu)GNU bash, version 4.4.7(1)-release (x86_64-pc-linux-gnu)GNU bash, version 4.4.7(1)-release (x86_64-pc-linux-gnu)GNU bash, version 4.4.7(1)-release (x86_64-pc-linux-gnu)GNU bash, version 4.4.7(1)-release (x86_64-pc-linux-gnu)GNU bash, version 4.4.7(1)-release (x86_64-pc-linux-gnu)GNU bash, version 4.4.7(1)-release (x86_64-pc-linux-gnu)GNU bash, version 4.4.7(1)-release (x86_64-pc-linux-gnu)GNU bash, version 4.4.7(1)-release (x86_64-pc-linux-gnu)GNU bash, version 4.4.7(1)-release (x86_64-pc-linux-gnu)GNU bash, version 4.4.7(1)-release (x86_64-pc-linux-gnu)GNU bash, version 4.4.7(1)-release (x86_64-pc-linux-gnu)GNU bash, version 4.4.7(1)-release (x86_64-pc-linux-gnu)GNU bash, version 4.4.7(1)-release (x86_64-pc-linux-gnu)GNU bash, version 4.4.7(1)-release (x86_64-pc-linux-gnu)GNU bash, version 4.4.7(1)-release (x86_64-pc-linux-gnu)GNU bash, version 4.4.7(1)-release (x86_64-pc-linux-gnu)GNU bash, version 4.4.7(1)-release (x86_64-pc-linux-gnu)GNU bash, version 4.4.7(1)-release (x86_64-pc-linux-gnu)GNU bash, version 4.4.7(1)-release (x86_64-pc-linux-gnu)GNU bash, version 4.4.7(1)-release (x86_64-pc-linux-gnu)GNU bash, version 4.4.7(1)-release (x86_64-pc-linux-gnu)GNU bash, version 4.4.7(1)-release (x86_64-pc-linux-gnu)GNU bash, version 4.4.7(1)-release (x86_64-pc-linux-gnu)GNU bash, version 4.4.7(1)-release (x86_64-pc-linux-gnu)GNU bash, version 4.4.7(1)-release (x86_64-pc-linux-gnu)GNU bash, version 4.4.7(1)-release (x86_64-pc-linux-gnu)GNU bash, version 4.4.7(1)-release (x86_64-pc-linux-gnu)GNU bash, version 4.4.7(1)-release (x86_64-pc-linux-gnu)GNU bash, version 4.4.7(1)-release (x86_64-pc-linux-gnu)GNU bash, version 4.4.7(1)-release (x86_64-pc-linux-gnu)GNU bash, version 4.4.7(1)-release (x86_64-pc-linux-gnu)GNU bash, version 4.4.7(1)-release (x86_64-pc-linux-gnu)GNU bash, version 4.4.7(1)-release (x86_64-pc-linux-gnu)GNU bash, version 4.4.7(1)-release (x86_64-pc-linux-gnu)GNU bash, version 4.4.7(1)-release (x86_64-pc-linux-gnu)GNU bash, version 4.4.7(1)-release (x86_64-pc-linux-gnu)GNU bash, version 4.4.7(1)-release (x86_64-pc-linux-gnu)GNU bash, version 4.4.7(1)-release (x86_64-pc-linux-gnu)GNU bash, version 4.4.7(1)-release (x86_64-pc-linux-gnu)GNU bash, version 4.4.7(1)-release (x86_64-pc-linux-gnu)GNU bash, version 4.4.7(1)-release (x86_64-pc-linux-gnu)GNU bash, version 4.4.7(1)-release (x86_64-pc-linux-gnu)GNU bash, version 4.4.7(1)-release (x86_64-pc-linux-gnu)GNU bash, version 4.4.7(1)-release (x86_64-pc-linux-gnu)GNU bash, version 4.4.7(1)-release (x86_64-pc-linux-gnu)GNU bash, version 4.4.7(1)-release (x86_64-pc-linux-gnu)GNU bash, version 4.4.7(1)-release (x86_64-pc-linux-gnu)GNU bash, version 4.4.7(1)-release (x86_64-pc-linux-gnu)GNU bash, version 4.4.7(1)-release (x86_64-pc-linux-gnu)GNU bash, version 4.4.7(1)-release (x86_64-pc-linux-gnu)
\$\endgroup\$
2
  • \$\begingroup\$ Use the common name or acronym of the language. and If there are multiple versions of a language, you need not include the version number. and for just plain bash I don't think it can get any shorter (although I may be wrong.) \$\endgroup\$
    – MD XF
    Commented Dec 20, 2017 at 19:19
  • \$\begingroup\$ @MDXF You're right, I didn't read the challenge properly. \$\endgroup\$
    – leo
    Commented Dec 21, 2017 at 8:55
0
\$\begingroup\$

Excel, 15 Bytes

Anonymous worksheet function that takes no input and outputs to the calling cell

=REPT("Excel",5

This may be ported to Google Sheets for 24 Bytes

=REPT("Google Sheets",13
\$\endgroup\$
0
\$\begingroup\$

Tomato, 14 bytes

"Tomato"YYYYYY
\$\endgroup\$
0
\$\begingroup\$

Powershell, 15 bytes

"Powershell"*10

Very boring. But I can't think of any way to shorten it.

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

Ruby: 10 chars

p 'ruby'*4

Result

rubyrubyrubyruby

Previous Implementation: 25 chars

def x(y);p y*y.length;end

Simple invocation:

x('javascript')
 => "javascriptjavascriptjavascriptjavascriptjavascriptjavascriptjavascriptjavascriptjavascriptjavascript" 
\$\endgroup\$
0
\$\begingroup\$

Julia, 24 15 bytes

Minus 9 bytes thanks to SalchiPapa

print("Julia"^5)

Try it online!

\$\endgroup\$
1
  • 1
    \$\begingroup\$ print("Julia"^5) \$\endgroup\$ Commented Mar 12, 2020 at 2:55
1 2 3
4

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