Letters challenge

7

5

Using the word “conemon” print each character 2 times more than the last. The first letter, “c”, should be printed 10 times, the second 12 and so on. Each repeated-letter-string should be printed on a new line.

So the end-result becomes:

cccccccccc
oooooooooooo
nnnnnnnnnnnnnn
eeeeeeeeeeeeeeee
mmmmmmmmmmmmmmmmmm
oooooooooooooooooooo
nnnnnnnnnnnnnnnnnnnnnn

Monolica

Posted 2018-10-02T09:59:11.013

Reputation: 1 101

Cccccccccc Oooooooooooo Nnnnnnnnnnnnnn And so on the solution should be displaced like that. There should be new line after every character is printed n times – Monolica – 2018-10-02T10:11:43.400

2Welcome to PPCG! I have update the challenge text to reflect your comment above (specifications should be in the post not in the comments). I also fixed up the grammar a little. Feel free to edit it more. – Jonathan Allan – 2018-10-02T10:17:13.930

The less characters the better. – Monolica – 2018-10-02T10:31:48.117

What is the smallest number of characters that could be used to solve this problem using python? – Monolica – 2018-10-02T13:14:05.090

7Don't know if this is of use for anyone, but conemon is rot10(seduced). – user2390246 – 2018-10-02T13:35:39.010

Are white spaces allowed before or after a string? – mazzy – 2018-10-02T13:48:13.953

Is it acceptable to return the list of lines, or do we need to output as a string? – None – 2018-10-02T15:30:51.277

Can we output it capitalised i.e. CONEMON – Jo King – 2018-10-03T09:12:57.190

Is it allow the follow output: ccccccccccoooooooooooonnnnnnnnnnnnnneeeeeeeeeeeeeeeemmmmmmmmmmmmmmmmmmoooooooooooooooooooonnnnnnnnnnnnnnnnnnnnnn

? – RosLuP – 2018-10-03T10:40:15.200

@RosLuP The spec is clear; it's not allowed. – Erik the Outgolfer – 2018-10-03T15:12:46.290

Answers

5

Python 2, 36 bytes

i=8
for c in'conemon':i+=2;print c*i

Try it online!

TFeld

Posted 2018-10-02T09:59:11.013

Reputation: 19 246

cccccccccc oooooooooooo nnnnnnnnnnnnnn And so on the solution should be displayed like above – Monolica – 2018-10-02T10:12:42.747

@Monolica Fixed – TFeld – 2018-10-02T10:17:44.100

who would be able to improve this python code to a shorter code. i=8 for c in'conemon':i+=2;print c*i – Monolica – 2018-10-02T11:10:22.400

20@Monolica FYI standard practice on PPCG is to wait quite some time (e.g. 1 week) before accepting an answer. Furthermore, for code-golf many question-posers don't ever actually accept any answer. If you are going to accept an answer, however, it should be the shortest code in bytes, since that is the winning criteria given by code-golf (given two of the same length it would be usual to accept the first to reach such a byte-count). – Jonathan Allan – 2018-10-02T11:24:11.953

10

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)

Try it online!

J.Doe

Posted 2018-10-02T09:59:11.013

Reputation: 2 379

2That deserves its own tip. – JayCe – 2018-10-04T13:07:05.530

4

K (ngn/k), 20 19 bytes

(2*5+!7)#'"conemon"

Try it online!

J. Sallé

Posted 2018-10-02T09:59:11.013

Reputation: 3 233

3

05AB1E, 16 14 bytes

.•Ω‡h₅•Sā·8+×»

-2 bytes thanks to @Emigna.

Try it online.

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

Kevin Cruijssen

Posted 2018-10-02T09:59:11.013

Reputation: 67 575

1.•Ω‡h₅•Sā·8+×» for 14. – Emigna – 2018-10-02T10:35:23.397

@Emigna I was just looking for a way to remove that map. Smart way with ā·, thanks! – Kevin Cruijssen – 2018-10-02T10:40:05.823

2

MathGolf, 15 bytes

╕│Pùmon+ô8î∞+*p

Try it online!

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

Jo King

Posted 2018-10-02T09:59:11.013

Reputation: 38 234

I'll write an explanation of the string compression in the mathgolf chat, look there in a minute. You could get 2-3 bytes off this solution. – maxb – 2018-10-02T11:43:26.420

This is one byte shorter. – maxb – 2018-10-02T11:51:10.097

The mapping to list of chars should not be needed now, saving one byte – maxb – 2018-10-02T16:06:43.053

2

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

Kevin Cruijssen

Posted 2018-10-02T09:59:11.013

Reputation: 67 575

2

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());

zruF

Posted 2018-10-02T09:59:11.013

Reputation: 59

This is a kolmogorov-complexity challenge which doesn't take any input, so you'll have to hardcode 'conemon' within the code. On the good news side, you don't need to include f= in your byte count, unless the function is referring to itself -- which is not the case here. – Arnauld – 2018-10-02T12:18:55.860

Hi. Welcome to PPCG. Quick note, you dont need to count f= bytes unless you use recursion so you answer is actually 47 bytes length – Luis felipe De jesus Munoz – 2018-10-02T12:19:29.937

Thank's for the clarification! I updated my answer. – zruF – 2018-10-02T12:34:42.290

2

Japt -R, 13 bytes

`¬¶n`¬Ë²p5+E

Try it


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

Shaggy

Posted 2018-10-02T09:59:11.013

Reputation: 24 623

2

PowerShell, 35 34 bytes

'conemon'|% t*y|%{"$_$_"*(++$j+4)}

Try it online!

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

AdmBorkBork

Posted 2018-10-02T09:59:11.013

Reputation: 41 581

-1? 'conemon'|% t*y|%{"$_$_"*(++$j+4)}. It is not reentrant. It requires rv j before second run. – mazzy – 2018-10-02T13:41:41.103

1@mazzy Or save it into a .ps1 script and execute the script. Thanks for the byte! – AdmBorkBork – 2018-10-02T14:50:17.513

2

Tcl, 78 bytes

set i 8
lmap x {c o n e m o n} {set s ""
time {set s $s$x} [incr i 2]
puts $s}

Try it online!

sergiol

Posted 2018-10-02T09:59:11.013

Reputation: 3 055

2

K (oK), 29 bytes

{i::8;{i+::2;i#x}'x}"conemon"

Try it online!

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.

Thaufeki

Posted 2018-10-02T09:59:11.013

Reputation: 421

1You'll need to include the "conemon" in your bytecount - take a look at the other K solution for inspiration :) – streetster – 2018-10-04T20:24:05.673

The other K solution is very neat, still coming to grips with this language. Do you know of any resources for k? I work with q, but would like to become more familiar with what's under the hood – Thaufeki – 2018-10-08T21:48:46.707

Q is just syntactic sugar on top of K4, and you can see the underlying K commands by typing the Q command raw into the REPL, e.g. count will return #:. There is a good manual for oK available here (an open source implementation of a mix of K5 and K6) which explains a lot of the commands. I would also suggest you taking a look at all the codegolf answers written in K for inspiration.

– streetster – 2018-10-09T12:55:31.407

There's also a Q Idioms page which shows how to perform the same task in Q or K

– streetster – 2018-10-09T12:56:21.243

Great, thank you for the link

<<<Q is just syntactic sugar on top of K4, and you can see the underlying K commands by typing the Q command raw into the REPL>>>

That's literally how I've been writing any of these K answers, writing it in q and then just switching to the underlying K if I can because it's so much more terse Thanks for the link – Thaufeki – 2018-10-09T12:56:53.373

2

Husk, 11 bytes

zR↓4İ0¨cΦ◄‰

Try it online!

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.

Leo

Posted 2018-10-02T09:59:11.013

Reputation: 8 482

1

Perl 6, 36 34 bytes

-2 bytes thanks to nwellnhof

("conemon".comb Zx(5..*X*2))>>.say

Try it online!

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

Jo King

Posted 2018-10-02T09:59:11.013

Reputation: 38 234

Would you be able to explain your solution? – Monolica – 2018-10-04T11:08:48.607

@Monolica I've added an explanation – Jo King – 2018-10-04T11:29:35.513

1

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.

Try it online!

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

Jonathan Allan

Posted 2018-10-02T09:59:11.013

Reputation: 67 804

I guess there's no literal for 11 in Jelly? – Jo King – 2018-10-02T11:08:14.463

There is 11 :) – Jonathan Allan – 2018-10-02T11:10:43.207

¢nṣkœ+¦s⁾ıß. Yes, mon is a word. – Erik the Outgolfer – 2018-10-02T15:36:24.940

1

Red, 53 bytes

n: 8 foreach c"conemon"[loop n: n + 2[prin c]print""]

Try it online!

Galen Ivanov

Posted 2018-10-02T09:59:11.013

Reputation: 13 815

1

J, 25 24 bytes

 echo'conemon'#"0~2*5+i.7

Try it online!

Note: There are trailing spaces on all lines except the last one.

Galen Ivanov

Posted 2018-10-02T09:59:11.013

Reputation: 13 815

1

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

Neil

Posted 2018-10-02T09:59:11.013

Reputation: 95 035

1

APL (Dyalog Classic), 21 bytes

⎕←↑'conemon'⍴¨⍨8+2×⍳7

Try it online!

Galen Ivanov

Posted 2018-10-02T09:59:11.013

Reputation: 13 815

I believe you can drop the first 2 bytes – Quintec – 2018-10-02T12:32:52.720

@Quintec Doesn't print anything in TIO without the first 2 bytes, that's why I left them – Galen Ivanov – 2018-10-02T12:43:15.063

1put it in input – Quintec – 2018-10-02T12:46:27.543

@Quintec - I'm not sure if it's acceptable. – Galen Ivanov – 2018-10-02T13:09:44.487

1Actually, for TIO you need to put anything prefixed with ⎕← to display output, or put it in input. For TryAPL and Dyalog application you don't. – Quintec – 2018-10-03T00:16:33.130

@Quintec Thanks! – Galen Ivanov – 2018-10-03T06:55:31.937

1

Japt, 17 bytes

"conemon"¬Ëp°EÑ+8

Try it online!


Japt, 14 bytes

`¬¶n`¬Ëp°EÑ+8

Try it online!


Explanation

"conemon"¬Ëp°EÑ+8           Full Program
"conemon"¬                  Split each letter       
          Ëp                Map and repeat  
            °EÑ+8           ((1 + Index) * 2) + 8

Luis felipe De jesus Munoz

Posted 2018-10-02T09:59:11.013

Reputation: 9 639

Looks like you beat me to it. You're welcome to this if you want it.

– Shaggy – 2018-10-02T12:32:26.430

@Shaggy Nah, keep yours, It is better than mine jejeje. Btw, why the string compression worked for you? I used v2.0 – Luis felipe De jesus Munoz – 2018-10-02T12:37:54.653

Compressing it as a single string and trying to decompress it with backticks didn't work for me either but it did with O.d() - it happens sometimes. I ended up splitting it into co and nemon, compressing those strings individually and then recombining them. – Shaggy – 2018-10-02T12:54:51.813

I tweaked mine slightly to be a little less similar to yours. – Shaggy – 2018-10-02T18:05:43.830

1

Haskell, 44 bytes

i=[0..]
g=["conemon"!!n<$take(10+n*2)i|n<-i]

Try it online!

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.

Max Yekhlakov

Posted 2018-10-02T09:59:11.013

Reputation: 601

2["conemon"!!n<$[0..9+2*n]|n<-[0..]] (without i). As anonymous functions are allowed, you don't have to give the function a name, so drop the g=. However, I'm not sure whether a list of strings is a valid output format for this particular challenge as it says "each [...] string [...] printed on a new line". – nimi – 2018-10-02T14:45:43.550

1

Perl 5, 33 bytes

conemon=~s/./say$&x(8+2*++$i)/reg

Try it online!

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

nwellnhof

Posted 2018-10-02T09:59:11.013

Reputation: 10 037

Can you explain your solution please? – Monolica – 2018-10-04T10:42:20.167

@Monolica Done. – nwellnhof – 2018-10-04T12:00:39.853

1

Canvas, 14 bytes

conemon{²«8+×]

Try it here!

dzaima

Posted 2018-10-02T09:59:11.013

Reputation: 19 048

1

SOGL V0.12, 13 bytes

╝⌠Ei№‘{ē«L+*P

Try it Here!

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

dzaima

Posted 2018-10-02T09:59:11.013

Reputation: 19 048

1

F#, 71 bytes

let d=Seq.iteri(fun i c->System.String(c,10+i*2)|>printfn"%s")"conemon"

Try it online!

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.

Ciaran_McCarthy

Posted 2018-10-02T09:59:11.013

Reputation: 689

1

C# (Visual C# Interactive Compiler) 65 64 bytes

for(int i=0;i<7;){WriteLine(new string("conemon"[i],i++*2+10));}

Try it online!

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));}

pocki_c

Posted 2018-10-02T09:59:11.013

Reputation: 121

I think you can move your i++ into your i*2+10. – Jonathan Frech – 2018-10-02T16:22:14.330

1

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

Sok

Posted 2018-10-02T09:59:11.013

Reputation: 5 592

1

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)}

lit

Posted 2018-10-02T09:59:11.013

Reputation: 111

Welcome to PPCG again! https://codegolf.stackexchange.com/questions/191/tips-for-golfing-in-powershell

– mazzy – 2018-10-02T14:48:02.230

1

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

Try it online!

manatwork

Posted 2018-10-02T09:59:11.013

Reputation: 17 865

1

Ruby, 48 bytes

->{a=4;'conemon'.each_char{|s|puts s*(a=1+a)*2}}

Try it online!

Idva

Posted 2018-10-02T09:59:11.013

Reputation: 97

1

Pyth, 17 bytes

j.e*b+Tyk"conemon

Try it here

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.

user48543

Posted 2018-10-02T09:59:11.013

Reputation:

1

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

wooshinyobject

Posted 2018-10-02T09:59:11.013

Reputation: 171

1

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

ARaspiK

Posted 2018-10-02T09:59:11.013

Reputation: 11

1

V, 27 26 bytes

Iµc
¶o
·n
¸e
¹m
±o
±±n<esc>Îä$

<esc> represents the escape character (ascii 27)

Try it online!

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

Herman L

Posted 2018-10-02T09:59:11.013

Reputation: 3 611

1

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.

BradC

Posted 2018-10-02T09:59:11.013

Reputation: 6 099

1

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

Try it online!

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

Logern

Posted 2018-10-02T09:59:11.013

Reputation: 845

1

Stax, 12 bytes

ü¡│\½◙S·«═▓╞

Run and debug it

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

Run this one

recursive

Posted 2018-10-02T09:59:11.013

Reputation: 8 616

1

APL(NARS), 19 chars, 38 bytes

⊃'conemon'/¨⍨2×4+⍳7

test:

  ⊃'conemon'/¨⍨2×4+⍳7
cccccccccc            
oooooooooooo          
nnnnnnnnnnnnnn        
eeeeeeeeeeeeeeee      
mmmmmmmmmmmmmmmmmm    
oooooooooooooooooooo  
nnnnnnnnnnnnnnnnnnnnnn

RosLuP

Posted 2018-10-02T09:59:11.013

Reputation: 3 036

1

[PHP], 76 bytes

$i=8;foreach(str_split("conemon") as $k){$i+=2;echo str_repeat($k,$i)."\n";}

Try it online

ketone

Posted 2018-10-02T09:59:11.013

Reputation: 41

1

Z80Golf, 23 bytes

00000000: 0907 060d 0507 0676 1a3c 473c 127e ee68  .......v.<G<.~.h
00000010: ff10 fd3e 0a23 e5                        ...>.#.

Try it online!

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.

Bubbler

Posted 2018-10-02T09:59:11.013

Reputation: 16 616

1

GolfScript, 26 bytes

7:a;"conemon"{{.}a)):a*n}%

Try it online!

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.

JosiahRyanW

Posted 2018-10-02T09:59:11.013

Reputation: 2 600

1

JavaScript (Node.js), 56 bytes

[..."conemon"].map((e,i)=>console.log(e.repeat(i*2+10)))

Try it online!

ggorlen

Posted 2018-10-02T09:59:11.013

Reputation: 121

1

///, 74 bytes

/E/eeee//M/mmm//N/nnnn//O/oooo//;/OOO
NNNnn/cccccccccc
;
EEEE
MMMMMM
OO;NN

Try it online!

Conor O'Brien

Posted 2018-10-02T09:59:11.013

Reputation: 36 228

0

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.

Neil

Posted 2018-10-02T09:59:11.013

Reputation: 95 035

0

LUA, 67 66 bytes

s="conemon"
l=10
for i in s:gmatch'.'do print(i.rep(i,l))l=l+2 end

Try it online.

ouflak

Posted 2018-10-02T09:59:11.013

Reputation: 925