Greeting The User

17

2

Create a program which when run displays the text below:

)-*-*-*^_^*-*-*-(
| Welcome User! |
)-*-*-*^_^*-*-*-(

Use any functions or language to answer this, have fun. Shortest code wins

Amurt4l

Posted 2017-06-20T19:51:22.657

Reputation: 323

3Can we alternatively return this from a function, as per usual? – Stephen – 2017-06-20T20:00:57.673

6Are leading/trailing newlines allowed? – Gryphon – 2017-06-20T20:08:18.543

Answers

6

Japt, 41 39 bytes

Saved 2 bytes thanks to @Shaggy

[U="){"-*-*-*^_"ê}("`| WelÖ  U r! |`U]·

Explanation:

[U="){"-*-*-*^_"ê}("`| WelÖ  U r! |`U]·
[                                    ]    // Create a new array
 U=                                       // Variable U =
   ")                                     //   ")
     {            }                       //   Evaluate everything in curley-brackets as code
      "-*-*-*^_"ê                         //   "-*-*-*^_" mirrored -> -*-*-*^_^*-*-*-
                  ("                      //   ("
                                          * Now we have [U=")-*-*-*^_^*-*-*-("]
                    `| WelÖ  U r! |`      // "| Welcome User! |" decompressed by `...`
                                     U    // ")-*-*-*^_^*-*-*-("
                                          * Now we have [")-*-*-*^_^*-*-*-(","| Welcome User! |",")-*-*-*^_^*-*-*-("]
                                      ·   // Split with new-lines

Try it online!

Oliver

Posted 2017-06-20T19:51:22.657

Reputation: 7 160

139 bytes – Shaggy – 2017-06-21T09:55:31.533

32

Python 2, 54 bytes

print(")-*-*-*^_^*-*-*-(\n| Welcome User! |\n"*2)[:53]

Try it online!

xnor

Posted 2017-06-20T19:51:22.657

Reputation: 115 687

7WOW, I'll tattoo this approach on my cerebral cortex!! – Mauro Baraldi – 2017-06-20T20:59:46.017

Impressive, beat me by 1 byte! Take a +1 – Gryphon – 2017-06-21T00:08:37.750

12

T-SQL, 60 bytes

PRINT')-*-*-*^_^*-*-*-(
| Welcome User! |
)-*-*-*^_^*-*-*-('

SQL allows splitting string literals over lines, so those returns are counted.

Working on a procedural solution, but doubt I'll find one under 60.

New Edit: Found a simple REPLACE that ties the trivial solution:

PRINT REPLACE('1
| Welcome User! |
1',1,')-*-*-*^_^*-*-*-(')

Turns out that REPLACE will do an implicit conversion of a numeral to a string, so this lets me save 2 characters by eliminating the quotes around my replacement character.

Trying to put it into a variable is too long, due to the overhead of the DECLARE (69 bytes):

DECLARE @ CHAR(17)=')-*-*-*^_^*-*-*-('PRINT @+'
| Welcome User! |
'+@

BradC

Posted 2017-06-20T19:51:22.657

Reputation: 6 099

Please see this: https://codegolf.meta.stackexchange.com/a/1146/46066

– juniorRubyist – 2017-06-20T20:16:04.063

8This answer is completely fine @juniorRubyist – Mr. Xcoder – 2017-06-20T20:16:53.277

Ok. I removed that downvote. – juniorRubyist – 2017-06-20T20:18:02.030

Thanks. Thought you were originally referring to the hard-coding the output limitation, but that's allowed for kolmogorov-complexity. Just not particularly efficient.

– BradC – 2017-06-20T20:19:55.433

9

Python 2.7, 55 bytes

a="\n)-*-*-*^_^*-*-*-(\n"
print a+'| Welcome User! |'+a

Pretty simple. Includes leading and trailing newlines.

Gryphon

Posted 2017-06-20T19:51:22.657

Reputation: 6 697

13It does not need to be a function. – totallyhuman – 2017-06-20T20:17:52.463

8

C (gcc), 78 75 bytes

main(i){for(;printf(")-*-*-*^_^*-*-*-(")&i--;puts("\n| Welcome User! |"));}

Try it online!

cleblanc

Posted 2017-06-20T19:51:22.657

Reputation: 3 360

Nice try, pretty low amount of bytes as well! – Amurt4l – 2017-06-20T20:03:30.730

Lowest I have got it down to is 66 bytes so far – Amurt4l – 2017-06-20T20:04:01.860

71 bytes with a trailing newline (75 without): #define P puts(")-*-*-*^_^*-*-*-(") f(){P;puts("| Welcome User! |");P;}

– Steadybox – 2017-06-20T20:11:07.307

2@Amurt4l if you would like, since you have gotten quite a few answers, you can post your own answer as well :) – Stephen – 2017-06-20T20:35:43.350

6

Bubblegum, 43 bytes

00000000: d3d4 d502 c1b8 f838 30ad abc1 55a3 109e  .......80...U...
00000010: 9a93 9c9f 9baa 105a 9c5a a4a8 50c3 a589  .......Z.Z..P...
00000020: ae06 00bd 4d85 9835 0000 00              ....M..5...

Try it online!

James

Posted 2017-06-20T19:51:22.657

Reputation: 54 537

3This language <s>is</s> feels like such an abuse of the "rules", that I think we should change them just so that @Dennis will have to change the language a little – Stephen – 2017-06-20T20:33:16.137

@StephenS TBH, I agree. However, thankfully languages optimized for [tag:kolmogorov-complexity] (Jelly, 05AB1E, V, SOGL, some others) can still usually beat it without feeling as cheap. – James – 2017-06-20T20:34:32.290

11@StephenS If a challenge is best solved with Bubblegum, it’s the challenge’s fault, not the language’s. Instead of rules lawyering, write more interesting challenges. – Anders Kaseorg – 2017-06-21T04:57:48.807

6

05AB1E, 31 29 26 bytes

-3 Bytes thanks to Emigna

")-*-*-*^_".∞D”|‡Ý‚Ý! |”s»

Try it online!

Explanation

")-*-*-*^_".∞D”|‡Ý‚Ý! |”s»
")-*-*-*^_"                # Push )-*-*-*^_
           .∞              # Intersected mirror (results in )-*-*-*^_^*-*-*-( )
             D             # Duplicate top of stack
              ”|‡Ý‚Ý! |”   # Pushes | Welcome User! |
                        s  # Swap top items on stack
                         » # Join on newlines

Datboi

Posted 2017-06-20T19:51:22.657

Reputation: 1 213

1You could do .∞ instead of û¨'(« – Emigna – 2017-06-20T20:47:15.327

I knew this had to exist somehow! Thanks man – Datboi – 2017-06-20T20:52:39.557

Nevermind, what I posted was equivalent lol. – Magic Octopus Urn – 2017-06-21T13:56:01.833

I know it's been a while, but you can save a byte by changing the ")-*-*-*^_" to ')„-*Є^_J. :) – Kevin Cruijssen – 2020-01-06T14:56:27.593

5

JavaScript, 56 bytes

alert(`${s=")-*-*-*^_^*-*-*-("}
| Welcome User! |
${s}`)

JavaScript (ES6), 50 48 bytes (function)

_=>(s=")-*-*-*^_^*-*-*-(")+`
| Welcome User! |
`+s

-2 bytes thanks to Rick Hitckcock

Stephen

Posted 2017-06-20T19:51:22.657

Reputation: 12 293

Why alert? Save a few bytes using a function. – Shaggy – 2017-06-20T20:11:31.120

@Shaggy I know that, just edited it in, but currently OP says display, and has not responded to my comment yet – Stephen – 2017-06-20T20:12:25.333

Please see this: https://codegolf.meta.stackexchange.com/a/1146/46066

– juniorRubyist – 2017-06-20T20:16:25.707

4@juniorRubyist we usually allow either a complete program or a function. OP did not specify that functions that returned the value instead of displaying it were allowed, so my second two entries may not be allowed. However, complete programs are (almost) always allowed, and JavaScript doesn't need boilerplate. Copy my alert into a .js file and run it in your browser, it'll run. – Stephen – 2017-06-20T20:19:55.313

Save 2 bytes with _=>(s=")-*-*-*^_^*-*-*-(")+\n| Welcome User! |\n+s – Rick Hitchcock – 2017-06-20T21:39:48.183

Is there a reason you can't use the function argument instead of a new variable for storing the top and bottom of the string? – kamoroso94 – 2017-10-19T17:01:28.437

5

Python 3, 62 bytes

print(")-*-*-*^_^*-*-*-(\n| Welcome User! |\n)-*-*-*^_^*-*-*-(")

Mauro Baraldi

Posted 2017-06-20T19:51:22.657

Reputation: 189

Needs to be a function. – juniorRubyist – 2017-06-20T20:12:58.933

Please see this: https://codegolf.meta.stackexchange.com/a/1146/46066

– juniorRubyist – 2017-06-20T20:16:13.997

3But it's not a snippet. It's a full program. – totallyhuman – 2017-06-20T20:17:18.083

2No, does not need to be a funciton. Read it again: Use any functions or language to answer this. – Mauro Baraldi – 2017-06-20T20:18:37.433

2@juniorRubyist The 1st line of the question says Create a program – dzaima – 2017-06-20T20:18:50.867

@dzaima I'll point out the other python answer and then direct you towards the standard defaults.

– Draco18s no longer trusts SE – 2017-06-21T03:41:21.080

@dzaima this is actually a full program.. – Stefan – 2017-06-22T07:34:29.367

4

C, 75 bytes

main(){char*S=")-*-*-*^_^*-*-*-(";printf("%s\n| Welcome User! |\n%s",S,S);}

Govind Parmar

Posted 2017-06-20T19:51:22.657

Reputation: 828

70 bytes like this; m=")-*-*-*^_^*-*-*-(";main(){printf("%s\n| Welcome User! |\n%s",m,m);} – cleblanc – 2017-06-21T12:59:16.383

4

C# (.NET Core), 60 bytes

_=>")-*-*-*^_^*-*-*-(\n| Welcome User! |\n)-*-*-*^_^*-*-*-("

Try it online!

Charlie

Posted 2017-06-20T19:51:22.657

Reputation: 11 448

4

Sed, 51

Two for the price of one:

s/^/)-*-*-*^_^*-*-*-(/p
x
s/^/| Welcome User! |/p
x

Try it online.

s/^/)-*-*-*^_^*-*-*-(\n| Welcome User! |/p
s/\n.*//

Try it online.

Digital Trauma

Posted 2017-06-20T19:51:22.657

Reputation: 64 644

4

MATLAB / Octave, 53 bytes

a=')-*-*-*^_^*-*-*-(';disp([a;'| Welcome User! |';a])

rayryeng - Reinstate Monica

Posted 2017-06-20T19:51:22.657

Reputation: 1 521

Why MATLAB / Python? This is definitely not valid python. – James – 2017-06-21T00:06:18.540

@DJMcMayhem Sorry I meant Octave. Thanks for noticing the typo. Been answering python questions over on SO all day so brain had a small glitch :) – rayryeng - Reinstate Monica – 2017-06-21T00:06:32.133

If you ommit disp Matlab will show leading ans = \n. – Crowley – 2017-06-21T12:31:50.687

@Crowley That's why you need the disp there as it won't conform to the exact output. – rayryeng - Reinstate Monica – 2017-06-21T14:21:16.840

If the ans = is not disallowed you can save 6 bytes. – Crowley – 2017-06-21T16:18:38.803

@Crowley I agree completely with the byte count, but I don't think it's permitted for this challenge. This is Kolmogorov Complexity so the output must exactly match the challenge. If the OP has some leeway, it would have been mentioned. – rayryeng - Reinstate Monica – 2017-06-21T16:22:34.987

4

Charcoal, 32 30 bytes

_^×*-³(⸿emocleW |‖B¬J¹¦¹ User!

Try it online! Link is to verbose version of code. Explanation:

_^              Print("_^");
×*-³            Print(Times("*-", 3));
(⸿emocleW |     Print("(\remocleW |");

Prints the mirror image of the top left portion of the output.

‖B¬             ReflectButterfly(:¬);

Reflects down and to the left to create the top and bottom lines and the left of the middle line.

J¹¦¹            JumpTo(1, 1);
 User!          Print(" User!");

Fixes up the middle line.

Neil

Posted 2017-06-20T19:51:22.657

Reputation: 95 035

(Why the downvote?) – Neil – 2017-06-22T12:15:49.690

2Apparently someone's been downvoting many of the answers in this challenge, my submission is also one of the affected ones. – user41805 – 2017-06-22T12:18:46.677

4

Perl 5, 49 bytes

print$\=")-*-*-*^_^*-*-*-(","
| Welcome User! |
"

Try it online!

Uses the fact that $\ is implicitly printed after each print.

Dada

Posted 2017-06-20T19:51:22.657

Reputation: 8 279

What about say? – simbabque – 2017-06-22T13:23:51.680

1

@simbabque I tend to follow this consensus. Furthermore, replacing all print with say isn't really where the point of golfing lies in my opinion. But I'm not on any crusade to stop using say though; I let everyone do as they like, and everyone is happy :)

– Dada – 2017-06-22T13:32:59.053

3

PHP, 50 bytes

<?=$a=")-*-*-*^_^*-*-*-(","
| Welcome User! |
$a";

Try it online!

Jörg Hülsermann

Posted 2017-06-20T19:51:22.657

Reputation: 13 026

1<?=$a=")-*-*-*^_^*-*-*-(","\n| Welcome User! |\n$a"; – Christoph – 2017-06-21T09:32:18.387

3

Mathematica, 52 bytes

Column@{t=")-*-*-*^_^*-*-*-(","| Welcome User! |",t}

J42161217

Posted 2017-06-20T19:51:22.657

Reputation: 15 931

3

Golang, 82 bytes

func main(){var a string=")-*-*-*^_^*-*-*-(\n";Printf(a+"| Welcome User! |\n"+a)}

Try it online!

ionk

Posted 2017-06-20T19:51:22.657

Reputation: 39

Hello, and welcome to PPCG! Your submission can be a function that returns the text as output, as per meta consensus, which might make it shorter and better for this site. – Comrade SparklePony – 2017-06-20T22:11:12.153

Ah okay, thank you for the heads up. I'll make an edit. – ionk – 2017-06-20T22:13:54.613

You have to include the fmt import, sorry. – totallyhuman – 2017-06-22T12:44:30.347

@totallyhuman wait but it's not part of the function. – ionk – 2017-06-22T18:53:31.493

3

Ruby, 49 bytes

$><<[")-*-*-*^_^*-*-*-("]*2*"
| Welcome User! |
"

Try it online!

Value Ink

Posted 2017-06-20T19:51:22.657

Reputation: 10 608

3

Minecraft Functions, 77 bytes

tellraw @a {"text":")-*-*-*^_^*-*-*-(\n| Welcome User! |\n)-*-*-*^_^*-*-*-("}

LyricLy

Posted 2017-06-20T19:51:22.657

Reputation: 3 313

This isn't even trying to compress the string... – Okx – 2017-06-22T10:07:29.957

2@Okx Well try doing that when the only non-constant things you can print are numbers and block/item names :p – dzaima – 2017-06-22T12:04:19.110

3

Braingolf, 55 bytes

22#)[#-#*]"^_^"[#*#-]#(V"
| Welcome User! |
"R!&@v&@R&@

Try it online!

It's 2 bytes shorter than hardcoding the output.

Explanation

22                         Push 2 2s to the stack
                             These are used for loop counting
  #)                       Push )
    [#-#*]                 Push -* 3 times, using one of the 2s
          "^_^"            Push ^_^
               [#*#-]      Push *- 3 times, using the remaining 2
                     #(    Push (
                       V   Create a new stack
                        "
| Welcome User! |
"                          Push \n| Welcome User! |\n to the new stack
 R!&@                      Return to main stack, print entire stack without popping
     v&@                   Switch to 2nd stack, pop and print stack
        R                  Return to main stack, pop and print stack

Skidsdev

Posted 2017-06-20T19:51:22.657

Reputation: 9 656

3

Batch, 70 bytes

@SET b=@ECHO )-*-*-*^^^^_^^^^*-*-*-(
%b%
@ECHO ^| Welcome User! ^|
%b%

I mostly enjoy this one because all the escape characters make the emoticon ^_^ look like an adorable Lovecraft abomination ^^^^_^^^^

Engineer Toast

Posted 2017-06-20T19:51:22.657

Reputation: 5 769

3

><>, 56 54 bytes

/a"| !resU emocleW |>"01pa
 l?!;o
/"(-*-*-*^_^*-*-*-)"

Try it online!

2 bytes saved by AGourd

Teal pelican

Posted 2017-06-20T19:51:22.657

Reputation: 1 338

On your first line, you could change |"a">"01p to |>"01pa to save a couple characters – AGourd – 2017-06-22T13:20:20.467

@AGourd; Oh I must have missed that, seems simple when you point it out :) - I'll edit it out soon, thanks. – Teal pelican – 2017-06-22T13:25:50.947

2

V, 35 bytes

é)8a-*r(ãhR^_^Äo| Welcome User! |

Try it online!

Hexdump:

00000000: e929 3861 2d2a 1b72 28e3 6852 5e5f 5e1b  .)8a-*.r(.hR^_^.
00000010: c46f 7c20 5765 6c63 6f6d 6520 5573 6572  .o| Welcome User
00000020: 2120 7c                                  ! |

Explanation:

é)                          " Insert a '('
  8a                        " Append 8 copies of the following: 
    -*<esc>                 "   '-*'
           r(               " Replace the last character on this line with '('
             ãh             " Move to the middle of this line
               R            " And write the following text over the existing text:
                ^_^<esc>    "   '^_^'
                        Ä   " Duplicate this line
o                           " On a new line:
 | Welcome User! |          "   Write the whole middle line

James

Posted 2017-06-20T19:51:22.657

Reputation: 54 537

2

Pyth, 41 bytes

It's boring, but I just cant find a way to creat )-*-*-*^_^*-*-*-( or | Welcome User! | in less bytes than just copying the strings.

J")-*-*-*^_^*-*-*-("J"| Welcome User! |"J

Explanation:
J")-*-*-*^_^*-*-*-("                      # J = ")-*-*-*^_^*-*-*-("
                    J                     # Print J with new line
                     "| Welcome User! |"  # Print "| Welcome User! |" with new line
                                        J # Print J with new line

try it Online

jacoblaw

Posted 2017-06-20T19:51:22.657

Reputation: 264

Why the down vote? – jacoblaw – 2017-06-22T16:07:55.143

2

///, 42 bytes

/#/)-*-*-*^_^*-*-*-(
/#| Welcome User! |
#

Try it online!

Shorter than the Bubblegum solution!

Comrade SparklePony

Posted 2017-06-20T19:51:22.657

Reputation: 5 784

Why the downvote? – Comrade SparklePony – 2017-06-22T14:06:56.603

2

Vim, 38 Bytes

i)^[8a-*^[r(9hR^_^^[Yo| Welcome User! |^[p

Shoutout to the homies in the comments

Original:

i)-\*^[vhyl2pa^_^\*-^[vhyl2pa(^[Vyo| Welcome User! |^[p

Where ^[ is the ESC key

bioweasel

Posted 2017-06-20T19:51:22.657

Reputation: 307

1i)-*-*-*^_^*-*-*-(^] is much shorter for constructing the top line. Also, Y is equivalent to Vy – James – 2017-06-21T05:52:28.980

Actually if you more or less borrow DJ's V answer top line construction you can save 2 bytes on the hardcode input i)^]8a-*^[r(9hR^_^^[ – nmjcman101 – 2017-06-21T13:01:27.407

Thanks y'all. I've been using Vim for like a month and I was just trying to see if I could do it. Obviously I have a lot of optimization to go on my workflow – bioweasel – 2017-06-21T14:37:33.653

One last tip: If duplicate the line before opening a newline for "Welcome User!", you won't need to hit ^[ at the end. YPo| Welcome User! | – James – 2017-06-22T16:24:19.697

See? didn't even know that P was a thing. That's awesome though. Thanks! – bioweasel – 2017-06-22T19:36:17.113

2

Carrot, 51 bytes

)-*-*-*\^_\^*-*-*-(
^*1//.+/gS"
| Welcome User! |
"

Try it online!

Explanation

)-*-*-*\^_\^*-*-*-(
^                            Give the stack-string this value ")-*-*-*^_^*-*-*-(\n"
 *1                          Append 1 duplicate of the stack-string to itself
                             stack-string: ")-*-*-*^_^*-*-*-(\n)-*-*-*^_^*-*-*-("
//.+/g                       Get matches of /.+/g and set the stack-array to this result
                             stack-array: [")-*-*-*^_^*-*-*-(",")-*-*-*^_^*-*-*-("]
S"
| Welcome User! |
"                            Join the stack-array on "\n| Welcome User! |\n" and
                             set the stack-string to this result

user41805

Posted 2017-06-20T19:51:22.657

Reputation: 16 320

2

bash, 52 bytes

f=")-*-*-*^_^*-*-*-("
echo "$f
| Welcome User! |
$f"

joeytwiddle

Posted 2017-06-20T19:51:22.657

Reputation: 601

2

C, 65 66 bytes

main(){printf("%s| Welcome User! |\n%1$s",")-*-*-*^_^*-*-*-(\n");}

Yes, there are other C solutions, also coming in at about 66 bytes.

Ungolfed

main()
{
    printf("%s| Welcome User! |\n%1$s",
          ")-*-*-*^_^*-*-*-(\n"
          );
}

GCC produces a warning for the missing printf prototype.

The %1$s says use argument 1 (again) for the second string argument.

In real-life programs, it can also be used to pass in precision/width arguments into a printf. This avoids having to use a printf to create the format string for the real printf.

CSM

Posted 2017-06-20T19:51:22.657

Reputation: 219

1Which compiler successfully compiles and runs this? My gcc (7.1.1) gives an error for the missing semicolon and fails to compile. – Doorknob – 2017-06-22T02:42:44.057

csm@localhost:~$ gcc --version

gcc (Debian 4.9.2-10) 4.9.2 

Copyright (C) 2014 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 – CSM  – 2017-06-22T20:45:06.277

I tried compiling gcc 4.9.2 from source on my machine, but I still got an error rather than a warning for the missing semicolon. Is there any other way to reproduce this? – Doorknob – 2017-06-22T23:53:59.017

Argh. You are right, the semicolon is needed. I was accidentally running the previous compilation result. – CSM – 2017-06-23T12:33:16.780

2

Java 8, 62 bytes

x->"".format("%s| Welcome User! |\n%<s",")-*-*-*^_^*-*-*-(\n")

Try it here.

Or as full program (110 bytes):

interface A{static void main(String[]a){System.out.printf("%s| Welcome User! |\n%<s",")-*-*-*^_^*-*-*-(\n");}}

Try it here.

Surprised there wasn't a Java answer yet.

Kevin Cruijssen

Posted 2017-06-20T19:51:22.657

Reputation: 67 575

2

Minecraft, 107 bytes

/tellraw @p ["",{"text":")-*-*-*^_^*-*-*-(\n"},{"text":"| Welcome User! |\n"},{"text":")-*-*-*^_^*-*-*-("}]

MCCCS

Posted 2017-06-20T19:51:22.657

Reputation: 121

2

PowerShell, 47 bytes

($z=')-*-*-*^_^*-*-*-(')
"| Welcome User! |
$z"

Try it online!

Ran into the problem everyone else is running into: there's not enough meat to justify trying to encode the top line's pattern. A fancier join method also turned out to cost one more byte

Veskah

Posted 2017-06-20T19:51:22.657

Reputation: 3 580

1

Retina, 42 bytes


A¶| Welcome User! |¶A
A
)-*-*-*^_^*-*-*-(

Try it online!

ovs

Posted 2017-06-20T19:51:22.657

Reputation: 21 408

1

PHP, 56 52 bytes

<?=$s=")-*-*-*^_^*-*-*-(\n","| Welcome User! |\n$s";

timmyRS

Posted 2017-06-20T19:51:22.657

Reputation: 329

;echo ──→  , – manatwork – 2017-06-21T12:03:24.417

@manatwork Thanks. I guess you always learn something new every day. – timmyRS – 2017-06-22T10:27:36.780

1

SOGL V0.12, 27 bytes

↑αMΟ±.○h+‘╬1"→ū↑, ¶‘θ⁾@∑32ž

Try it Here!
I have no idea why I still haven't added a capitalize 1st letter of each word function... Here it uses a 4-byte replacement

dzaima

Posted 2017-06-20T19:51:22.657

Reputation: 19 048

1

TCL, 73 bytes 54 bytes

set a )-*-*-*^_^*-*-*-( set b "| Welcome User! |" puts " $a\n $b\n $a"


puts "[set a )-*-*-*^_^*-*-*-(]
| Welcome User! |
$a"

Thanks @sergiol for the suggestion!

Silentziler

Posted 2017-06-20T19:51:22.657

Reputation: 39

Can be golfed down quite a lot: http://rextester.com/GUX27128

– sergiol – 2017-06-24T22:56:46.443

1

Braingolf, 48 bytes

")-*-*-*^_^*-*-*-("!&@"
| Welcome User! |
"@19&@

Try it online!

Explanation

")-*-*-*^_^*-*-*-("        push the string ")-*-*-*^_^*-*-*-(" as characters
                   !&@     print all the characters on the stack without popping
                      "
| Welcome User! |          push the string "\n| Welcome User! |\n"
"
 @19                       pop and print 19 characters on the stack
    &@                     print all the characters on the stack

totallyhuman

Posted 2017-06-20T19:51:22.657

Reputation: 15 378

1

Kotlin, 88 bytes

fun main(a:Array<String>){val s=")-*-*-*^_^*-*-*-(";print("$s\n| Welcome User! |\n$s")}"

lakerka

Posted 2017-06-20T19:51:22.657

Reputation: 11

1

Stax, 25 bytes

æu√hy╘£.ÅJnc¡┐ßD.P☻Θ╖>╘rÇ

Run and debug it

recursive

Posted 2017-06-20T19:51:22.657

Reputation: 8 616

1

Wren, 64 bytes

Fn.new{"1| Welcome User! |
1".replace("1",")-*-*-*^_^*-*-*-(
")}

Try it online!

Explanation

Fn.new{                           // New anonymous function
       "1| Welcome User! |
1"                                // Create the string "| Welcome User! |"
  .replace("1",")-*-*-*^_^*-*-*-(
")}                               // Prepend & append the string ")-*-*-*^_^*-*-*-(\n"

user85052

Posted 2017-06-20T19:51:22.657

Reputation:

1

C (gcc), 63 bytes

f(){printf("%s| Welcome User! |\n%1$s",")-*-*-*^_^*-*-*-(\n");}

Try it online!

Three bytes shorter than all the previous solutions because new rules allow functions.

S.S. Anne

Posted 2017-06-20T19:51:22.657

Reputation: 1 161

0

><>, 76 61 bytes

!v"(-*-*-*^_"~! |
 >~")"a"| !resU emocleW |v"61pa10.
l?!;o >

AGourd

Posted 2017-06-20T19:51:22.657

Reputation: 271

0

PHP, 55 bytes

$a=')-*-*-*^_^*-*-*-(';
echo <<<S
$a
| Welcome User! |
$a
S;

Deepak Thomas

Posted 2017-06-20T19:51:22.657

Reputation: 101

Welcome to PPCG! – Laikoni – 2017-06-21T21:31:52.553

0

VBA, 48 Bytes

Anonymous VBE immediate window function that takes no input and outputs a greeting to the user via the immediate window

a=")-*-*-*^_^*-*-*-(":?a:?"| Welcome User! |":?a

Taylor Scott

Posted 2017-06-20T19:51:22.657

Reputation: 6 709

I post mine then deleted immediately when I saw yours. :D – remoel – 2017-10-20T10:13:48.030

0

Golang, 67 Bytes

func n(){a:=")-*-*-*^_^*-*-*-(\n";Print(a+"| Welcome User! |\n"+a)}

Prints with a trailing newline.

Try it online!

Dust

Posted 2017-06-20T19:51:22.657

Reputation: 131

0

Canvas, 29 bytes

-*3×^_+)×│| Welcome User! |┌)

Try it here!

hakr14

Posted 2017-06-20T19:51:22.657

Reputation: 1 295

0

JavaScript (Node.js), 58 bytes

(u=')-*-*-*^_^*-*-*-(')=>[u,'| Welcome User! |',u].join`
`

Try it online!

I am sure I can golf if down , but later

Muhammad Salman

Posted 2017-06-20T19:51:22.657

Reputation: 2 361

0

Runic Enchantments, 46 bytes

>")-*-*-*^_^*-*-*-(":$ak"| Welcome User! |"ak@

Try it online!

It will appear to process until it times out, due to the two ^ commands which spawn IPs that do nothing (necessitating the explicit entry >). I am disapointed that this is 2 bytes shorter than the multiple IP method. Constructing the first and last lines using multiplication/duplication turns out to be even more expensive as well (50 bytes). :(

Draco18s no longer trusts SE

Posted 2017-06-20T19:51:22.657

Reputation: 3 053

0

PowerShell, 54 bytes

$a=')-*-*-*^_^*-*-*-(';write $a;"| Welcome User! |";$a

Try it online!

Old - 68 bytes

Write-Host ")-*-*-*^_^*-*-*-(`n| Welcome User! |`n)-*-*-*^_^*-*-*-("

I.T Delinquent

Posted 2017-06-20T19:51:22.657

Reputation: 165

0

R, 61 bytes

r=")-*-*-*^_^*-*-*-(\n";cat(r,"| Welcome User! |\n",r,sep="")

Try it online!

Has a trailing newline. I couldn't see if that was approved or not, so I just rolled with it.

Sumner18

Posted 2017-06-20T19:51:22.657

Reputation: 1 334