73
\$\begingroup\$

Challenge

I need help building a brick wall! Throw together some code for me using no input and produce the following output wall shown below:

_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__

Now, this wall is exactly 10 characters high and 70 characters wide.

As stated above, no inputs, only code. Least amount of bytes, we have to efficiently build this brick wall. Obviously, this program has to function to get the wall built..? or it obviously won't build itself! Good luck!


Winner

The winner goes to Marinus using the APL language, requiring a whole 12 bytes! https://codegolf.stackexchange.com/a/99028/61857


Thank you everyone for participating!

\$\endgroup\$
  • 2
    \$\begingroup\$ Related, Related, \$\endgroup\$ – FlipTack Nov 8 '16 at 18:42
  • 8
    \$\begingroup\$ Also Related. (odd that this should come up today, haha) \$\endgroup\$ – Conor O'Brien Nov 8 '16 at 18:43
  • 1
    \$\begingroup\$ That's OK. I'll let you know when I have a working interpreter. I'm working on it right now, actually :) \$\endgroup\$ – ETHproductions Nov 10 '16 at 14:20
  • 2
    \$\begingroup\$ Related! \$\endgroup\$ – RudolfJelin Nov 10 '16 at 17:49
  • 29
    \$\begingroup\$ For bonus points, make Mexico pay for it. \$\endgroup\$ – Dawood ibn Kareem Nov 11 '16 at 8:26

86 Answers 86

46
\$\begingroup\$

APL, 12 bytes

10 70⍴'_|__'

Output:

      10 70⍴'_|__'
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
\$\endgroup\$
  • 1
    \$\begingroup\$ I just noticed this answer as I put my J answer. they're basically the same haha \$\endgroup\$ – Conor O'Brien Nov 8 '16 at 18:22
  • 2
    \$\begingroup\$ This outputs something else in addition to the ascii wall. Is this allowed? \$\endgroup\$ – Buffer Over Read Nov 9 '16 at 16:11
  • \$\begingroup\$ when using tryapl.org, I got the wall output. what have you received @TheBitByte? \$\endgroup\$ – FivePixels Nov 10 '16 at 14:34
  • 4
    \$\begingroup\$ @Dylan He's probably confused, since the answerer included the program in the output without knowing the REPL nature of APL. \$\endgroup\$ – Conor O'Brien Nov 10 '16 at 19:49
191
\$\begingroup\$

Trumpscript, 303 285 244 231 226 bytes

make i 1000005-1000000
as long as,i;:
make i,i - fact;
say "_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|"
say "___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__"!
America is great

I would like to say this is one of the most verbose languages where almost everything fails to compile into a working program.

Apparently whether - works instead of minus is completely up to the interpreter and sometimes works. This time it did so I'm putting it in as golfed.

Abuses the fact Trumpscript is written in Python and therefore fact when used as an integer is one.

Golfing tips welcome.

\$\endgroup\$
  • 48
    \$\begingroup\$ I take it Trumpscript doesn't allow numbers less than 1,000,000? ;-) \$\endgroup\$ – ETHproductions Nov 8 '16 at 20:45
  • 3
    \$\begingroup\$ you are correct. \$\endgroup\$ – Blue Nov 8 '16 at 20:52
  • 2
    \$\begingroup\$ Can you use i is 1000005-1000000 and i is i-fact? (Just taken a look at the readme of Trumpscript.) \$\endgroup\$ – AlexRacer Nov 8 '16 at 22:31
  • 19
    \$\begingroup\$ I'm surprised it allows you to use 1000000. Documentation states All numbers must be strictly greater than 1 million. The small stuff is inconsequential to us.. \$\endgroup\$ – Mad Physicist Nov 10 '16 at 20:41
  • 9
    \$\begingroup\$ Fact and lies (and other truth/false constants) have a random, time based chance to flip flop (be reversed) during tokenization (see tokenizer.py, search flip_flop) may be why it seemed to not work with minus, when really it had to do with fact at that point in time \$\endgroup\$ – pinkfloydx33 Nov 12 '16 at 1:21
20
\$\begingroup\$

J, 12 bytes

10 70$'_|__'

Shapes the string on the right into a 10 by 70 shape. Simple!

\$\endgroup\$
18
\$\begingroup\$

BBC BASIC, 28 bytes

Tokenised filesize 23 bytes.

WIDTH70P.STRING$(175,"_|__")

WIDTH70 would normally be followed by a newline. It sets the field width to 70. Then we just print 175 copies of the string, which wrap around.

\$\endgroup\$
  • 2
    \$\begingroup\$ Best (ab)use of WIDTH that I have seen :) \$\endgroup\$ – ElPedro Nov 8 '16 at 18:46
  • \$\begingroup\$ This should have "23 bytes" in the header then. \$\endgroup\$ – Adám Nov 8 '16 at 20:33
  • \$\begingroup\$ @Adám Only if the tokenized version is posted as the answer. \$\endgroup\$ – ErikE Nov 14 '16 at 7:38
17
\$\begingroup\$

Brainfuck, 171 bytes

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

Brainfuck is fun, here is my submission.

Here is the output:

_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__

Here is a link to try it

https://repl.it/EW2Z/0

\$\endgroup\$
16
\$\begingroup\$

WinDbg, 45 bytes

f2000000 L2bc 5f 7c 5f 5f;da/c46 2000000 L2bc

How it works:

f 2000000 L2bc 5f 7c 5f 5f; *Repeat the pattern _|__ (5F 7C 5F 5F) to fill 2BC (700) bytes 
                            *starting at 2000000
da /c46 2000000 L2bc        *Show 2BC (700) ASCII chars starting from 2000000 in lines 
                            *of length 0x46 (70)

Output:

0:000> f2000000 L2bc 5f 7c 5f 5f;da/c46 2000000 L2bc
Filled 0x2bc bytes
02000000  "_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|"
02000046  "___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__"
0200008c  "_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|"
020000d2  "___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__"
02000118  "_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|"
0200015e  "___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__"
020001a4  "_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|"
020001ea  "___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__"
02000230  "_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|"
02000276  "___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__"
\$\endgroup\$
10
\$\begingroup\$

Pyth, 12 bytes

Code:

jcT*175"_|__

Explanation:

       "_|__    # For the string "_|__"
   *175         # Repeat it 175 times
 cT             # Chop into 10 equal pieces
j               # Join them by newlines

Try it here.

\$\endgroup\$
10
\$\begingroup\$

Python 2, 37 bytes

s="_|__"*17;print(s+"_|\n__%s\n"%s)*5

Decomposes two rows as 17 copies of _|__, plus another copy interrupted by a newline, plus 17 more copies, plus another newline.

Longer alternatives:

print"%s_|\n__%s\n"%(2*("_|__"*17,))*5

s="_|__"*17;print"%s_|\n__%%s\n"%s%s*5

for i in[0,2]*5:print("_|__"*18)[i:i+70]

print("_|__"*17+"_|\n"+"___|"*17+"__\n")*5

for s in["_|__","___|"]*5:print(s*18)[:70]

s="_|__"*99;exec"print s[:70];s=s[2:];"*10

print("%s"*70+"\n")*10%(175*tuple("_|__"))
\$\endgroup\$
  • \$\begingroup\$ Your last alternative is shorter as print(("%s"*70+"\n")*10%(175*(*"_|__",))) in Python 3. \$\endgroup\$ – mbomb007 Nov 8 '16 at 20:49
8
\$\begingroup\$

05AB1E, 13 bytes

Code:

"_|__"175×Tä»

Explanation:

"_|__"         # For the string "_|__"
      175×     # Repeat that 175 times
          Tä   # Split into 10 even pieces
            »  # And join them by newlines

Uses the CP-1252 encoding. Try it online!

\$\endgroup\$
7
\$\begingroup\$

PHP, 44 42 41 characters

<?=chunk_split(str_pad(_,700,"|___"),70);

(Just because had no chance to use chunk_split() ever before.)

Thanks to:

  • user59178 for suggesting to use str_pad() (-1 character)

Sample run:

bash-4.3$ php <<< '<?=chunk_split(str_pad(_,700,"|___"),70);'
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
\$\endgroup\$
  • \$\begingroup\$ bytes, not character count. \$\endgroup\$ – FivePixels Nov 8 '16 at 19:40
  • 2
    \$\begingroup\$ Same. I use no multibyte characters. \$\endgroup\$ – manatwork Nov 8 '16 at 19:41
  • 9
    \$\begingroup\$ Crossed out 44 is still regular 44 ;( \$\endgroup\$ – pajonk Nov 8 '16 at 20:05
  • 2
    \$\begingroup\$ @pajonk, Fixed with PPCG - Crossed Out 44 user style on my machine: i.stack.imgur.com/czn5h.png \$\endgroup\$ – manatwork Nov 8 '16 at 20:26
  • \$\begingroup\$ You can save a byte by using str_pad instead of str_repeat, largely because _ is treated as a constant with value _. \$\endgroup\$ – user59178 Nov 9 '16 at 9:21
7
\$\begingroup\$

Vim, 30 24 19 keystrokes

18a___|<esc>YP2x}h.yk4P

Thanks to DrMcMoylex and nmjcman101 for saving valuable keystrokes!

\$\endgroup\$
  • 1
    \$\begingroup\$ Nice answer, welcome to the site! Some tips: 1) a takes a count, so you could do 18a___|<esc> instead of making the macro. 2) <cr> in normal mode is equivalent to j0, so you could take one byte off your second macro. \$\endgroup\$ – DJMcMayhem Nov 9 '16 at 16:07
  • \$\begingroup\$ Cool, thanks for the tips! \$\endgroup\$ – karpfen Nov 9 '16 at 16:15
  • 1
    \$\begingroup\$ I golfed your solution a bit for fun. Formatting the wall before copy/pasting saves all the bytes of not making a macro: 18a___|<esc>YP2x}h.yk5P is 19 bytes. \$\endgroup\$ – nmjcman101 Nov 23 '16 at 16:44
  • \$\begingroup\$ Nice, I'll update the answer! I'll just replace the second to last key with 4, otherwise the wall is getting too high :) \$\endgroup\$ – karpfen Nov 23 '16 at 17:12
6
\$\begingroup\$

Perl, 47 34 29 bytes

$_="_|__"x175;say for/.{70}/g
\$\endgroup\$
  • \$\begingroup\$ You can golf it down to 29 : say for("_|__"x175)=~/.{70}/g \$\endgroup\$ – Dada Nov 8 '16 at 18:22
  • \$\begingroup\$ For some reason, that used to produce no output every time I tried it, but I found another solution in as many bytes. Thank you though! \$\endgroup\$ – Gabriel Benamy Nov 8 '16 at 18:39
  • \$\begingroup\$ Well, the code I suggested does produce a valid output... Maybe you forgot the parenthesis around "_|__"x175 or something like that? \$\endgroup\$ – Dada Nov 8 '16 at 18:47
  • \$\begingroup\$ I think that's what it is. I figured parentheses had to go somewhere, I just couldn't figure out where, lol \$\endgroup\$ – Gabriel Benamy Nov 8 '16 at 18:48
  • \$\begingroup\$ Huhu, hard to remember the precedence of every operator (=~ has a higher precedence than x)! \$\endgroup\$ – Dada Nov 8 '16 at 18:50
5
\$\begingroup\$

Perl, 31 bytes

say+($@="_|__"x17,"_|
__$@
")x5

You'll need -E flag to run it :

perl -E 'say+($@="_|__"x17,"_|
__$@
")x5'
\$\endgroup\$
  • \$\begingroup\$ Thought of a slightly different approach for 29 bytes: say for("_|__"x175)=~/.{70}/g :). I do like the trick you employed there though! \$\endgroup\$ – Dom Hastings Nov 9 '16 at 12:23
  • \$\begingroup\$ @DomHastings huhu, I wrote the exact same code in the comments of Gabriel Benamy's answer! \$\endgroup\$ – Dada Nov 9 '16 at 15:11
  • \$\begingroup\$ D'oh! Didn't see that one! Also then saw it's been used a lot in other answers.. Oh well! \$\endgroup\$ – Dom Hastings Nov 9 '16 at 15:13
  • \$\begingroup\$ @DomHastings Yea, I didn't thought of it at first, and it was already in Gabriel's answer, so that's why I didn't update my answer after ;) \$\endgroup\$ – Dada Nov 9 '16 at 15:22
5
\$\begingroup\$

V, 24, 16 bytes

175i_|__ò70|lé

Try it online! This contains <esc> characters (0x1B) so here is a hexdump:

0000000: 3137 3569 5f7c 5f5f 1bf2 3730 7c6c e90a  175i_|__..70|l..

8 bytes indirectly saved thanks to Jordan!

\$\endgroup\$
  • \$\begingroup\$ 19 bytes: v.tryitonline.net/… I couldn't figure out how to use the .\{-} shortcut mentioned in the V docs, though. \$\endgroup\$ – Jordan Nov 8 '16 at 19:52
  • \$\begingroup\$ @Jordan Wow, very nice! The \{-} shortcut wouldn't work anyway, since you can't change the number inside. However, you could set the high bit on the \{ to get this instead. Feel free to post that as an answer. \$\endgroup\$ – DJMcMayhem Nov 8 '16 at 20:31
  • \$\begingroup\$ Ah, that makes sense. Posted here: codegolf.stackexchange.com/a/99070/11261 \$\endgroup\$ – Jordan Nov 8 '16 at 20:35
  • \$\begingroup\$ Damn I still need to grok this language: 25 bytes \$\endgroup\$ – statox Nov 9 '16 at 13:12
5
\$\begingroup\$

V, 18 bytes

-1 byte thanks to DJMcMayhem.

175i_|__<Esc>Ó.û70}/°ò

Here it is with unprintable characters in xxd format:

0000000: 3137 3569 5f7c 5f5f 1bd3 2efb 3730 7d2f  175i_|__....70}/
0000010: b0f2                                     ..

Try it online!

\$\endgroup\$
  • \$\begingroup\$ Nice, I am no longer the only person who has used V! Now I'm going to have to see if I can take the lead back, haha \$\endgroup\$ – DJMcMayhem Nov 8 '16 at 20:39
5
\$\begingroup\$

MATL, 15 bytes

'_|__'700:)70e!

Of course, you can Try it online! Explanation:

'_|__' % Put a brick on the stack
700    % 700 times
:)     % Makes a happy mason...
70e!   % Secret freemason code

OK, actually, it works as follows:

'_|__' % Put the first bit of the string on the stack
700:   % Put 1, 2, ..., 700 on the stack as array
)      % Index into the string, modularly. Result: '_|___|__ ... __'
70e    % Reshape into 70 rows (and consequently, 10 columns)
!      % Transpose to get the desired output.
\$\endgroup\$
  • \$\begingroup\$ Well done! And your smiley is better than mine \$\endgroup\$ – Luis Mendo Nov 8 '16 at 21:18
  • \$\begingroup\$ @LuisMendo Really, using smileys could be considered a design pattern in MATL. xD Perhaps you could have :) on C... but that would be your last 1-byte code point gone (or is there another reason C is not used?) \$\endgroup\$ – Sanchises Nov 8 '16 at 21:39
  • \$\begingroup\$ You want to get rid of the smiley?? :-P \$\endgroup\$ – Luis Mendo Nov 8 '16 at 22:30
5
\$\begingroup\$

Python 2, 46 44 Bytes

Just using string multiplication to build the string, and slicing to get the right bits :)

k='_|__'*18
print'\n'.join([k[:70],k[2:]]*5)

thanks to Antony Hatchkins for saving two bytes :)

\$\endgroup\$
  • \$\begingroup\$ Could be 2 bytes less: print'\n'.join([k[:70],k[2:]]*5) \$\endgroup\$ – Antony Hatchkins Nov 14 '16 at 7:24
  • \$\begingroup\$ @AntonyHatchkins Thanks! \$\endgroup\$ – Kade Nov 16 '16 at 13:43
4
\$\begingroup\$

PowerShell v2+, 34 30 bytes

'_|__'*175-split"(.{70})"-ne''

Stupid regex matching algorithm requiring the -ne'' ... wastes five bytes!

'_|__'*175-split"(.{70})"-ne''
'_|__'*175                     # Repeat this string 175 times
          -split"       "      # Split on this regex pattern:
                  .{70}        # Match any character 70 times
                 (     )       # Encapsulated in parens so we keep the regex results
                         -ne'' # But don't select the empty strings
                               # Output with newlines via Write-Output is implicit

Saved 4 bytes thanks to Conor!

\$\endgroup\$
  • \$\begingroup\$ Would .{70} be any shorter for teh regex? \$\endgroup\$ – Conor O'Brien Nov 8 '16 at 21:00
  • \$\begingroup\$ split works like that in other languages - you always get the unmatched portions whether you want them or not. Some languages have a match operator that can be used to return an array of only matching results, but I don't see a PowerShell equivalent for that. \$\endgroup\$ – Neil Nov 9 '16 at 10:23
  • \$\begingroup\$ @Neil Performing 'abc'-split'(.)' will return ('','a','','b','','c',''). There's nothing unmatched, but due to how the algorithm processes through the input string, you get empty strings back. See here. \$\endgroup\$ – AdmBorkBork Nov 9 '16 at 13:33
  • \$\begingroup\$ Yes, and I'm saying you shouldn't be surprised by that result, because that's what split's supposed to do. \$\endgroup\$ – Neil Nov 9 '16 at 14:01
  • \$\begingroup\$ @Neil Surprised? No, not really. Doesn't mean I have to be happy about it, though. :D \$\endgroup\$ – AdmBorkBork Nov 9 '16 at 14:08
4
\$\begingroup\$

C, 131 115 113 103 97 95 Bytes

i,j;main(){for(;i<10;puts(i++&1?"|__":"|"))for(j=0;j<18-(i&1);printf(&"|___"[j++?0:i&1?1:3]));}

Time to start golfing this...

_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
\$\endgroup\$
3
\$\begingroup\$

Jelly, 14 bytes

“_|__”ṁ700s70Y

TryItOnline!

How?

“_|__”ṁ700s70Y - Main link: no arguments
“_|__”         - literal ['_','|','_','_']
      ṁ700     - mould like something 700 long
          s70  - split into chunks of length 70
             Y - join with line feeds
\$\endgroup\$
  • 1
    \$\begingroup\$ By definition, Jelly cannot be longer than J. \$\endgroup\$ – Adám Nov 8 '16 at 20:34
  • \$\begingroup\$ I did something similar without the peculiar : “_|__”ẋ175œs⁵Y (14 bytes) \$\endgroup\$ – Erik the Outgolfer Nov 13 '16 at 11:34
3
\$\begingroup\$

MATL, 16 bytes

'___|'10:E!70:+)

Try it online!

'___|'   % Push this string
10:E!    % Push [2; 4; 6; ...; 20] (10×1 column vector)
70:      % Push [1, 2, 3, ..., 70] (1×70 row vector)
+        % Add. Gives a 10×70 matrix of all pairwise additions
)        % Index (modular, 1-based) into the string
\$\endgroup\$
3
\$\begingroup\$

CJam, 15 bytes

"_|__"175*70/N*

Try it online!

Port of Adnan's 05AB1E answer.

"_|__"             e# Push this string
      175*         e# Repeat 175 times
          70/      e# Split in pieces of size 70
             N*    e# Join by newlines
\$\endgroup\$
3
\$\begingroup\$

Javascript REPL, 45 bytes

"_|__".repeat(175).match(/.{70}/g).join("\n")
\$\endgroup\$
  • 1
    \$\begingroup\$ Welcome to PPCG! This should be marked as "JavaScript REPL" or similar, as this doesn't print anything at all outside of an interactive console environment. \$\endgroup\$ – Martin Ender Nov 8 '16 at 19:41
  • 1
    \$\begingroup\$ Isn't this 45 bytes? \$\endgroup\$ – acrolith Nov 8 '16 at 19:50
  • \$\begingroup\$ @daHugLenny you are right, I counted \n as a single byte \$\endgroup\$ – Juan Tonina Nov 8 '16 at 20:02
  • \$\begingroup\$ where is the console.log ? \$\endgroup\$ – cardeol Nov 9 '16 at 12:49
  • 1
    \$\begingroup\$ As long as you are using ES6 (I think it is) you can use template strings, so join("\n") becomes join<backtick><literal newline><backtick> \$\endgroup\$ – Stephen Jul 24 '17 at 17:17
3
\$\begingroup\$

JavaScript (ES6), 48 bytes

f=(n=350)=>n?(n%35?'_':`
_`)+"|_"[n%2]+f(n-1):""

Because recursion.

\$\endgroup\$
3
\$\begingroup\$

Bash, 44, 41, 40 bytes

printf _\|__%.0s {1..175}|egrep -o .{70}

The printf makes a single line 700 characters long, the egrep matches it 70 characters at a time.

\$\endgroup\$
2
\$\begingroup\$

Befunge-98, 63 bytes

'_\:3+4%0`!> #0 #\ #|' $ #\_\,1+:7a*%0`!> #0 #, #a_:7aa**\`!#@_

TryItOnline!

\$\endgroup\$
2
\$\begingroup\$

///, 51 bytes

If a trailing newline is allowed:

/e/aaaa//a/_|__//b/eeeea_|//c/__eeeea//d/b
c
/ddddd

Try it online!

\$\endgroup\$
2
\$\begingroup\$

Pyke, 12 bytes

w�"_|__"*TfX

where is the literal byte 163.

Try it here! (w� replaced with literal)

\$\endgroup\$
2
\$\begingroup\$

Ruby, 30 bytes

Thanks to manatwork for this solution

puts ("_|__"*175).scan /.{70}/

Ruby, 39 bytes

10.times{|i|puts ("_|__"*18)[i%2*2,70]}
\$\endgroup\$
  • 2
    \$\begingroup\$ The generate-all-then-split approach is shorter here too: puts ("_|__"*175).scan /.{70}/. \$\endgroup\$ – manatwork Nov 8 '16 at 19:15
  • \$\begingroup\$ @manatwork thanks a lot! I rarely think of using scan as I´m not that comfortable with regexes. You know you could have posted that as your own answer... \$\endgroup\$ – Level River St Nov 8 '16 at 22:27
2
\$\begingroup\$

Haskell, 56 47 bytes

unlines$[1..5]>>take 70.cycle<$>["_|__","___|"]
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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