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\$
  • 30
    \$\begingroup\$ Tasks that depend on a language's name are a form of disadvantaging some languages by arbitrary criteria. \$\endgroup\$ – Martin Ender Dec 17 '17 at 15:08
  • 17
    \$\begingroup\$ I think this challenge would have been a lot more interesting if the repetition count was supposed to be our bytecount... \$\endgroup\$ – NieDzejkob Dec 17 '17 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 Dec 17 '17 at 21:06
  • 3
    \$\begingroup\$ @DonielF is that shortest though? \$\endgroup\$ – Quintec Dec 18 '17 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 Dec 24 '17 at 19:25

97 Answers 97

2
\$\begingroup\$

itflabtijtslwi, 31 bytes

/I/itflabtijtslwi//J/IIIIIII/JJ

Try it online!

| improve this answer | |
\$\endgroup\$
2
\$\begingroup\$

Bubblegum, 14 13 bytes

Saved 1 byte thanks to @ovs

00000000: 732a 4d4a ca49 4d2f cda5 1603 00         s*MJ.IM/.....

Try it online!

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ 13 bytes, generated with zopfli. \$\endgroup\$ – ovs Dec 17 '17 at 19:24
  • \$\begingroup\$ @ovs Thanks! I was pretty sure I was doing it wrong. \$\endgroup\$ – Arnauld Dec 17 '17 at 19:34
2
\$\begingroup\$

Hexadecimal Stacking Pseudo-Assembly Language, 636 bytes

20002D4077FF00AAAA20006540000020006740000020006140000020007540000020006740000020006e40000020006140000020004c40000020002040000020007940000020006c40000020006240000020006d40000020006540000020007340000020007340000020004140000020002d40000020006f40000020006440000020007540000020006540000020007340000020005040000020002040000020006740000020006e40000020006940000020006b40000020006340000020006140000020007440000020005340000020002040000020006c40000020006140000020006d4000002000694000002000634000002000654000002000644000002000614000002000784000002000654000002000484000001400004277FF4099FF2000014077FF4299FF4077FF2277FF4277FF4077FF0377FF04000101AAAA

Try it online!

Formatted:

20002D4077FF00AAAA200065400000200067400000200061400000200075
40000020006740000020006e40000020006140000020004c400000200020
40000020007940000020006c40000020006240000020006d400000200065
40000020007340000020007340000020004140000020002d40000020006f
400000200064400000200075400000200065400000200073400000200050
40000020002040000020006740000020006e40000020006940000020006b
400000200063400000200061400000200074400000200053400000200020
40000020006c40000020006140000020006d400000200069400000200063
400000200065400000200064400000200061400000200078400000200065
4000002000484000001400004277FF4099FF2000014077FF4299FF4077FF
2277FF4277FF4077FF0377FF04000101AAAA 

Explanation

; initialize 77 with 0x002D (45)
20 002D
40 77 (FF)

; label AAAA
00 AAAA

; print out the text
20006540000020006740000020006140000020007540000020006740000020006e40000020006140000020004c400000200020400000
20007940000020006c40000020006240000020006d40000020006540000020007340000020007340000020004140000020002d400000
20006f40000020006440000020007540000020006540000020007340000020005040000020002040000020006740000020006e400000
20006940000020006b40000020006340000020006140000020007440000020005340000020002040000020006c400000200061400000
20006d400000200069400000200063400000200065400000200064400000200061400000200078400000200065400000200048400000
140000

; decrement
    ; move counter to stack 99
        42 77 (FF)
        40 99 (FF)
    ; push 1 to 77
        20 0001
        40 77 (FF)
    ; move counter to stack 77
        42 99 (FF)
        40 77 (FF)
    ; subtract
        22 77 (FF)

; duplicate
42 77 (FF)
40 77 (FF)

; terminate if counter is 0
03 77 (FF)
04 (0001)

; redo
01 AAAA
| improve this answer | |
\$\endgroup\$
2
\$\begingroup\$

Hodor, 38 bytes

hodor.hod("HodorHodorHodorHodorHodor")

It's actually shorter than the pure Javascript equivalent!

Try it online!

| improve this answer | |
\$\endgroup\$
2
\$\begingroup\$

TI-BASIC, 16 bytes

"TI-BASIC
Disp Ans,Ans
Ans

Alternatively (19 bytes):

For(I,1,3
Disp "TI-BASIC
End
| improve this answer | |
\$\endgroup\$
2
\$\begingroup\$

Standard ML (MLton), 55 54 46 bytes

val s="Standard ML";s^s^s;print(it^it^it^s^s);

Try it online!

Output:

Standard MLStandard MLStandard MLStandard MLStandard MLStandard MLStandard MLStandard MLStandard MLStandard MLStandard ML

Previous version: (55 bytes)

"Standard ML";print(concat(map(fn _=>it)(explode it)));

Try it online! (No worries, the code is harmless, eventhough it contains explode it.)

Explanation:

"Standard ML"; binds the string to the implicit value identifier it. We then explode it to convert the string into a list of characters and map a function fn _=>it over the list which replaces each character with the string. concat combines the list of strings to a single string and print outputs the resulting string.

| improve this answer | |
\$\endgroup\$
2
\$\begingroup\$

Bash, 14 bytes

echo bash{,,,}

Try it online!

ksh, 12 bytes

echo ksh{,,}

Try it online!

sh, 10 bytes

echo sh{,}

Try it online!

Although, for 9 bytes, I can just do echo shsh.

| improve this answer | |
\$\endgroup\$
2
\$\begingroup\$

brainfuck, 125 119 bytes

+++++++++[>+++++++++++[>+++++++++[>+>+<<-]>>+<<<-]>>-.>++++.<-.++++++++.>----.<---.>+++++++.<---.++++++++.>[-]<[-]<<<-]

First BF, I think it's still golfable but it may be a bit BF to golf BF ;)

Explanation:

+++++++++                        (_009  000  000  000  000)
[
 >+++++++++++                    ( 009 _011  000  000  000)
 [
  >+++++++++                     ( 009  011 _009  000  000)
  [
   >+>+<<-                       ( 009  011 _008  001  001)
  ]                              ( 009  011 _000  009  009)
  >>+<<<-                        ( 009 _010  000  009  010)
 ]                               ( 009 _000  000  099  110)
 >>-.                            ( 009  000  000 _098  110) Output: b
 >++++.                          ( 009  000  000  098  114) Output: r
 <-.                             ( 009  000  000 _097  114) Output: a
 ++++++++.                       ( 009  000  000 _105  114) Output: i
 >----.                          ( 009  000  000  105 _110) Output: n
 <---.                           ( 009  000  000 _102  110) Output: f
 >+++++++.                       ( 009  000  000  102 _117) Output: u
 <---.                           ( 009  000  000 _099  117) Output: c
 ++++++++.                       ( 009  000  000 _107  117) Output: k
 >[-]<[-]<<<-                    (_008  000  000  000  000)
]                                (_000  000  000  000  000)

-6 for removing redundant clear commands

Try it online!

| improve this answer | |
\$\endgroup\$
2
\$\begingroup\$

Befunge-93, 27 Bytes

Edit: Much cleaner solution of the same length suggested by James Holderness

0"39-egnufeB">:#,_$1+:9`#@_

Try It Online

Old 30 byte version:

?
_g7-00p"39-egnufeB">:#,_g`#@

Try It Online

It feels weird to use the ? command for something that isn’t random, but that’s the only direction changing instruction that had an ASCII value low enough

| improve this answer | |
\$\endgroup\$
  • 1
    \$\begingroup\$ Surely it's easier to just keep the counter on the stack: Try it online! \$\endgroup\$ – James Holderness Dec 20 '17 at 15:25
  • \$\begingroup\$ @JamesHolderness Not if you're printing the "-93" as well. Then it's the same length (but still a much cleaner solution) \$\endgroup\$ – Jo King Dec 24 '17 at 15:34
2
\$\begingroup\$

;#*, 420 bytes

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;#;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;#;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;#;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;#;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;#;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;#;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;#;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;#;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;#

Try it online! (uses ;#+ instead)

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ You can golf this approach. \$\endgroup\$ – Conor O'Brien Dec 17 '17 at 19:03
  • \$\begingroup\$ @ConorO'Brien Well I intended this to be a ;# answer but since that is not considered a language (it cannot perform a primality test), I used ;#+. Will look at the docs and see what I can do \$\endgroup\$ – Mr. Xcoder Dec 17 '17 at 19:10
  • \$\begingroup\$ This is a kolgomorov complexity challenge, so primality testing isn't required. This can be a ;# answer if you still want to \$\endgroup\$ – caird coinheringaahing Dec 25 '17 at 1:20
  • \$\begingroup\$ @cairdcoinheringaahing Changed to ;#* \$\endgroup\$ – Mr. Xcoder Dec 25 '17 at 6:23
2
\$\begingroup\$

Java 11, 19 bytes

v->"Java".repeat(4)

Try it online.

Java 8, 21 bytes

v->"JavaJavaJavaJava"

Well...

Try it here.

| improve this answer | |
\$\endgroup\$
1
\$\begingroup\$

Pyth, 7 bytes

*4"Pyth

My first Pyth answer!

Thanks to Mr. Xcoder for a neat trick.

Try it online!

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ *4"Pyth for 7 bytes \$\endgroup\$ – Mr. Xcoder Dec 17 '17 at 14:57
  • \$\begingroup\$ @Mr.Xcoder, neat! \$\endgroup\$ – Daniel Dec 17 '17 at 14:58
1
\$\begingroup\$

Jelly, 7 bytes

“¢³ƒ»ẋ5

Try it online!

| improve this answer | |
\$\endgroup\$
1
\$\begingroup\$

APL,  10 7 bytes

∊(⍴c)⍴⊂c←⎕

APL => APLAPLAPL

previous answer above prompted for screen input but if no input is required then we have the trivial for 7 bytes

9⍴'APL'
| improve this answer | |
\$\endgroup\$
1
\$\begingroup\$

SNOBOL4 (CSNOBOL4), 30 bytes

 OUTPUT =DUPL('SNOBOL4',7)
END

Try it online!

| improve this answer | |
\$\endgroup\$
1
\$\begingroup\$

Deorst, 11 bytes

'Deorst'l6*

Try it online!

| improve this answer | |
\$\endgroup\$
1
\$\begingroup\$

uBASIC, 27 bytes

1FORI=1TO6:?"uBASIC";:NEXTI

This answer is pretty small, thanks to uBASIC's tokenizer being powered with a solution of magic in unicorn blood.

Try it online!

| improve this answer | |
\$\endgroup\$
1
\$\begingroup\$

PHP, 59 bytes

Not the best way to do it (and there's a better php solution), but here's my go at it:

<?php $s="php";$l=strlen($s);for($i=0;$i<$l;$i++){echo $s;}

Try it online!

| improve this answer | |
\$\endgroup\$
1
\$\begingroup\$

rk, 22 bytes

rk:start
print: "rkrk"

Try it online!

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ Wait someone else knows about this language :o \$\endgroup\$ – MD XF Dec 17 '17 at 23:51
1
\$\begingroup\$

Octave, 26 bytes

disp(repmat('Octave',1,6))

Try it online!

| improve this answer | |
\$\endgroup\$
1
\$\begingroup\$

MY-BASIC, 33 bytes

for x=1 to 8
print"MY-BASIC"
next

Try it online!

| improve this answer | |
\$\endgroup\$
1
\$\begingroup\$

05AB1E, 10 bytes

"05AB1E"6×

Try it online!

| improve this answer | |
\$\endgroup\$
1
\$\begingroup\$

Befunge-98 (FBBI), 22 bytes

7v
"<_@#:-1,k6"Befunge

Try it online!

with -98 included:

av
"<_@#:-1,k9"Befunge-98

Try it online!

| improve this answer | |
\$\endgroup\$
1
\$\begingroup\$

pl, 4 bytes

plpl

Try it online!

| improve this answer | |
\$\endgroup\$
1
\$\begingroup\$

Cy, 12 bytes

"CyCy" print

Try it online!

| improve this answer | |
\$\endgroup\$
1
\$\begingroup\$

Tcl, 14 bytes

puts TclTclTcl

Try it online!

| improve this answer | |
\$\endgroup\$
1
\$\begingroup\$

Husk, 8 6 bytes

‼D¨Ż%k

-2 bytes thanks to @Zgarb!

Try it online or alternatively DD¨Ż%k would work too..

Explanation

‼D¨Ż%k
  ¨Ż%k  -- compressed string: "Husk"
‼D      -- duplicate twice: "HuskHuskHuskHusk"
| improve this answer | |
\$\endgroup\$
  • 2
    \$\begingroup\$ ‼D works too. \$\endgroup\$ – Zgarb Dec 17 '17 at 20:08
1
\$\begingroup\$

Charcoal, 10 bytes

×Charcoal⁸

Try it online! Alternatively, also 10 bytes:

×⁸Charcoal
F⁸Charcoal

More idiomatic for 13 bytes would be to say:

≔Charcoalθ⭆θθ
≔CharcoalθFθθ
| improve this answer | |
\$\endgroup\$
1
\$\begingroup\$

Clean, 29 bytes

c="CleanCleanCleanCleanClean"

Because actually doing anything requires import StdEnv, it's shorter to just hardcode.

Try it online!

| improve this answer | |
\$\endgroup\$
1
\$\begingroup\$

ReRegex, 17 bytes

a/ReRegex/aaaaaaa

Potentially one of the most simple ReRegex answers I've ever written.

Try it online!

| improve this answer | |
\$\endgroup\$

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