Output a pretty box

20

2

Your challenge is to exactly output the following box:

..................................................
..................................................
..                                              ..
..                                              ..
..  ++++++++++++++++++++++++++++++++++++++++++  ..
..  ++++++++++++++++++++++++++++++++++++++++++  ..
..  ++                                      ++  ..
..  ++                                      ++  ..
..  ++  ..................................  ++  ..
..  ++  ..................................  ++  ..
..  ++  ..                              ..  ++  ..
..  ++  ..                              ..  ++  ..
..  ++  ..  ++++++++++++++++++++++++++  ..  ++  ..
..  ++  ..  ++++++++++++++++++++++++++  ..  ++  ..
..  ++  ..  ++                      ++  ..  ++  ..
..  ++  ..  ++                      ++  ..  ++  ..
..  ++  ..  ++  ..................  ++  ..  ++  ..
..  ++  ..  ++  ..................  ++  ..  ++  ..
..  ++  ..  ++  ..              ..  ++  ..  ++  ..
..  ++  ..  ++  ..              ..  ++  ..  ++  ..
..  ++  ..  ++  ..  ++++++++++  ..  ++  ..  ++  ..
..  ++  ..  ++  ..  ++++++++++  ..  ++  ..  ++  ..
..  ++  ..  ++  ..  ++      ++  ..  ++  ..  ++  ..
..  ++  ..  ++  ..  ++      ++  ..  ++  ..  ++  ..
..  ++  ..  ++  ..  ++  ..  ++  ..  ++  ..  ++  ..
..  ++  ..  ++  ..  ++  ..  ++  ..  ++  ..  ++  ..
..  ++  ..  ++  ..  ++      ++  ..  ++  ..  ++  ..
..  ++  ..  ++  ..  ++      ++  ..  ++  ..  ++  ..
..  ++  ..  ++  ..  ++++++++++  ..  ++  ..  ++  ..
..  ++  ..  ++  ..  ++++++++++  ..  ++  ..  ++  ..
..  ++  ..  ++  ..              ..  ++  ..  ++  ..
..  ++  ..  ++  ..              ..  ++  ..  ++  ..
..  ++  ..  ++  ..................  ++  ..  ++  ..
..  ++  ..  ++  ..................  ++  ..  ++  ..
..  ++  ..  ++                      ++  ..  ++  ..
..  ++  ..  ++                      ++  ..  ++  ..
..  ++  ..  ++++++++++++++++++++++++++  ..  ++  ..
..  ++  ..  ++++++++++++++++++++++++++  ..  ++  ..
..  ++  ..                              ..  ++  ..
..  ++  ..                              ..  ++  ..
..  ++  ..................................  ++  ..
..  ++  ..................................  ++  ..
..  ++                                      ++  ..
..  ++                                      ++  ..
..  ++++++++++++++++++++++++++++++++++++++++++  ..
..  ++++++++++++++++++++++++++++++++++++++++++  ..
..                                              ..
..                                              ..
..................................................
..................................................

The box is height and width 50, spaces are two wide.

You must write a function or program which outputs or returns a string and takes no input.

Fewest bytes wins!

Pavel

Posted 2017-01-13T17:24:21.297

Reputation: 8 585

5Any reason why the innermost + box only has 1 layer at the top and bottom? That'll make algorithm-based answers somewhat longer, as it means the innermost two layers aren't exactly square. – ETHproductions – 2017-01-13T17:34:52.310

@Pavel OK. Close-vote retracted :) – Digital Trauma – 2017-01-13T17:44:42.007

4Why the restriction on a complete program? – Rɪᴋᴇʀ – 2017-01-13T18:30:36.573

@EasterlyIrk I've decided to allow functions, but kept the requirement that it must print to StdOut. – Pavel – 2017-01-13T20:33:58.443

1@Pavel why? It adds really nothing to the challenge. – Rɪᴋᴇʀ – 2017-01-13T20:41:52.573

2@Pavel .....no. I mean yeah some have that, but it's not by far a requirement/standard for KG challenges. – Rɪᴋᴇʀ – 2017-01-13T20:54:38.580

Answers

10

Pyke, 20 17 bytes

k25V". + "ohe@A.X

Try it here!

k                 - out = ""
 25V              - repeat 25 times:
          oh      -     (o++)+1
            e     -    ^//2
    ". + "   @    -   " + ."[^] (wraps around)
              A.X -  out = surround(out, ^)

The surround function was made for questions like this!

Blue

Posted 2017-01-13T17:24:21.297

Reputation: 26 661

15

J, 25 bytes

echo'. + '{~4|>./~2#|i:12

Try it online!

Explanation

echo'. + '{~4|>./~2#|i:12
                     i:12  Range from -12 to 12.
                    |      Take absolute values,
                  2#       duplicate every element,
                /~         compute "multiplication table"
              >.           using maximum,
            4|             take mod 4 of every element,
    '. + '{~               index into this string,
echo                       print char matrix for everyone to see.

Zgarb

Posted 2017-01-13T17:24:21.297

Reputation: 39 083

I think you can leave off the echo. – Conor O'Brien – 2017-01-13T21:12:26.857

@ConorO'Brien Oh, the output rule changed. ...Hmm, but if I remove echo, it won't be even a function, just a value. Although J doesn't have zero-argument functions anyway. – Zgarb – 2017-01-13T21:21:17.323

I think that's allowed as per J's repl nature. In any case, constant functions can be considered to be zero-argument. – Conor O'Brien – 2017-01-13T21:45:57.847

11

C, 115 bytes

#define M(x,y)x<(y)?x:y
f(i){for(i=2549;i;i--)putchar(i%51?". + "[(M(i%51-1,M(50-i%51,M(i/51,49-i/51))))/2%4]:10);}

Defines a function f (call as f();) that prints the string to STDOUT.

Lynn

Posted 2017-01-13T17:24:21.297

Reputation: 55 648

9

C, 535 478 477 Bytes

Now that's a lot of golf :-/

i;main(j){for(;++i<51;puts(""))for(j=0;++j<51;)putchar(i<3|i>48?46:j<3|j>48?46:i>4&i<47&j>4&j<47?i<7|(i>44&i<47)|(j>2&j<7)|(j>44&j<47)?43:j>8&j<43&((i>8&i<11)|(i>40&i<43))?46:i>9&i<41&((j>8&j<11)|(j>40&j<43))?46:i>13&i<37&((j>12&j<15)|(j>36&j<39))?43:((i>12&i<15)|(i>36&i<39))&j>12&j<39?43:i>17&i<33&((j>16&j<19)|(j>32&j<35))?46:((i>16&i<19)|(i>32&i<35))&j>16&j<35?46:i>21&i<29&((j>20&j<23)|(j>28&j<31))?43:((i>20&i<23)|(i>28&i<31))&j>20&j<31?43:i>24&i<27&j>24&j<27?46:32:32);}

Here's the output;

..................................................
..................................................
..                                              ..
..                                              ..
..  ++++++++++++++++++++++++++++++++++++++++++  ..
..  ++++++++++++++++++++++++++++++++++++++++++  ..
..  ++                                      ++  ..
..  ++                                      ++  ..
..  ++  ..................................  ++  ..
..  ++  ..................................  ++  ..
..  ++  ..                              ..  ++  ..
..  ++  ..                              ..  ++  ..
..  ++  ..  ++++++++++++++++++++++++++  ..  ++  ..
..  ++  ..  ++++++++++++++++++++++++++  ..  ++  ..
..  ++  ..  ++                      ++  ..  ++  ..
..  ++  ..  ++                      ++  ..  ++  ..
..  ++  ..  ++  ..................  ++  ..  ++  ..
..  ++  ..  ++  ..................  ++  ..  ++  ..
..  ++  ..  ++  ..              ..  ++  ..  ++  ..
..  ++  ..  ++  ..              ..  ++  ..  ++  ..
..  ++  ..  ++  ..  ++++++++++  ..  ++  ..  ++  ..
..  ++  ..  ++  ..  ++++++++++  ..  ++  ..  ++  ..
..  ++  ..  ++  ..  ++      ++  ..  ++  ..  ++  ..
..  ++  ..  ++  ..  ++      ++  ..  ++  ..  ++  ..
..  ++  ..  ++  ..  ++  ..  ++  ..  ++  ..  ++  ..
..  ++  ..  ++  ..  ++  ..  ++  ..  ++  ..  ++  ..
..  ++  ..  ++  ..  ++      ++  ..  ++  ..  ++  ..
..  ++  ..  ++  ..  ++      ++  ..  ++  ..  ++  ..
..  ++  ..  ++  ..  ++++++++++  ..  ++  ..  ++  ..
..  ++  ..  ++  ..  ++++++++++  ..  ++  ..  ++  ..
..  ++  ..  ++  ..              ..  ++  ..  ++  ..
..  ++  ..  ++  ..              ..  ++  ..  ++  ..
..  ++  ..  ++  ..................  ++  ..  ++  ..
..  ++  ..  ++  ..................  ++  ..  ++  ..
..  ++  ..  ++                      ++  ..  ++  ..
..  ++  ..  ++                      ++  ..  ++  ..
..  ++  ..  ++++++++++++++++++++++++++  ..  ++  ..
..  ++  ..  ++++++++++++++++++++++++++  ..  ++  ..
..  ++  ..                              ..  ++  ..
..  ++  ..                              ..  ++  ..
..  ++  ..................................  ++  ..
..  ++  ..................................  ++  ..
..  ++                                      ++  ..
..  ++                                      ++  ..
..  ++++++++++++++++++++++++++++++++++++++++++  ..
..  ++++++++++++++++++++++++++++++++++++++++++  ..
..                                              ..
..                                              ..
..................................................
..................................................

cleblanc

Posted 2017-01-13T17:24:21.297

Reputation: 3 360

2Holy shit. I admire your dedication. – Rɪᴋᴇʀ – 2017-01-13T20:54:52.487

I've changed the restriction, functions which return a string are allowed now. – Pavel – 2017-01-13T20:59:41.537

I just realized I can golf a few bytes out re-writing the loops for(;i++<51; and now I'm off by one everywhere :-/ – cleblanc – 2017-01-13T21:00:35.550

@cleblanc ++i – dkudriavtsev – 2017-01-14T10:39:25.127

MFW I started trying to understand this: http://i.imgur.com/TLV9gJ4.png +1

– Magic Octopus Urn – 2017-01-19T18:32:40.723

6

Haskell, 72 bytes

q=(\n->[n,n]).abs=<<[-12..12]
unlines[[". + "!!mod(max x y)4|y<-q]|x<-q]

@Zgarb's solution in Haskell. I've also tried to construct the box by adding layers around the core ["..",".."], but it is 9 bytes longer (81 bytes).

e!b=e:e:b++[e,e];s#c=(c!)<$>(c<$s!!0)!s
unlines$foldl(#)["..",".."]" + . + . + ."

nimi

Posted 2017-01-13T17:24:21.297

Reputation: 34 639

5

Stacked, noncompeting, 35 bytes

Try it here!

ε'.'3$' + .'2*tostr*+$surroundfold

Ungolfed:

'' '.  ++  ..  ++  ..  ++  ..' $surround fold

Quite simple. surround is a function that, well, surrounds an entity with a fill entity. For example, (0) 1 surround is ((1 1 1) (1 0 1) (1 1 1)). $surround is surround as a function, not evaluated. fold takes an initial value, then something to fold over, then a function. In this case, surround is folded, surrounding the initially empty string '' (equiv. ε) with each character of the string.

'.'3$' + .'2*tostr*+

This is first making a character string $' + .', that, when multiplied by a number, repeats each character. This leaves us with: ++ ... This is then casted to a string. Then, we repeat this string thrice, and finally prepend a ., giving us the desired string.


A different approach for 39 bytes:

' .'3$' + .'2*tostr*+toarr$surround#\out

#\ is insert and takes the initial char of the string as the starting value. It also only works on Arrays.

Conor O'Brien

Posted 2017-01-13T17:24:21.297

Reputation: 36 228

How is this noncompeting, the challenge went up only a few hours ago. – Pavel – 2017-01-14T03:07:17.613

@Pavel I'm always working on this – Conor O'Brien – 2017-01-14T03:17:20.490

4

Jelly, 18 bytes

12ŒRAx2»þ`ị“ + .”Y

Try it online!

Same approach as Zgarb’s J answer: 12ŒRA is abs([-12 … 12]), x2 repeats every element twice, »þ` creates a table of maximums, ị“ + .” cyclically indexes into a string, and Y joins by newlines.

Lynn

Posted 2017-01-13T17:24:21.297

Reputation: 55 648

4

JavaScript (ES6), 117 bytes

f=(n=12,c=`. + `[n%4],t=c.repeat(n*4+2))=>n?t+`
${t}
${f(n-1).replace(/^|$/gm,c+c)}
${t}
`+t:`..
..`
console.log(f())

Nonrecursive solution took me 128 bytes:

console.log([...Array(100)].map((_,i,a)=>a.map((_,j)=>`. + `[j=j>50?j-50:51-j,(i>j?i:j)%8>>1],i=i>50?i-50:51-i).join``).join`\n`)

Where \n represents the literal newline character.

Neil

Posted 2017-01-13T17:24:21.297

Reputation: 95 035

4

C, 97 bytes

i,x,y;main(){for(;i<2550;putchar(++i%51?". + "[(x*x<y*y?y:x)&3]:10))x=i%51/2-12,y=i/102-12;}

orlp

Posted 2017-01-13T17:24:21.297

Reputation: 37 067

3

05AB1E, 39 35 33 bytes

•â3fM~•3B…012… .+‡.pvyD¤sg25s-׫«})«»

Try it online!

•â3fM~•3B                               # Push 1100220011002200110022001
         …012… .+‡                      # Push ..  ++  ..  ++  ..  ++  .
                  .p                    # All prefixes of the above string.
                    vy            }     # For each prefix.
                      D¤sg25s-×         # Repeat the last letter until length is 25.
                               «Â«      # Concat, bifurcate, concat.
                                   )«» # Wrap to array, bifurcate, concat, print.

33 Byte version that is cooler now because Emigna commented saving me 2 bytes:

". + "DøJ3×'.«.pvy¤25yg-׫«})«»

Try it online!

Magic Octopus Urn

Posted 2017-01-13T17:24:21.297

Reputation: 19 422

1". + "DøJ3×'.«.pvy¤25yg-׫«})«» for 33 bytes. – Emigna – 2017-01-19T19:17:43.720

… .+•â3fM~•3BSè.pvy¤25yg-׫«})«» for 34 bytes on the "cooler version". – Emigna – 2017-01-19T19:20:34.600

Cool was not the correct choice of word haha. "Less Ghetto", maybe? – Magic Octopus Urn – 2017-01-19T19:36:11.817

I do love your use of the prefix command. Brilliant! – Emigna – 2017-01-19T20:06:19.933

@Emigna I was hoping there would be a way to "fold" the prefixes or something... Because the pattern is octal, but I'm unsure how so I used repetition. If you figure that out I'll delete my answer and let you have the points. – Magic Octopus Urn – 2017-01-19T20:09:21.007

Not sure what you want to do. You probably have to explain more in detail about the pattern you've found if you want my help there. I came up with a different answer as well, not using prefixes but it also ended up at 33. – Emigna – 2017-01-19T20:53:58.287

1@Emigna the prefixes make a triangle, if you transpose the triangle and rotate it, then combine it with the original prefixes you may be able to shave off bytes. That was the main plan that I couldn't get at. – Magic Octopus Urn – 2017-01-19T20:56:41.740

@Emigna this is as far as I got on that idea: ". + "DøJ3×'.«.pD.Bø – Magic Octopus Urn – 2017-01-19T20:58:43.453

3

Python 3, 89 bytes

r=range(-24,26)
for i in r:print("".join([". + "[max(abs(i//2),abs(j//2))%4]for j in r]))

Try it online!

Leaky Nun

Posted 2017-01-13T17:24:21.297

Reputation: 45 011

2

MATL, 21 bytes

'. + '[]25:"TTYaQ]2/)

Try it online!

'. + '    % Push this string
[]        % Push empty array. This will be used as "seed"
25:"      % Do the following 25 times
  TTYa    %   Extend the array with a frame of zeros
  Q       %   Add 1 to each entry
]         % End
2/        % Divide by 2
)         % Index modularly into the string. Non-integer indices are rounded
          % Implicitly display

Luis Mendo

Posted 2017-01-13T17:24:21.297

Reputation: 87 464

2

Octave, 53 bytes

 '.  ++  .'(mod(bsxfun(@max,x=[24:-1:0 0:24],x'),8)+1)

Generate repeating pattern of 1 to 8 from center outward and use it as the index for extraction of elements of . ++ .

Try It Online!

rahnema1

Posted 2017-01-13T17:24:21.297

Reputation: 5 435

2

Ruby, 77 bytes

-623.upto(676){|i|print i%26>0?". + "[[(i%26-13).abs,(i/52).abs].max%4]*2:$/}

Level River St

Posted 2017-01-13T17:24:21.297

Reputation: 22 049

I think you can replace the index expression with [i%26-13,i/52].map(&:abs).max%4 (saves a byte) – Conor O'Brien – 2017-01-19T01:22:27.963

2

Charcoal, 25 bytes

F…¹¦²⁶⁺×ι§. + ÷鲶‖O↗‖C↑←

Try it online! Link contains verbose mode for explanation

ASCII-only

Posted 2017-01-13T17:24:21.297

Reputation: 4 687

1

Haskell, 385 Bytes

    b 0 = ["..", ".."]
b n = f:f:s:s:m (b (n - 1)) ++s:s:f:f:[]
    where f = replicate (8*n+2) $ d
          s = l++replicate ((8*n)-6) ' ' ++r
          m (x:xs) = map (\x -> l ++ x ++ r ) $ t
          l = d:d:' ':' ':[]
          r = reverse l
          t = b (n - 1)
          d :: Char
          d | n `mod` 2 == 0 = '.'
            | n `mod` 2 == 1 = '+'
main = mapM_ putStrLn $ b 6

First round of code golf here... looking forward to seeing how others tackle this one.

Output:

..................................................
..................................................
..                                              ..
..                                              ..
..  ++++++++++++++++++++++++++++++++++++++++++  ..
..  ++++++++++++++++++++++++++++++++++++++++++  ..
..  ++                                      ++  ..
..  ++                                      ++  ..
..  ++  ..................................  ++  ..
..  ++  ..................................  ++  ..
..  ++  ..                              ..  ++  ..
..  ++  ..                              ..  ++  ..
..  ++  ..  ++++++++++++++++++++++++++  ..  ++  ..
..  ++  ..  ++++++++++++++++++++++++++  ..  ++  ..
..  ++  ..  ++                      ++  ..  ++  ..
..  ++  ..  ++                      ++  ..  ++  ..
..  ++  ..  ++  ..................  ++  ..  ++  ..
..  ++  ..  ++  ..................  ++  ..  ++  ..
..  ++  ..  ++  ..              ..  ++  ..  ++  ..
..  ++  ..  ++  ..              ..  ++  ..  ++  ..
..  ++  ..  ++  ..  ++++++++++  ..  ++  ..  ++  ..
..  ++  ..  ++  ..  ++++++++++  ..  ++  ..  ++  ..
..  ++  ..  ++  ..  ++      ++  ..  ++  ..  ++  ..
..  ++  ..  ++  ..  ++      ++  ..  ++  ..  ++  ..
..  ++  ..  ++  ..  ++  ..  ++  ..  ++  ..  ++  ..
..  ++  ..  ++  ..  ++  ..  ++  ..  ++  ..  ++  ..
..  ++  ..  ++  ..  ++      ++  ..  ++  ..  ++  ..
..  ++  ..  ++  ..  ++      ++  ..  ++  ..  ++  ..
..  ++  ..  ++  ..  ++++++++++  ..  ++  ..  ++  ..
..  ++  ..  ++  ..  ++++++++++  ..  ++  ..  ++  ..
..  ++  ..  ++  ..              ..  ++  ..  ++  ..
..  ++  ..  ++  ..              ..  ++  ..  ++  ..
..  ++  ..  ++  ..................  ++  ..  ++  ..
..  ++  ..  ++  ..................  ++  ..  ++  ..
..  ++  ..  ++                      ++  ..  ++  ..
..  ++  ..  ++                      ++  ..  ++  ..
..  ++  ..  ++++++++++++++++++++++++++  ..  ++  ..
..  ++  ..  ++++++++++++++++++++++++++  ..  ++  ..
..  ++  ..                              ..  ++  ..
..  ++  ..                              ..  ++  ..
..  ++  ..................................  ++  ..
..  ++  ..................................  ++  ..
..  ++                                      ++  ..
..  ++                                      ++  ..
..  ++++++++++++++++++++++++++++++++++++++++++  ..
..  ++++++++++++++++++++++++++++++++++++++++++  ..
..                                              ..
..                                              ..
..................................................
..................................................

brander

Posted 2017-01-13T17:24:21.297

Reputation: 111

3>

  • You have tons of unnecessary whitespace. 2) put all function definitions within the where into a single line and use ; for separation . 3) f:f:[] is f:[f] andd:' ':' ':[]isd:" ". 4)mtakes a parameter but doesn't use it. Inlinemandt. 5) define a new function#to replacereplicate:c#x=c<$[1..8*n+x]and call it liked#2and' '#(-6). 6)mod 2 == 0can be replaced witheven, or flip the test and useoddand the golfer'sotherwise:1<2`. ...
  • < – nimi – 2017-01-14T11:53:42.980

    2... all in all: b n=f:f:s:s:map(\x->l++x++r)(b$n-1)++s:s:f:[f]where f=d#2;s=l++' '#(-6)++r;l=d:d:" ";r=reverse l;d|odd n='+'|1<2='.';c#x=c<$[1..8*n+x]. – nimi – 2017-01-14T11:53:59.900

    1

    Bash, 191 184 bytes

    echo H4sIALBITF4CA72WuQ0AIAzEeqagR8r+47EAgTyH01BZApPPLBvDKshMRR1Z4eghsUv1kbdcDfKSq0LucnXITa4S8eVqEU+uGjnL1SMnuT8Q/1QixFuIfyFyjKgXovaJPkb0ZGK+ELOSmPvEDkPsYxvgYU8W9gkAAA|base64 -d|gunzip
    

    Can probably get smaller, but was smaller than my algorithmic attempts.

    Update: Use --best on gzip for great power. Thanks orthoplex.

    throx

    Posted 2017-01-13T17:24:21.297

    Reputation: 161

    I tried the same thing and got 184 bytes. Maybe you didn't use the --best flag for gzip. Try It Online

    – orthoplex – 2020-02-18T20:36:26.890

    1

    C#, 203 bytes

    Complete, readable program:

    using System;
    public class P
    {
        public static void Main(string[] a)
        {
            Func<string> f = () =>
            {
                var z = 25;
                var t = "";
                Func<int, string> c = (q) => q % 4 == 0 ? ".." : (q % 4 != 2 ? "  " : "++");
                for (var y = 0; y < z; y++)
                {
                    var l = "";
                    for (var x = 0; x < z; x++)
                            l += ((y > z / 2) ? (x >= y | x < z - y) : (x < y | x >= z - y)) ? c(x):c(y);
                    l += "\n";
                    t += l + l;
                }
                return t;
            };
    
            Console.Write(f());
            Console.ReadKey();
        }
    }
    

    Golfed function:

    ()=>{var z=25;var t="";Func<int,string>c=(q)=>q%4==0?"..":(q%4!=2?"  ":"++");for(var y=0;y<z;y++){var l="";for(var x=0;x<z;x++)l+=((y>z/2)?(x>=y|x<z-y):(x<y|x>=z-y))?c(x):c(y);l+="\n";t+=l+l;}return t;};
    

    CSharpie

    Posted 2017-01-13T17:24:21.297

    Reputation: 381

    1

    05AB1E, 33 bytes

    14G" . +"NL¤¸13N-.׫€D¨Â«èD})¨Â«»
    

    Try it online!

    Explanation

    14G                               # for N in [1 ... 13]
       " . +"                         # push this string
             NL                       # push range [1 ... N]
               ¤¸13N-.×               # push a list of 13-N repetitions 
                                      # of the last element of the above range
                       «              # concatenate the two ranges
                        €D            # duplicate each element
                          ¨           # remove the last element
                           «         # concatenate a reversed copy to the list
                             è        # use the elements of the list to index into the string
                              D       # duplicate the resulting string
                               }      # end loop
                                )     # wrap the strings in a list
                                 ¨    # remove the last element
                                  «  # concatenate a reversed copy
                                    » # join the list on newlines
    

    Emigna

    Posted 2017-01-13T17:24:21.297

    Reputation: 50 798

    Explanation to come? – Pavel – 2017-01-19T20:52:25.517

    @Pavel: of course! :) – Emigna – 2017-01-19T20:54:30.250

    1

    PowerShell, 171 151 bytes

    ($x=(1..12|%{' . +'[$_%4]}|%{($a+=$_+$_)})+"$a."|%{$c=if(++$i%2){('+','.')[($b=!$b)]}else{' '};$_.PadRight(25,$c)}|%{,($_+-join$_[25..0])*2});$x[23..0]
    

    Try it online!

    Ho-hum answer. I'm sure there's a shorter way (given the lengths of the other answers, I'm confident), but this shows some neat tricks.

    Explanation:

    1..12|%{' . +'[$_%4]} generates an array of strings (of one character in length), in the correct pattern we need. Try it online!

    We then add on |%{($a+=$_+$_)})+"$a." which takes the array and expands it sideways based on the previous row. Try it online!

    Those strings are then sent into a loop, |%{$c=if(++$i%2){('+','.')[($b=!$b)]}else{' '};$_.PadRight(25,$c)}. Each iteration, we're choosing the correct character (either a plus, a dot, or a space), and then using the .PadRight function to pad out to the appropriate number of characters. Try it online!

    Now, we have the foundation of the upper-right corner. We need to reverse each string |%{,($_+-join$_[($z=25..0)])*2} and append them together so we can get the top of the block. This is done with the -join command and indexing backward 25..0. Additionally, we encapsulate the strings in an array ,(...) and make 'em double *2 so we get the whole top. Try it online!

    That is all stored into $x and encapsulated in parens so it places the strings on the pipeline. Finally, we reverse $x (being sure to snip out the duplicate-duplicate middle row, else we'd have four .. in the middle) and leave those on the pipeline. An implicit Write-Output sticks a newline between the strings, so we get that for free.

    AdmBorkBork

    Posted 2017-01-13T17:24:21.297

    Reputation: 41 581

    1

    PowerShell, 90 75 69 bytes

    ($r=25..1+1..25)|%{$y=$_
    -join($r|%{'..  ++  '[($_,$y)[$_-lt$y]%8]})}
    

    Try it online!

    mazzy

    Posted 2017-01-13T17:24:21.297

    Reputation: 4 832

    1

    Perl 5, 137 135 132 123 bytes

    for$i(0..24){$e=49-$i;map{$a[$_][$i]=$a[$_][$e]=$a[$i][$_]=$a[$e][$_]=substr'. + ',$i%8/2,1}$i..$e}print join'',@$_,$/for@a
    

    Try it online!

    andytech

    Posted 2017-01-13T17:24:21.297

    Reputation: 189

    1

    05AB1E, 21 bytes

    ". + "12Ýû€Dã€ßèJ50ô»
    

    Inspired by @Zgarb's J answer, so make sure to upvote him as well.

    Try it online.

    Explanation:

        12Ý              # Push a list in the range [0,12]
           û             # Palindromize it: [12,11,10,...,2,1,0,1,2,...,10,11,12]
            €D           # Duplicate each item in this list: [12,12,11,11,10,10,...]
              ã          # Create all possible pairs by taking the cartesian product with itself
               ۧ        # For each pair, leave the lowest value
    ". + "       è       # (0-base) index those into the string ". + "
                  J      # Join all those characters together to a single string
                   50ô   # Split it into 50 lines
                      »  # And join those by newlines
                         # (after which the result is output implicitly)
    

    Kevin Cruijssen

    Posted 2017-01-13T17:24:21.297

    Reputation: 67 575