| Bytes | Lang | Time | Link |
|---|---|---|---|
| 348 | Bespoke | 250814T133355Z | Josiah W |
| 064 | AWK | 250314T161442Z | xrs |
| 076 | PHP | 181003T220745Z | ketone |
| 065 | Tcl | 181002T141023Z | sergiol |
| 129 | Deadfish~ | 210322T083258Z | emanresu |
| 074 | /// | 181101T050233Z | Conor O& |
| 066 | LUA | 181008T132313Z | ouflak |
| 046 | PowerShell | 181002T141322Z | lit |
| 056 | JavaScript Node.js | 181006T020323Z | ggorlen |
| 017 | Japt | 181002T120043Z | Luis fel |
| 029 | K oK | 181003T180253Z | Thaufeki |
| 045 | R | 181002T102636Z | J.Doe |
| 033 | Perl 5 | 181002T120620Z | nwellnho |
| 034 | Perl 6 | 181002T104404Z | Jo King |
| 038 | APLNARS | 181003T185117Z | user5898 |
| 026 | GolfScript | 181004T031547Z | JosiahRy |
| 011 | Husk | 181004T020631Z | Leo |
| 023 | Z80Golf | 181004T001057Z | Bubbler |
| 031 | Z80Golf | 181003T172822Z | user3604 |
| 012 | Stax | 181003T173457Z | recursiv |
| 013 | SOGL V0.12 | 181002T122245Z | dzaima |
| 016 | Pyth | 181002T135122Z | Sok |
| 064 | C# Visual C# Interactive Compiler 65 | 181002T133339Z | pocki_c |
| 015 | MathGolf | 181002T105033Z | Jo King |
| 024 | J | 181002T105707Z | Galen Iv |
| 019 | K ngn/k | 181002T191829Z | J. Sall& |
| 013 | Jelly | 181002T104847Z | Jonathan |
| 026 | V | 181002T162404Z | Endenite |
| 073 | MBASIC | 181002T161114Z | wooshiny |
| 084 | TSQL | 181002T162431Z | BradC |
| 048 | D | 181002T162214Z | ARaspiK |
| 017 | Pyth | 181002T154336Z | user4854 |
| 048 | Ruby | 181002T151313Z | Idva |
| 034 | PowerShell | 181002T123346Z | AdmBorkB |
| 056 | jq | 181002T141431Z | manatwor |
| 071 | F# | 181002T132529Z | Ciaran_M |
| 013 | Japt R | 181002T122249Z | Shaggy |
| 052 | Javascript | 181002T120510Z | zruF |
| 014 | Canvas | 181002T121807Z | dzaima |
| 044 | Haskell | 181002T120104Z | Max Yekh |
| 021 | APL Dyalog Classic | 181002T115735Z | Galen Iv |
| 078 | Java 11 | 181002T105453Z | Kevin Cr |
| 014 | Charcoal | 181002T113318Z | Neil |
| 029 | Retina | 181002T111608Z | Neil |
| 053 | Red | 181002T104959Z | Galen Iv |
| 014 | 05AB1E | 181002T103125Z | Kevin Cr |
| 036 | Python 2 | 181002T100422Z | TFeld |
Bespoke, 348 bytes
con emo n
c onemoncone mon
con e m o nco nemonco n e m onco ne mo n
con emo n
conemoncon e monc onem on
conem onc one m o n
con em onconemon
conemonco nem on
c onemoncone moncone moncone mo ncon emon
co nemoncon emon
cone mon
co nem onconem onconem onconemo nconemon
cone mo nc onemo nconem on
co nemo nconemo nco ne m onc on e monconemon
conemo nc
I got lazy.
PHP, 76 bytes
$i=8;foreach(str_split("conemon") as $k){$i+=2;echo str_repeat($k,$i)."\n";}
Deadfish~, 129 bytes
{{i}}d{c}{{d}i}ic{{i}}i{c}cc{{d}}dc{{i}}{c}cccc{{d}}c{{i}d}i{c}cccccc{{d}i}dc{{i}}d{c}cccccccc{{d}}ic{{i}}i{cc}{{d}}dc{{i}}{cc}cc
///, 74 bytes
/E/eeee//M/mmm//N/nnnn//O/oooo//;/OOO
NNNnn/cccccccccc
;
EEEE
MMMMMM
OO;NN
PowerShell, 46 bytes
$i=8;'c','o','n','e','m','o','n'|%{$_*($i+=2)}
# $i=8;foreach($c in [char[]]'conemon'){[string]$c*($i+=2)}
JavaScript (Node.js), 56 bytes
[..."conemon"].map((e,i)=>console.log(e.repeat(i*2+10)))
Japt, 17 bytes
"conemon"¬Ëp°EÑ+8
Japt, 14 bytes
`¬¶n`¬Ëp°EÑ+8
Explanation
"conemon"¬Ëp°EÑ+8 Full Program
"conemon"¬ Split each letter
Ëp Map and repeat
°EÑ+8 ((1 + Index) * 2) + 8
K (oK), 29 bytes
{i::8;{i+::2;i#x}'x}"conemon"
I'm not the biggest fan of this solution as it's bad practice (global variables), but it's short. May work on a better solution.
R, 50 47 45 bytes
This is some serious R abuse. I create a quote R expression C(O,N,E,M,O,N) and feed it into the string repeat function strrep, which kindly coerces each name inside the quote into a string. Shorter than scan !
write(strrep(quote(C(O,N,E,M,O,N)),5:11*2),1)
Perl 5, 33 bytes
conemon=~s/./say$&x(8+2*++$i)/reg
Explanation
s/ / / # Replace
g # each
. # character
=~ # in
conemon # string "conemon"
r # non-destructively (source is read-only)
e # only for the side effect of
say # printing with newline
$& # the full match (character)
x # repeated
++$i # 1,2,3,...
2* # 2,4,6,...
8+ # 10,12,14,...
( ) # times
Perl 6, 36 34 bytes
-2 bytes thanks to nwellnhof
("conemon".comb Zx(5..*X*2))>>.say
Explanation:
"conemon".comb # Get conemon as a list of characters
5..* # A lazy list from 5 to infinity
X*2 # Multiplied by 2
# This results in the list 10,12,14 etc.
Zx # Zip the two together with the string multiplication operator
# This multiplies each character by 10, 12 etc.
>>.say # Print each line
APL(NARS), 19 chars, 38 bytes
⊃'conemon'/¨⍨2×4+⍳7
test:
⊃'conemon'/¨⍨2×4+⍳7
cccccccccc
oooooooooooo
nnnnnnnnnnnnnn
eeeeeeeeeeeeeeee
mmmmmmmmmmmmmmmmmm
oooooooooooooooooooo
nnnnnnnnnnnnnnnnnnnnnn
GolfScript, 26 bytes
7:a;"conemon"{{.}a)):a*n}%
I'm surprised nobody else has done a solution in this language by now. However, I won't be surprised when this submission is eventually beaten.
Husk, 11 bytes
zR↓4İ0¨cΦ◄‰
Explanation
zR↓4İ0¨cΦ◄‰
¨cΦ◄‰ A = The compressed string "conemon"
İ0 B = The infinite list of even positive numbers
↓4 without its first four elements: [10,12,14,16...]
zR Create a list of strings replicating each character in A as many times
as the corresponding number in B
A list of strings in Husk is printed by joining them with newlines.
Z80Golf, 23 bytes
00000000: 0907 060d 0507 0676 1a3c 473c 127e ee68 .......v.<G<.~.h
00000010: ff10 fd3e 0a23 e5 ...>.#.
Disassembly
start:
add hl, bc ; db ('c'^$68)-2
rlca ; db 'o'^$68
ld b, $0d ; db 'n'^$68
; db 'e'^$68
dec b ; db 'm'^$68
rlca ; db 'o'^$68
ld b, $76 ; db 'n'^$68
; halt
ld a, (de) ; manipulate the byte at address 0
inc a
ld b, a ; loop count
inc a
ld (de), a ; save +2 of previous
ld a, (hl)
xor $68 ; the char to print
loop:
rst $38 ; print it `b` times
djnz loop
ld a, $0a ; newline to print
inc hl ; string index & return address
push hl
The Hello World trick strikes again. The first byte is also used to track the loop count.
Z80Golf, 35 31 bytes
00000000: 2118 0016 0a42 7efe 0028 0cff 10f8 3e0a !....B~..(....>.
00000010: ff23 1414 4218 ef76 636f 6e65 6d6f 6e .#..B..vconemon
Assembly:
ld hl,str
ld d, 10
ld b, d
loop:
ld a,(hl)
cp 0
jr z, hlt
rst 38h; putchar
djnz loop
ld a, 10; newline
rst 38h
inc hl
inc d
inc d
ld b, d
jr loop
hlt:
halt
str:
db 'conemon'
-4 bytes changed call 8000h to rst 38h
Stax, 12 bytes
ü¡│\½◙S·«═▓╞
Unpacked, ungolfed, and commented, it looks like this.
`Mwys-` compressed literal "conemon"
m for each character output the result after running the rest of the program
] wrap in singleton array
iHA+ `2 * i + 10` where i is the 0-based iteration index
* repeat array
SOGL V0.12, 13 bytes
╝⌠Ei№‘{ē«L+*P
Explanation:
╝⌠Ei№‘ push "conemon" - 2 words "cone" and "mon" compressed
{ for each
ē push the value of e (default 0), and increment it (aka e++)
« multiply that by 2
L+ add 10 to that
* repeat the character that many times
P and print it
Pyth, 17 16 bytes
V"conemon"*N~+T2
Try it online here.
V"conemon"*N~+T2 Implicit: T=10
V"conemon" For each character in "conemon", as N:
*N T Repeat N T times, implicit print with newline
~+T2 T += 2
C# (Visual C# Interactive Compiler) 65 64 bytes
for(int i=0;i<7;){WriteLine(new string("conemon"[i],i++*2+10));}
thanks to @Jonathan Frech saving 1 byte
new string(char, int) repeats the char as often as the int value.
C#, 72 bytes without "Console" as static using (example outside interactive compiler):
for(int i=0;i<7;){Console.WriteLine(new string("conemon"[i],i++*2+10));}
MathGolf, 15 bytes
╕│Pùmon+ô8î∞+*p
Explanation
╕│P Compression of 'cone'
ùmon Push 'mon'
+ Concatenate together
ô Foreach over each letter
8 Push 8
î∞ Push the index of the loop (1 based) and double it
+ Add the 8
*p Repeat the letter that many times and print with a newline
J, 25 24 bytes
echo'conemon'#"0~2*5+i.7
Note: There are trailing spaces on all lines except the last one.
Jelly, 14 13 bytes
-1 Thanks to Erik the Outgolfer (pointing me to the real optimal string compressor)
...and, of course, to user202729 (for creating it)!
“¦[Þ⁷ƥ»J+4×ḤY
A full program which prints the output required.
How?
“¦[Þ⁷ƥ»J+4×ḤY - Main Link: no arguments
“¦[Þ⁷ƥ» - compressed string as a list of characters -> ['c','o','n','e','m','o','n']
- (...due to this being a leading constant this is now the argument too)
J - range of length -> [ 1, 2, 3, 4, 5, 6, 7]
4 - literal four
+ - add (vectorises) -> [ 5, 6, 7, 8, 9,10,11]
× - multiply by the argument -> ['ccccc','oooooo',...,'nnnnnnnnnnn']
Ḥ - multiply by 2 (vectorises) -> ['cccccccccc','oooooooooooo',...,'nnnnnnnnnnnnnnnnnnnnnn']
Y - join with newline characters
- implicit print
V, 27 26 bytes
Iµc
¶o
·n
¸e
¹m
±o
±±n<esc>Îä$
<esc> represents the escape character (ascii 27)
Explanation
I Enter insert mode
µc Write 5 c and a newline
¶o Write 6 o and a newline
·n Write 7 n and a newline
¸e Write 8 e and a newline
¹m Write 9 m and a newline
±o Write 10 o and a newline
±±n Write 11 n
<esc> End insert mode
Îä$ Duplicate every line
MBASIC, 80 73 bytes
1 S$="conemon":FOR I=1 TO LEN(S$):PRINT STRING$(8+I*2,MID$(S$,I,1)):NEXT
Saved a loop by using the STRING$ function to generate the string of characters. Saved another 7 bytes by computing the length relative to the loop index.
Output:
cccccccccc
oooooooooooo
nnnnnnnnnnnnnn
eeeeeeeeeeeeeeee
mmmmmmmmmmmmmmmmmm
oooooooooooooooooooo
nnnnnnnnnnnnnnnnnnnnnn
T-SQL, 84 bytes
DECLARE @ INT=1a:PRINT REPLICATE(SUBSTRING('conemon',@,1),2*@+8)SET @+=1IF @<8GOTO a
The variable/loop approach turned out shorter than the best set-based variation I came up with (91 bytes):
SELECT REPLICATE(SUBSTRING('conemon',n,1),2*n+8)FROM(VALUES(1),(2),(3),(4),(5),(6),(7))a(n)
I don't know what it is, but I found this question particularly annoying. Which probably means it's a good question.
D, 48 bytes
foreach(i,c;"conemon")c.repeat(10+i*2).writeln;
Explanation:
foreach(i,c;"conemon") // Loop over string with index i, char c
c.repeat(10+i*2) // Repeat character 10 + (i*2) times
.writeln; // Write with newline
Run with rdmd:
$ rdmd --eval='foreach(i,c;"conemon")c.repeat(10+i*2).writeln;'
cccccccccc
oooooooooooo
nnnnnnnnnnnnnn
eeeeeeeeeeeeeeee
mmmmmmmmmmmmmmmmmm
oooooooooooooooooooo
nnnnnnnnnnnnnnnnnnnnnn
Pyth, 17 bytes
j.e*b+Tyk"conemon
Explanation
j.e*b+Tyk"conemon
.e "conemon For each character 'b' and index 'k' in "conemon"...
*b+Tyk ... get 2k + 10 copies of b.
j Join the result with newlines.
PowerShell, 35 34 bytes
'conemon'|% t*y|%{"$_$_"*(++$j+4)}
-1 byte thanks to mazzy
Literal string 'conemon' is converted toCharArray, then for each character we multiply it out by the appropriate length. This is handled by doubling up the character $_$_ then multiplying by $j+4 with $j pre-incremented each time (i.e., so it'll start at 1+4 = 5, which gets us 10 characters).
Each newly formed string is left on the pipeline, and implicit Write-Output gives us newlines for free.
jq, 56 characters
(52 characters code + 4 characters command line options)
[[range(5;12)],"conemon"/""]|transpose[]|.[1]*.[0]*2
Sample run:
bash-4.4$ jq -nr '[[range(5;12)],"conemon"/""]|transpose[]|.[1]*.[0]*2'
cccccccccc
oooooooooooo
nnnnnnnnnnnnnn
eeeeeeeeeeeeeeee
mmmmmmmmmmmmmmmmmm
oooooooooooooooooooo
nnnnnnnnnnnnnnnnnnnnnn
F#, 71 bytes
let d=Seq.iteri(fun i c->System.String(c,10+i*2)|>printfn"%s")"conemon"
Seq.iteri iterates through the sequence and applies the function to the index of the item i and the item itself c. In this case the string, every character in the string conemon.
System.String is a shortform of new System.String, taking the current letter c and repeating it 10+i*2 times, where i is the index of the letter. It then prints the string to the output with a new line.
You can omit the string and shorten it to:
let d=Seq.iteri(fun i c->System.String(c,10+i*2)|>printfn"%s")
And this will work with every string. But given this challenge is specifically for conemon the string is hard-coded.
Japt -R, 13 bytes
`¬¶n`¬Ë²p5+E
Explanation
`¬¶n`¬Ë²p5+E
`¦n` :Compressed string "conemon"
¬ :Split
Ë :Map each character at 0-based index E
² : Repeat twice
p5+E : Repeat 5+E times
:Implicitly join with new lines and output
Javascript, 55 52 bytes
saved 3 bytes thanks to @Arnauld
s=>[...'conemon'].map(x=>x.repeat(i+=2),i=8).join`
`
f=s=>[...'conemon'].map(x=>x.repeat(i+=2),i=8).join`
`
console.log(f());
Haskell, 44 bytes
i=[0..]
g=["conemon"!!n<$take(10+n*2)i|n<-i]
We generate a list of lists of lengths 10, 12 etc. (by taking the appropriate amount of elements from an infinite list) and then replace each element in each such list with corresponding character from the required string.
Java 11, 78 bytes
v->{int i=8;for(var c:"conemon".split(""))System.out.println(c.repeat(i+=2));}
Try it online. (NOTE: String.repeat(int) is emulated as repeat(String,int) for the same byte-count, because Java 11 isn't on TIO yet.)
Explanation:
v->{ // Method with empty unused parameter and no return-type
int i=8; // Integer `i`, starting at 8
for(var c:"conemon".split(""))
// Loop over the characters (as Strings) of "codemon"
System.out.println( // Print with trailing new-line:
c.repeat( // The current character repeated
i+=2));} // `i` amount of times, after we've first increased `i` by 2
Charcoal, 14 bytes
Econemon×ι⁺χ⊗κ
Try it online! Link is to verbose version of code. Explanation:
conemon Literal string
E Map over characters
κ Current index
⊗ Doubled
χ Predefined variable 10
⁺ Add
ι Current character
× Repeat
Implicitly print each string on separate lines
Retina, 29 bytes
K`conemon
L$`.
$.(5*_$`)*2*$&
Try it online! Explanation:
K`conemon
Initialise the buffer with the text.
L$`.
Loop over each character and output each substituion on its own line.
$.(5*_$`)*2*$&
Repeat the match (5 + index) * 2 times.
05AB1E, 16 14 bytes
.•Ω‡h₅•Sā·8+×»
-2 bytes thanks to @Emigna.
Explanation:
.•Ω‡h₅• # Push "conemon"
S # Convert it to a list of character: ["c","o","n","e","m","o","n"]
ā # Push a list in the range [1, length]: [1,2,3,4,5,6,7]
· # Double each: [2,4,6,8,10,12,14]
8+ # Add 8: [10,12,14,16,18,20,22]
× # Repeat the characters that many times
» # Join the list by newlines (and output implicitly)
See this 05AB1E tip of mine (section How to compress strings not part of the dictionary?) to understand why .•Ω‡h₅• is "conemon".