Build me a brick wall!

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!

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

APL, 12 bytes

10 70⍴'_|__'


Output:

      10 70⍴'_|__'
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__

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

$_="_|__"x175;say for/.{70}/g  • You can golf it down to 29 : say for("_|__"x175)=~/.{70}/g – Dada Nov 8 '16 at 18:22 • 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! – Gabriel Benamy Nov 8 '16 at 18:39 • Well, the code I suggested does produce a valid output... Maybe you forgot the parenthesis around "_|__"x175 or something like that? – Dada Nov 8 '16 at 18:47 • I think that's what it is. I figured parentheses had to go somewhere, I just couldn't figure out where, lol – Gabriel Benamy Nov 8 '16 at 18:48 • Huhu, hard to remember the precedence of every operator (=~ has a higher precedence than x)! – Dada Nov 8 '16 at 18:50 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! • 19 bytes: v.tryitonline.net/… I couldn't figure out how to use the .\{-} shortcut mentioned in the V docs, though. – Jordan Nov 8 '16 at 19:52 • @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. – DJMcMayhem Nov 8 '16 at 20:31 • Ah, that makes sense. Posted here: codegolf.stackexchange.com/a/99070/11261 – Jordan Nov 8 '16 at 20:35 • Damn I still need to grok this language: 25 bytes – statox Nov 9 '16 at 13:12 PHP, 4442 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);'
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__

• bytes, not character count. – FivePixels Nov 8 '16 at 19:40
• Same. I use no multibyte characters. – manatwork Nov 8 '16 at 19:41
• Crossed out 44 is still regular 44 ;( – pajonk Nov 8 '16 at 20:05
• @pajonk, Fixed with PPCG - Crossed Out 44 user style on my machine: i.stack.imgur.com/czn5h.png – manatwork Nov 8 '16 at 20:26
• You can save a byte by using str_pad instead of str_repeat, largely because _ is treated as a constant with value _. – user59178 Nov 9 '16 at 9:21

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

• By definition, Jelly cannot be longer than J. – Adám Nov 8 '16 at 20:34
• I did something similar without the peculiar ṁ: “_|__”ẋ175œs⁵Y (14 bytes) – Erik the Outgolfer Nov 13 '16 at 11:34

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!

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. • Best (ab)use of WIDTH that I have seen :) – ElPedro Nov 8 '16 at 18:46 • This should have "23 bytes" in the header then. – Adám Nov 8 '16 at 20:33 • @Adám Only if the tokenized version is posted as the answer. – ErikE Nov 14 '16 at 7:38 Perl, 31 bytes say+($@="_|__"x17,"_|
__$@ ")x5  You'll need -E flag to run it : perl -E 'say+($@="_|__"x17,"_|
__$@ ")x5'  • Thought of a slightly different approach for 29 bytes: say for("_|__"x175)=~/.{70}/g :). I do like the trick you employed there though! – Dom Hastings Nov 9 '16 at 12:23 • @DomHastings huhu, I wrote the exact same code in the comments of Gabriel Benamy's answer! – Dada Nov 9 '16 at 15:11 • D'oh! Didn't see that one! Also then saw it's been used a lot in other answers.. Oh well! – Dom Hastings Nov 9 '16 at 15:13 • @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 ;) – Dada Nov 9 '16 at 15:22 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  J, 12 bytes 10 70$'_|__'


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

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

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

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("_|__"))

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

Befunge-98, 63 bytes

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


TryItOnline!

Python 2, 50 48 bytes

for b in range(10):print('_|__'*175)[b*70:][:70]


2 saved with thanks to @xnor but also thanks to @Shebang for the suggestion :)

• b*70+70 -> -~b*70 saves a byte :) – Kade Nov 8 '16 at 18:33
• Or [b*70:][:70]. – xnor Nov 8 '16 at 18:34
• Thanks @xnor. Didn't know you could do that. may well go back and trim a couple off some of my other recent answers :) – ElPedro Nov 8 '16 at 18:41

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

C#, 106102101118107106100 96 bytes

Thanks shebang for saving 2 bytes and pointing out a mistake, Yodle for saving 6 bytes and Link Ng for saving 4 bytes.

var a="";int i;for(;i++<175;)a+="_|__";for(i=0;i<10;)Console.Write(a.Substring(i++*10,70)+"\n");


You can test it directly on http://csharppad.com/.

• Change the a%2==0 to a%2<1 to save a byte :) – Kade Nov 8 '16 at 18:39
• Also, you can remove the a++ in the for definition and change a%2 to a++%2! – Kade Nov 8 '16 at 18:41
• You can save 4 bytes by declaring i outside the loop, incrementing i within the condition i<175, and using i in the second loop instead of a new integer b. – Yodle Nov 8 '16 at 19:45
• @Yodle I could save 6 bytes by doing so (and not 4), thanks! – Ave Nov 8 '16 at 19:48
• Ahh I guess they have a default value of 0 :P. In VS it won't let you declare local variables without initializing them, so the =0 made it only 4 for me. – Yodle Nov 8 '16 at 19:50

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

• The generate-all-then-split approach is shorter here too: puts ("_|__"*175).scan /.{70}/. – manatwork Nov 8 '16 at 19:15
• @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... – Level River St Nov 8 '16 at 22:27

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)
)        % Index (modular, 1-based) into the string


CJam, 15 bytes

"_|__"175*70/N*


Try it online!

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


Jolf, 17 bytes

RZc*"_|__"Τ755@FS


Try it here!

Explanation

RZc*"_|__"Τ755@FS
*"_|__"         repeat this string:
Τ755      7*5*5 = 175 times
Zc           @F   chop into groups of 70 (F's charcode)
R               S  join by newlines


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!

• Would .{70} be any shorter for teh regex? – Conor O'Brien Nov 8 '16 at 21:00
• 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. – Neil Nov 9 '16 at 10:23
• @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. – AdmBorkBork Nov 9 '16 at 13:33
• Yes, and I'm saying you shouldn't be surprised by that result, because that's what split's supposed to do. – Neil Nov 9 '16 at 14:01
• @Neil Surprised? No, not really. Doesn't mean I have to be happy about it, though. :D – AdmBorkBork Nov 9 '16 at 14:08

SOML, 16 bytes

_|__”’ø*L{:jjp»»


explanation:

_|__”             push "_|__"
’ø           push 18
*          repeat the "_|__" 18 times
L{        repeat 10 times:
:       duplicate the sting
jj     pop the last 2 letters off
p    output it
»»  put the last 2 characters at the start


Pyth, 2423 22 bytes

VT:*175"_|__"J*70N+70J


OK, I'm still learning. Any hints gratefully received :)

Edit

Saved a byte by moving the assignment of J to first use

Java 8 + Guava, 81 106 bytes

25 bytes for import: com.google.common.base.*;

Lambda that takes no input and returns the required wall.

()->String.join("\n",Splitter.fixedLength(70).split(Strings.repeat("_|__",175)));


Same as many other solutions. Takes a repeating string of "_|__" 175 times, splits it into lengths of 70, then joins them on newline.

Javascript REPL, 45 bytes

"_|__".repeat(175).match(/.{70}/g).join("\n")

• 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. – Martin Ender Nov 8 '16 at 19:41
• Isn't this 45 bytes? – acrolith Nov 8 '16 at 19:50
• @daHugLenny you are right, I counted \n as a single byte – Juan Tonina Nov 8 '16 at 20:02
• where is the console.log ? – cardeol Nov 9 '16 at 12:49
• 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> – Stephen Jul 24 '17 at 17:17

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  "___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__"


///, 51 bytes

If a trailing newline is allowed:

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


Try it online!

C, 13111511310397 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...

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


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!

• 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 – DJMcMayhem Nov 8 '16 at 20:39

Trumpscript, 303285244231 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.

• I take it Trumpscript doesn't allow numbers less than 1,000,000? ;-) – ETHproductions Nov 8 '16 at 20:45
• you are correct. – Blue Nov 8 '16 at 20:52
• Can you use i is 1000005-1000000 and i is i-fact? (Just taken a look at the readme of Trumpscript.) – AlexRacer Nov 8 '16 at 22:31
• 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.. – Mad Physicist Nov 10 '16 at 20:41
• 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 – pinkfloydx33 Nov 12 '16 at 1:21