text:
No strings attached!
Intro
There are 3 nails in the wall. You've got a piece of string that is fixed to the picture frame with both ends. To hang the picture, you entangled the string with the nails. But before letting the picture go: Can you predict whether the image is going to fall, just by looking at how the string is wrapped around the nails?

In the first example the picture will not fall. In the second example the picture is going to fall.
Challenge
Given the path of the string around N nails, determine whether the picture is going to fall or not. Return a truthy value if the picture is going to fall, and a falsy value otherwise.
Details

You can assume that the nails and the picture are arranged in a regular N+1-gon, with the picture at the bottom.
You can assume that there are no knots in the rope, i.e. the rope can be continuously be uwrapped from one of the two ends.
Each nail is enumerated clockwise with a letter of the alphabet. You can assume that there are at most 26 nails (A-Z).
A clockwise wrap around a nail is denoted with the lower case letter, a counter clockwise wrap is denoted with an upper case letter.

The first example from above will be encoded as BcA, the second example is encoded as CAbBac.
For the inclined reader: This problem is equivalent to determining whether an element of the free group - generated by the set of nails - is the identity or not. This means it is sufficient to repeatedly cancel substrings like aA or Aa until you reached a fixed point. If the fixed point is an empty string, this is the neutral element, otherwise it is not.
Examples
Picture will fall:
Aa
CAbBac
aBbA
DAacAaCdCaAcBCBbcaAb
ARrQqRrUuVHhvTtYyDdYyEKRrkeUWwua
AKkQqEeVvBESWwseYQqyXBbxVvPpWwTtKkVHLlWwNBbAanYYyyhWwEJZUuNnzjYyBLQqQqlEGgebeEPLlTtZzpUuevZzSsbXSGgsUuLlHhUQquPpHUuFfhTZzIitGgFAaBRrBbbYXxOoDZTDdtzVvXxUudHhOVvoUuXKkxyBEeLlbFfKkHhfVAaQqHAaJjODdoVvhSsZzMZzmPpXNBbnxBbUuSSsUuDRrdNnUusJDIiUuIidCEGgeMmcLlDPOopdTEeQqCAETtNnYyeGUuPEFfSsWwHheAaBbpgCcOHUuhAaCcoEFBbfeaFHhfcCFFffNncGFfgtjMVUuKAakvKkXxLlTMmtmOFfoUuXSsYZzLXxlyxUuRPZzTtprSsWwRrPLlpGgMmKRrDHhdRCcUurYNnKCckykXJjxWwUSsJjKkLlKkuBbBbOoWwWwIiUuPDdBbCcWHBbCFfcDdYBbLlyVvSsWGgEewCchDdYywAaJjEepPpPpQXxZzFfLGXxglNnZzYDdyqCcKWXxwXxQqXTtxkFfBSSAasTFftZzsXGgxSsLlLlbZzAaCCccXVvYyxTIiOoBbFftCVQqDdBbGgAavQqKkDPpKTCctRrkdcvAaQWOowLOolqVMmvZAaHCBbcPphIiRKkrLlzFMOomDIiXJjIixMmdNnMHhmfNTtIiKkSDdTtsVvHhnAaNSVvTUutNnXxsGIiXxPpPHhUupgNnAaAAOoaaIiHJjhVvLlnYyXxQqSsTtKJjkBbNnVvEYCcFfMHGghBbmNnEeJTtjJjWYywyeNWwDIiZYyzOodnMQqmVvCcQqxVvGNnEeNBbngVvUGgYyBbDdVvIiAAaauPpQKDdEekNnVLlvHhGSDIidPZzpsPCcpgQqKkQqNOonLlIiLlJjqPAaPXxTtppYyCPpHhCIicARBbracXxWwXEVUuUuGgZHhzBSsbvGgFfeVvxLlNKknWwBLlIibWOowNnRSsrSEeKAakOosLZzZRrHhzTtTFfUuNnOKkotXxTtla

Picture will not fall:
A
BcA
ABCD
aBaA
bAaBcbBCBcAaCdCaAcaCAD
ARrQqRrUatuVHhvTYyDdYyEKRrkeUAua
AEEeQqNneHhLlAIiGgaECXxcJjZzeJFfVWwDdKkvYWwyTJjtCXxANIinaXWwxcTWwtUuWwMmTBbVWIiFLlWwZzfwPLlEepvWZzwKkEYEeWXxwySXTtEexRIiNBbnWAaTtQqNnBMSsWwOombwWwPVPpGPpgYyvDdpBbrQqHhUusKRrDAVvadLlWwOZzokGJCXSSssXxxJPpGIigZzjJjLlOoNRrnPpcMZzmjgJjNDEeQqWKkNTtnSswIidCcnYBGgbyJSsjPpIiMmMmMmSNnWVvwZzIQqLXHhxTPptlisOoeTtTtYMmVvPpyKNnMFfmkXxSVvsCGJjXxgXYJPpjWwQIiXxqyDdxFfDdAaRNnJjrctHBbZzhEQqMmeCcRBbrGgAaAaJNnRrYyWwSDdVvsJOojQGgWWwIBbiwRrqJjjWwOoFPMmDdRrQOoqNnRrDPJjpMmdPpGFfVvWUuwgpWCcNnPpwfUXCcZzJjUSsuXxxUuuRGgHhrSQqJjOosMMTtmHhmKkXxDdLlWwjSUuAaMmKYyksZzVvPZzVEeVvvHhZZOozBbzMmZCczYyGgISsiQqpXxMmXxEMmeRrAGgaGgMOGgomZFfDdzSSssBGPpgbTtBbOoRWWwGgLJjlEeGgLDdRrUulNnZzJjJjUKkuXxFfwATtaZzLVvlWwSsMmrBAaELleGBLFflbgHhbIFfiBbPpTWZzwKkKLASsaTJYyjtBbBbWwIiZCcWwzIiZLlUTtuBbYyBbIizTJjtLTtDOOoBbodBbllSsUGgLlAKkauYykUuUNnPpuDFfAaLNVvnVvlHhdMmBAaBbIiVRrGWOoPpwgWXwKkvJjOoTtYCUucVGgYyLlVvFfvRrMmySsDdbtICZzcNnINSOosDQAaXoxRGgKkrqdZznDdXxZzMGgmiJjNnACcMQqmaNnWZzUOuwTVvAJjSsaRrGgSsTtOMmRroVvRrtAVGgvMmaINniDGCcOogRrWwMVvYFfyTtmTtVvOoOIiodRrGgAxaSsGgiJja

It seems that in freeing one's hands to write down the string's path, the picture would fall anyway. Then this challenge becomes really easy.

@owacoder You just have to be quick enough :D

Relevant: https://www.youtube.com/watch?v=x5h3yTxeCew

Retina, 21 bytes
+`(.)(?!\1)(?i)\1

^$

Try it online!
Like flawr's solution, this just repeatedly deletes adjacent uppercase/lowercase pairs and then checks whether the result is empty or not.
As for how one matches an uppercase/lowercase pair:
(.)     # Match and capture a letter.
(?!\1)  # Ensure that the next character is not the same, to avoid matching
        # "aa" and "AA".
(?i)    # Turn on case-insensitivity.
\1      # Match the backreference. In .NET, when using case insensitivity,
        # backreferences also get case-insensitive, so this *can* still match
        # iff the cases of the two letters are different.

MATLAB, 76 bytes Octave, 82 79 77 bytes
This might be the first time I've seen where MATLAB is actually shorter than Octave (by an entire byte)!
New answer in MATLAB:
c=input('');k='Aa';while k<1e5,k=k+1;c=strrep(c,65+mod(k,64),'');end;~nnz(c)

Answer in Octave:
c=input('');k='Aa';while k++<1e5,c=strrep(c,['',65+mod(k,64)],'');end;~nnz(c)

Saved three five bytes thanks to flawr. ~nnz(c) is shorter than isempty(c), and 'Aa' is two bytes shorter than [0,32].
Try it the Octave-version online!

Explanation:
c=input('') asks the user for input. We define k='Aa' as a character array.
while k++<1e5: While loop where both elements in k are incremented each iteration, Aa, Bb, Cc and so on. The loop will continue until the largest element is 1e5, which should be sufficiently high for most strings. It can be increased to 9e9 without increasing the byte count.
We'll take the strrep function in steps, starting from the middle.
By using mod(k,64) we'll get the following when we reach the end of the alphabet (if we convert k back to characters):
ans = Yy
ans = Zz
ans = [{
ans = \|
ans = ]}
ans = ^~
ans = _
ans = `�
ans = aA
ans = bB

As you can see, there will be some symbols in between, but then it will wrap around and start with the alphabet again, but now with the lower case letters first. This is a very short way to check both Aa and aA.
['',65+mod(k,64)] concatenates the numeric values from the mod-call, with an empty string, converting the numbers to characters.
strrep is used to remove elements from the string c and return it. It will search for all occurrences of k in the string and replace it with an empty string.
After 1e5 iterations we'll either have an empty string or a non-empty string. We check if there are any elements in c using nnz(c). We return not(nnz(c)), thus 1 if it's empty, and 0 if there are characters left in c

Minkolang 0.15, 30 bytes
od4&x,N.I1=$6&d3~c-$~48*=,2&xx

Try it here!
Explanation
od                            Take character from input and duplicate it
  4&                          If top of stack is truthy, jump 4 spaces
    x                         Dump top of stack
     ,                        NOT top of stack
      N.                      Output as number and stop

    I1=                       1 if stack has 1 element, 0 otherwise
       $6&                    If top of stack is truthy, jump 16 spaces (to the beginning)
          d3~c                Duplicate top two items of stack, in reversed order
              -               Subtract
               $~             Absolute value
                 48*          Push 32
                    =,        0 if top two items are equal, 1 otherwise
                      2&xx    If top of stack is truthy, dump two elements from top

Minkolang's toroidal nature is leveraged here to eliminate the need for an outer loop. The general idea here is to check if the top two elements of the stack are 32 units apart (meaning they're an uppercase/lowercase pair), and if they are, pop both of them off. Since this is done "in realtime", so to speak, nesting of pairs is handled properly.

Haskell, 98 97 85 81 bytes
This is just a naive implementation that repeatedly tries to cancel adjecent letters until there is no more change, and then determines the result from that.
Thanks @nimi for -12 bytes and @xnor for another -4 bytes!
o=fromEnum
r(a:b:l)|abs(o a-o b)==32=l|1>0=a:r(b:l)
r x=x
f=null.until((==)=<<r)r

Try it online! or Verify all examples!

f=null.until(\a->r a==a)r.map fromEnum should save two bytes.

I think (\a->r a==a) can be ((==)=<<r).

In the second line, I think you can change =r l to l, the idea being it suffices to only make one replacement per run.

Thank you! I understand the second hint, but I have no idea what's going on with the =<<, seems like magic XD

@flawr See this tip. The =<< is like >>= but with the arguments swapped. The expression often comes up as in the form ((==)=<<r) to mean "is invariant under r".

@xnor Aah this makes sense now!! I'm still not really that familiar with monads, but I just found this which really helped me now=)

Haskell, 62  bytes
a%l|b:t<-l,abs(a-b)==32=t|1>0=a:l
f=null.foldr((%).fromEnum)[]

Try it online
Credit to flawr for the abs and Laikoni for the fromEnum map.
The helper function % takes an already-simplified string l, and prepends the symbol a before simplifying the result. If l starts with the inverse character to a, they cancel. Otherwise, a is simply prepended. Note that no further simplification is needed at this stage.
The main function f prepends and simplifies each character in turn via a foldr. Then, it checks whether the result is empty.
To check whether two characters are opposite cases and so should cancel, see if their ASCII values differ by 32. Each element is processed by fromEnum before being passed to %.

Nice! And thanks for the explanation, I'm learning new things everytime!

05AB1E, 17 bytes
DvADu‚øDíìvyK}}õQ

Try it online!
Explanation
Dv                 # input number of times do:
  A                # push lowercase alphabet
   Du              # push uppercase alphabet
     ‚ø            # zip the alphabets together (['aA', ..., 'zZ'])
       Díì         # prepend a copy with each element reversed ('Aa' ...)
          v        # for each pair in the resulting list
           yK      # remove it from the accumulated string (starts as input)
             }}    # end loops
               õQ  # check result for equality to empty string

Mathematica, 102 bytes
""==StringDelete[""|##&@@#<>#2&~MapThread~{Join[a=Alphabet[],A=ToUpperCase@a],A~Join~a}]~FixedPoint~#&

Unnamed function taking an alphabetic string as input and returning True or False.
The heart of the implementation is creating a function that deletes any cancelling pair, like "Pp" or "gG", from a string. The expression {Join[a=Alphabet[],A=ToUpperCase@a],A~Join~a} produces an ordered pair of lists of characters, the first list being {"a","b",...,"Z"} and the second being {"A","B",...,"z"}. Then #<>#2&~MapThread~ produces a list where the corresponding elements of these two lists have been concatenated, that is, {"aA","bB",...,"Zz"}. The fun expression ""|##&@@ then (through the magic of the argument sequence ##) produces a list of alternatives "" | "aA" | "bB" | ... | "Zz"; finally, StringDelete[...] is a function that deletes any occurrence of any of those alternatives from a string.
It now suffices to repeatedly apply that function to the input string until the result doesn't change, which is accomplished by ~FixedPoint~#, and then test whether the result is the empty string with ""==.

JavaScript (ES6), 73 bytes
f=(s,t=s.replace(/(.)\1+/gi,s=>s.replace(/(.)(?!\1)./,'')))=>s==t?!s:f(t)

Unlike .NET, JavaScript has no way of turning off case sensitivity in the middle of a match, so instead we have to find all substrings of repeated letters case insensitively, and then delete any mismatching pair of adjacent characters, which by this point must be an upper/lowercase pair.

71

Perl, 28 bytes
1 while s/.(??{$&^' '})//;$_

Explanation:
Perl allows one to include a dynamically generated regular expression inside of a standard regular expression.
The . matches anything.
The (??{ is the start of the generated regex.
The $& variable will contain the entire matched string so far, which in this case is just whatever . matched.
The ^ operator does either numeric xor or string xor, depending on the values of the operands.  In this case, it will be string xor.
The ' ' is just a string containing a space, which conveniently has the ascii (or unicode!) value of 32.  When a space is xor-ed with a char in the range a-z or A-Z, it will change from upper to lower case or vise versa.
The }) is the end of the generated regex.
1 while s/whatever// will repeatedly search for a pattern and replace it with the empty string.
$_ is the default variable.  This variable is what perl does fun and exciting stuff upon when you don't specify another variable.  Here I'm using it to return a truthy or falsy value, since a zero length string is false, and a nonzero length string which does not equal "0" is true.  I'm also assuming that the input string was originally placed in it.
Try it here

technically, this returns the opposite of what the challenge asks for (you return truthy when it should be falsy and vice versa).  To fix it, simply add ! before the final $_.  If keeping it this way is okay with you, you can save 4 bytes by changing it to s/.(??{$&^' '})//&&redo, +1 byte for the -p flag.  It won't work in a subroutine the way you have it now because the { code } isn't actually a loop (thus &&redo won't work), but -p puts it inside a while loop.

You can also save another byte by replacing ' ' with $".  Take a look at this to see what the code looks like.

Prolog (SWI), 151 bytes
f(S):-S="";string_code(I,S,X),string_code(J,S,Y),J is I+1,32is abs(X-Y),B is J+1,sub_string(S,0,I,_,T),sub_string(S,B,_,0,U),string_concat(T,U,V),f(V).

Takes a long time to run on the longer false cases because of backtracking.
Try it online!
Ungolfed
f(S):-                       The string S corresponds to a falling picture if:
  S="";                      S is the empty string, or...
  string_code(I,S,X),        X is the character code at some index I
  string_code(J,S,Y),        Y is the character code at some index J
  J is I+1,                  J is I+1
  32 is abs(X-Y),            X and Y differ by 32 (difference between lower/upper case)
  B is J+1,                  ...
  sub_string(S,0,I,_,T),     ...
  sub_string(S,B,_,0,U),     ...
  string_concat(T,U,V),      ...
  f(V).                      The concatenation of the substrings before and after
                             the letters X and Y corresponds to a falling picture.

JavaScript (Node.js), 55 bytes
x=>Buffer(x).map(c=>c==e[i]?--i:e[++i]=c^32,i=e=[])&&!i

Try it online!

Wouldn't you need to use a Regex like Martin's to account for erroneously removing non-pairs aa and AA (corresponding to double wraps in the same direction)?

@ConorO'Brien Maybe regex isn't good here, such cases should be added to problem

MATL, 20 bytes
t"[]yd|32=fX<tQh(]n~

Try it online! Or verify all test cases (it takes a while).
Explanation
t       % Input string implicitly. Duplicate
"       % Do as many times as input size
  []    %   Push empty array
  y     %   Duplicate current string onto the top
  d|    %   Absolute consecutive differences
  32=   %   Convert to true if 32, false otherwise
  fX<   %   Index of first occurrence of true, or empty of all false
  tQ    %   Duplicate, add 1. This gives the next index, or empty
  h     %   Concatenate. Gives the two consecutive indices of letters
        %   to be removed, or empty
  (     %   Assign an empty array to those positions, i.e. delete them
]       % End
n~      % Number of elements, negate

Wolfram Language (Mathematica), 58 bytes
(Or@@ToCharacterCode@#//.y_||z_/;Abs[y-z]==32:>1<0)===1<0&

Try it online!

C -m32, 100 + 4 = 104 bytes
n;i,k;j;f(s){for(i=0;~++i;)if(k=i%128,n=(k^32)<<8|k,(j=strstr(s,&n))&&k)memmove(j,j+2,strlen(j+1));}

No TIO link, because it takes a few minutes to execute, as it loops through all 32-bit integers.
It takes a char * (zero-terminated string) which will be modified and points  to \0 iff the result is empty.
We construct an string containing an uppercase and a lowercase letter with (k^32)<<8|k. When this int is read as a little-endian char *, the top 2 bytes are the null terminator. If that substring is found, we delete these 2 characters with memmove.

Jelly, 15 bytes
ØẠżŒs¤œṣF¥ƒ$ÐLṆ

Try it online!
Outputs 1 if the picture will fall, and 0 if not
How it works
ØẠżŒs¤œṣF¥ƒ$ÐLṆ - Main link. Takes a string S on the left
           $    - Group the previous 2 links into a monad f(S):
     ¤          -   Group previous links into a nilad, A:
ØẠ              -     Alphabet; "ABC...XYZabc...xyz"
   Œs           -     Swapcase; "abc...xyzABC...XYZ"
  ż             -     Zip; ["Aa", "Bb", ..., "Yy", "Zz", "aA", "bB", ..., "yY", "zZ"]
         ¥      -   Group previous 2 links into a dyad g(S, p), where p is some pair of letters:
      œṣ        -     Split S at this pair
        F       -     Flatten
          ƒ     -   Reduce the nilad A by g(S, p), initialising with S on the left
            ÐL  - Repeatedly apply f(S) until a fixed point (empty list if fall, non-empty if not)
              Ṇ - Logical NOT

Python 3, 71 bytes
s=input()
for i in s*len(s):s=s.replace(i+i.swapcase(),'')
print(not s)

Try it online!

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
Output a pretty box
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!

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

@Pavel OK.  Close-vote retracted :)

Why the restriction on a complete program?

@EasterlyIrk I've decided to allow functions, but kept the requirement that it must print to StdOut.

@Pavel why? It adds really nothing to the challenge.

@Pavel .....no. I mean yeah some have that, but it's not by far a requirement/standard for KG challenges.

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 kolmogorov-complexity questions like this!

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.

I think you can leave off the echo.

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

I think that's allowed as per J's repl nature. In any case, constant functions can be considered to be zero-argument.

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.

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

I've changed the restriction, functions which return a string are allowed now.

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 ++i

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

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(#)["..",".."]" + . + . + ."

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.

How is this noncompeting, the challenge went up only a few hours ago.

@Pavel I'm always working on this

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.

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.

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

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!

". + "DøJ3×'.«.pvy¤25yg-×«Â«})Â«» for 33 bytes.

… .+•â3fM~•3BSè.pvy¤25yg-×«Â«})Â«» for 34 bytes on the "cooler version".

Cool was not the correct choice of word haha. "Less Ghetto", maybe?

I do love your use of the prefix command. Brilliant!

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

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

@Emigna this is as far as I got on that idea: ". + "DøJ3×'.«.pD.Bø

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!

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

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!

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

I think you can replace the index expression with [i%26-13,i/52].map(&:abs).max%4 (saves a byte)

Charcoal, 25 bytes
Ｆ…¹¦²⁶⁺×ι§. + ÷ι²¶‖Ｏ↗‖Ｃ↑←

Try it online! Link contains verbose mode for explanation

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

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] and d:' ':' ':[]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 use oddand the golfer'sotherwise: 1<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].

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.

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

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

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

Explanation to come?

@Pavel: of course! :)

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.

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

Try it online!

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!

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)

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/

sort: votes


text:
Negative XOR primes
About a year ago you were asked to find the XOR primes.  These are numbers whose only factors are 1 and themselves when performing XOR multiplication in base 2.  Now were are going to spice things up a bit.
We are going to find the XOR primes in base -2
Converting to Base -2
Base -2 is a lot like every other base.  The left most place is the 1s place (1 = (-2)0), next to that its the -2s place (-2 = (-2)1), next to that is the 4s place (4 = (-2)2), and so on and so forth.  The big difference is that negative numbers can be represented in base -2 without any negative sign.
Here are some example conversions:
Decimal | Base -2
-----------------
 6      |   11010
-7      |    1001
 12     |   11100
-15     |  110001

XOR addition in Base -2
XOR addition in Base -2 is pretty much the same as XOR addition in binary.  You simply convert the number to Base -2 and XOR each digit in place.  (This is the same as addition without the carry)
Here is an example worked through step by step:
(We will use the symbol +' to indicate Base -2 XOR addition)
Start in base 10:
6 +' 19

Convert to base -2:
11010 +' 10111

Add them without carrying:
   11010
+' 10111
---------
   01101

Convert your result back into base 10:
-3

XOR multiplication in Base -2
Once again XOR multiplication in base -2 is nearly the same as XOR multiplication in binary.  If you are not familiar with XOR multiplication in base 2 there is an excellent explanation here I suggest you take a look at that first.
XOR multiplication in Base -2 is the same as performing long multiplication in base -2 except when it comes to the last step instead of adding up all of the numbers with a traditional + you use the +' we defined above.
Here is an example worked out below:
Start in decimal:
8 *' 7

Convert to Base -2:
11000 *' 11011

Set up long division:
   11000
*' 11011
---------

Multiply the first number by every place in the second
      11000
*'    11011
------------
      11000
     11000
        0
   11000
  11000

Add up all the results using base -2 XOR addition
       11000
*'     11011
-------------
       11000
      11000
         0
    11000
+' 11000
-------------
   101101000

Convert the result back to decimal:
280

The challenge
Your challenge is to verify whether or not a number is an XOR prime in base -2.   A number is an XOR prime in base -2 if the only pair of integers that multiply to it in base are 1 and itself.  (1 is not prime)
You will take in a number and output a boolean, truthy if the input is an XOR prime in base -2 falsy otherwise.
Solutions will be scored in bytes with attaining the lowest number of bytes as the goal.
Test cases
The following are all XOR primes in base -2:
-395
-3
-2
 3
 15
 83

The following are not XOR primes in base -2:
-500
-4
 0
 1
 258
 280

258 seems to equal -2 *' -129 = 10 *' 10000011

@JungHwanMin my bad that one was supposed to be in the other category.  I apologize if this has caused you any trouble.

In your addition example 6 +' -19 you actually use 19 not -19.

Mathematica, 156 101 bytes
IrreduciblePolynomialQ[FromDigits[{#}//.{a_,p___}/;a!=1&&a!=0:>{-⌊a/2⌋,a~Mod~2,p},x],Modulus->2]&

As stated here, this works because XOR multiplication is essentially multiplication in the polynomial ring F_2.
Explanation
{#}//.{a_,p___}/;a!=1&&a!=0:>{-⌊a/2⌋,a~Mod~2,p}

Start with {input}. Repeatedly replace a number a (except 0 and 1) by a mod 2 and prepend -floor(a/2), until it does not change. This calculates the input in base -2.
FromDigits[ ... ,x]

Create a polynomial using the digits of the base -2 number, using x as the variable. e.g. {1, 1, 0} -> x^2 + x
IrreduciblePolynomialQ[ ... ,Modulus->2]

Check whether the resulting polynomial is irreducible, with modulus 2.
Old version (156 bytes)
If[#==1,1,Outer[FromDigits[BitXor@@(#~ArrayPad~{i++,--l}&)/@Outer[i=0;l=m;1##&,##],-2]&,k=Tuples[{0,1},m=Floor@Log2[8Abs@#~Max~1]]~Drop~{2},k,1,1]]~FreeQ~#&

List of primes
Here's a list of base -2 XOR primes between -1000 and 1000 (pastebin)

APL (Dyalog Extended), 36 bytes
{2=≢⍸⍵=∘.{¯2⊥≠/⊤⍺×2*⍸⌽⊤⍵}⍨1+⍳8×1+|⍵}

Try it online!
Simple brute-force, and extremely inefficient (input 15 takes ~1s). Given an integer n, it generates a range large enough that their binary representation evaluated in negabinary includes n, evaluates its multiplication table (last step evaluated to negabinary instead of binary), then checks if the input appears exactly twice.
The algorithm was inspired by a solution to regular XOR primes.
How it works
{2=≢⍸⍵=∘.{¯2⊥≠/⊤⍺×2*⍸⌽⊤⍵}⍨1+⍳8×1+|⍵}  ⍝ Inline function; ⍵←n
                             8×1+|⍵   ⍝ 8×(1+abs(n))
                          1+⍳         ⍝ 1-based range of above
       ∘.{              }⍨  ⍝ Evaluate XORmul table
                      ⊤⍵    ⍝ Binary of right arg
                  2*⍸⌽      ⍝ Digit values of ones
               ⊤⍺×          ⍝ Multiply left arg and convert each to binary
             ≠/             ⍝ Digit-wise XOR
          ¯2⊥               ⍝ Interpret as negabinary and convert to integer
 2=≢⍸⍵=  ⍝ Does n appear exactly twice in the table?

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/


text:
Draw Reutersvärd's Triangle
This impossible object is Reutersvärd's triangle:

Draw your own version according to these rules:

Exactly 9 cubes total
Each side is made up of exactly 4 cubes
The cubes appear to overlap such that the rendered object is in fact an impossible object
4 distinct colours are used - one for the background and 3 for each of the faces of the cubes
In bitmap output, the full triangle should be at least 100 pixels tall and at least 100 pixels wide
Aspect ratio: the width and height of the full triangle should not be off by more than a factor of 2
The triangle may be rotated by any amount relative to the above image
The triangle may or may not be reflected relative to the above image

Mathematica, 237 bytes
n={-1,1}#&;c_~g~s_:=Polygon[c+s#&/@{k={12,9},m=n@k,t={0,-12}}];p={#,#2~g~1,#3~g~-1}&;a=p[Cyan,#-k,#+m]&;b=p[Blue,#-t,#+k]&;c=p[Red,#-m,#+t]&;Graphics@{{a@#,b@#,c@#}&/@{j=4k,s=4{4,9},n@s,4m,r={-32,8},q=-4{4,5},4t,n@q,n@r},a@j,b@s,c@j,c@s}

Easier-to-read version:
1  n = {-1, 1} # &;
2  c_~g~s_ := Polygon[c + s # & /@ {k = {12, 9}, m = n@k, t = {0, -12}}];
3  p = {#, #2~g~1, #3~g~-1} &;
4  a = p[Cyan, # - k, # + m] &;
5  b = p[Blue, # - t, # + k] &;
6  c = p[Red, # - m, # + t] &;
7  Graphics@{
8    {a@#, b@#, c@#} & /@
9      {j = 4 k, s = 4{4, 9}, n@s, 4 m, r = {-32, 8},
10       q = -4{4, 5}, 4 t, n@q, n@r},
11   a@j, b@s, c@j, c@s}

Line 1 defines a function n that negates the first coordinate of an ordered pair. Line 2 defines a function g that produces a (roughly) equilateral triangle centered at the point c, and pointing down or up depending on whether s is 1 or -1. Line 3 defines p to be a parallelogram template consisting of a color and two triangles, and lines 4–6 define a, b, and c to be the three different specific types of parallelograms that appear in the cubes.
Line 8 defines a function {a@#, b@#, c@#}& that draws an entire cube centered at the point #; lines 9 and 10 apply that to the nine points needed to make the larger triangle. This produces nine cubes, starting at the upper right and going counterclockwise, where the later ones cover up parts of the earlier ones. Finally, line 11 redraws four parallelograms (in the upper right of the picture) so that they end up covering the later cubes as they're supposed to. The output is below:

Wait what Mathematica doesn't have a built-in for this?

Impressive work! +1

@DigitalTrauma Always in the next version. :)

Brain-Flak, 487810 327722 75564 + 1 = 75565 bytes
Unfortunately this is a tad big to fit in an answer.
PasteBin
Try it Online
With the -A flag this outputs an ASCII ppm file that looks as follows:

Explanation
You may have already guessed I did not write this by hand.  So here's how I did it:
I first made the image you see above from the image provided by the challenge.  It has the distinction of having no color channel that is at any value other than 255 or 0 this way we can wrap it up into a smaller file with the max color channel set to 1.  I then wrote a python script to golf a Brain-Flak program that solves this using a module I wrote myself that can be found here.  Its not very polished its just a hack I threw together for things like this.  push is a function that returns efficient Brain-Flak code to push a number to the stack and kolmo is a very simple Kolmogorov complexity solving program that attempts to find an efficient way to push a particular string to the stack.
from value import push,kolmo

def group(a, n):
    return zip(*[a[i::n]for i in range(n)])

f=open("R.ppm")
a=["".join(x)for x in group(f.read().split()[3:][::-1],3)]
f.close()

def hardcode(string):
    result = push(ord("\n")).join("(<>({})<>"+{"0":"","1":"()"}[x]+")"for x in string)
    return result

last = ""
acc = 0
result = push(ord("0"))+"<>"
for x in a+[""]:
    if x != last:
        string = ("" if not last else kolmo("\n")+hardcode(last))
        result += min([push(acc)+"{({}[()]<%s>)}{}"%string,acc*string],key=len)
        acc=1
    else:
        acc += 1
    last = x
print result+kolmo("P3 100 100 ")

This was quite fun and I hope to improve my answer

You legitimately golfed away 160088 bytes? Is that a record?

Maybe some unary answers can beat that

@Neil Not even a personal one

Your Python code intrigues me. What's value? (Not this module on PyPI, I'm guessing?) What's kolmo?

@TimPederick Sorry about that. Thats a module a wrote myself for golfing Brain-Flak.  I will include a link in the body.

BBC BASIC, 147 bytes
tokenised filesize 129 bytes
t=PI/1.5x=500y=x:FORi=0TO28b=i MOD3GCOL0,b:b*=t:a=i DIV9*t:IFb=0x-=99*COSa:y-=99*SINa
MOVEx,y:VDU25;66*COSb;66*SINb;28953;66*COS(b-t);66*SIN(b-t);:NEXT

2 bytes saved by using an absolute coordinate specification (MOVE) and two relative specifications per parallelogram, instead of changing the origin in order to be able to use all absolute specifications. 1 byte of unnecessary whitespace eliminated.
BBC BASIC, 150 bytes
tokenised filesize 127 bytes
Download interpreter at http://www.bbcbasic.co.uk/bbcwin/download.html
t=PI/1.5x=500y=x:F.i=0TO28b=i MOD3GCOL0,b:b*=t:a=i DIV9*t:IFb=0 x-=99*COSa:y-=99*SINa:ORIGINx,y
L.66*COSb,66*SINb,0,0PLOT117,66*COS(b-t),66*SIN(b-t)N.

Explanation
We start with the coordinates at top right and plot rhombuses in groups of 3. Before each group of 3 we move the origin (West, West, West, SE, SE SE, NE, NE NE.) That means that the group of 3 at top right is the last complete group to be plotted, bringing the origin back to its original location. We then continue and plot the black and red (but not the green) of the first group again, a total of 29 rhombuses.
Ungolfed
  t=PI/1.5                                 :REM 120 deg
  x=500                                    :REM coordinates of top right corner
  y=x
  FORi=0TO28
    b=i MOD3:GCOL0,b                       :REM set colour 0=black,1=red,2=green
    b*=t                                   :REM convert b to a multiple of 120deg
    a=i DIV9*t
    IFb=0 x-=99*COSa:y-=99*SINa:ORIGINx,y  :REM before each group of 3 rhombs move the graphics origin
    LINE66*COSb,66*SINb,0,0                :REM define one side of a rhombus
    PLOT117,66*COS(b-t),66*SIN(b-t)        :REM define one further corner and plot the rhombus
  NEXT

Output

HTML + CSS 3D (855 866 bytes)
HTML 117 bytes + CSS 738 bytes
To keep the z-indexes in order was a bit tricky. ;)

/* CSS */
p{position:absolute;left:110px;top:0;width:50px;height:50px;transform-style:preserve-3d;transform:rotateX(-45deg)rotateY(21deg)rotateZ(20deg)}
p+p{left:140px;top:50px}
p+p+p{left:170px;top:100px}
p+p+p+p{left:200px;top:150px}
p+p+p+p+p{left:140px;top:150px}
p+p+p+p+p+p{left:80px;top:150px}
p+p+p+p+p+p+p{left:20px;top:150px}
p:nth-child(8){z-index:1;left:50px;top:100px}
p:nth-child(9){z-index:-1;left:80px;top:50px}
p:nth-child(10){z-index:1;left:67px;top:59px;transform:rotateX(-45deg)rotateY(21deg)rotateZ(20deg)scale(0.6)}
a{position:absolute;width:50px;height:50px;background:red;transform:rotateY(0deg)translateZ(25px)}
a+a{background:tan;transform:rotateY(-90deg)translateZ(25px)}
a+a+a{background:navy;transform:rotateX(90deg)translateZ(25px

I've kept the new lines for better readability. Maybe somebody spots potential for more golfing. However, they are not included in the byte count.
Result

jsFiddle Demo
Try it yourself
Use Goole Chrome. Other browsers may have problems with the z-indexes.
Edit

Saved 2 bytes by removing the duplicate a-selector, thanks to ETHproductions.
Saved 9 bytes by removing an unnecessary margin:0 on the a-element.

Is it still valid HTML without HEAD/BODY and closing tags? I know browsers tend to ignore syntax errors and try to display whatever you throw at them, but I don't think this code follows the specs. (That said, great solution!)

@FedericoPoloni Thank you. Regarding the html|head|body-elements: They can be omitted. Take a look at "Optional Tags", you'll be surprised how many elements and closing tags can be omitted as well. What is not in the specs but works too is to omit the closing tags of the a-elements. They are however closed correctly by the browser, because you can't nest them. Also from the Code Golf point of view: Everything that "compiles" and has the correct output is valid. ;)

HTML + JavaScript (ES6), 351 374 384
<canvas id=C></canvas>

Less golfed
<canvas id=C></canvas>

Test

<canvas id=C></canvas>

JavaScript(ES6)/SVG(HTML5), 350 312 bytes

document.write(`<svg width=390 height=338>`)
a=`195,52;240,130;285,208;330,286;240,286;150,286;60,286;105,208;150,130;`
a=(a+a).split`;`
for(i=9;i--;)document.write(`<path fill=#FD0 d=M${a[i]}h60l-30,-52h-60z /><path fill=#088 d=M${a[i+3]}h60l-30,52h-60z /><path fill=#F64 d=M${a[i+6]}l-30,-52l-30,52l30,52z />`)

SVG, 562 540 520 504 487 473 bytes
This is my first time golfing SVG (or any markup, in fact); be gentle!
The assumed viewing environment is an SVG-capable web browser with anything like a typical window size. I tested it in Firefox 50 and in Chrome 55.
The viewBox is necessary to meet the 100-pixel requirement; blowing up all measurements by a suitable factor would also work but would take more bytes. Incidentally, it is possible to save another byte by removing the space in 0 -5 in the viewBox value, but Firefox won't accept this as valid (whereas Chrome will).
The aspect ratio is 1:1 instead of the true 0.866:1. I'm not sure exactly how the "factor of 2" rule is meant to be interpreted (I think it means that exaggeration as extreme as 0.433:1 or 1.732:1 is acceptable), but I'm pretty sure this meets the requirement anyway.
SVG
<svg xmlns="http://www.w3.org/2000/svg"
xmlns:l="http://www.w3.org/1999/xlink"
viewBox="0 -5 26 26"><g
id="a"><path d="m7,9H3V5h6z"/><g
id="f"><path fill="red" d="m9,5H3V1h4z"/><path
fill="blue" d="m3,1l2,4L3,9l-2-4z"/></g></g><use
l:href="#a" x="3" y="6"/><use
l:href="#e" x="12"/><g
id="e"><use l:href="#a" x="-6" y="12"/><use l:href="#a" x="-12" y="12"/></g><use
l:href="#a" x="-9" y="6"/><use
l:href="#a" x="-6"/><use
l:href="#a" x="-3" y="-6"/><use
l:href="#f"/></svg>

Result

I think you could probably delete the newlines here, couldn't you? IIRC, XML disregards whitespace in most contexts.

@ais523: Yeah, I forgot to do that before posting it. facepalm It's done now, though. There's still newlines, keeping it vaguely readable, but only in places (namely between tag names and attributes) where a space of some sort is needed anyway.

Your interpretation of the aspect ratio rule is correct

Python 3 + Turtle, 389 bytes
from turtle import*
a='#2e6f6e','#FAD028','#E44834'
L=lt;F=fd;B=begin_fill;E=end_fill
Z=0,1,2
pu()
ht()
speed(0)
for m in Z:L(120);F(30);L(60);F(30);L(60);[[[[color(a[j-m]),B(),[F(20)==L((5-i%2)*60)for i in(1,)+Z],E(),L(120)]for j in Z],k%2and[L(180),F(30),L(180)]or[L(300),F(30),L(60)]]for k in Z]
L(120)
F(30)
L(60)
F(10)
for k in[2,1]:color(a[k]);B();[F(20)==L(240)for i in Z];E();L(60)

From Bubbler's golf of -131 bytes!
Try it online!
Python 3 + Turtle, 537 520 bytes
from turtle import*
a=['#2e6f6e','#FAD028','#E44834']
pu()
ht()
speed(0)
for m in range(3):
	lt(120);fd(30);lt(60);fd(30);lt(60)
	for k in range(3):
		for j in range(3):
			color(a[j]);begin_fill()
			for i in range(4):fd(20);rt(120 if i%2==0 else 60)
			end_fill();lt(120)
		if k==1:rt(180);fd(30);lt(180)
		else:rt(60);fd(30);lt(60)
	a=a[2:]+a[:2]
lt(120)
fd(30)
lt(60)
fd(10)
a=[a[2],a[1]]
for k in range(2):
	color(a[k]);begin_fill()
	for i in range(3):fd(20);rt(120)
	end_fill();lt(60)
turtle.Screen().exitonclick()

-17 bytes from Dion, after removing unnecessary whitespace.
Try it online!

gif made from cdlane's instructions!

520 bytes with useless and trailing whitespace removed Try it online!

389 bytes with some extreme loop inlining and removing the last line (the animation is displayed anyway; you just can't exit the window easily).

Thats a huge golf, so i put it up separately.


text:
Print a cube net of the specified size
Challenge
Given a size s, print a cube net of that size made of hash symbols (#) and spaces ().
Examples:
1:
  #
# # #
  #
  #

2:
    # #
    # #
# # # # # #
# # # # # #
    # #
    # #
    # #
    # #

3:
      # # #
      # # #
      # # #
# # # # # # # # #
# # # # # # # # #
# # # # # # # # #
      # # #
      # # #
      # # #
      # # #
      # # #
      # # #

The net can actually be any valid cube net that can fold into a cube, for example these:
    # #
    # #
# # # # # # # #
# # # # # # # #
    # #
    # #

    # # # #
    # # # #
    # #
    # #
    # #
    # #
# # # #
# # # #

Rules

The resulting net must be geometrically valid (foldable into a cube)
Standard loopholes forbidden
Read the rules carefully
This is code-golf, shortest answer wins, but will not be selected

Can there be leading/trailing spaces/newlines?

@KritixiLithos Yes

For reference, all 11 cube nets.

Is it okay if we output it without the spaces?

@KritixiLithos no

Related

Will the input ever be 0?

What if I don't read the rules carefully?

@FlipTack No. It will always be positive as well

@steenbergh Then your solution is invalid

Python 2, 47 bytes
n=input()
for c in 1,4,1:exec"print'# '*c*n;"*n

Try it online!
Prints this net, chosen for being left-justified:
# #
# #
# # # # # # # #
# # # # # # # #
# #
# #

The lines have n or 4*n copies of '# '. For each of 1,4,1, we print n times that many copies, done n times for n lines. Having an exec loop inside a for loop seems wasteful, but I didn't see better.
Alternatives I tested:
lambda n:('# '*n*3+'\n')*n+('  '*n+'# '*n+'\n')*3*n

lambda n:('# '*n*3+'\n')*n+(' '*4*n+'# '*n*3+'\n')*n

def f(n):
 for c in[3]*n+[1]*3*n:print('# '*c*n).center(6*n)

def f(n):
 for c in[4]*n+[0]*n:print' '*c*n+'# '*n*3

def f(n):
 for c in[1]*n+[4]*n+[1]*n:print'# '*c*n

def f(n):
 c=1;exec("print'# '*c*n;"*n+"c^=5;"*n)*3

def f(n):
 for i in range(3*n):print'# '*[1,4,1][i/n]*n

def f(n):
 for c in 1,4,1:print('# '*c*n+'\n')*n,

def f(n):
 for c in 1,4,1:exec"print'# '*c*n;"*n

(The def functions can all be one shorter as a program.)

Octave, 58 44 42 32 bytes
@(n)[z=repmat('# ',n);z,z,z,z;z]

partly inspired by @xnor 's python answer.
z=repmat('# ',n);

creates a squre pattern of '# ' for input 2 results the following pattern:
# #
# #

y=[z,z,z,z];

four z s are concatenated horizontally:
# # # # # # # #
# # # # # # # #

[z;y;z]

z and y and z are concatenated vertically
Try It Online!
# #
# #
# # # # # # # #
# # # # # # # #
# #
# #

Previous answer:
@(n){h(1:n,1:2:n*6)=1;h(1:n*4,n*2+1:2:4*n)=1;' #'(h+1)}{3}

Try It Online!
Generates a T shaped one
# # # # # # # # #
# # # # # # # # #
# # # # # # # # #
      # # #
      # # #
      # # #
      # # #
      # # #
      # # #
      # # #
      # # #
      # # #

Mathematica, 77 60 52 bytes
Thanks to Martin Ender for golfing 8 bytes away!
{±s_:=s~Table~#;b=±{a=±"# ","
"},±{a,a,a,a,"
"}}<>b&

Unnamed function taking a positive integer argument # and returning a string with newlines (including a trailing newline); each line has a trailing space as well. First we define ± to be a function that repeats its input # times; then a is defined as ±"# " (this # is a character, not the input!), and from that b is defined to be the set of # short lines, while ±{a,a,a,a}<>n is the set of # long lines. (In both cases, there is a literal linefeed between matching quotes.) The final <>b concatenates the resulting list of strings with second copy of the set of short lines. Example output when #=2 (xnor's answer taught me that this orientation is golfier):
# #
# #
# # # # # # # #
# # # # # # # #
# #
# #

Previous version of this implementation:
""<>(±s_:=s&~Array~#;{b=±{a=±"# ",n="\n"},±{a,a,a,a}<>n,b})&

Original submission:
""<>If[(m=n~Mod~t)==0,"\n",If[n<t#||#<m<=2#,"# ","  "]]~Table~{n,4(t=3#+1)#}&

Builds a string out of 4*(3#+1) pieces, each of which is either "# ", "  ", or "\n"; simply calculates which pieces to use based on the index n. Example output when #=2:
# # # # # #
# # # # # #
    # #
    # #
    # #
    # #
    # #
    # #

JavaScript (ES6), 59 bytes

f=
n=>`141`.replace(/./g,m=>`${`# `.repeat(n*m)}\n`.repeat(n))
<input type=number oninput=o.textContent=f(this.value)>

Output includes a trailing space at the end of each line and a trailing newline.

Ruby, 36 bytes
f=->n{puts (t=[s="# "*n]*n)+[s*4]*n+t}

Usage:
f=->n{puts (t=[s="# "*n]*n)+[s*4]*n+t}
f[3]
# # #
# # #
# # #
# # # # # # # # # # # #
# # # # # # # # # # # #
# # # # # # # # # # # #
# # #
# # #
# # #

Ruby, 38 bytes
This shape is longer in Ruby but I expect there are some languages where it is shorter.
->n{puts [s="# "*n*3]*n+[" "*n*4+s]*n}

Usage:
g=->n{puts [s="# "*n*3]*n+[" "*n*4+s]*n}
g[3]
# # # # # # # # #
# # # # # # # # #
# # # # # # # # #
            # # # # # # # # #
            # # # # # # # # #
            # # # # # # # # #

Both answers can be shorter if it is permitted to return (preferably) an array of strings or (less preferably) a single string instead of printing.

Returning a string is considered a valid form of output.

JavaScript (ES6), 71
n=>((z='# '[R='repeat'](n))[R](3)+`
`)[R](n)+('  '[R](n)+z+`
`)[R](n*3)

Test

f=
n=>((z='# '[R='repeat'](n))[R](3)+`
`)[R](n)+('  '[R](n)+z+`
`)[R](n*3)

function update() {
  O.textContent=f(I.value)
}

update()
<input id=I type=number value=3 oninput='update()'>

I'm not entirely sure, but I think you need to output the spaces along with the hashes. (I also made that mistake of not including the spaces in the first edit of my answer)

@KritixiLithos uh, got it. Thanks

V, 24 23 20 18 20 bytes
Ài# ddÀpLyGïp3PGïp

With all the hidden characters shown
Ài# ^[ddÀp^VLyGïp3PGoïp

^[ is 0x1b (escape character literal) and ^V is 0x16 (C-v)
Try it online!
I had to increase bytecount because the Ä command was being buggy in this new V pull
Outputs in this format:
#
# # # #
#

with a leading newline
Hexdump:
00000000: c069 2320 1b64 64c0 7016 4c79 47ef 7033  .i# .dd.p.LyG.p3
00000010: 5047 ef70                                PG.p

Explanation
Ài# ^[              " Argument times insert "# "
ddÀp                " Argument times duplicate line

Now that one face of the net has been completed, we have to create the net
^VLy                " Copy the face
Gïp                 " Paste it at the end of buffer
3P                  " Paste 3 times (these form the line)
Gïp                 " Paste at end of buffer again

Alternate solution if we don't output the spaces:
21 20 18 16 18 bytes
Àé#ddÀpLyGïp3pGïp

(for the same reason as the top solution, this TIO link is modified)
Try it online!

Jelly, 20 19 bytes
”#xẋ³Wẋ³K€Y
141DÇ€Y

Try it online!
-1 thanks to 44874 (steenbergh).
I CAN'T OUTGOLF MUDDYFISH HELP!
Is this golfable??? 20 19 bytes just seems like too much, seeing Link 1.
Explanation:
”#xẋ³Wẋ³K€Y Helper link. Arguments: z
”#          Character #.
            y (implicit)
  x         Repeat each element of y x times.
    ³       1st command-line argument.
   ẋ        Repeat x y times.
     W      Wrap z.
       ³    1st command-line argument.
      ẋ     Repeat x y times.
        K   Join z on spaces.
         €  Map this link on x.
          Y Join z on newlines.

141DÇ€Y Main link. Arguments: 0
141     Integer 141.
   D    Convert z to base 10.
    Ç   The above link as a monad.
     €  Map this link on x.
      Y Join z on newlines.

It's V versus Jelly now :)

@KritixiLithos Nah, your solution was first.

V is at 18 bytes now :)

You can drop a byte by not using @ but swapping the operands to x yourself: ”#xẋ³Wẋ³K€Y.

Scala, 56 bytes
(n:Int)=>Seq(1,4,1)map("# "*_*n+"\n")map(_*n)mkString ""

Java 8, 99 bytes
l->{for(int i=-1,j;++i<3*l;)for(j=-1,k=(i/l==2)?4*l:l;++j<k;)System.out.print("# "+j>k-2?"\n":"");}

V, 14 bytes (non-competing)
Ài# 5Ù4JjòÀÄk

Try it online!
00000000: c069 2320 1b35 d934 4a6a f2c0 c46b       .i# .5.4Jj...k

For whatever reason, this challenge uncovered numerous bugs. Now that they're all fixed, this version is unfortunately non-competing, but it's nice to see what a V answer to this challenge should look like when it doesn't have to add tons of bytes to keep up with my sloppy coding.
Explanation:
À                   " Arg 1 times:
 i# <esc>           "   Insert the string "# "
         5Ù         " Make 5 copies of this line, and put the cursor on the second copy
           4J       " Join four of these lines together
             j      " Move down to the last line
              ò     " Recursively:
               ÀÄ   "   Make Arg 1 copies of this line
                 k  "   And move up a line

To be fair, the J issue wasn't sloppy coding AFAIK, I think it was just nvim default?

Yeah, that's true. But the duplicate operator definitely was sloppy. Thankfully this new version is much simpler.

Charcoal, 20 bytes
ＮλＧ↑λ←×⁶λ↓λ# ＤＭ×⁴λ←

The code ends with a space. Try it online!
Explanation
Charcoal is a language specializing in ASCII art. It is also incomplete, buggy, and under-documented. Suffice it to say, this took a fair amount of trial and error before it did what it was supposed to.

Ｎλ inputs a number into λ.
Ｇ is the polygon command, which we'll use here to draw a rectangle. ↑λ←×⁶λ↓λ specifies the border of the polygon: upward λ steps, leftward 6 times λ steps, and downward λ steps. (That's three λ by λ blocks side-by-side.) The bottom edge of the rectangle is inferred. The polygon is then filled with the string # .
Ｄ dumps the current canvas to stdout, resulting in something like this:

 # # # # # # # # #
 # # # # # # # # #
 # # # # # # # # #

After the Ｇ command, the cursor is at the bottom left corner of the canvas. Ｍ×⁴λ← moves it leftward by 4 times λ steps (equivalent to two λ by λ blocks).
  outputs a space there, extending the canvas leftward by the correct amount.
At the end of the program, the canvas is (again) sent to stdout:

             # # # # # # # # #
             # # # # # # # # #
             # # # # # # # # #

Put 'em together and you've got a cube net.

Wow, you really had to struggle back then! (Oblong wasn't added until several weeks later.)

Pyke, 16 bytes
uAD,sXF**"#

Try it here!
Equivalent to
1 4 1]3AD,sXF**"#

Because of unprintables
This uses a couple of tricks to lower the byte-count:

It uses some unprintables to represent the list [1, 4, 1]
XF automatically dumps the output to the stack
The string "#  at the end gets swapped with the last *, meaning that the closing " is not required. This happens implicitly when the last token is a string.

u                -      [1, 4, 1]
     AD          -     apply(*, ^, input)
       ,         -    zip(^)
        s        -   sum(^)
          F**"#  -  for i in ^:
           *     -    ^ * input
            *    -   ^ * v
             "#  -    "# "
         X       - splat(^)

Python 2, 68 71 65 bytes
-6 with thanks to @sagiksp
def f(i,c=1):
 print(' '*i*4,'')[c>i]+'# '*i*3
 if i*2>c:f(i,c+1)

Try it online!
In the absence of finding a way to beat @xnor I'll post my recursive function simply as an alternative approach. For f(5) prints
                    # # # # # # # # # # # # # # #
                    # # # # # # # # # # # # # # #
                    # # # # # # # # # # # # # # #
                    # # # # # # # # # # # # # # #
                    # # # # # # # # # # # # # # #
# # # # # # # # # # # # # # #
# # # # # # # # # # # # # # #
# # # # # # # # # # # # # # #
# # # # # # # # # # # # # # #
# # # # # # # # # # # # # # #

This pattern was chosen simply because it can be split into two parts unlike all of the others.

Where are the spaces?

Without the spaces in the output, this isn't valid.

My mistake +3 to add the spaces. Updated.

Actually why do you even need j? You can redefine the entire thing in terms of i and save ~6 bytes!

@sagiksp - Thanks. Updated using your suggestion.

Bash / Unix utilities, 72 69 68 66 bytes
b()(yes `dc<<<2o4d$n^$1^3/p`|tr 01 ' #'|head -$n);n=$1;b 1;b 4;b 1

Try it online!
This works by using the fact that [4^k / 3], when written in base 2, is 10101010...01, with k 1's. (The square brackets here denote the floor function.)

PHP, 64 62 bytes
Saved 2 bytes thanks to Christoph.
while($a="282"[$i++/$s=$argv[1]]*$s)echo str_pad("
",$a,"# ");

Prints a net like this:
# #
# #
# # # # # # # #
# # # # # # # #
# #
# #

(with a leading newline)

while($a="282"[$i++/$s=$argv[1]]*$s)echo str_pad("\n",$a,"# "); saves 2 bytes.

Pushy, 32 29 28 bytes
Prints the cube net left-justified. This was hard to golf...
&V:`# `;{:";N^:4:";T'.;TD^:"

Try it online!

Retina, 39 37 bytes
This is my first time using Retina, I'm still trying to understand how to do things.
.+
$*#
#
#
\`#
$_¶
G`.
)*%`^
$_$_$_

(with two trailing spaces after the 4th and 5th lines)
Thanks to Martin Ender for golfing 2 bytes!
Try it online!

@MartinEnder Thank you, I had not noticed that requirement, now it should be correct. Do you have any suggestion to how I should try to golf this?

Not having a lot of brilliant ideas but https://tio.run/nexus/retina#@6@nzaWipcwFhApcMQlAQiX@0DYu9wQ9Lk0t1YQ4IBcE//83AgA saves two bytes. You can avoid the trailing linefeeds by wrapping everything in a group which has its output flag (and since the group is the last thing the program, the output flag defaults to being non-silent). The other byte avoids the fourth $_ at the bottom by switching some things around after removing the empty line. https://tio.run/nexus/retina#@6@nzaWipcwFhApcMQlAQiX@0DYuzRgt1QQ9FS4FlXgQPLTt/38jAA is the same byte count but a bit uglier.

@MartinEnder Thank you for the tips, and thank you for this language too, it's really nice!

Thank you for the kind words. :) There's a chatroom for it if you have any questions or want to discuss things. It's currently rather quiet, but I try to keep it unfrozen in case people have questions (and you should be able to ping me in there any time).

Batch, 111 bytes
@set s=
@set i=@for /l %%i in (1,1,%1)do @
%i%call set s=%%s%% #
%i%echo%s%
%i%echo%s%%s%%s%%s%
%i%echo%s%

QBIC, 52 67 40 bytes
Complete re-write:
:[a*3|G=G+@#`][a*2|G=G+@ `][a|?G][a|?_fG

This now uses this pattern:
###--
--###

Where the -are filled with spaces.
:        Read 'a' from the command line        > Assume 3
[a*3|    Create 3 segments times 'a' filling   > 3*3 = 9
G=G+@#`] Define A$ to be '#' and add this to G > G = "#########"
[a*2|    Create 2 segments times 'a' spacer
G=G+@ `] Define B$ to be ' ' and add this to G > G = "#########       "
[a|      FOR d == 1; d <= a; d++
?G]      Display G$:
            "#########       "
            "#########       "
            "#########       "
[a|      FOR e == 1; e <= a; e++
?_fG     Display G$ in reverse (_f...|):
            "      #########"
            "      #########"
            "      #########"
         (For loop and function call to Flip impicitly closed by QBIC)

This answer is invalid, per this comment by OP.

@EriktheOutgolfer Updated.

Appropriate language name for the challenge!

Pip, 28 17 16 bytes
15 bytes of code, +1 for -n flag.
"# "Xa*_RLaM141

Takes the size as a command-line argument. Try it online!
Explanation
                 a is 1st cmdline arg
       _         Build a lambda function
     a*          (a) times argument
"# "X            Repeat string "# " that many times
        RLa      Wrap in a list and repeat list (a) times
           M141  Map that function to the characters of 141
                 Autoprint (-n flag separating list items with newlines)

The following isn't exactly how the data gets modified, but it gives the basic idea (for a=2):
141

[1;4;1]

[2;8;2]

["# # ";"# # # # # # # # ";"# # "]

[["# # ";"# # "];["# # # # # # # # ";"# # # # # # # # "];["# # ";"# # "]]

# #
# #
# # # # # # # #
# # # # # # # #
# #
# #

05AB1E, 13 bytes
D141S×S*„# ×»

Try it online!
Explanation
Example input n=2
D              # duplicate input
               # STACK: 2, 2
 141S          # push the list [1,4,1]
               # STACK: 2, 2, [1,4,1]
     ×         # repeat each item in the list input_no times
               # STACK: 2, [11, 44, 11]
      S        # split into list of digits
               # STACK: 2, [1, 1, 4, 4, 1, 1]
       *       # multiply each digit with input
               # STACK: [2, 2, 8, 8, 2, 2]
        „# ×   # repeat the string "# " for each item in the list
               # STACK: ['# # ','# # ','# # # # # # # # ','# # # # # # # # ','# # ','# # ']
            »  # join by newlines
               # OUTPUT: # #
                         # #
                         # # # # # # # #
                         # # # # # # # #
                         # #
                         # #

SmileBASIC, 57 50 bytes
INPUT S
E$=("#"*S*3+CHR$(10))*S?E$SCROLL-S*2,-1?E$

Explained:
INPUT SIZE
PART$=("#"*SIZE*3+CHR$(10))*S 'generate half of the pattern
PRINT PART$ 'print half the pattern
SCROLL SIZE*-2,-1 'scroll the text 2 squares right (and 1 character down)
PRINT PART$ 'print half the pattern again

After the first PRINT (size=2, @ is the cursor position):
######
######

@

After the SCROLL:
    ######
    ######
@

After the second PRINT:
    ######
    ######
######
######
@

In this case you can skip the spaces

C#, 152 bytes
n=>{var m="";foreach(int c in new[]{1,4,1})for(int i=0,j;i++<n;){for(j=0;j++<c;)m+=new System.Text.StringBuilder().Insert(0,"# ",n);m+="\n";}return m;};

Common Lisp, 83 81 79 bytes
(lambda(x)(format t"~v@{~v@{# ~}~:*~%~}~v@{~vt~0@*~v{# ~}~%~}"x(* x 3)(* x 2)))

Usage:
(funcall #'(lambda(x)(format t"~v@{~v@{# ~}~:*~%~}~v@{~vt~0@*~v{# ~}~%~}"x(* x 3)(* x 2)))2)
Output:
# # # # # #
# # # # # #
    # #
    # #
    # #
    # #
    # #
    # #

How does it work?
in format there is control string (inside "") and arguments after it
certain commands in string can use arguments (for example ~a displays argument)
~v{~} - takes argument and does commends inside {~} number of times
                                      (number is given by argument)
       we can write text in loop body - it'll get displayed. Even if
       in loop body there are none commends to use arguments loop itself
       will consume one argument (it doesn't matter what it'll be -
       it doesn't seem to affect output)
~% - newline
~n* - jump n arguments forward (relative)
~n:* - jump n arguments backwards (relative)
~n@* - jump to argument n (global, counting from 0)

~v@{~v{# ~}~%~1@*~} <--- we make x rowns, 3x columns of string "# ".
                         ~1@* is used during looping, it also means we end on argument 1.
                         (second argument: (* x 3))
~v@{~vt~0@*~v{# ~}~%~} <--- we now make 3x rows, x columns of "(spaces)# "
                         ~vt - is used to move to accurate column.
                         Here it takes argument (* x 2) - this is
                         minimal number of columns to display. It uses
                         space as default character for missing characters
                         (when string inside <~> is shorter than min
                         number of columns). I use it to make (* x 2) spaces,
                         by giving it no text.
      ~0@* <--- after making spaces we have no new arguments, we go back to
                argument number zero - it is used to determine number of columns in our block

Ideas for improvement are welcomed.


text:
Tape Measure String
Motivation: Sometimes you need to know where you are in a string. You want to be able to look at any part of a string and know exactly where you are, as far as possible.
Challenge: write a program to output a tape measure string of a given length. A tape measure string self describes its length-so-far as often as possible along it's own length.
Rules:

Your program must take one positive integer parameter, for the total length of the tape measure string
For each contiguous string of digits in the output, these digits must accurately report the length of the output so far - inclusive!

Lengths are measured from the start of the string to the end of each number

As many length numbers as possible should be included in the string
Avoid ambiguity. Separators/delimiters can be used to avoid numbers being juxtaposed, i.e. 12 says twelve not one, two.
The string must always accurately report its total length at its end, with no trailing separators
You may need multiple separators to keep the lengths accurate, e.g. here's an example tape measure string of length 4: 1--4

Non prescriptive/exhaustive examples:

tape measure string of length 1: 1
tape measure string of length 2: -2
tape measure string of length 3: 1-3
tape measure string of length 4: 1--4 or -2-4 (both report lengths as often as possible, i.e. twice, and end with the correct total length)
tape measure string of length 10: 1-3-5-7-10
tape measure string of length 11: 1-3-5-7--11 or 1-3-5--8-11 or 1-3--6-8-11 or 1--4-6-8-11 or -2-4-6-8-11 (all have as many length numbers as possible, and finish with the total string length)

So every digit in the string is non-adjacent to another digit, the string is composed entirely of dashes -, and you need to have as many length marks as you possibly can in the string?

Can we use 0 based indexing?

@EasterlyIrk Rule 3 is as many numbers as possible must be fit into the string.

Related.

@EasterlyIrk you can't have all dashes as that fails to meet the motivation and breaks rules 3 and 5.
There is no indexing. Just lengths. So no, a tape measure string of length one, can't be 0.

Can you please choose the answer?

Python, 50 48 47 46 bytes
f=lambda x:x*"1"if x<2else f(x-len(`-x`))+`-x`

Explanation
Pretty simple recursive lambda solution
Our base cases are 1 and 0 which are covered by  "1"*x otherwise we get the string of -x with `-x` and prepend the result of calling the function on len(`-x`) less.

Can you save bytes by stringifying -x?

@MartinEnder Ok I got it to work.  Thanks for the tip!  I feel kind of dumb for not noticing that earlier.

Mathematica, 67 57 bytes
Thanks to Martin Ender for jettisoning 10 bytes!
""["1"][[#]]/._@__:>#0[#-1-IntegerLength@#]<>ToString@-#&

Unnamed function taking a nonnegative integer argument and returning a string. Pretty much the obvious recursive algorithm: make sure the string ends with the input number preceded by a "-", and then call the function again using #0.
But there's golfy fun to be had in implementing the algorithm. ""["1"][[#]] denotes the #th argument of the expression ""["1"]: the 0th argument is the head "" and the 1st argument is visibly "1", which provides the base cases of the recursion. If # exceeds 1, then ""["1"][[#]] throws an error message and remains as an unevaluated function. But then /._@__:> is a rule that takes any unevaluated function and transforms it into the expression that comes next, which is the recursive call to the original function.
Original submission:
If[#<2,""["1"][[#]],#0[#-1-IntegerLength@#]<>"-"<>IntegerString@#]&

""["1"][[#]]/._@__:>#0[#-1-IntegerLength@#]<>ToString@-#& saves one byte by avoiding the If and a bunch of bytes by avoiding IntegerString and "-"<>.

omg, _@__ is evil magic

JavaScript (ES6), 49 bytes

f=(n,s='',t=''+-n)=>n>1?f(n-t.length,t+s):n?n+s:s
<input type=number oninput=o.value=f(this.value)><br><textarea id=o></textarea>

I think you need to define f

@TomViner I'm always doing that. (At least I had the right byte count.)

Pyth, 23 bytes
L?<b2*"1"b+y-bl+""_bs_b

Blatantly stole the recursive solution from Wheat wizard's answer. Also, I believe this is not golfed properly.
Try it here!

Perl 6, 43 bytes
{[R~](-$_,{$_+.comb}...^*>-1).&{S/^\-1/1/}}

Explanation:
{                                         }  # A lambda.
                    ...                      # Generate a sequence...
      -$_                                    #   starting from the negated lambda argument,
         ,{        }                         #   continuing iteratively using the formula:
           $_+.comb                          #     Last element plus length of last element.
                        *>-1                 #   until we hit 0 or higher,
                       ^                         end-point not inclusive.
 [R~](                      )                # Reverse and concatenate the number sequence.
                             .&{         }   # Apply to this the transformation:
                                S/^\-1/1/    #   Remove the sign from a leading "-1".

So for example for input 10, it generates the sequence (-10, -7, -5, -3, -1), and from that the string -1-3-5-7-10, and from that the final string 1-3-5-7-10.
Try it online.

C (gcc), 68 bytes
f(n){int*j;n<2?j="1"+!n:printf(f(n-asprintf(&j,"%d",-n)));return j;}

Try it online!
Borrows @Wheat Wizard's recursive solution.


text:
Match coordinates with their values
Given 3 input items, a list of coordinate pairs, a 2D string, and a single-character string, output whether the character at each coordinate of the 2D string is equal to the single character.  You can take the input in any order and the coordinates may be 1-indexed.
You may take the 2D string as a 2D list, a list of lines, or a 2D string.
Example: (0,0), "#_\n__", "#" -> True
The string is
#_
__

The char at the coordinate (0,0) (from the top left) is #.  This is equal to the third input item, #, so you output True (or any truthy value)
Example: [(0,0), (1,1)], "#_\n_#", "#" -> True
The string is
#_
_#

The characters at the coordinates of (0,0) and (1,1) are both #, so the output is true.
The output is only true iff every coordinate matches a hash.  Not every hash has to have a matching coordinate though.  If there are no occurrences of the single char (# in some of the test cases) in the 2D string, the output is still just falsy.
You can assume the coordinates will always be within the bounds of the 2D string.
More test cases: (I put the single char second for ease of readability)
[(0,0), (2,1), (3,0)], #

#_##
#_##

True

[(0,0), (1,1), (3,0)], #

#_##
#_##

False (1,1 is not a hash)

[(1,1)], a

#a##
#a##

True

[(4, 0), (3, 0), (2, 0), (1, 0), (0, 0), (0, 1), (0, 2), (0, 3), (1, 3), (2, 3), (2, 2), (3, 2), (4, 2), (4, 3)], ' '

 ####
 #
   #

True

Note the last test case uses spaces as the single char string, and hashes around the spaces.
Related. (inverse of this challenge)

Can we assume that input is a 2d array instead of using "\n"?

@rahnema1 not a 2D array, but an array/list of lines yes.

@EasterlyIrk I believe this falls into the category Cumbersome I/O formats

In your first example coordinates are in the format (row, column)  but in the  last example coordinates are in the format (column, row) .

@JungHwanMin no, because it trivializes the challenge a bit more.

@rahnema1 ah, thanks for catching that. For reference, you may use either coordinate input method.

@EasterlyIrk Some languages treat strings like an array of chars. Wouldn't that make this challenge trivial already?

Can the coordinates be 1-indexed?

@KritixiLithos yes, they can.

@JungHwanMin yeah, it would. I don't want to trivialize it any more though.

@EasterlyIrk my point is that there is no difference between allowing 2D arrays and not allowing it because there is no distinction in some languages.

@JungHwanMin eh, I guess I'll allow it.

I'm assuming that the "list of coordinate pairs" can be understood as a 2×N matrix, where N is the number of coordinates. Can you confirm?

@Luis yes that's correct

@EasterlyIrk Thanks for clarifying. Also, can we assume the list / matrix will not be empty?

@Luis yeah, sure

Dyalog APL, 8 bytes
Prompts for list of coordinate pairs (row,column), then 2D array, then character.
∧/⎕=⎕[⎕]

[⎕] prompt for coordinates and use them to scatter pick from
⎕ prompted input (2D array)
= compare the selected elements to
⎕ input (the character)
∧/ check if all are true (AND-reduction)
Test cases (⎕IO←0 to match examples, but this is not necessary):
First example
Second example
Third example
Fourth example
Fifth example

Python, 39 bytes
Takes the inputs:

a list of (x, y) integer coordinates
b list of strings
c single character string

lambda a,b,c:{b[y][x]for x,y in a}=={c}

On this site, you don't need to name your functions. You can remove the f=. Welcome to PPCG!

Welcome to PPCG, nice first answer!

Octave, 45 38 29 bytes
@(A,B,C)A(1+B*[rows(A);1])==C

A function that takes a 2D array of chars as A and coordinates(0 based) B as a two column matrix of [col row] and the matching character as C.
The two element coordinates(using matrix multiplication) converted to linear index.
Note: Previous answer that made use of sparse matrix was wrong.
Other Contributors:
Stewie Griffin for saving 5 bytes noting  that [0 1 0] can be regarded as false value!!
Luis Mendo for saving 2 bytes that ~0 == true and notification about sparse matrix.
Try it Online

Nice :) You can skip all and save three bytes. 1 1 1 is true, and 1 0 1 is false in Octave, so it should be OK. :)

Great approach! I like how this exploits the fact that logical indices need not have the same size as the indexed array

In addition to Stewie's suggestion, you can replace true by ~0 to save 2 bytes

@StewieGriffin  Thanks it is really OK:)

@LuisMendo Good point

@LuisMendo It was my mistake for assuming that input format is [row col], so I flipped B in tio to work correctly, Thanks for notification

@LuisMendo my answer based on sparse matrix was wrong (since it is not always correct to index a matrix with logical matrix of smaller dimensions! ) and consumed more bytes so I changed it

Oh now I see the problem with the smaller logical mask. It linearizes

JavaScript (ES6), 37 bytes
Takes the inputs:

a array of [x, y] integer coordinates
s array of strings
c single character string

(a,s,c)=>a.every(([x,y])=>s[y][x]==c)

Mathematica, 28 bytes
#3~Extract~#~MatchQ~{#2...}&

1-indexed. Due to how arrays are structured in Mathematica, the input coordinates must be reversed (i.e. (row, column))
Usage
#3~Extract~#~MatchQ~{#2...}&[{{1, 1}, {2, 3}, {1, 4}}, "#", {{"#", "_", "#", "#"}, {"#", "_", "#", "#"}}]

True

Perl 6, 41 40 bytes

->\c,\h,\n{all map {n eq h[.[0];.[1]]},c}

->$_,\h,\n{all .map:{n eq h[.[0];.[1]]}}

Expects the 2D string as a 2D list.
Thanks to b2gills for -1 byte.

If you used $_ instead of \c you could use .map:{…} saving one byte

@BradGilbertb2gills: Oh, I didn't realize the space was optional in .map: {…}. That's useful to know. Also, it's a shame that prefix || isn't implemented yet, it could make the inner lambda simply n eq h[||$_]...

Haskell, 27 bytes
s!c=all(\(x,y)->s!!y!!x==c)

Usage example: ( ["#_##","#_##"] ! '#' ) [(0,0), (2,1), (3,0)] -> True.

C#, 80 77 bytes
Saved 3 bytes, thanks to pinkfloydx33
a=>b=>c=>{foreach(var i in a){if(b[i[0]][i[1]]!=c){return 1<0;}}return 1>0;};

a is the pairs of coordinate, b is the list of lines, and c is the single-character string.

You can replace false with 1<0 and true with 1>0 and save 3 bytes.

Jelly, 10 bytes
ịṪ⁸ịḢð€Q⁼⁵

This only works as a full program. Input order is indices, string array, singleton string.
Try it online!
How it works
ịṪ⁸ịḢð€Q⁼⁵  Main link.
            Left argument:  P (array of coordinate pairs)
            Right argument: S (array of strings)
            Third argument: C (singleton string)

     ð€     Combine the links to the left into a dyadic chain and call it with each
            p = (x, y) in P as left argument and S as the right one.
ị             Unindex; retrieve the strings of S at indices x and y.
 Ṫ            Tail; yield s, the string of S at index y.
  ⁸ị          Unindex; retrieve the characters of s at indices x and y.
    Ḣ         Head; yield the character of s at index x.
       Q    Unique; deduplicate the resulting string/array of characters.
        ⁼⁵  Compare the result with the third argument.

Haskell, 72 63 bytes
c [] _ _ =1<2;c ((f,s):t) m n |n/=lines m!!s!!f=1>2|1>0=c t m n

Input of
c [(0,0), (1,0), (3,0)]  "#_##\n#_##" '#'
Outputs
False
Input c [(4, 0), (3, 0), (2, 0), (1, 0), (0, 0), (0, 1), (0, 2), (0, 3), (1, 3), (2, 3), (2, 2), (3, 2), (4, 2), (4, 3)]  "     \n ####\n #   \n   # " ' '
Output
True
UnGolfed
checkfunc :: [(Int,Int)] -> String -> Char -> Bool
checkfunc [] _ _ = True
checkfunc (x:xs) string char | char /= ((lines string)!!(snd x))!!(fst x)= False  -- Checks first coordinates and returns False if no match
                             | otherwise = checkfunc xs string char --Otherwise iterate over remaining coordinate pairs

There is still unnecessary whitespace left: c[]_ _=1<2;c((f,s):t)m n|n/=lines m!!s!!f=1>2|1>0=c t m n

Also as you are doing boolean logic, the implicit conditional if n/=lines m!!s!!f then False else c t m n can be replaced by n/=lines m!!s!!f&&c t m n.

Finally, as the OP says You may take the 2D string as a 2D list, a list of lines, or a 2D string. you can drop the lines and directly take a list of lines as input.

Scala, 68 bytes
def f(l:(Int,Int)*)(s:String*)(c:Char)=l forall{x=>s(x._2)(x._1)==c}

Clojure, 39 bytes
#(apply = %3(map(fn[[x y]]((%2 y)x))%))

Example (string input is a vec of vec of characters):
(def f #(apply = %3(map(fn[[x y]]((%2 y)x))%)))
(f [[0 0] [1 1] [3 0]] (mapv vec ["#_##" "#_##"]) \#)