A Programming Puzzle of Mode Golf

43

4

Your task is to print the text Good morning, Green orb!, with every character repeated in place as many times as the most frequent byte in your source (the mode). A trailing newline is permitted and need not be repeated.

For example if your source was

print p

Since p appears twice and every other byte appears once you would need to print

GGoooodd  mmoorrnniinngg,,  GGrreeeenn  oorrbb!!

Answers will be scored by the product of their byte count and the number of times the output is repeated. For example the above code (if it worked) would score 7*2 = 14. The goal should be to minimize one's score.

Your code must contain at least 1 byte.

Use this program to verify that your code and output match

Post Rock Garf Hunter

Posted 2017-12-28T19:47:22.297

Reputation: 55 382

Functions are allowed, right? – totallyhuman – 2017-12-28T20:05:20.937

1@totallyhuman Yes, so long as they don't take input. – Post Rock Garf Hunter – 2017-12-28T20:05:42.617

1Shouldn't this be tagged [tag:quine]? – FantaC – 2017-12-29T16:12:21.133

Morning can't be capitalized, can it haha? – Magic Octopus Urn – 2018-01-10T19:56:43.320

@magicoctopusurn Nope the text should be the same. – Post Rock Garf Hunter – 2018-01-10T20:06:50.820

Sad face, was going to tie Jelly :P. – Magic Octopus Urn – 2018-01-10T20:23:30.103

Answers

18

Brain-Flak, 384 * 106 366 * 100 = 36,600

(((((((()()()))))))(()({}{}{}(([(({}{})){}()]((((({}())){})){}{}()(({})<([{}](((({}()())))([{}]([{}]()((()()())(()()({}()([(({})){}()](((((({}))))({}({}{}{}){})(({}){}()))))<((((([]){}){}){}<>)<>)>[])))))))(((((()()())()){}{}){}){})<>(((({})<>)))>{}{})))))<(<>({})<>)>))(<>((({}))()){}{}<>)<>(((({}<>()))))({}{}{}<>)<>{((<>{}<><({}<>)>)<{({}[()]<(({}))>)}{}>)<>}<>{}

Try it online!

Explanation

The first thing I do is push the string

!bro neerG ,gninrom dooG

to the stack using pretty standard brain-flak Kolmogorov-complexity tactics.

(((((((()()()))))))(()({}{}{}(([(({}{})){}()]((((({}())){})){}{}()(({})<([{}](((({}()())))([{}]([{}]()((()()())(()()({}()([(({})){}()](((((({}))))({}({}{}{}){})(({}){}()))))<((((([]){}){}){}<>)<>)>[])))))))(((((()()())()){}{}){}){})<>(((({})<>)))>{}{})))))<(<>({})<>)>))(<>((({}))()){}{}<>)<>({}<>())

Then we push a counter to the off stack to tell us how many times to duplicate each character. However I wasn't going to be able to determine what this counter was until I was done writing the program.

Next up we simultaneously reverse the string and duplicate each character in place the correct number of times. Specifically the counter + 1.

{((<>{}<><({}<>)>)<{({}[()]<(({}))>)}{}>)<>}<>{}

These two parts of the program have a mode of 99 open parentheses. However since we are most certainly going to need at least 1 parenthesis. Here is where I noticed that the last character we pushed ! conveniently has character code 33 which means we can use it to create 99, the exact number we want using only one additional parenthesis. This is quite the coincidence but it works.

Post Rock Garf Hunter

Posted 2017-12-28T19:47:22.297

Reputation: 55 382

9Ah yes, just pretty standard brain-flak Kolmogorov-complexity tactics. Those are the thing. – John Keates – 2017-12-30T02:49:35.723

You, my good fellow, must be mad to even try this. I'm just going to +1 and walk away before my brain explodes from trying to understand all the brackets. – caird coinheringaahing – 2018-01-03T14:51:38.840

15

Haskell, 37 bytes × 3 = 111

-20 thanks to H.PWiz. -25 thanks to nimi.

"Good m\111rning, Green orb!"<*[2..4]

Try it online!

Haskell's operators FTW.

Self-reminder to never golf on mobile. I keep making dumb mistakes. I can push at least half the blame on mobile. :P

totallyhuman

Posted 2017-12-28T19:47:22.297

Reputation: 15 378

5Using <* to save bytes (Note that I haven't checked its validity) – H.PWiz – 2017-12-28T20:42:14.923

...Bloody hell, Haskell almost has too many operators. Thanks! – totallyhuman – 2017-12-28T20:44:37.213

15

brainfuck, 235 x 77 = 18,095 points

Edit: -2 bytes thanks to @Dennis

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

Try it online!

TIO test

Wait, this isn’t code bowling?? \s

With only 8 usable characters, brainfuck is one of the worst languages to do this question. I had to start with minimising which character would inevitably appear the most, typically either + or -. After writing the first iteration of the code, I found it horribly unbalanced in favour of +s. I rearranged parts of the code, such as generation of larger numbers, to use more -. Finally, I ended up at an equal amount of the two characters at 77 one less - than +. It’s certainly possible to reduce this further, which I’ll have a go at tomorrow.

But hey, at least I beat the Brainflak answer

Jo King

Posted 2017-12-28T19:47:22.297

Reputation: 38 234

Hey, congratulations! I can't believe that it's even possible to do this in BF... Pretty if it can be done in the ;# language ( ͡° ͜ʖ ͡°) – RedClover – 2017-12-29T18:45:43.040

13

Jelly, 13 bytes * 1 = 13

“¢Ȧ@XĊ'WÑṭḂ#»

Try it online!

Mr. Xcoder

Posted 2017-12-28T19:47:22.297

Reputation: 39 774

3Finally someone manages the elusive *1 answer. I had a feeling Jelly would be the language to do it... – ETHproductions – 2017-12-28T20:25:08.420

@ETHproductions Haha, just halved my code while keeping * 1 – Mr. Xcoder – 2017-12-28T20:27:16.543

Haha dang I just found that right after you edited it – dylnan – 2017-12-28T20:30:14.663

Out of curiousity, what exactly is the difference? How is the new compressed string half the length of the old one? – ETHproductions – 2017-12-28T20:30:43.190

@ETHproductions I basically used a non-optimal compressed string at first, then I used the optimised Jelly compressor which found the matches in the dictionary.

– Mr. Xcoder – 2017-12-28T20:32:03.780

10

Alice, 49 bytes * 2 = 98 144

/:G!4o3r8"1=5',0Grey9Z<@
\"b0=dnm 2'i%g<7R6~e.;o/

Try it online!

Explanation

/...@
\.../

This is the usual framework for linear programs that operate entirely in Ordinal mode. Unfolding the zigzag control flow, we get:

"G04d3m821i5g,7G6ee9;<:b!=onr "'=%'<0Rr~y.Zo@

The basic idea is to avoid characters which repeat more than twice with the help of a transliteration. The transliteration we're going to do is the following:

input: "G04d3m821i5g,7G6ee9;<:b!"
from:  "0123456789:;<"
to:    "onr "

The way transliteration works in Alice is that the from and to strings are first repeated to the LCM of their lengths, although in this case, all the matters is the length of the from string, so we get:

from:  "0123456789:;<"
to:    "onr onr onr o"

This way, we get four different characters to represent the os, and three each for n, r and the space. We can generate the from string using range expansion as follows:

'<   Push "<".
0    Append a zero.
R    Reverse.
r    Range expansion.

The only issue now is that we'd need four " for both the input and the to string. To avoid that, we put them both into a single string and split it at a = used as a separator.

"G04d3m821i5g,7G6ee9;<:b!=onr "
     Push the string containing both parts.
'=%  Split around "=".

The rest is just:

~   Swap "from" and "to".
y   Transliterate.
.Z  Duplicate and interleave. This duplicates each character.
o   Print.
@   Terminate the program.

Martin Ender

Posted 2017-12-28T19:47:22.297

Reputation: 184 808

6

C (gcc), 74×6=444crossed out 444 is still regular 444 77×5=385 81×4=324

f(q){char*a="Go\157d morning, G\162een o\162b!";for(q=0;q<96;)putchar(a[q++/4]);}

Try it online!

betseg

Posted 2017-12-28T19:47:22.297

Reputation: 8 493

16o0 wat did you do to your post header – totallyhuman – 2017-12-28T20:35:35.327

9had a bit of fun – betseg – 2017-12-28T20:41:34.350

where did the crossed out 44 meta post go? – NieDzejkob – 2018-01-01T18:40:51.057

6

Python 2, 62 × 3 = 186

lambda:`sum(zip(*['Good morning, Green \x6frb!']*3),())`[2::5]

Try it online!

Dennis

Posted 2017-12-28T19:47:22.297

Reputation: 196 637

5

APL (Dyalog Unicode), 46 bytes × 2 = 92

(Contains unprintables)

2/⎕UCS(¯18+⍳24)+⎕UCS'X~r-yz|wqum1$Jtfemln]'

Try it online!

+Alot of bytes thanks to Dyalog's code page, thanks to @Adám for pointing that out.

Zacharý

Posted 2017-12-28T19:47:22.297

Reputation: 5 710

84 – Adám – 2017-12-28T20:34:05.387

That's really genius, @Adám – Zacharý – 2017-12-28T20:45:05.440

I'm afraid you have to settle for 92 since ~⎕AV∊⍨⎕UCS 18.

– Adám – 2017-12-28T23:08:13.180

5

C (gcc), 68 × 3 = 204

0000000: 6a 3b 6d 61 69 6e 28 29 7b 77 68 69 6c 65 28 6a  j;main(){while(j
0000010: 3c 37 32 29 70 75 74 63 68 61 72 28 7e 22 b8 90  <72)putchar(~"..
0000020: 90 9b df 92 90 8d 91 96 91 98 d3 df b8 8d 9a 9a  ................
0000030: 91 df 5c 32 32 30 8d 9d de 22 5b 6a 2b 2b 2f 33  ..\220..."[j++/3
0000040: 5d 29 3b 7d                                      ]);}

Thanks to @MDXF for saving 9 points and paving the way for 6 more!

Try it online!

Alternate version, printable ASCII, 69 × 3 = 207

j;main(k){while(j<72)putchar("Gnmg$hiuf`dl -I}ut|3{gt6"[k=j++/3]^k);}

Try it online!

Dennis

Posted 2017-12-28T19:47:22.297

Reputation: 196 637

Let us continue this discussion in chat.

– Dennis – 2017-12-30T01:06:53.217

5

Vim, 42 41 keystrokes × 3 = 123

iGod morning, Green orb!<Esc>2|qsyl2pl@sqX0@s

Explanation:

  1. iGod morning, Green orb!<Esc>
    Write the string God morning, Green orb! (one o missing).
  2. 2|
    Jump to the first o.
  3. qsyl2pl@sq
    Create a recursive macro s. As a side effect, triple the current o.
  4. X0
    Remove one o and jump to the beginning.
  5. @s
    Run the macro s, which repeat each character twice.

user285259

Posted 2017-12-28T19:47:22.297

Reputation: 201

4

C, 78 × 4 = 312

*s=L" ÞÞÈ@ÚÞäÜÒÜÎX@äÊÊÜ@ÞäÄB";main(y){while(*++s)for(;y++%5;putchar(*s/2));}

Try it online!

356 332

MD XF

Posted 2017-12-28T19:47:22.297

Reputation: 11 605

Commenting because I'm tired of finding it in my browser history every time I want to golf: I used this to find the number of character repetitions.

– MD XF – 2017-12-29T23:47:30.410

And this to encode the string.

– MD XF – 2017-12-29T23:57:15.717

3

Japt, 24 bytes * 2 = 48

`Good ¶rÍÁ,
GÎ9 b!`m²·¸

Contains an unprintable. Test it online!

The majority of the program is just a compressed string, which decompresses to

Good morning,
Green orb!

and then maps each character by repeating it ²wice okay, that was a bit of a stretch. Space is the only character that appears 3 times in the compressed string; to save one instance we replace it with a newline, then use ·¸ to split on newlines and immediately join on spaces. While 2 bytes longer, it substantially reduces the score (from 66 to 48).

Now if only there were a short way to do it using no character twice...

ETHproductions

Posted 2017-12-28T19:47:22.297

Reputation: 47 880

Because I can't see it: which character is in the source three times? I see several things that have a count of 2, but not 3. – Draco18s no longer trusts SE – 2017-12-28T20:14:13.690

1@Draco18s None, the score is 24*2. – ETHproductions – 2017-12-28T20:16:04.967

Then the output is wrong. You're printing each character 3 times instead of twice. – Draco18s no longer trusts SE – 2017-12-28T20:17:47.717

@Draco18s Dangit, posted the wrong link... Thanks for pointing that out. – ETHproductions – 2017-12-28T20:18:28.937

*salute* And now that I look at your answer I see it has ² whereas the link had ³ :) – Draco18s no longer trusts SE – 2017-12-28T20:19:48.103

@Draco18s Yep, and they do the same thing, but ² twice and ³ thrice :-) – ETHproductions – 2017-12-28T20:22:35.110

Yup, I know exactly what it does, just that I was looking at the source in the link as compared to the source in the answer. Otherwise I'd have seen that it was a bunged link. ;) – Draco18s no longer trusts SE – 2017-12-28T20:23:27.710

3

R, 65 bytes * 5 = 325 59 bytes * 5 = 295 62 bytes * 4 = 248

cat(gsub('(.)',strrep('\\1',4),"Good Mo\x72ning, Green orb!"))

Try it online!

There are 4 (or,') characters.

Giuseppe

Posted 2017-12-28T19:47:22.297

Reputation: 21 077

2I've never seen strrep before, that should come in handy. – BLT – 2017-12-29T16:02:07.333

3

SNOBOL4 (CSNOBOL4), 97 bytes * 10 = 970

	S ='Good Morning, Green orb!'
y	S	LEN(1) . y rem . s	:f(p)
	x	=x DUPL(y,10)	:(y)
p	OUTPUT	=x
END

Try it online!

yeah........SNOBOL requires operators to be separated by whitespace, and there are whitespace requirements that are quite awkward. There are 9 '\t' and 10 ' ' in the code, so any improvements will require a fairly significant change in approach.

Giuseppe

Posted 2017-12-28T19:47:22.297

Reputation: 21 077

3

Ruby, 52 bytes × 3 = 156

puts"Good morning, Green \x6frb!".gsub(/(.)/,'\1'*3)

Try it online!

Lynn

Posted 2017-12-28T19:47:22.297

Reputation: 55 648

Nice way to avoid repeating characters – Håvard Nygård – 2017-12-29T16:37:58.560

3

Perl 5, 59 × 2 = 118 points

$_="GSSdYmoVRing,YGVIen orb!";y<H-Z>[d-t ],s<.>[$&x2]eg;say

Try it online!

Perl 5, 51 × 3 = 153 156 points

s""GOOd morning, Green orb!";y'O'o';s/./$&x3/eg;say

Try it online!

Perl 5, 43 × 4 = 172 points

say"Good morning, Green orb!"=~s/./$&x4/egr

Try it online!

Saved 2 bytes in each solution thanks to @Xcali (a few changes ago). For all optimizations look at the edits.

mik

Posted 2017-12-28T19:47:22.297

Reputation: 208

Making this a program instead of a function would save 2 bytes (4 points): Try it online!

– Xcali – 2017-12-30T06:53:06.933

@Xcali, but your change needs a nonstandard option -M5.010, which also counts – mik – 2017-12-31T18:09:45.700

2

Python 2, 62*4 = 248

Thanks to @ovs and @Giuseppe!

lambda:"".join(c*4for(c)in"G\x6f\x6fd mor\x6eing, Green orb!")

Try it online!

Python 2, 51*6 = 306

print"".join(c*6for c in"Good morning, Green orb!")

Try it online!

Python 2, 70*5 = 350

lambda:"".join(c*5for(c)in"Gxxd mxrning, Green xrb!".replace('x','o'))

Try it online!

Thanks to @Mr. Xcoder for saving a byte from both versions!

Steadybox

Posted 2017-12-28T19:47:22.297

Reputation: 15 798

You can remove the space between 6 and for. – Mr. Xcoder – 2017-12-28T20:33:48.690

@Mr.Xcoder Thanks! – Steadybox – 2017-12-28T20:36:21.327

57*4=228 – ovs – 2017-12-28T22:23:59.270

@ovs that's not quite right, I think you need two \x6fs which is still good for 244 – Giuseppe – 2017-12-28T22:53:11.553

2

V, 35 bytes * 2 = 70

IG²od morning, GreeN ORb!5h3~ӈ/°°

Try it online!

Hexdump:

00000000: 4947 b26f 6420 6d6f 726e 696e 672c 2047  IG.od morning, G
00000010: 7265 654e 204f 5262 211b 3568 337e d388  reeN ORb!.5h3~..
00000020: 2fb0 b0                                  /..

James

Posted 2017-12-28T19:47:22.297

Reputation: 54 537

2

SOGL V0.12, 16 bytes * 1 = 16

7n]ēæ¬⁹≡qa╔αXE‘⁽

Try it Here!

Compression!

Though, if Green wasn't capitalized like that, this could be 3 bytes shorter :/

dzaima

Posted 2017-12-28T19:47:22.297

Reputation: 19 048

2

Clean, 77 bytes * 3 = 231

import StdEnv
f=[[b,b..]%(0,2)\\a<-:"Qyyn*wy|xsxq6*Q|oox*\171|l+",b<-[a-'
']]

Try it online!

Οurous

Posted 2017-12-28T19:47:22.297

Reputation: 7 916

2

Ohm v2, 20 bytes * 1 = 20

”1Gäåa¬Î|òÙγy[õ↕~LzN

Try it online!

Gotta love compression, although unfortunately it's not as good as SOGL's.

Nick Clifford

Posted 2017-12-28T19:47:22.297

Reputation: 1 184

2

CJam, 32 bytes × 2 = 64

"Gnmg$hiuf`dl -I}ut|3orb!"K,.^:_

Try it online!

Pushes a string, then XORs the first 20 character with [0, 1, …, 19], then duplicates each character.

Lynn

Posted 2017-12-28T19:47:22.297

Reputation: 55 648

2

PowerShell, 49*5 58 bytes * 4 = 232 pts

-13 pts thanks to ASCII-only

-join("Good m{0}rning, Green {0}rb!"-f'o'|% t*y|%{"$_"*4})

Try it online!

Uses formatting to go from 5 os to 4 to chip out some numbers

Veskah

Posted 2017-12-28T19:47:22.297

Reputation: 3 580

2232? – ASCII-only – 2019-02-12T08:52:25.443

close – ASCII-only – 2019-02-12T09:02:50.097

2

05AB1E, Score: 22 (22 bytes * 1)

…‚¿•´,„ˆ¨èã).ªðý23£'!«

Try it online.

Explanation:

NOTE 1: The wrap stack into list builtin ) is used instead of the builtin pair , because the is already part of the dictionary word good.
NOTE 2: The two commas in the code and , may look the same, but are different unicode characters. The first one is usually used for the builtin pair, and the second for the builtin print to STDOUT with trailing newline. In this case they are used for the dictionary word good, and the expected comma in the output however.

…‚¿•´,        # 3-word dictionary string "good morning," (the comma counts as the third word)
„ˆ¨èã         # 2-word dictionary string "green orbit"
)             # Wrap everything on the stack into a list: ["good morning,","green orbit"]
 .ª           # Sentence capitalize all strings: ["Good morning,","Green orbit"]
   ðý         # Join by spaces: "Good morning, Green orbit"
     23£      # Only leave the first 23 characters: "Good morning, Green orb"
        '!«  '# Append a "!": "Good morning, Green orb!" (and output the result implicitly)

See this 05AB1E tip of mine (section How to use the dictionary?) to understand why …‚¿•´, is "good morning," and „ˆ¨èã is "green orbit".

Kevin Cruijssen

Posted 2017-12-28T19:47:22.297

Reputation: 67 575

2

PowerShell, 46 bytes * 4 = 184 points

"Good morning, Green orb!"-replace'.',('$0'*4)

Try it online!

mazzy

Posted 2017-12-28T19:47:22.297

Reputation: 4 832

1That's clever. I completely forgot about $0 – Veskah – 2019-02-12T21:22:31.500

:| wait i tried this but only after doing the format so it didn't work as well as this did – ASCII-only – 2019-02-16T11:55:03.700

¯\(ツ)/¯ what about TIO link? – mazzy – 2019-02-16T18:28:14.903

1

JavaScript (ES6), 61 bytes * 3 = 183

_=>'Good morning, Gr\145en \x6f\x72b!'.replace(/./g,"$&$&$&")

f=
_=>'Good morning, Gr\145en \x6f\x72b!'.replace(/./g,"$&$&$&")
console.log(f())

JavaScript (ES6), 51 bytes * 4 = 204

_=>'Good morning, Green orb!'.replace(/./g,'$&$&$&$&')

Answer suggested by @ETHproductions.

f=
_=>'Good morning, Green orb!'.replace(/./g,'$&$&$&$&')
console.log(f())

JavaScript (ES6), 73 bytes * 4 = 292

_=>`G00d mo1ning, G244n orb!`.replace(/./g,_=>(('o'+!0)[_]||_).repeat(4))

f=
_=>`G00d mo1ning, G244n orb!`.replace(/./g,_=>(('o'+!0)[_]||_).repeat(4))
console.log(f())

JavaScript (ES6), 58 bytes * 6 = 348

_=>'Good morning, Green orb!'.replace(/./g,_=>_.repeat(6))

f=
_=>'Good morning, Green orb!'.replace(/./g,_=>_.repeat(6))
console.log(f())

darrylyeo

Posted 2017-12-28T19:47:22.297

Reputation: 6 214

Alternatively, change _=>_ to '$&' – ETHproductions – 2017-12-28T20:19:03.840

1Alternaternatively, I think you can just do '$&$&$&$&$&$&' for the replacement, which then I think allows you remove two instances and go down to having several characters tied at 4, drastically reducing the score... – ETHproductions – 2017-12-28T20:21:27.067

@ETHproductions Thanks, didn't know about that replacement pattern! – darrylyeo – 2017-12-28T20:30:09.770

1

Jelly, 31 bytes × 2 = 62 points

“2ðƈZ(Øṡdȷ¿Ɱ’ṃ“God mrnig,eb!”x2

Try it online!

Explanation

“2ðƈZ(Øṡdȷ¿Ɱ’ṃ“God mrnig,eb!”x2
“2ðƈZ(Øṡdȷ¿Ɱ’                     Base 250 number
              “God mrnig,eb!”     Unique characters of "Good morning..."
             ṃ                    Convert the base 250 number in base 13 then index into the string "God mr..."
                             x2   Repeat each character twice because “ occurs twice in the source (and now 2)

dylnan

Posted 2017-12-28T19:47:22.297

Reputation: 4 993

1

Retina, 36×4=144


Good morning, Green orb!
.
$&$&$&$&

Try it online! There are three newlines and four os, so there's nothing more to be done.

Neil

Posted 2017-12-28T19:47:22.297

Reputation: 95 035

1

Pushy, 36 * 2 = 72

`GXVWOP^4W_[afdc\hiB`N$29+L-''.

Try it online!

The main principle of this answer is that each character n is stored as n + index - 29 in order to avoid the repetition in the original string. This mapping created the string in the backticks. The rest of the program simply decodes this and prints each character twice:

` ... `              \ Push the encoded string
       N             \ Remove printing delimiter
        $            \ While there are items left on stack:
         29+         \   Add 29 to top of stack
            L-       \   Subtract current length from top of stack
              ''.    \   Print twice, then pop

Bytes used twice: `'W

Changelog

  • Golfed length from 41 to 38, by changing decoding method.
  • Golfed length from 38 to 37 by subtracting 29 from each encoded character to prevent multibyte characters.
  • Golfed length from 37 to 36 by using implicit 'end loop'

FlipTack

Posted 2017-12-28T19:47:22.297

Reputation: 13 242

1

Ruby, 55x4 = 220 points

"Good morning, Green orb!".split(//).each{|x|print x*4}

Im quite annoyed that using each_char makes the count of r's 5..

Håvard Nygård

Posted 2017-12-28T19:47:22.297

Reputation: 341

1

brainfuck, 414 * 163 = 67,482

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

Try it online!

I'm not very good at brainfuck so this is likely far from optimal, but it works.

Explanation

The first part is

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

This writes the charcodes for

Good morning, Green orb!

to memory in order. It is certainly the place that could use the most optimization.

Then we have

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

Which goes and prints off each character as many times as we tell it. Since there are 163 pluses in the program we tell it to print each character 163 times.

-[>-<---]>--------

Post Rock Garf Hunter

Posted 2017-12-28T19:47:22.297

Reputation: 55 382

1

Standard ML (MLton), 84*5=420 83 bytes * 5 = 415

map(fn$ =>map(fn _=>print(str$))[0,2,3,4,5])(explode"Good mor\110ing, Green orb!");

Try it online!


Alternative approach (same score)

String.map;it(fn c=>(print(it(fn _=>c)"vwxyz");c))"Good mor\110i\110g, Green orb!";

Try it online!

Laikoni

Posted 2017-12-28T19:47:22.297

Reputation: 23 676

1

Noether, 42 bytes * 4 = 168

"Good morning, Green orb!"~sL(si/4*Pi1+~i)

Outputs:

GGGGoooooooodddd    mmmmoooorrrrnnnniiiinnnngggg,,,,    GGGGrrrreeeeeeeennnn    oooorrrrbbbb!!!!

Try it online!

Beta Decay

Posted 2017-12-28T19:47:22.297

Reputation: 21 478

1

><>, 41 bytes x 7 = 287

|v"Good morning, Green orb!"
o\! !\:::|oo

Try it online!

As 'o' is used as the print character, this uses some mirrors to reuse them for printing.

Teal pelican

Posted 2017-12-28T19:47:22.297

Reputation: 1 338

@HeebyJeebyMan completely forgot to add that on, changed it now thanks :) – Teal pelican – 2018-01-16T09:33:31.723

144*3 – Jo King – 2019-02-12T07:39:19.650

1

Perl 6, 3 * 54 bytes = 162

<<"G{q`o`x 2}d"morning,'Green'orb!>>~~say S:g{.}=$/x 3

Try it online!

I started off with the normal:

"Good morning, Green orb!"~~(S:g{.}=$/x 4).say

Which simply replaces each letter by 4 copies of itself and prints. The mode characters were the spaces and the os, so I changed the string part to a word quote with interpolation:

<<Good morning,'Green'orb!>>~~say S:g{.}=$/x 4

This decreased the spaces down to 3. Next was the o, which I decided to double in the oo part of Good.

<<"G{q`o`x 2}d"morning,'Green'orb!>>~~say S:g{.}=$/x 4

This involved wrapping the Good in interpolating quotes of its own, then having to use a custom quoting construct to do the o character, since the quote characters were taken.

Jo King

Posted 2017-12-28T19:47:22.297

Reputation: 38 234

0

K (oK), 35 bytes * 4 = 140

Solution:

`0:,/4#'"Good morning, Green orb!";

Try it online!

Explanation:

Nothing fancy here, the most common letter is o which occurs 4 times.

`0:,/4#'"Good morning, Green orb!"; / the solution
        "Good morning, Green orb!"  / the string to be displayed
     4#'                            / 4 take (#) each (') repeats each character 4 times
   ,/                               / flatten these lists
`0:                               ; / print to stdout (`0:) and swallow return value (;)

streetster

Posted 2017-12-28T19:47:22.297

Reputation: 3 635

0

Swift, 53*3=159 bytes

{"Good morning, Green \u{6f}rb!".flatMap{[$0,$0,$0]}}

Try it online!

Herman L

Posted 2017-12-28T19:47:22.297

Reputation: 3 611

0

05AB1E, 22 bytes * 2 = 44

”‚¿•´,ˆ¨ orb!”'m5ǝ2иζJ

Try it online!


If I am able to output title-cased:

05AB1E, 13 bytes

”‚¿•´,ˆ¨ Orb!

Try it online!

Please note, CP-1252 is not a comma, therefore there are no dupes.

Magic Octopus Urn

Posted 2017-12-28T19:47:22.297

Reputation: 19 422

0

Java 11, score: 455 (91 bytes * 5)

x->{for(var s:"G\157od mo\162ning, G\162een orb!".split(""))System.out.print(s.repeat(5));}

The e, o, r, and t are all four used 5 times.

Try it online.

Explanation:

x->{                     // Method with empty unused parameter and no return-type
  for(var s:"G\157od mo\162ning, G\162een orb!"
                         //  Push String "Good morning, Green orb!"
            .split(""))  //  And loop over its characters as Strings
    System.out.print(s   //   Print the current character
      .repeat(5));}      //   Repeated 5 times

Kevin Cruijssen

Posted 2017-12-28T19:47:22.297

Reputation: 67 575

0

AWK, 59 bytes × 4 = 236

BEGIN{$0="Good morning, Green orb!";gsub(/./,"&&&&");print}

Try it online!

mik

Posted 2017-12-28T19:47:22.297

Reputation: 208

0

Pip, 42*4 = 168

a:"Good morning, Green orb!"Fi,#a{L4O(ai)}

Try it online!

Kenneth Taylor

Posted 2017-12-28T19:47:22.297

Reputation: 183