# 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!

• Nov 8, 2016 at 18:42
• Also Related. (odd that this should come up today, haha) Nov 8, 2016 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 :) Nov 10, 2016 at 14:20
• Nov 10, 2016 at 17:49
• For bonus points, make Mexico pay for it. Nov 11, 2016 at 8:26

## 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? ;-) Nov 8, 2016 at 20:45
• you are correct.
– Blue
Nov 8, 2016 at 20:52
• Can you use i is 1000005-1000000 and i is i-fact? (Just taken a look at the readme of Trumpscript.) Nov 8, 2016 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.. Nov 10, 2016 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 Nov 12, 2016 at 1:21

# 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 Nov 8, 2016 at 18:22
• This outputs something else in addition to the ascii wall. Is this allowed? Nov 9, 2016 at 16:11
• when using tryapl.org, I got the wall output. what have you received @TheBitByte? Nov 10, 2016 at 14:34
• @Dylan He's probably confused, since the answerer included the program in the output without knowing the REPL nature of APL. Nov 10, 2016 at 19:49

10 70$'_|__' Shapes the string on the right into a 10 by 70 shape. Simple! # 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 :) Nov 8, 2016 at 18:46
• This should have "23 bytes" in the header then.
Nov 8, 2016 at 20:33
• @Adám Only if the tokenized version is posted as the answer. Nov 14, 2016 at 7:38

# 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

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

# 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

## 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. Nov 8, 2016 at 20:49

# 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!

• -2 by using …_|_Ć and the compressed Ƶм for 175 (I realize the second wasn't available when you posted the answer; not sure about the first). Jun 30, 2020 at 15:12

# PHP, 4442 41 characters

(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. Nov 8, 2016 at 19:40 • Same. I use no multibyte characters. Nov 8, 2016 at 19:41 • Crossed out 44 is still regular 44 ;( Nov 8, 2016 at 20:05 • @pajonk, Fixed with PPCG - Crossed Out 44 user style on my machine: i.stack.imgur.com/czn5h.png Nov 8, 2016 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 _. Nov 9, 2016 at 9:21 ## Vim, 3024 19 keystrokes 18a___|<esc>YP2x}h.yk4P Thanks to DrMcMoylex and nmjcman101 for saving valuable keystrokes! • 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. Nov 9, 2016 at 16:07 • Cool, thanks for the tips! Nov 9, 2016 at 16:15 • 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. Nov 23, 2016 at 16:44 • Nice, I'll update the answer! I'll just replace the second to last key with 4, otherwise the wall is getting too high :) Nov 23, 2016 at 17:12 # Perl, 4734 29 bytes$_="_|__"x175;say for/.{70}/g
• You can golf it down to 29 : say for("_|__"x175)=~/.{70}/g
Nov 8, 2016 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! Nov 8, 2016 at 18:39
• Well, the code I suggested does produce a valid output... Maybe you forgot the parenthesis around "_|__"x175 or something like that?
Nov 8, 2016 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 Nov 8, 2016 at 18:48
• Huhu, hard to remember the precedence of every operator (=~ has a higher precedence than x)!
Nov 8, 2016 at 18:50

## 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! Nov 9, 2016 at 12:23
• @DomHastings huhu, I wrote the exact same code in the comments of Gabriel Benamy's answer!
Nov 9, 2016 at 15:11
• D'oh! Didn't see that one! Also then saw it's been used a lot in other answers.. Oh well! Nov 9, 2016 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 ;)
Nov 9, 2016 at 15:22

# 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. Nov 8, 2016 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. Nov 8, 2016 at 20:31
• Ah, that makes sense. Posted here: codegolf.stackexchange.com/a/99070/11261 Nov 8, 2016 at 20:35
• Damn I still need to grok this language: 25 bytes Nov 9, 2016 at 13:12

# 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 Nov 8, 2016 at 20:39

# 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.
• Well done! And your smiley is better than mine Nov 8, 2016 at 21:18
• @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?) Nov 8, 2016 at 21:39
• You want to get rid of the smiley?? :-P Nov 8, 2016 at 22:30

# 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) Nov 14, 2016 at 7:24
• @AntonyHatchkins Thanks!
Nov 16, 2016 at 13:43

# 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.
Nov 8, 2016 at 20:34
• I did something similar without the peculiar : “_|__”ẋ175œs⁵Y (14 bytes) Nov 13, 2016 at 11:34

## 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? Nov 8, 2016 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, 2016 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. Nov 9, 2016 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, 2016 at 14:01
• @Neil Surprised? No, not really. Doesn't mean I have to be happy about it, though. :D Nov 9, 2016 at 14:08

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

_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
• 81 bytes Aug 4, 2020 at 21:29

# 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

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. Nov 8, 2016 at 19:41
• Isn't this 45 bytes? Nov 8, 2016 at 19:50
• @daHugLenny you are right, I counted \n as a single byte Nov 8, 2016 at 20:02
• where is the console.log ? Nov 9, 2016 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> Jul 24, 2017 at 17:17

# JavaScript (ES6), 48 bytes

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

Because recursion.

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