Build me a brick wall!

73

11

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!

FivePixels

Posted 2016-11-08T18:03:16.790

Reputation: 907

2Related, Related, – FlipTack – 2016-11-08T18:42:37.653

8Also Related. (odd that this should come up today, haha) – Conor O'Brien – 2016-11-08T18:43:35.490

This would be around 10 bytes in Crayon, too bad there's no interpreter yet...

– ETHproductions – 2016-11-08T20:47:30.643

could you provide a screenshot possibly @ETHproductions? thanks! – FivePixels – 2016-11-09T15:11:41.117

Who's gonna build your wall? – Toby Speight – 2016-11-10T11:11:03.157

@dylan I'm sorry, a screenshot of what? I don't have an interpreter yet, and the spec isn't even finalized, so I can't write the exact code... – ETHproductions – 2016-11-10T13:11:32.153

i thought you meant online interpreter, but yeah I understand. sorry for the miscommunication @ETHproductions – FivePixels – 2016-11-10T14:12:54.430

1That's OK. I'll let you know when I have a working interpreter. I'm working on it right now, actually :) – ETHproductions – 2016-11-10T14:20:10.223

2Related! – RudolfJelin – 2016-11-10T17:49:53.133

30For bonus points, make Mexico pay for it. – Dawood says reinstate Monica – 2016-11-11T08:26:51.430

Donald Trump just found cheap workmanship here! – sergiol – 2017-09-21T00:28:13.623

Haha, just stumbled across this challenge and I remembered being salty when this challenge came out as I had just put a very similar one in the sandbox.

– FlipTack – 2017-11-26T21:30:45.093

May we output a list of lines? – FlipTack – 2017-12-03T18:01:03.850

Answers

46

APL, 12 bytes

10 70⍴'_|__'

Output:

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

marinus

Posted 2016-11-08T18:03:16.790

Reputation: 30 224

1I just noticed this answer as I put my J answer. they're basically the same haha – Conor O'Brien – 2016-11-08T18:22:43.250

2This outputs something else in addition to the ascii wall. Is this allowed? – Buffer Over Read – 2016-11-09T16:11:02.707

when using tryapl.org, I got the wall output. what have you received @TheBitByte? – FivePixels – 2016-11-10T14:34:58.437

4@Dylan He's probably confused, since the answerer included the program in the output without knowing the REPL nature of APL. – Conor O'Brien – 2016-11-10T19:49:13.380

191

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.

Blue

Posted 2016-11-08T18:03:16.790

Reputation: 26 661

48I take it Trumpscript doesn't allow numbers less than 1,000,000? ;-) – ETHproductions – 2016-11-08T20:45:24.110

3you are correct. – Blue – 2016-11-08T20:52:44.970

2Can you use i is 1000005-1000000 and i is i-fact? (Just taken a look at the readme of Trumpscript.) – AlexRacer – 2016-11-08T22:31:49.350

2@AlexRacer I'll update once I get to a computer with a Trumpscript interpreter so I can test that – Blue – 2016-11-08T22:59:35.257

1Doesn't python have a way to multiply a string? e.g.: say "_|_" x 35 – Tim – 2016-11-10T03:25:19.337

20

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 – 2016-11-10T20:41:17.313

10Fact 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 – 2016-11-12T01:21:36.580

2Actually, the code`s 0 bytes. The 226 bytes come from the file. Fact. – JohnLBevan – 2016-11-14T19:50:48.113

232, doesn't use fact so no possible failing depending on time – ASCII-only – 2018-05-30T05:32:34.473

20

J, 12 bytes

10 70$'_|__'

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

Conor O'Brien

Posted 2016-11-08T18:03:16.790

Reputation: 36 228

18

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.

Level River St

Posted 2016-11-08T18:03:16.790

Reputation: 22 049

2Best (ab)use of WIDTH that I have seen :) – ElPedro – 2016-11-08T18:46:29.493

This should have "23 bytes" in the header then. – Adám – 2016-11-08T20:33:22.403

@Adám Only if the tokenized version is posted as the answer. – ErikE – 2016-11-14T07:38:21.727

17

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

Mitchell Humphrey

Posted 2016-11-08T18:03:16.790

Reputation: 348

16

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

milk

Posted 2016-11-08T18:03:16.790

Reputation: 3 043

10

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.

Adnan

Posted 2016-11-08T18:03:16.790

Reputation: 41 965

10

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

xnor

Posted 2016-11-08T18:03:16.790

Reputation: 115 687

Your last alternative is shorter as print(("%s"*70+"\n")*10%(175*(*"_|__",))) in Python 3. – mbomb007 – 2016-11-08T20:49:33.123

8

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!

Adnan

Posted 2016-11-08T18:03:16.790

Reputation: 41 965

7

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);'
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__

manatwork

Posted 2016-11-08T18:03:16.790

Reputation: 17 865

bytes, not character count. – FivePixels – 2016-11-08T19:40:03.707

2Same. I use no multibyte characters. – manatwork – 2016-11-08T19:41:36.207

9Crossed out 44 is still regular 44 ;( – pajonk – 2016-11-08T20:05:04.897

2

@pajonk, Fixed with PPCG - Crossed Out 44 user style on my machine: https://i.stack.imgur.com/czn5h.png

– manatwork – 2016-11-08T20:26:48.373

You can save a byte by using str_pad instead of str_repeat, largely because _ is treated as a constant with value _. – user59178 – 2016-11-09T09:21:57.880

7

Vim, 30 24 19 keystrokes

18a___|<esc>YP2x}h.yk4P

Thanks to DrMcMoylex and nmjcman101 for saving valuable keystrokes!

karpfen

Posted 2016-11-08T18:03:16.790

Reputation: 181

1Nice 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. – James – 2016-11-09T16:07:16.323

Cool, thanks for the tips! – karpfen – 2016-11-09T16:15:20.567

1I 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. – nmjcman101 – 2016-11-23T16:44:53.873

Nice, I'll update the answer! I'll just replace the second to last key with 4, otherwise the wall is getting too high :) – karpfen – 2016-11-23T17:12:11.593

6

Perl, 47 34 29 bytes

$_="_|__"x175;say for/.{70}/g

Gabriel Benamy

Posted 2016-11-08T18:03:16.790

Reputation: 2 827

You can golf it down to 29 : say for("_|__"x175)=~/.{70}/g – Dada – 2016-11-08T18:22:03.517

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 – 2016-11-08T18:39:07.590

Well, the code I suggested does produce a valid output... Maybe you forgot the parenthesis around "_|__"x175 or something like that? – Dada – 2016-11-08T18:47:34.577

I think that's what it is. I figured parentheses had to go somewhere, I just couldn't figure out where, lol – Gabriel Benamy – 2016-11-08T18:48:46.387

Huhu, hard to remember the precedence of every operator (=~ has a higher precedence than x)! – Dada – 2016-11-08T18:50:30.697

I always seem to have tabs with perlre, perlop, and perlrun open at all times for that very reason :P – Gabriel Benamy – 2016-11-08T18:52:07.383

5

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!

James

Posted 2016-11-08T18:03:16.790

Reputation: 54 537

19 bytes: http://v.tryitonline.net/#code=MTc1aV98X18bw5MuXHs3MH0vwrDDsg&input= I couldn't figure out how to use the .\{-} shortcut mentioned in the V docs, though.

– Jordan – 2016-11-08T19:52:09.010

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

– James – 2016-11-08T20:31:32.653

Ah, that makes sense. Posted here: http://codegolf.stackexchange.com/a/99070/11261

– Jordan – 2016-11-08T20:35:49.960

Damn I still need to grok this language: 25 bytes

– statox – 2016-11-09T13:12:24.033

5

Perl, 31 bytes

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

You'll need -E flag to run it :

perl -E 'say+($@="_|__"x17,"_|
__$@
")x5'

Dada

Posted 2016-11-08T18:03:16.790

Reputation: 8 279

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 – 2016-11-09T12:23:11.560

@DomHastings huhu, I wrote the exact same code in the comments of Gabriel Benamy's answer! – Dada – 2016-11-09T15:11:45.467

D'oh! Didn't see that one! Also then saw it's been used a lot in other answers.. Oh well! – Dom Hastings – 2016-11-09T15:13:35.690

@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 – 2016-11-09T15:22:47.140

5

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

Kade

Posted 2016-11-08T18:03:16.790

Reputation: 7 463

Could be 2 bytes less: print'\n'.join([k[:70],k[2:]]*5) – Antony Hatchkins – 2016-11-14T07:24:18.470

@AntonyHatchkins Thanks! – Kade – 2016-11-16T13:43:54.440

5

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!

Jordan

Posted 2016-11-08T18:03:16.790

Reputation: 5 001

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 – James – 2016-11-08T20:39:39.980

5

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.

Sanchises

Posted 2016-11-08T18:03:16.790

Reputation: 8 530

Well done! And your smiley is better than mine – Luis Mendo – 2016-11-08T21:18:03.073

@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?) – Sanchises – 2016-11-08T21:39:49.577

You want to get rid of the smiley?? :-P – Luis Mendo – 2016-11-08T22:30:50.273

4

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!

AdmBorkBork

Posted 2016-11-08T18:03:16.790

Reputation: 41 581

Would .{70} be any shorter for teh regex? – Conor O'Brien – 2016-11-08T21:00:19.643

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 – 2016-11-09T10:23:39.670

@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 – 2016-11-09T13:33:36.163

Yes, and I'm saying you shouldn't be surprised by that result, because that's what split's supposed to do. – Neil – 2016-11-09T14:01:59.967

@Neil Surprised? No, not really. Doesn't mean I have to be happy about it, though. :D – AdmBorkBork – 2016-11-09T14:08:28.960

4

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

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

cleblanc

Posted 2016-11-08T18:03:16.790

Reputation: 3 360

3

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

Jonathan Allan

Posted 2016-11-08T18:03:16.790

Reputation: 67 804

1By definition, Jelly cannot be longer than J. – Adám – 2016-11-08T20:34:44.280

I did something similar without the peculiar : “_|__”ẋ175œs⁵Y (14 bytes) – Erik the Outgolfer – 2016-11-13T11:34:28.613

3

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

Luis Mendo

Posted 2016-11-08T18:03:16.790

Reputation: 87 464

Beat you with an entire byte: http://codegolf.stackexchange.com/a/99073/32352

– Sanchises – 2016-11-08T20:46:12.463

3

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

Luis Mendo

Posted 2016-11-08T18:03:16.790

Reputation: 87 464

3

Javascript REPL, 45 bytes

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

Juan Tonina - Reinstate Monica

Posted 2016-11-08T18:03:16.790

Reputation: 459

1Welcome 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 – 2016-11-08T19:41:50.643

1Isn't this 45 bytes? – acrolith – 2016-11-08T19:50:19.877

@daHugLenny you are right, I counted \n as a single byte – Juan Tonina - Reinstate Monica – 2016-11-08T20:02:15.557

where is the console.log ? – cardeol – 2016-11-09T12:49:35.930

1As 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 – 2017-07-24T17:17:08.147

3

JavaScript (ES6), 48 bytes

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

Because recursion.

ETHproductions

Posted 2016-11-08T18:03:16.790

Reputation: 47 880

3

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.

rjmunro

Posted 2016-11-08T18:03:16.790

Reputation: 181

2

Python 3, 40 bytes

p="_|__"*17
print((p+"_|\n__"+p+"\n")*5)

Juntos

Posted 2016-11-08T18:03:16.790

Reputation: 41

2

Befunge-98, 63 bytes

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

TryItOnline!

Brian Gradin

Posted 2016-11-08T18:03:16.790

Reputation: 569

2

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

Level River St

Posted 2016-11-08T18:03:16.790

Reputation: 22 049

2The generate-all-then-split approach is shorter here too: puts ("_|__"*175).scan /.{70}/. – manatwork – 2016-11-08T19:15:09.913

@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 – 2016-11-08T22:27:36.557

2

///, 51 bytes

If a trailing newline is allowed:

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

Try it online!

acrolith

Posted 2016-11-08T18:03:16.790

Reputation: 3 728

2

Pyke, 12 bytes

w�"_|__"*TfX

where is the literal byte 163.

Try it here! (w� replaced with literal)

Blue

Posted 2016-11-08T18:03:16.790

Reputation: 26 661

2

Retina, 23 21 20 bytes


175$*_

_|_
!`.{70}

Try it online

mbomb007

Posted 2016-11-08T18:03:16.790

Reputation: 21 944

Use !\.{70}` to split the string at the end. – Martin Ender – 2016-11-09T13:59:22.917

You can save another byte like this: http://retina.tryitonline.net/#code=CjE3NSQqXwoKX3xfCiFgLns3MH0&input=

– Martin Ender – 2016-11-15T21:15:13.287

2

Haskell, 56 47 bytes

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

Angs

Posted 2016-11-08T18:03:16.790

Reputation: 4 825

2

R, 78 bytes

    strwrap(gsub('(.{70})','\\1 ',paste(rep('___|',175),collapse='')),70)

How?

    x=paste(rep('___|',175),collapse='')   #Creates string on 1 line
    y=gsub('(.{70})','\\1 ',x)             #Adds spaces every 70 characters
    z=strwrap(y,70)                        #Creates a new line every space
    z                                      #Print the finished product

cps1

Posted 2016-11-08T18:03:16.790

Reputation: 21

2

C, 61 bytes

TCC Version

main(i){for(;i+699;)printf("\n%c"+(--i%70||!i),"___|"[i&3]);}

GCC Version

main(i){for(;i+699;)printf("\n%c"+(i%70||!i),"___|"[--i&3]);}

david.werecat

Posted 2016-11-08T18:03:16.790

Reputation: 41

Welcome to the site! – James – 2016-11-11T17:29:10.423

2

Befunge-93, 42 bytes

:4%1g,1+:"F"%!#v_0#@_
_|__~>:+#5,#:4#<1g*`^

Try it online!

James Holderness

Posted 2016-11-08T18:03:16.790

Reputation: 8 298

1Nice answer. Welcome to the site! – James – 2016-11-12T01:43:04.500

1

PHP, 56 bytes

Although I know it can be done smaller using wordwrap or string splits, I prefer more hacky solutions.

for($i=0;$i<700;$i++){echo($i%70?'':'
').'_|___'[$i%4];}

Xesau

Posted 2016-11-08T18:03:16.790

Reputation: 81

1

Symbolic Python, 69 bytes

Outputs as a list of lines.

_=-~(_==_)
__=-~_*-~_*_
_=[('_|__'*__)[:-_],('___|'*__)[:-_]]*-~(_*_)

Try it online!

Alternatively, for 16 more bytes, we can print the wall:

_=-~(_==_)
__=-~_*-~_*_
_=(('_|__'*__)[:-_]+"""
"""+('___|'*__)[:-_]+"""
""")*-~(_*_)

Try it online!

FlipTack

Posted 2016-11-08T18:03:16.790

Reputation: 13 242

1

Tcl, 84 78 77 76 bytes

time {append a [expr [incr i]%4-2?"_":"|"];if $i%70<1 {puts $a;unset a}} 700

Try it online!

ASCII-only

Posted 2016-11-08T18:03:16.790

Reputation: 4 687

Interesting trick of append and unset! – sergiol – 2018-11-30T01:46:42.573

@sergiol you sure took your time to reply :P also haven't been using tcl lately. idk if i should start using it again – ASCII-only – 2018-12-05T11:37:24.807

1

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

ElPedro

Posted 2016-11-08T18:03:16.790

Reputation: 5 301

1b*70+70 -> -~b*70 saves a byte :) – Kade – 2016-11-08T18:33:24.487

2Or [b*70:][:70]. – xnor – 2016-11-08T18:34:45.837

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 – 2016-11-08T18:41:17.363

1

C#, 106 102 101 118 107 106 100 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/.

Ave

Posted 2016-11-08T18:03:16.790

Reputation: 131

1Change the a%2==0 to a%2<1 to save a byte :) – Kade – 2016-11-08T18:39:25.167

Also, you can remove the a++ in the for definition and change a%2 to a++%2! – Kade – 2016-11-08T18:41:07.113

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 – 2016-11-08T19:45:36.133

@Yodle I could save 6 bytes by doing so (and not 4), thanks! – Ave – 2016-11-08T19:48:57.757

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 – 2016-11-08T19:50:57.783

Remove the two pairs of curly braces for 4 bytes – Link Ng – 2016-11-10T12:40:03.633

@LinkNg thanks :) – Ave – 2016-11-10T13:54:41.773

Could you do this and save 2 bytes? int i;for(;i<10;)Console.Write(string.Join("_|__",new string[75]).Substring(i++*10,70)+ "\n"); http://csharppad.com/gist/92a5bcefaeaeb90a96a9cc367593b1c5

– chrixbittinx – 2016-11-10T17:52:48.290

1

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

Conor O'Brien

Posted 2016-11-08T18:03:16.790

Reputation: 36 228

1

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

dzaima

Posted 2016-11-08T18:03:16.790

Reputation: 19 048

1

Pyth, 24 23 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

ElPedro

Posted 2016-11-08T18:03:16.790

Reputation: 5 301

1

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.

Xanderhall

Posted 2016-11-08T18:03:16.790

Reputation: 1 236

2Don't you need imports for this? – mbomb007 – 2016-11-08T21:03:22.270

@mbomb007 That's why I put '+ Guava' in the title. I assumed that was sufficient. – Xanderhall – 2016-11-10T12:01:14.150

Imports must be included in the byte count. https://meta.codegolf.stackexchange.com/q/10081/34718; https://meta.codegolf.stackexchange.com/a/8782/34718

– mbomb007 – 2016-11-10T14:31:35.903

1

GolfSharp, 38 bytes

c(r(175).s(n=>"_|__").j().S(70).j(N));

downrep_nation

Posted 2016-11-08T18:03:16.790

Reputation: 1 152

is it this language?

– aloisdg moving to codidact.com – 2018-10-25T19:37:33.100

@aloisdg it is fellow typo corrector! You warmed my heart – downrep_nation – 2018-10-25T20:18:26.500

1

PHP, 46 bytes

<?=wordwrap(str_repeat('_|__',175),70,"\n",1);

Output:

C:\PHP>php build-me-a-brick-wall.php
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__

Mario

Posted 2016-11-08T18:03:16.790

Reputation: 3 043

I think wordwrap()'s 3rd parameter should be "\n" as this currently keeps the string unwrapped in PHP 5.6. – manatwork – 2016-11-09T14:29:59.753

@manatwork In the "test online" link you can check the various versions of PHP, it seems working fine in PHP all versions. – Mario – 2016-11-09T14:37:43.060

Correct, “seems”. But the output is wrapped by the sandbox site, not by PHP. See with “Output: Raw”. – manatwork – 2016-11-09T14:49:51.083

@manatwork I thought the textbox output is acceptable too. I tryed with <?=wordwrap(str_repeat('_|__',175),70,"\n",1); and still no wraps in Raw output while it works fine if you save it in a PHP file and run in a browser. – Mario – 2016-11-09T14:58:20.513

Well, relying on the sandbox sounds similar to what was discussed in When is code that requires a REPL acceptable?. So if you add it to the post title, should be fine. (Honestly, I still not like the idea.) BTW, you can just wrap the line in that place instead of writing \n, to keep the code size at original 45.

– manatwork – 2016-11-09T15:04:40.333

@manatwork I added the PHP interpreted version called by console. – Mario – 2016-11-09T17:05:28.490

chunk_split will save four bytes over wordwrap, because you don´t need the 3rd and 4th parameter. Funny: str_pad("",700,"_|__") has the same length as str_repeat("_|__",175). – Titus – 2016-11-10T13:28:32.580

@Titus I know, but I didn't want to copy the other answer :) Someone used that before me and the answers would have been too much similar or almost the same... – Mario – 2016-11-10T13:41:53.847

1

Racket 159 bytes

(let p((n 2)(x 0)(t 0)(d display))(when(> x 69)(d"\n")(set! x 0))(cond[(> t 699)
(d"\n")][(> n 2)(d"|")(p 0(+ 1 x)(+ 1 t)d)][(d"_")(p(+ 1 n)(+ 1 x)(+ 1 t)d)]))

Ungolfed:

(define (f)
  (let loop ((n 2)   (x 0)   (t 0)  (d display))

    (when (> x 69)  (d "\n")
                    (set! x 0))
    (cond
      [(> t 699)    (d "\n")]

      [(> n 2)      (d "|")
                    (loop    0    (+ 1 x) (+ 1 t) d)]

      [else         (d "_")
                    (loop (+ 1 n) (+ 1 x) (+ 1 t) d)]
      )))

Testing:

(f)

Output:

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

rnso

Posted 2016-11-08T18:03:16.790

Reputation: 1 635

1

Ruby, 89 80 77 76 72 53 47 42 Bytes

puts (%w[___]*176*?|)[2..-1].scan(/.{70}/)

Demo:

>> puts (%w[___]*176*?|)[2..-1].scan(/.{70}/)
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__

Update: I didn’t see there’s already an answer with 30 bytes.

bfontaine

Posted 2016-11-08T18:03:16.790

Reputation: 133

1

Java 8, 128

This code directly calculates each character and has no imports or dependencies.

Golfed:

()->{String s="";for(int x,y=0;y<10;++y){for(x=0;x<70;++x)s+=((y%2<1&(x+3)%4<1)|(y%2>0&(x+1)%4<1))?"|":"_";s+="\n";}return s;}

Ungolfed:

() -> {
  String s = "";
  for (int x, y = 0; y < 10; ++y) {
    for (x = 0; x < 70; ++x)
      s += ((y % 2 < 1 & (x + 3) % 4 < 1) | (y % 2 > 0 & (x + 1) % 4 < 1)) ? "|" : "_";
    s += "\n";
  }
  return s;
}

user18932

Posted 2016-11-08T18:03:16.790

Reputation:

1

Swift 3, 69 bytes

(3...702).map{print($0%4<1 ?"|":"_",terminator:($0-2)%70<1 ?"\n":"")}

Output after compiling and running:

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

Try online here (In this tool it run as script so it will produce a warning due the map result is unused.

Otávio

Posted 2016-11-08T18:03:16.790

Reputation: 161

1

Clojure, 117 110 bytes

(fn[](println(apply str(map #(str(apply str %)"\n")(partition 70(subs(apply str(repeat 175 "_|__"))0 700))))))

Basically creates a long string of "_|__"s 700 characters long, cuts it every 70 characters, then joins them with newline.

Managed to get rid of the calls to join!

Ungolfed:

(defn build-wall []
  (println
    (apply str
      (map #(str (apply str %) "\n")
        (partition 70
          (subs (apply str
                  (repeat 175 "_|__"))
                0 700))))))

Carcigenicate

Posted 2016-11-08T18:03:16.790

Reputation: 3 295

1

Python 3, 43

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

Fixed to be more Trump-like.

Michael-Andrew Keays

Posted 2016-11-08T18:03:16.790

Reputation: 11

1

SAS, 68

option linesize=70;data;length w$700;w=repeat('_|__',174);put w;run;

The 174 is not a typo - in SAS the repeat function rather pedantically returns the original string plus n repeats.

user3490

Posted 2016-11-08T18:03:16.790

Reputation: 809

1

Kotlin, 99 bytes

fun main(a:Array<String>){"_|__".repeat(999).split(Regex("(?<=\\G.{70})")).take(10).map(::println)}

Regex taken from here. First ever golf, done in 10 minutes, probably improvable..

F. George

Posted 2016-11-08T18:03:16.790

Reputation: 317

Welcome to PPCG! Can you remove some of the spaces? Like a:Array<String>? – Rɪᴋᴇʀ – 2016-11-11T17:48:07.420

How'd I miss that...thanks. – F. George – 2016-11-11T17:50:01.613

@mEQ5aNLrK3lqs3kfSa5HbvsTWe0nIu What does your name mean? – Oliver Ni – 2016-11-11T18:04:20.280

I use random usernames everywhere, I don't like the possibility of somebody googling my nick and finding out everything about my online life. – F. George – 2016-11-11T18:07:43.510

1

Lua, 54 bytes

w=("_|__"):rep(17)print((w.."_|\n__"..w.."\n"):rep(5))

No fancy splits for Lua, but it does have an easy repeat.

Blab

Posted 2016-11-08T18:03:16.790

Reputation: 451

1

bash 36 Byte

printf '_|__%.0s' {1..175}|fold -w70

OUtput:

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

بارپابابا

Posted 2016-11-08T18:03:16.790

Reputation: 159

1

Python 2, 46 bytes

import textwrap as t;print t.fill('_|__'*175)

I was going to do an exec loop similar to @xnor's one alternate solution but he/she got to it before me. I guess I'll just have to let Python do the dirty work for me.

Lord Ratte

Posted 2016-11-08T18:03:16.790

Reputation: 111

1

R, 62 bytes

Don't have the rep to comment, so posting as an answer: @user3297046's answer can be golfed-down to 62 bytes:

cat(gsub('(.{70})','\\1
',paste(rep('_|__',175),collapse='')))

which results in

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

Nutle

Posted 2016-11-08T18:03:16.790

Reputation: 221

0

Pushy, 21 bytes

`_|__`17:4d;T:vv"^^{{

(non-competing as the language postdates the challenge)

Really wish I could golf it more, will have another go later. It works like so:

`_|__`                  % Push the brick string to the stack
      17:4d;            % Copy 17 times
            T:          % 10 times do:
              vv"^^     %   Print without the last two characters
                   {{   %   Shift the string left twice

Seeing as there's no online interpreter as of yet, here's what it looks like:

$ pushy brickwall.pshy

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

FlipTack

Posted 2016-11-08T18:03:16.790

Reputation: 13 242

0

SOGL V0.12, 10 bytes

Ωo³‘'╥*'4n

Try it Here!

Explanation:

Ωo³‘        push "_|__"
    '╥*     multiply the string 175 times
       '4n  split into lines of length 70

dzaima

Posted 2016-11-08T18:03:16.790

Reputation: 19 048

0

C (gcc), 61 bytes

f(i){for(i=700;i--;)printf(i%70|!i?"%c":"%c\n","__|_"[i%4]);}

Try it online!

gastropner

Posted 2016-11-08T18:03:16.790

Reputation: 3 264

0

Japt -R, 15 bytes

AÆ70î"_|__"éX*2

Try it online!

Unpacked & How it works

Ao@70î"_|__"éX*2

Ao@      range(10).map(X=>...)
70î        Repeat the following string to length 70...
"_|__"éX*2   This string rotated X*2 chars to the right.
         `-R` joins the resulting array with newline
         Implicit output

Bubbler

Posted 2016-11-08T18:03:16.790

Reputation: 16 616

0

Brainfuck, 141 bytes

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

Try it online !

My first brainfuck answer !

There is a more aerial and commented version :

+++++[>+++++[>>++++>+++++<<<-]>++>-<<<-]>>>>->  value storage
+++++[                                          doing this ↓ 5 times
  <<.>.>                                        first "_|"
  >++++++++[>++>++<<-]>+>+<                     storing 17 two times
    [<<<<...>.>>>-]                             first 17 "|___" batch
    <<<<<.>>>>>>                                new line
    [<<<<<...>.>>>>-]                           second 17 "|___" batch
  <<<<<..<.>>>-                                 last "__" and new line
]

The random guy

Posted 2016-11-08T18:03:16.790

Reputation: 1 262

0

Charm, 87 bytes

f := " ___| " 18 repeat
s := substring pstring newline
[ f 2 72 s f 0 70 s ] 5 repeat i

Try it online!

Charm's repeat makes this kind of thing easy, but its syntax prevents very good scores regardless.

Explanation:

f := " ___| " 18 repeat " function to push 18 bricks " pop
s := substring pstring newline " we need to get a substring before printing it with a newline at two different points during the program, so we save bytes defining a function for it " pop
[ f 2 72 s f 0 70 s ] 5 repeat i " now we apply our functions, getting two slightly different substrings of the bricks from the f function and printing them, repeating this 5 times "

LyricLy

Posted 2016-11-08T18:03:16.790

Reputation: 3 313

would it be shorter to get the ascii value of the new line ? – The random guy – 2018-05-25T09:54:13.833

10 char p is longer than newline. – LyricLy – 2018-05-25T10:27:06.677

0

Charcoal, 11 bytes

⪪×¹⁷⁵_|__⁷⁰

Try it online!

ASCII-only

Posted 2016-11-08T18:03:16.790

Reputation: 4 687

0

Prolog (SWI), 83 bytes

?-between(0,699,I),(1 is I mod 4->write("|");write("_")),69 is I mod 70,nl,1=0;1=1.

Try it online!

ASCII-only

Posted 2016-11-08T18:03:16.790

Reputation: 4 687

0

Common Lisp, 70 bytes

(dotimes(i 700)(format t"~[|~:;_~]~[
~:;~]"(mod(1- i)4)(mod(1+ i)70)))

Try it online!

ASCII-only

Posted 2016-11-08T18:03:16.790

Reputation: 4 687

0

JavaScript (Node.js), 45 bytes

_=>`_|__`.repeat(175).match(/.{70}/g).join`
`

Try it online!

Explanation :

_ =>                    // lambda function (argument passed to save a byte)
    `_|__`              // simple enough
    .repeat(175)        // repeat the above mentioned shape 175 times
    .match(/.{70}/g)    // simple regexp to match a shape 70 (something :) ) long 
    .join`\n`           // and join them on a new line

Simple enough.

Alternate version :

JavaScript (Node.js), 714 bytes

_=>`_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__`

Try it online!

No explanation required. Simple hard coded.

Muhammad Salman

Posted 2016-11-08T18:03:16.790

Reputation: 2 361

0

Perl, 37 bytes

print$_.$/x!(++$i%35)for('_|',__)x175

Ungolfed:

my $i = 0;
print($_, "\n" x !(++$i % 35)) for ('_|', '__') x 175;

Denis Ibaev

Posted 2016-11-08T18:03:16.790

Reputation: 876

0

Lithp, 72 bytes

#::((print (replace (repeat "_|__" 175) (regex "(.{70})" "g") "$1\n"))))

Sample usage:

% wall.lithp
(
    (def x #::((print (replace (repeat "_|__" 175) (regex "(.{70})" "g") "$1\n"))))
    (x)
)

Output:

$ ./run.js wall.lithp
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__

Andrakis

Posted 2016-11-08T18:03:16.790

Reputation: 361

0

Batch, 90 bytes

@set s=_________________
@for /l %%i in (1,1,5)do @echo _^|%s:_=___^|%&echo __%s:_=_^|__%

|s cause problems if I want to use them as contents of the variable so it's easiest to stick with them as replace strings.

Neil

Posted 2016-11-08T18:03:16.790

Reputation: 95 035

0

BASH, 91,34 bytes

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

cardeol

Posted 2016-11-08T18:03:16.790

Reputation: 101

0

Java 7, 136 124 120 115 bytes

String c(){String r,x=r="";int i=999,q=0;for(;i-->0;x+="_|__");for(;i++<10;r+=x.substring(q,q+=70)+"\n");return r;}

Ungolfed & test code:

Try it here.

class M{
  static String c(){
    String r,
           x = r = "";
    int i = 999,
        q = 0;
    for(; i-- > 0; x += "___|");
    for(; i++ < 10; r+= x.substring(q, q+=70) + "\n");
    return r;
  }

  public static void main(String[] a){
    System.out.println(c());
  }
}

Output:

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

Kevin Cruijssen

Posted 2016-11-08T18:03:16.790

Reputation: 67 575

Is it possible to use recursion instead of a for-loop here? That could cut down on some amount of data. – Clayton Ramsey – 2016-11-10T00:55:54.123

0

Ruby, 30 bytes

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

Output:

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

dkudriavtsev

Posted 2016-11-08T18:03:16.790

Reputation: 5 781

Duplicate of Level River St's Ruby solution posted 20 hours earlier. :(

– manatwork – 2016-11-09T19:31:59.480

0

Vim, 26 22 strokes

Assume the q register to be empty (if not type qqq)

175i_|__<esc>0qq70li<enter><esc>q8@q

永劫回帰

Posted 2016-11-08T18:03:16.790

Reputation: 131

1It's 8q at the end, not 9q. 9q produces a single underscore on an 11th line. – Bart van Nierop – 2016-11-13T10:21:20.057

0

Java 8, 101 119 bytes

18 for the import: java.util.stream.*;

Lambda that returns the wall. We generate an infinite Stream of brick pieces ('_|__'), limit it to 175, and collect them into a string. We then use replaceAll to swap in a newline every 70 characters.

()->Stream.generate(()->"_|__").limit(175).collect(Collectors.joining()).replaceAll("(.{70})","$1\n")

Xanderhall

Posted 2016-11-08T18:03:16.790

Reputation: 1 236

0

Gema, 45 characters

\A=@subst{<U70>=\$1\\n;@repeat{175;_|__}}@end

Sample run:

bash-4.3$ gema '\A=@subst{<U70>=\$1\\n;@repeat{175;_|__}}@end'
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__

manatwork

Posted 2016-11-08T18:03:16.790

Reputation: 17 865

0

Javascript, 232 bytes

brick = ["_","_","_","|"];
brickIndex = 2;
output = "";
for(var y=0;y<10;y++){
    for(var x=0;x<70;x++){
      brickIndex = brickIndex % 4;
      output += brick[brickIndex++];
    }
    output += "\n";
}
console.log(output)

KYL3R

Posted 2016-11-08T18:03:16.790

Reputation: 101

3

“All solutions to challenges should: (…) Be a serious contender for the winning criteria in use. For example, an entry to a code golf contest needs to be golfed (…)” – [help/on-topic] Please read Tips for golfing in <all languages> and/or Tips for golfing in JavaScript for hints on reducing your code's size.

– manatwork – 2016-11-10T13:56:02.920

0

jq, 37 characters

(33 characters code + 4 characters command line options)

range(10)|.*2|("_|__"*70)[.:.+70]
range(10)|("_|__"*70)[.*2:.*2+70]
range(0;20;2)|("_|__"*70)[.:.+70]

Sample run:

bash-4.3$ jq -nr 'range(10)|.*2|("_|__"*70)[.:.+70]'
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__

On-line test code 1, code 2 and code 3 (Passing -r through URL is not supported – check Raw Output yourself.)

manatwork

Posted 2016-11-08T18:03:16.790

Reputation: 17 865

0

sh (via base64 and pigz) 59 bytes

echo eNqLr4mPpxxzgQjKMRc5mkZdM+oaAG7xGAs=|base64 -D|pigz -d

rjmunro

Posted 2016-11-08T18:03:16.790

Reputation: 181

0

FurryScript, 71 bytes

A[ <_|> 17 REP +<___|> +BR +<__> 17 REP +<_|__> +BR ]
<<A><A><A><A><A>>

Explanation:

A[ ... ]            {{ Subroutine called A }}
<_|>                {{ Push string "_|" }}
17 REP              {{ Repeat next command 17 times: }}
+<___|>             {{ Concatenate "___|" }}
+BR                 {{ Concatenate newline }}
+<__>               {{ Concatenate "__" }}
17 REP              {{ Repeat next command 17 times: }}
+<_|__>             {{ Concatenate "_|__" }}
+BR                 {{ Concatenate newline }}
<<A><A><A><A><A>>   {{ Template; result of A, 5 times }}

acrolith

Posted 2016-11-08T18:03:16.790

Reputation: 3 728

0

bash, 35 bytes

printf '\e[8;;70t_|__%.0s' {1..175}

Must be run in graphical terminal as it sets the size of the window.

rjmunro

Posted 2016-11-08T18:03:16.790

Reputation: 181

0

Python 3.5.2, 44 bytes

exec("print('_|__'*18);print('___|'*18);"*5)

This is my first attempted golf, so feel free to leave a suggestion!

Try it here

MinteZ

Posted 2016-11-08T18:03:16.790

Reputation: 1

0

MySQL, 196 123 118 95 bytes

First wall was backwards, removed procedure.

set @x:=repeat('_|__',99);select left(repeat(concat(left(@x,70),'\n',mid(@x,3,70),'\n'),9),709)

Wahooka

Posted 2016-11-08T18:03:16.790

Reputation: 79

0

Python 3 - 41 chars

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

vpzomtrrfrt

Posted 2016-11-08T18:03:16.790

Reputation: 201

0

Python 3, 54 bytes

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

I know this is longer than other Python 3 solutions, so I post because it is a different approach.

Jimmy Johnson

Posted 2016-11-08T18:03:16.790

Reputation: 71