答:
CJam, 20 bytes

```<code>Laq~{'a+_@f*\f+z}/N*
</code>```

Try it online.

```<code>La                      Push [[]]
  q~                    Push input n
    {           }/      For i in 0..n-1 ...
     'a+                  Add to char 'a to give current char
        _@f*              Join each row by char
            \f+           Add char to the end of each row as well
               z          Zip to transpose
                  N*    Join result by newlines
</code>```

20/21-byte alternatives:

```<code>Laaq~{'a+aff+:sz}/N*
Laaq~{'a+\Laf+f*z}/N*
Laq~{'a+f{_@*\+}z}/N*
</code>```

Title: Print the AdamN tile

Body:
Adam7 is an interlacing algorithm for raster images, such as PNG. It is called the "Adam7" algorithm because it was invented by Adam M. Costello, and it is generated by following a certain pattern 7 times. One of the cool things about the Adam7 algorithm that makes it really fun for code golf, is that the pattern can be repeated an arbitrary number of times, as long as it's odd. Back when 1996 when the PNG standard was developed, using only 7 iterations was seen as sufficient, since the 9 iterations was too complex, and 5 iterations is not as efficient.

Here is the first iteration of the tile:

```<code>a
</code>```

Pretty simple. This is an "Adam1" tile. Here's how we get to the next iteration, the "Adam3" tile.

Since our last tile was 1x1, we double the height and width, and the next one will be 2x2. First, we start with an 'a' in the upper left corner.

```<code>a-
--
</code>```

Step 2, copy this pattern to the right, and increase the letter we're on by one.

```<code>ab
--
</code>```

Step 3, same as step 2, but copy down instead of right.

```<code>ab
cc
</code>```

Boom. The "Adam3" tile. Let's do the "Adam5" also, so you can actually see how the algorithm works. This tile will, again, be twice as large, so 4x4. Again, we start with a a in the upper left corner:

```<code>a---
----
----
----
</code>```

Double this pattern, increase the letter, and move it to the right:

```<code>a-b-
----
----
----
</code>```

Again, this time down.

```<code>a-b-
----
c-c-
----
</code>```

Again, this time to the right.

```<code>adbd
----
cdcd
----
</code>```

Again, this time down.

```<code>adbd
eeee
cdcd
eeee
</code>```

This is the "Adam5" tile. Here is the ASCII representation of the Adam7 tile:

```<code>afdfbfdf
gggggggg
efefefef
gggggggg
cfdfcfdf
gggggggg
efefefef
gggggggg
</code>```

And while we're at it, here is a fun animation of each step of the Adam7 tile (although it does several tiles side by side):

The challenge

Given a positive odd number N, output the "AdamN" tile. You can use any default method of IO. Since we're using the alphabet in lieu of numbers, you only need to handle inputs up to 25. You can choose to output lower-case or upper-case characters as long as you specify and it's consistent.

Sample IO

1:

```<code>a-
--
</code>```0

3:

```<code>a-
--
</code>```1

5:

```<code>a-
--
</code>```2

7:

```<code>afdfbfdf
gggggggg
efefefef
gggggggg
cfdfcfdf
gggggggg
efefefef
gggggggg
</code>```

9:

```<code>ahfhdhfhbhfhdhfh
iiiiiiiiiiiiiiii
ghghghghghghghgh
iiiiiiiiiiiiiiii
ehfhehfhehfhehfh
iiiiiiiiiiiiiiii
ghghghghghghghgh
iiiiiiiiiiiiiiii
chfhdhfhchfhdhfh
iiiiiiiiiiiiiiii
ghghghghghghghgh
iiiiiiiiiiiiiiii
ehfhehfhehfhehfh
iiiiiiiiiiiiiiii
ghghghghghghghgh
iiiiiiiiiiiiiiii
</code>```

As usual, this is code-golf, so standard loopholes apply, and shortest answer in bytes wins!

Body:
CJam, 20 bytes

Laq~{'a+_@f*\f+z}/N*

Try it online.

La                      Push [[]]
  q~                    Push input n
    {           }/      For i in 0..n-1 ...
     'a+                  Add to char 'a to give current char
        _@f*              Join each row by char
            \f+           Add char to the end of each row as well
               z          Zip to transpose
                  N*    Join result by newlines

20/21-byte alternatives:

Laaq~{'a+aff+:sz}/N*
Laaq~{'a+\Laf+f*z}/N*
Laq~{'a+f{_@*\+}z}/N*


问:
Simple cat program
One of the most common standard tasks (especially when showcasing esoteric programming languages) is to implement a "cat program": read all of STDIN and print it to STDOUT. While this is named after the Unix shell utility cat it is of course much less powerful than the real thing, which is normally used to print (and concatenate) several files read from disc.

Task

You should write a full program which reads the contents of the standard input stream and writes them verbatim to the standard output stream. If and only if your language does not support standard input and/or output streams (as understood in most languages), you may instead take these terms to mean their closest equivalent in your language (e.g. JavaScript's prompt and alert). These are the only admissible forms of I/O, as any other interface would largely change the nature of the task and make answers much less comparable.

The output should contain exactly the input and nothing else. The only exception to this rule is constant output of your language's interpreter that cannot be suppressed, such as a greeting, ANSI color codes or indentation. This also applies to trailing newlines. If the input does not contain a trailing newline, the output shouldn't include one either! (The only exception being if your language absolutely always prints a trailing newline after execution.)

Output to the standard error stream is ignored, so long as the standard output stream contains the expected output. In particular, this means your program can terminate with an error upon hitting the end of the stream (EOF), provided that doesn't pollute the standard output stream. If you do this, I encourage you to add an error-free version to your answer as well (for reference).

As this is intended as a challenge within each language and not between languages, there are a few language specific rules:

If it is at all possible in your language to distinguish null bytes in the standard input stream from the EOF, your program must support null bytes like any other bytes (that is, they have to be written to the standard output stream as well).

If it is at all possible in your language to support an arbitrary infinite input stream (i.e. if you can start printing bytes to the output before you hit EOF in the input), your program has to work correctly in this case. As an example yes | tr -d \\n | ./my_cat should print an infinite stream of ys. It is up to you how often you print and flush the standard output stream, but it must be guaranteed to happen after a finite amount of time, regardless of the stream (this means, in particular, that you cannot wait for a specific character like a linefeed before printing).

Please add a note to your answer about the exact behaviour regarding null-bytes, infinite streams, and extraneous output.

Additional rules

This is not about finding the language with the shortest solution for this (there are some where the empty program does the trick) - this is about finding the shortest solution in every language. Therefore, no answer will be marked as accepted.

Submissions in most languages will be scored in bytes in an appropriate preexisting encoding, usually (but not necessarily) UTF-8.

Some languages, like Folders, are a bit tricky to score. If in doubt, please ask on Meta.

Feel free to use a language (or language version) even if it's newer than this challenge. Languages specifically written to submit a 0-byte answer to this challenge are fair game but not particularly interesting.

Note that there must be an interpreter so the submission can be tested. It is allowed (and even encouraged) to write this interpreter yourself for a previously unimplemented language.

Also note that languages do have to fulfil our usual criteria for programming languages.

If your language of choice is a trivial variant of another (potentially more popular) language which already has an answer (think BASIC or SQL dialects, Unix shells or trivial Brainfuck derivatives like Headsecks or Unary), consider adding a note to the existing answer that the same or a very similar solution is also the shortest in the other language.

Unless they have been overruled earlier, all standard code-golf rules apply, including the http://meta.codegolf.stackexchange.com/q/1061.

As a side note, please don't downvote boring (but valid) answers in languages where there is not much to golf; these are still useful to this question as it tries to compile a catalogue as complete as possible. However, do primarily upvote answers in languages where the author actually had to put effort into golfing the code.

Catalogue

The Stack Snippet at the bottom of this post generates the catalogue from the answers a) as a list of shortest solution per language and b) as an overall leaderboard.

To make sure that your answer shows up, please start your answer with a headline, using the following Markdown template:

```<code>## Language Name, N bytes
</code>```

where N is the size of your submission. If you improve your score, you can keep old scores in the headline, by striking them through. For instance:

```<code>## Ruby, <s>104</s> <s>101</s> 96 bytes
</code>```

If there you want to include multiple numbers in your header (e.g. because your score is the sum of two files or you want to list interpreter flag penalties separately), make sure that the actual score is the last number in the header:

```<code>## Perl, 43 + 2 (-p flag) = 45 bytes
</code>```

You can also make the language name a link which will then show up in the snippet:

```<code>## [><>](http://esolangs.org/wiki/Fish), 121 bytes
</code>```

 <link rel="stylesheet" type="text/css" href="//cdn.sstatic.net/codegolf/all.css?v=83c949450c8b">

Shortest Solution by Language

Language	User	Score

Leaderboard

	Author	Language	Size

{{PLACE}}	{{NAME}}	{{LANGUAGE}}	{{SIZE}}	Link

{{LANGUAGE}}	{{NAME}}	{{SIZE}}	Link

```

答:
Tellurium, 2 bytes

```<code>i^
</code>```

Pretty simple, eh?

What it does is get input from the user using the i command, and stores it in the tape in the currently selected item (in the code above, it's 0, the default).

After that, it prints the currently selected item's value using the ^ command. (whatever the user input).

ContentLicense: CC BY-SA 3.0

Title: Simple cat program

Body:
Tellurium, 2 bytes

i^

Pretty simple, eh?

What it does is get input from the user using the i command, and stores it in the tape in the currently selected item (in the code above, it's 0, the default).

After that, it prints the currently selected item's value using the ^ command. (whatever the user input).


问:
Gasket Weaving - draw a Sierpiński knot
Given an integer N >= 2, produce an image showing a Sierpiński knot of degree N.

For example, here are knots of degree 2, 3, 4 and 5:

Click on the images to view full size (the higher the degree the larger the image).

Specification

A Sierpiński knot of degree N is drawn using the vertices of a Sierpiński triangle of degree N as guide points. A Sierpiński triangle of degree N is three Sierpiński triangles of degree N-1 arranged into a larger triangle. A Sierpiński triangle of degree 0 is an equilateral triangle.

The smallest component triangles have side length 64, giving the Sierpiński triangle on which the knot is based an overall side length of

The centre of the outer triangle is positioned at the centre of the image. This does not give equal white space at top and bottom.

The output is a square image of side length  where  is ceiling(x), the smallest integer greater than or equal to x. This is just large enough for the top vertex of the underlying Sierpiński triangle to be contained within the image when the centre of the triangle is at the centre of the image.

The single curve must pass over and under itself, strictly alternating. Solutions can choose between under then over, or over then under.

The example images show black foreground and white background. You may choose any two easily distinguished colours. Anti-aliasing is permitted but not necessary.

There must not be gaps where two arcs meet or where the curve passes over or under itself.

Output may be to any raster format image file, or to any vector format image file that includes a correct default display size. If you display directly to screen, this must be in a form that allows scrolling to see the full image when larger than the screen.

Determining arc centre, radius and thickness

The knot is constructed as a series of circular arcs that meet at points where their tangents are parallel, to give a seamless join. These arcs are displayed as annular sectors (arcs with thickness).

The centres of these arcs are the vertices of the smallest upside down triangles. Each such vertex is the centre of exactly one arc.

Each arc has a radius of

The exception is that the arcs in the three outermost triangles (at the corners of the large triangle) have a centre which is the midpoint of the two adjacent inner vertices, and thus have a radius of

Each arc is represented with a total thickness (difference between inner radius and outer radius) of  and the black borders of this each have a thickness of  The curve must have these borders, and not just be a solid strip.

Units of measure

All distances are in pixels (1 is the horizontal or vertical distance between 2 adjacent pixels).

The square root of 3 must be accurate to 7 significant figures. That is, your calculations must be equivalent to using a ROOT3 such that 1.7320505 <= ROOT3 < 1.7320515

Scoring

The shortest code in bytes wins.

For those wondering, N=0 and N=1 are not included because they correspond to a circle and a trefoil, which don't quite match the pattern that applies for N>=2. I would expect that most approaches to this challenge would need to add special case code for 0 and 1, so I decided to omit them.

答:
Ruby, <s>1168</s> 932

Corrected a mistake from last night, more golfing to do after clarifying.

This is (currently) a full program that accepts a number from stdin and outputs an svg file to stdout. I chose svg because I knew it was possible to meet all the requirements of the question, but it did have some issues. in particular SVG only supports arcs of circles as part of the path object, and does not define them in terms of their centre but rather the two endpoints.

Code

```<code>n=gets.to_i
r=64*w=0.75**0.5
m=1<<n-2
z=128*m/w
a=(s="<path style='fill:none;stroke:black;stroke-width:3.464102' transform='translate(%f %f)'
")%[0,r-r*m*8/3]+"d='M18.11943,-2A#{b=r-6*w-32} #{b} 0 0,0 #{-b} 0#{k='A%f %f 0 0 '%([58*w]*2)}0 0,38.71692
M28.58980,1.968882#{l='A%f %f 0 0 '%([70*w]*2)}0 #{c=r+6*w-32} 0A#{c} #{c} 0 0,0 #{-c} 0#{l}0 -9 44.65423'/>"
p=2
m.times{|i|(i*2+1).times{|j|(p>>j)%8%3==2&&a<<s%[128*(j-i),r*3+r*i*4-r*m*8/3]+
"d='M-55,44.65423#{k}0 11.5,25.11473#{l}1 35.41020,1.968882
M-64,51.48786#{l}0 20.5,30.31089#{k}1 36.82830,13.17993
M-82.17170,-2.408529#{l}1 -11.5,25.11473#{k}0 0,38.71692
M-81.52984 8.35435#{k}1 -20.5,30.31089#{l}0 -9,44.65423
M9,44.65423#{k}0 81.52984,8.35435
M0,51.48786#{l}0 91.17169,13.17993'/>"}
p^=p*4}
puts "<svg xmlns='http://www.w3.org/2000/svg' viewBox='#{-z} #{-z} #{e=2*z+1} #{e}' width='#{e}px' height='#{e}px'>"+
"<g transform='rotate(%d)'>#{a}</g>"*3%[0,120,240]+"</svg>"
</code>```

Output N=4

rescaled by Stack exchange. Looks much better as original.

Explanation

At first I considered something like http://euler.nmt.edu/~jstarret/sierpinski.html where the triangle is broken down into three differently coloured strands, each of which forms a path from one corner to another. The incomplete circles are shown as incomplete hexagons there. inscribing circles inside the hexagons shows that the circle radius should be sqrt(3)/2 times the sidelength. The strands could be built up recursively as shown, but there is an added complication because the corners need to be rounded and it is difficult to know in which direction to curve, so I did not use this approach.

What I did was the following.

In the image below you can see there are horizontal twists belonging to the N=2 units (in green) arranged in a sierpinski triangle and additional bridging twists (in blue.)

It is common knowledge that the odd numbers on Pascal's triangle form a sierpinski triangle. A sierpinski triangle of binary digits can be obtained in an analogous manner by starting with the number p=1 and iteratively xoring it with p<<1.

I modified this approach, starting at p=2 and iteratively xoring with p*4. This gives a sierpinski triangle alternating with columns of zeros.

Now we can rightshift p and inspect the last three bits using %8. If they are 010 we need to draw a green twist belonging to an N=2 unit. if they are 101 we need to draw a blue, bridging twist. To test for both of these numbers together we find the modulo %3 and if this is 2 we need to draw the twist.

Finally, in additional to the horizontal twists, we make two copies rotated through 120 and 240 degrees to draw the diagonal twists and complete the picture. All that remains is to add the corners.

Commented code

```<code>n=gets.to_i

#r=vertical distance between rows
r=64*w=0.75**0.5

#m=number of rows of horizontal twists
m=1<<n-2

#z=half the size of the viewport
z=128*m/w

#s=SVG common to all paths
s="<path style='fill:none;stroke:black;stroke-width:3.464102' transform='translate(%f %f)'
"

#initialize a with SVG to draw top corner loop. Set k and l to the SVG common to all arcs of 58*w and 70*w radius
a=s%[0,r-r*m*8/3]+
"d='M18.11943,-2A#{b=r-6*w-32} #{b} 0 0,0 #{-b} 0#{k='A%f %f 0 0 '%([58*w]*2)}0 0,38.71692
M28.58980,1.968882#{l='A%f %f 0 0 '%([70*w]*2)}0 #{c=r+6*w-32} 0A#{c} #{c} 0 0,0 #{-c} 0#{l}0 -9 44.65423'/>"

#p is the pattern variable, top row of twists has one twist so set to binary 00000010
p=2

#loop vertically and horizontally
m.times{|i|
 (i*2+1).times{|j|

   #leftshift p. if 3 digits inspected are 010 or 101
   (p>>j)%8%3==2&&

   #append to a, the common parts of a path...
   a<<s%[128*(j-i),r*3+r*i*4-r*m*8/3]+

   #...and the SVG for the front strand and left and right parts of the back strand (each strand has 2 borders)
"d='M-55,44.65423#{k}0 11.5,25.11473#{l}1 35.41020,1.968882
M-64,51.48786#{l}0 20.5,30.31089#{k}1 36.82830,13.17993
M-82.17170,-2.408529#{l}1 -11.5,25.11473#{k}0 0,38.71692
M-81.52984 8.35435#{k}1 -20.5,30.31089#{l}0 -9,44.65423
M9,44.65423#{k}0 81.52984,8.35435
M0,51.48786#{l}0 91.17169,13.17993'/>"}

#modify the pattern by xoring with 4 times itself for the next row
p^=p*4}

#output complete SVG of correct size with three copies of the finished pattern rotated through 0,120,240 degrees.
puts "<svg xmlns='http://www.w3.org/2000/svg' viewBox='#{-z} #{-z} #{e=2*z+1} #{e}' width='#{e}px' height='#{e}px'>"+
"<g transform='rotate(%d)'>#{a}</g>"*3%[0,120,240]+"</svg>"
</code>```

Title: Gasket Weaving - draw a Sierpiński knot

Body:
Ruby, <s>1168</s> 932

Corrected a mistake from last night, more golfing to do after clarifying.

This is (currently) a full program that accepts a number from stdin and outputs an svg file to stdout. I chose svg because I knew it was possible to meet all the requirements of the question, but it did have some issues. in particular SVG only supports arcs of circles as part of the path object, and does not define them in terms of their centre but rather the two endpoints.

Code

n=gets.to_i
r=64*w=0.75**0.5
m=1<<n-2
z=128*m/w
a=(s="<path style='fill:none;stroke:black;stroke-width:3.464102' transform='translate(%f %f)'
")%[0,r-r*m*8/3]+"d='M18.11943,-2A#{b=r-6*w-32} #{b} 0 0,0 #{-b} 0#{k='A%f %f 0 0 '%([58*w]*2)}0 0,38.71692
M28.58980,1.968882#{l='A%f %f 0 0 '%([70*w]*2)}0 #{c=r+6*w-32} 0A#{c} #{c} 0 0,0 #{-c} 0#{l}0 -9 44.65423'/>"
p=2
m.times{|i|(i*2+1).times{|j|(p>>j)%8%3==2&&a<<s%[128*(j-i),r*3+r*i*4-r*m*8/3]+
"d='M-55,44.65423#{k}0 11.5,25.11473#{l}1 35.41020,1.968882
M-64,51.48786#{l}0 20.5,30.31089#{k}1 36.82830,13.17993
M-82.17170,-2.408529#{l}1 -11.5,25.11473#{k}0 0,38.71692
M-81.52984 8.35435#{k}1 -20.5,30.31089#{l}0 -9,44.65423
M9,44.65423#{k}0 81.52984,8.35435
M0,51.48786#{l}0 91.17169,13.17993'/>"}
p^=p*4}
puts "<svg xmlns='http://www.w3.org/2000/svg' viewBox='#{-z} #{-z} #{e=2*z+1} #{e}' width='#{e}px' height='#{e}px'>"+
"<g transform='rotate(%d)'>#{a}</g>"*3%[0,120,240]+"</svg>"

Output N=4

rescaled by Stack exchange. Looks much better as original.

Explanation

At first I considered something like http://euler.nmt.edu/~jstarret/sierpinski.html where the triangle is broken down into three differently coloured strands, each of which forms a path from one corner to another. The incomplete circles are shown as incomplete hexagons there. inscribing circles inside the hexagons shows that the circle radius should be sqrt(3)/2 times the sidelength. The strands could be built up recursively as shown, but there is an added complication because the corners need to be rounded and it is difficult to know in which direction to curve, so I did not use this approach.

What I did was the following.

In the image below you can see there are horizontal twists belonging to the N=2 units (in green) arranged in a sierpinski triangle and additional bridging twists (in blue.)

It is common knowledge that the odd numbers on Pascal's triangle form a sierpinski triangle. A sierpinski triangle of binary digits can be obtained in an analogous manner by starting with the number p=1 and iteratively xoring it with p<<1.

I modified this approach, starting at p=2 and iteratively xoring with p*4. This gives a sierpinski triangle alternating with columns of zeros.

Now we can rightshift p and inspect the last three bits using %8. If they are 010 we need to draw a green twist belonging to an N=2 unit. if they are 101 we need to draw a blue, bridging twist. To test for both of these numbers together we find the modulo %3 and if this is 2 we need to draw the twist.

Finally, in additional to the horizontal twists, we make two copies rotated through 120 and 240 degrees to draw the diagonal twists and complete the picture. All that remains is to add the corners.

Commented code

n=gets.to_i

#r=vertical distance between rows
r=64*w=0.75**0.5

#m=number of rows of horizontal twists
m=1<<n-2

#z=half the size of the viewport
z=128*m/w

#s=SVG common to all paths
s="<path style='fill:none;stroke:black;stroke-width:3.464102' transform='translate(%f %f)'
"

#initialize a with SVG to draw top corner loop. Set k and l to the SVG common to all arcs of 58*w and 70*w radius
a=s%[0,r-r*m*8/3]+
"d='M18.11943,-2A#{b=r-6*w-32} #{b} 0 0,0 #{-b} 0#{k='A%f %f 0 0 '%([58*w]*2)}0 0,38.71692
M28.58980,1.968882#{l='A%f %f 0 0 '%([70*w]*2)}0 #{c=r+6*w-32} 0A#{c} #{c} 0 0,0 #{-c} 0#{l}0 -9 44.65423'/>"

#p is the pattern variable, top row of twists has one twist so set to binary 00000010
p=2

#loop vertically and horizontally
m.times{|i|
 (i*2+1).times{|j|

   #leftshift p. if 3 digits inspected are 010 or 101
   (p>>j)%8%3==2&&

   #append to a, the common parts of a path...
   a<<s%[128*(j-i),r*3+r*i*4-r*m*8/3]+

   #...and the SVG for the front strand and left and right parts of the back strand (each strand has 2 borders)
"d='M-55,44.65423#{k}0 11.5,25.11473#{l}1 35.41020,1.968882
M-64,51.48786#{l}0 20.5,30.31089#{k}1 36.82830,13.17993
M-82.17170,-2.408529#{l}1 -11.5,25.11473#{k}0 0,38.71692
M-81.52984 8.35435#{k}1 -20.5,30.31089#{l}0 -9,44.65423
M9,44.65423#{k}0 81.52984,8.35435
M0,51.48786#{l}0 91.17169,13.17993'/>"}

#modify the pattern by xoring with 4 times itself for the next row
p^=p*4}

#output complete SVG of correct size with three copies of the finished pattern rotated through 0,120,240 degrees.
puts "<svg xmlns='http://www.w3.org/2000/svg' viewBox='#{-z} #{-z} #{e=2*z+1} #{e}' width='#{e}px' height='#{e}px'>"+
"<g transform='rotate(%d)'>#{a}</g>"*3%[0,120,240]+"</svg>"


问:
Shortest infinite loop producing no output
Your task is to create the shortest infinite loop!

The point of this challenge is to create an infinite loop producing no output, unlike its possible duplicate. The reason to this is because the code might be shorter if no output is given.

Rules

Each submission must be a full program.

You must create the shortest infinite loop.

Even if your program runs out of memory eventually, it is still accepted as long as it is running the whole time from the start to when it runs out of memory. Also when it runs out of memory, it should still not print anything to STDERR.

The program must take no input (however, reading from a file is allowed), and should not print anything to STDOUT. Output to a file is also forbidden.

The program must not write anything to STDERR.

Feel free to use a language (or language version) even if it's newer than this challenge.
-Note that there must be an interpreter so the submission can be tested. It is allowed (and even encouraged) to write this interpreter yourself for a previously unimplemented language. :D

Submissions are scored in bytes, in an appropriate (pre-existing) encoding, usually (but not necessarily) UTF-8. Some languages, like Folders, are a bit tricky to score - if in doubt, please ask on Meta.

This is not about finding the language with the shortest infinite loop program. This is about finding the shortest infinite loop program in every language. Therefore, I will not accept an answer.

If your language of choice is a trivial variant of another (potentially more popular) language which already has an answer (think BASIC or SQL dialects, Unix shells or trivial Brainf**k-derivatives like Alphuck), consider adding a note to the existing answer that the same or a very similar solution is also the shortest in the other language.

There should be a website such as Wikipedia, Esolangs, or GitHub for the language. For example, if the language is CJam, then one could link to the site in the header like #[CJam](http://sourceforge.net/p/cjam/wiki/Home/), X bytes.

Standard loopholes are not allowed.

(I have taken some of these rules from Martin Büttner's "Hello World" challenge)

Please feel free to post in the comments to tell me how this challenge could be  improved.

Catalogue

This is a Stack Snippet which generates both an alphabetical catalogue of the used languages, and an overall leaderboard. To make sure your answer shows up, please start it with this Markdown header:

```<code># Language name, X bytes
</code>```

Obviously replacing Language name and X bytes with the proper items. If you want to link to the languages' website, use this template, as posted above:

```<code>#[Language name](http://link.to/the/language), X bytes
</code>```

Now, finally, here's the snippet: (Try pressing "Full page" for a better view.)

var QUESTION_ID=59347;var ANSWER_FILTER="!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe";var COMMENT_FILTER="!)Q2B_A2kjfAiU78X(md6BoYk";var OVERRIDE_USER=41805;var answers=[],answers_hash,answer_ids,answer_page=1,more_answers=true,comment_page;function answersUrl(index){return"//api.stackexchange.com/2.2/questions/"+QUESTION_ID+"/answers?page="+index+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+ANSWER_FILTER}function commentUrl(index,answers){return"//api.stackexchange.com/2.2/answers/"+answers.join(';')+"/comments?page="+index+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+COMMENT_FILTER}function getAnswers(){jQuery.ajax({url:answersUrl(answer_page++),method:"get",dataType:"jsonp",crossDomain:true,success:function(data){answers.push.apply(answers,data.items);answers_hash=[];answer_ids=[];data.items.forEach(function(a){a.comments=[];var id=+a.share_link.match(/\d+/);answer_ids.push(id);answers_hash[id]=a});if(!data.has_more)more_answers=false;comment_page=1;getComments()}})}function getComments(){jQuery.ajax({url:commentUrl(comment_page++,answer_ids),method:"get",dataType:"jsonp",crossDomain:true,success:function(data){data.items.forEach(function(c){if(c.owner.user_id===OVERRIDE_USER)answers_hash[c.post_id].comments.push(c)});if(data.has_more)getComments();else if(more_answers)getAnswers();else process()}})}getAnswers();var SCORE_REG=/<h\d>\s*([^\n,<]*(?:<(?:[^\n>]*>[^\n<]*<\/[^\n>]*>)[^\n,<]*)*),.*?(\d+)(?=[^\n\d<>]*(?:<(?:s>[^\n<>]*<\/s>|[^\n<>]+>)[^\n\d<>]*)*<\/h\d>)/;var OVERRIDE_REG=/^Override\s*header:\s*/i;function getAuthorName(a){return a.owner.display_name}function process(){var valid=[];answers.forEach(function(a){var body=a.body;a.comments.forEach(function(c){if(OVERRIDE_REG.test(c.body))body='
'+c.body.replace(OVERRIDE_REG,'')+'
'});var match=body.match(SCORE_REG);if(match)valid.push({user:getAuthorName(a),size:+match[2],language:match[1],link:a.share_link,});else console.log(body)});valid.sort(function(a,b){var aB=a.size,bB=b.size;return aB-bB});var languages={};var place=1;var lastSize=null;var lastPlace=1;valid.forEach(function(a){if(a.size!=lastSize)lastPlace=place;lastSize=a.size;++place;var answer=jQuery("#answer-template").html();answer=answer.replace("{{PLACE}}",lastPlace+".").replace("{{NAME}}",a.user).replace("{{LANGUAGE}}",a.language).replace("{{SIZE}}",a.size).replace("{{LINK}}",a.link);answer=jQuery(answer);jQuery("#answers").append(answer);var lang=a.language;lang=jQuery(''+lang+'').text();languages[lang]=languages[lang]||{lang:a.language,lang_raw:lang,user:a.user,size:a.size,link:a.link}});var langs=[];for(var lang in languages)if(languages.hasOwnProperty(lang))langs.push(languages[lang]);langs.sort(function(a,b){if(a.lang_raw.toLowerCase()>b.lang_raw.toLowerCase())return 1;if(a.lang_raw.toLowerCase()<b.lang_raw.toLowerCase())return-1;return 0});for(var i=0;i<langs.length;++i){var language=jQuery("#language-template").html();var lang=langs[i];language=language.replace("{{LANGUAGE}}",lang.lang).replace("{{NAME}}",lang.user).replace("{{SIZE}}",lang.size).replace("{{LINK}}",lang.link);language=jQuery(language);jQuery("#languages").append(language)}}```
<pre class="snippet-code-css lang-css prettyprint-override"><code>body{text-align:left!important}#answer-list{padding:10px;width:500px;float:left}#language-list{padding:10px;padding-right:40px;width:500px;float:left}table thead{font-weight:700}table td{padding:5px}</code>```

 <link rel="stylesheet" type="text/css" href="//cdn.sstatic.net/codegolf/all.css?v=83c949450c8b">

Shortest Solution by Language

Language	User	Score

Leaderboard

	Author	Language	Size

{{PLACE}}	{{NAME}}	{{LANGUAGE}}	{{SIZE}}	Link

{{LANGUAGE}}	{{NAME}}	{{SIZE}}	Link

```

答:
Pyke, 1 byte

```<code>r
</code>```

Try it here!

The r node sets the counter to 0, resetting the program.

Body:
Pyke, 1 byte

r

Try it here!

The r node sets the counter to 0, resetting the program.


问:
How many squares are there?
This challenge is inspired by a picture that often roams on Facebook that looks like this. Except our base square will look more like this:

```<code>┌─┬───┬─┐
├─┼─┬─┼─┤
├─┼─┴─┼─┤
├─┼─┬─┼─┤
└─┴─┴─┴─┘
</code>```

The square is made out of n x m 1x1 square, you have to count how many sub-squares (1x1, 2x2, 3x3, 4x4, 5x5, etc.) can fit within that square. Squares can be missing some grid lines (like in the example above) or be complete like in the example bellow. Which means a mathematical breakdown is not possible (as far as I know).

Inputs:

The amount of lines (n) of input to build the square;

A square made from the following characters: ─ ┐ ┌ └ ┴ ┘ ┬ ├ ┤ ┼ | across n lines of input.

Output:

The amount of squares of any size that can fit within the input square (we only want a single number here, not a number for each size).

Winning criterion:

The smallest answer (number of bytes) wins.

Test Cases:

In:

```<code>5
┌─┬─┬─┬─┐
├─┼─┼─┼─┤
├─┼─┼─┼─┤
├─┼─┼─┼─┤
└─┴─┴─┴─┘
</code>```

Out: 30

In:

```<code>3
┌─┬─┐
├─┼─┤
└─┴─┘
</code>```

Out: 5

In:

```<code>5
┌─┬─┐
├─┴─┤
├───┤
├─┬─┤
└─┴─┘
</code>```

Out: 7

In:

```<code>4
┌─┬─┬─┬─┬─┬─┐
├─┼─┼─┼─┼─┼─┤
├─┼─┼─┼─┼─┼─┤
└─┴─┴─┴─┴─┴─┘
</code>```

Out: 32

In:

```<code>2
┌─┐
└─┘
</code>```

Out: 1

In:

```<code>4
┌─┬─┬─┬─┬─┬─┐
├─┴─┼─┼─┼─┴─┤
├─┬─┼─┼─┼─┬─┤
└─┴─┴─┴─┴─┴─┘
</code>```

Out: 22

答:
JavaScript (ES6), 292 bytes <s>306 325</s>

Edit I did the byte count totally wrong,<s> corrected now thx http://bytesizematters.com/</s> correct for the last time I hope thx  Cᴏɴᴏʀ O'Bʀɪᴇɴ see https://goo.gl/LSHC1U (and 1 byte less using a literal newline insteads of '\n')

(h,z)=>(o=>{r=p=>" ),┌(─┐┬'└│├┘┴┤┼".search(z[p]);for(q=s=0;++s<o/2&s<h;)for(y=0;y<(h-s)*o;y+=o)for(x=0;x<o-s*2;q+=!n,x+=2)for(n=i=0,t=x,u=y;i<=s;t+=2,u+=o,i++)n|=i<s&(!(r(t+y)&r(t+y+s*o)&1)|!(r(x+u)&r(x+u+s*2)&2))|i>0&(!(r(t+y)&r(t+y+s*o)&4)|!(r(x+u)&r(x+u+s*2)&8))})(-~z.search`
`)|q
```

<p>Longer than I expected (probably a few more byte can be shaved off)</p>

<p>All possible squares are checked and counted.  </p>

<p>The <code>r</code> function map each character to a bitmap having</p>

<ul>
<li>1 : horizontal line center to right</li>
<li>2 : vertical line center to bottom</li>
<li>4 : horizontal line center to left</li>
<li>8 : vertical line center to top</li>
</ul>

<p>A square of any size must have </p>

<ul>
<li>4 in all cells except the first in top and bottom row</li>
<li>1 in all cells except the last in top and bottom row</li>
<li>8 in all cells except the first in leftmost and rightmost column</li>
<li>2 in all cells except the last in leftmost and rightmost column</li>
</ul>

<p><strong>Test</strong></p>

<p><div class="snippet" data-lang="js" data-hide="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>f=(h,z)=>(o=>{r=p=>" ),┌(─┐┬'└│├┘┴┤┼".search(z[p]);k=(p,d,m)=>r(p)&r(p+s*d)&m;for(q=s=0;++s<o/2&s<h;)for(y=0;y<(h-s)*o;y+=o)for(x=0;x<o-s*2;q+=!n,x+=2)for(n=i=0,t=x,u=y;i<=s;t+=2,u+=o,i++)n=n|i<s&(!k(t+y,o,1)|!k(x+u,2,2))|i>0&(!k(t+y,o,4)|!k(x+u,2,8));})(-~z.search`
`)|q

console.log=(...x)=>O.textContent+=x+'\n'

// Less golfed

Uf=(h,z)=>{
  o=-~z.search`\n`;
  w=o/2;
  r=p=>" ),┌(─┐┬'└│├┘┴┤┼".search(z[p]);
  k=(p,d,m)=>r(p)&r(p+s*d)&m;
  for(q=s=0;++s<w&s<h;)
    for(y=0;y<(h-s)*o;y+=o)
      for(x=0;x<(w-s)*2;q+=!n,x+=2)
        for(n=i=0,t=x,u=y;i<=s;t+=2,u+=o,i++)
          n|=i<s&(!k(t+y,o,1)|!k(x+u,2,2))
          |i>0&(!k(t+y,o,4)|!k(x+u,2,8));
  return q
}

;[[5,`┌─┬───┬─┐
├─┼─┬─┼─┤
├─┼─┴─┼─┤
├─┼─┬─┼─┤
└─┴─┴─┴─┘`,20]
,[5,`┌─┬─┬─┬─┐
├─┼─┼─┼─┤
├─┼─┼─┼─┤
├─┼─┼─┼─┤
└─┴─┴─┴─┘`,30]
,[3,`┌─┬─┐
├─┼─┤
└─┴─┘`,5]
,[5,`┌─┬─┐
├─┴─┤
├───┤
├─┬─┤
└─┴─┘`,7]
,[4,`┌─┬─┬─┬─┬─┬─┐
├─┼─┼─┼─┼─┼─┤
├─┼─┼─┼─┼─┼─┤
└─┴─┴─┴─┴─┴─┘`,32]
,[2,`┌─┐
└─┘`,1]
,[4,`┌─┬─┬─┬─┬─┬─┐
├─┴─┼─┼─┼─┴─┤
├─┬─┼─┼─┼─┬─┤
└─┴─┴─┴─┴─┴─┘`,22],
,[6,`┌─┬─────┐
├─┼─┬─┐ │
│ ├─┼─┼─┤
│ └─┼─┼─┤
│   └─┼─┤
└─────┴─┘`,12],
,[6,`┌─┬─┬─┬─┐
├─┴─┼─┼─┤
│   └─┼─┤
├─┬─┬─┼─┤
├─┼─┼─┼─┤
└─┴─┴─┴─┘`,23]]
.forEach(t=>{
  var r=t[0],a=t[1],k=t[2],x=f(r,a)
  console.log(x==k?'OK '+x:'KO '+x+' Expected '+k,'\n'+a)
})</code>```

```</code>```

Title: How many squares are there?

Body:
JavaScript (ES6), <a href="https://mothereff.in/byte-counter#%28h%2Cz%29%3D%3E%28o%3D%3E%7Br%3Dp%3D%3E%22%20%29%2C%E2%94%8C%28%E2%94%80%E2%94%90%E2%94%AC%27%E2%94%94%E2%94%82%E2%94%9C%E2%94%98%E2%94%B4%E2%94%A4%E2%94%BC%22.search%28z%5Bp%5D%29%3Bk%3D%28p%2Cd%2Cm%29%3D%3Er%28p%29%26r%28p%2Bs%2Ad%29%26m%3Bfor%28q%3Ds%3D0%3B%2B%2Bs%3Co%2F2%26s%3Ch%3B%29for%28y%3D0%3By%3C%28h-s%29%2Ao%3By%2B%3Do%29for%28x%3D0%3Bx%3Co-s%2A2%3Bq%2B%3D!n%2Cx%2B%3D2%29for%28n%3Di%3D0%2Ct%3Dx%2Cu%3Dy%3Bi%3C%3Ds%3Bt%2B%3D2%2Cu%2B%3Do%2Ci%2B%2B%29n%3Dn%7Ci%3Cs%26%28!k%28t%2By%2Co%2C1%29%7C!k%28x%2Bu%2C2%2C2%29%29%7Ci%3E0%26%28!k%28t%2By%2Co%2C4%29%7C!k%28x%2Bu%2C2%2C8%29%29%3B%7D%29%28-~z.search%60%0A%60%29%7Cq%0A" rel="nofollow">292 bytes <s>306 325</s>

Edit I did the byte count totally wrong,<s> corrected now thx http://bytesizematters.com/</s> correct for the last time I hope thx  Cᴏɴᴏʀ O'Bʀɪᴇɴ see https://goo.gl/LSHC1U (and 1 byte less using a literal newline insteads of '\n')

(h,z)=>(o=>{r=p=>" ),┌(─┐┬'└│├┘┴┤┼".search(z[p]);for(q=s=0;++s<o/2&s<h;)for(y=0;y<(h-s)*o;y+=o)for(x=0;x<o-s*2;q+=!n,x+=2)for(n=i=0,t=x,u=y;i<=s;t+=2,u+=o,i++)n|=i<s&(!(r(t+y)&r(t+y+s*o)&1)|!(r(x+u)&r(x+u+s*2)&2))|i>0&(!(r(t+y)&r(t+y+s*o)&4)|!(r(x+u)&r(x+u+s*2)&8))})(-~z.search`
`)|q

Longer than I expected (probably a few more byte can be shaved off)

All possible squares are checked and counted.

The r function map each character to a bitmap having

1 : horizontal line center to right

2 : vertical line center to bottom

4 : horizontal line center to left

8 : vertical line center to top

A square of any size must have

4 in all cells except the first in top and bottom row

1 in all cells except the last in top and bottom row

8 in all cells except the first in leftmost and rightmost column

2 in all cells except the last in leftmost and rightmost column

Test

f=(h,z)=>(o=>{r=p=>" ),┌(─┐┬'└│├┘┴┤┼".search(z[p]);k=(p,d,m)=>r(p)&r(p+s*d)&m;for(q=s=0;++s<o/2&s<h;)for(y=0;y<(h-s)*o;y+=o)for(x=0;x<o-s*2;q+=!n,x+=2)for(n=i=0,t=x,u=y;i<=s;t+=2,u+=o,i++)n=n|i<s&(!k(t+y,o,1)|!k(x+u,2,2))|i>0&(!k(t+y,o,4)|!k(x+u,2,8));})(-~z.search`
`)|q

console.log=(...x)=>O.textContent+=x+'\n'

// Less golfed

Uf=(h,z)=>{
  o=-~z.search`\n`;
  w=o/2;
  r=p=>" ),┌(─┐┬'└│├┘┴┤┼".search(z[p]);
  k=(p,d,m)=>r(p)&r(p+s*d)&m;
  for(q=s=0;++s<w&s<h;)
    for(y=0;y<(h-s)*o;y+=o)
      for(x=0;x<(w-s)*2;q+=!n,x+=2)
        for(n=i=0,t=x,u=y;i<=s;t+=2,u+=o,i++)
          n|=i<s&(!k(t+y,o,1)|!k(x+u,2,2))
          |i>0&(!k(t+y,o,4)|!k(x+u,2,8));
  return q
}

;[[5,`┌─┬───┬─┐
├─┼─┬─┼─┤
├─┼─┴─┼─┤
├─┼─┬─┼─┤
└─┴─┴─┴─┘`,20]
,[5,`┌─┬─┬─┬─┐
├─┼─┼─┼─┤
├─┼─┼─┼─┤
├─┼─┼─┼─┤
└─┴─┴─┴─┘`,30]
,[3,`┌─┬─┐
├─┼─┤
└─┴─┘`,5]
,[5,`┌─┬─┐
├─┴─┤
├───┤
├─┬─┤
└─┴─┘`,7]
,[4,`┌─┬─┬─┬─┬─┬─┐
├─┼─┼─┼─┼─┼─┤
├─┼─┼─┼─┼─┼─┤
└─┴─┴─┴─┴─┴─┘`,32]
,[2,`┌─┐
└─┘`,1]
,[4,`┌─┬─┬─┬─┬─┬─┐
├─┴─┼─┼─┼─┴─┤
├─┬─┼─┼─┼─┬─┤
└─┴─┴─┴─┴─┴─┘`,22],
,[6,`┌─┬─────┐
├─┼─┬─┐ │
│ ├─┼─┼─┤
│ └─┼─┼─┤
│   └─┼─┤
└─────┴─┘`,12],
,[6,`┌─┬─┬─┬─┐
├─┴─┼─┼─┤
│   └─┼─┤
├─┬─┬─┼─┤
├─┼─┼─┼─┤
└─┴─┴─┴─┘`,23]]
.forEach(t=>{
  var r=t[0],a=t[1],k=t[2],x=f(r,a)
  console.log(x==k?'OK '+x:'KO '+x+' Expected '+k,'\n'+a)
})

<pre id=O></pre>


问:
Showcase of Languages

Notes

This thread is open and unlocked only because the community decided to make an exception. Please do not use this question as evidence that you can ask similar questions here. Please do not create additional showcase questions.

This is no longer a popularity-contest, nor are snippet lengths limited by the vote tally. If you know this thread from before, please make sure you familiarize yourself with the changes.

This thread is dedicated to showing off interesting, useful, obscure, and/or unique features your favorite programming languages have to offer. This is neither a challenge nor a competition, but a collaboration effort to showcase as many programming languages as possible as well as possible.

How this works

All answers should include the name of the programming language at the top of the post, prefixed by a #.

Answers may contain one (and only one) factoid, i.e., a couple of sentences without code that describe the language.

Aside from the factoid, answers should consist of snippets of code, which can (but don't have to be) programs or functions.

The snippets do not need to be related. In fact, snippets that are too related may be redundant.

Since this is not a contest, all programming languages are welcome, whenever they were created.

Answers that contain more than a handful of code snippets should use a Stack Snippet to collapse everything except the factoid and one of the snippets.

Whenever possible, there should be only one answer per programming language. This is a community wiki, so feel free to add snippets to any answer, even if you haven't created it yourself. There is a Stack Snippet for compressing posts, which should mitigate the effect of the 30,000 character limit.

Answers that predate these guidelines should be edited. Please help updating them as needed.

Current answers, sorted alphabetically by language name

$.ajax({type:"GET",url:"https://api.stackexchange.com/2.2/questions/44680/answers?site=codegolf&filter=withbody",success:function(data){for(var i=0;i<data.items.length;i++){var temp=document.createElement('p');temp.innerHTML = data.items[i].body.split("\n")[0];$('#list').append('
' + temp.innerText || temp.textContent + '');}}})```
<pre class="snippet-code-html lang-html prettyprint-override"><code><script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script><base href="http://codegolf.stackexchange.com"><ul id="list"></ul></code>```

答:
CSS (Cascading Style Sheets)

Somebody's already done a CSS answer, but here's another one. I promise to make the one-char snippet exactly the same. :)

6 chars

```<code>:hover
</code>```

This is an example of a pseudo-class, which is basically the state of an element. The :hover pseudo-class applies when the element is being hovered over; some others are :active (mouse button down), :valid/:invalid (form/input is valid/invalid), and :target (element is target of current #hash-portion-of-url).

Pseudo-classes can also take arguments, for example :not(some-other-selector) and the :nth-child family: :nth-child, :nth-last-child, :nth-of-type, and :nth-last-of-type.

5 chars

```<code>--foo
</code>```

CSS variables, properly known as custom properties, function like variables in other languages, only a bit more

```<code>c
 a
  s
   c
    a
     d
      i
       n
        g
</code>```

to fit in better with the nature of CSS. Variables are used like this:

```<code>:root {
  --foo: goldenrod;
}

.some-element {
  background-color: var(--foo);
}

.another-element {
  background-color: lightgray;
  border: 3px solid var(--foo);
}
</code>```

and var(--foo) is replaced with the value of --foo.

However, because these variables are parsed at runtime, not as a compilation step in a preprocessor such as Sass or LESS, they can be used more dynamically. For example:

```<code>:root { --foo: red }
body:hover { --foo: blue }
p { color: var(--foo) }
</code>```

This will make the text in
 (paragraph) elements red, except when the  is hovered, in which case the text will turn blue.

4 chars

```<code>42cm
</code>```

As well as the px (pixels), em (relative to font size), rem (relative to font size of root element), vh (1/100 of viewport height), and vw (1/100 of viewport width) units, which are usually what you use, CSS also has physical units for cm, mm, and in.  The only problem is that they don't necessarily represent physical centimetres, millimetres, and inches, but (device-dependent) may be relative to the assumption that 1 inch = 96px. Anyway, it's usually better to use relative units like em and rem instead.

3 chars

```<code>-o-
</code>```

Browser prefixes allow browsers to implement WIP standards before they've been finalised. The idea is that if the spec changes, the old implementation's behind a prefix so the correct implementation can be done without the prefix. However, browsers are moving away from prefixes in favour of flags set by the user in the browser (chrome://flags in Chrome and about:config in Firefox), as prefixes have caused headaches when trying to ensure compatibility with old browsers.

The prefix shown above is for Opera (before it switched to using the Blink rendering engine); the other prefixes are:

-webkit- for WebKit/Blink (Chrome, Opera, Safari)

-moz- for Gecko (Firefox)

-ms- for that thing.

Prefixes are used like this:

```<code>.foo {
  -webkit-transform: rotateZ(30deg);
          transform: rotateZ(30deg);
}
</code>```

They can also be used on selectors and property values.

2 chars

```<code>//
</code>```

People ask why CSS doesn't have // comments. Well it does. Sort of.

In this blog post, Tab Atkins talks about using // comments in CSS. They don't function as line comments, but rather "next construct comments". This means that these are equivalent:

```<code>foo {
  color: white;
  // font-weight: bold;
  background-color: black;
}

// bar {
  width: 12rem;
}

// @keyframes baz {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
</code>```

and

```<code>--foo
</code>```0

There are also some weird tricks like using a @comment {  } block to simulate nested comments.

1 char

```<code>--foo
</code>```1

The star hack. Sample usage:

```<code>--foo
</code>```2

Factoid: some web servers originally served .css files as application/x-pointplus, to do with presentation software, instead of text/css.

Title: Showcase of Languages

Body:
CSS (Cascading Style Sheets)

Somebody's already done a CSS answer, but here's another one. I promise to make the one-char snippet exactly the same. :)

6 chars

:hover

This is an example of a pseudo-class, which is basically the state of an element. The :hover pseudo-class applies when the element is being hovered over; some others are :active (mouse button down), :valid/:invalid (form/input is valid/invalid), and :target (element is target of current #hash-portion-of-url).

Pseudo-classes can also take arguments, for example :not(some-other-selector) and the :nth-child family: :nth-child, :nth-last-child, :nth-of-type, and :nth-last-of-type.

5 chars

--foo

CSS variables, properly known as custom properties, function like variables in other languages, only a bit more

c
 a
  s
   c
    a
     d
      i
       n
        g

to fit in better with the nature of CSS. Variables are used like this:

:root {
  --foo: goldenrod;
}

.some-element {
  background-color: var(--foo);
}

.another-element {
  background-color: lightgray;
  border: 3px solid var(--foo);
}

and var(--foo) is replaced with the value of --foo.

However, because these variables are parsed at runtime, not as a compilation step in a preprocessor such as Sass or LESS, they can be used more dynamically. For example:

:root { --foo: red }
body:hover { --foo: blue }
p { color: var(--foo) }

This will make the text in <p> (paragraph) elements red, except when the <body> is hovered, in which case the text will turn blue.

4 chars

42cm

As well as the px (pixels), em (relative to font size), rem (relative to font size of root element), vh (1/100 of viewport height), and vw (1/100 of viewport width) units, which are usually what you use, CSS also has physical units for cm, mm, and in.  The only problem is that they don't necessarily represent physical centimetres, millimetres, and inches, but (device-dependent) may be relative to the assumption that 1 inch = 96px. Anyway, it's usually better to use relative units like em and rem instead.

3 chars

-o-

Browser prefixes allow browsers to implement WIP standards before they've been finalised. The idea is that if the spec changes, the old implementation's behind a prefix so the correct implementation can be done without the prefix. However, browsers are moving away from prefixes in favour of flags set by the user in the browser (chrome://flags in Chrome and about:config in Firefox), as prefixes have caused headaches when trying to ensure compatibility with old browsers.

The prefix shown above is for Opera (before it switched to using the Blink rendering engine); the other prefixes are:

-webkit- for WebKit/Blink (Chrome, Opera, Safari)

-moz- for Gecko (Firefox)

-ms- for that thing.

Prefixes are used like this:

.foo {
  -webkit-transform: rotateZ(30deg);
          transform: rotateZ(30deg);
}

They can also be used on selectors and property values.

2 chars

//

People ask why CSS doesn't have // comments. Well it does. Sort of.

In this blog post, Tab Atkins talks about using // comments in CSS. They don't function as line comments, but rather "next construct comments". This means that these are equivalent:

foo {
  color: white;
  // font-weight: bold;
  background-color: black;
}

// bar {
  width: 12rem;
}

// @keyframes baz {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

and

foo {
  color: white;
  /* font-weight: bold; */
  background-color: black;
}

/* bar {
  width: 12rem;
} */

/* @keyframes baz {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
} */

There are also some weird tricks like using a @comment {  } block to simulate nested comments.

1 char

*

The star hack. Sample usage:

.foo {
  background-color: lightgray; /* displayed by most browsers */
  *background-color: red; /* displayed by IE <= 7 */
}

Factoid: some web servers originally served .css files as application/x-pointplus, to do with presentation software, instead of text/css.


问:
List of first n prime numbers most efficiently and in shortest code
Rules are simple:

First n primes (not primes below n), should be printed to standard output separated by newlines (primes should be generated within the code)

primes cannot be generated by an inbuilt function or through a library, i.e. use of a inbuilt or library function such as, prime = get_nth_prime(n), is_a_prime(number), or factorlist = list_all_factors(number) won't be very creative.

Scoring - Say, we define Score = f([number of chars in the code]), O(f(n)) being the complexity of your algorithm where n is the number of primes it finds. So for example, if you have a 300 char code with O(n^2) complexity, score is 300^2 = 90000, for 300 chars with O(n*ln(n)), score becomes 300*5.7 = 1711.13 (let's assume all logs to be natural logs for simplicity)

Use any existing programming language, lowest score wins

Edit: Problem has been changed from finding 'first 1000000 primes' to 'first n primes' because of a confusion about what 'n' in O(f(n)) is, n is the number of primes you find (finding primes is the problem here and so complexity of the problem depends on the number of primes found)

Note: to clarify some confusions on complexity, if 'n' is the number of primes you find and 'N' is the nth prime found, complexity in terms of n is and N are not equivalent i.e. O(f(n)) != O(f(N)) as , f(N) != constant * f(n) and N != constant * n, because we know that nth prime function is not linear, I though since we were finding 'n' primes complexity should be easily expressible in terms of 'n'.

As pointed out by Kibbee, you can visit this site to verify your solutions (here, is the old google docs list)

Please Include these in your solution -

what complexity your program has (include basic analysis if not trivial)

character length of code

the final calculated score

This is my first CodeGolf Question so, if there is a mistake or loophole in above rules please do point them out.

答:
This is so easy even my text editor can do this!

Vim: 143 keystrokes (115 actions): O(n^2*log(n)): Score: 101485.21

Submission:

```<code>qpqqdqA^V^Ayyp<Esc>3h"aC@a<Esc>0C1<Esc>@"ddmpqdmd"bywo^Ra ^Rb 0 0 `pj@p ^Ra 0 ^R=@a%@b<Enter> `pdd@p 0 `dj@d<Esc>0*w*wyiWdd@0qqpmp"aywgg@dqgg@p
</code>```

Input: N should be on the first line of a blank document. After this is finished, each prime from 2 to N will be a separate line.

Running the Commands:

First, note that any commands with a caret in front of them mean you need to hold Ctrl and type the next letter (e.g. ^V is Ctrl-v and ^R is Ctrl-r).

This will overwrite anything in your @a, @b, @d, and @p registers.

Because this uses q commands, it can't just be placed in a macro. However, here are some tips for running it.

qpqqdq just clears registers

A^V^Ayyp<Esc>3h"aC@a<Esc>0C1<Esc>@"dd will create a list of numbers 2 to N+1. This is a break between the two main parts, so once this is done, you shouldn't need to do it again

mpqdmd"bywo^Ra ^Rb 0 0 `pj@p ^Ra 0 ^R=@a%@b<Enter> `pdd@p 0 `dj@d<Esc>0*w*wyiWdd@0qqpmp"aywgg@dqgg@p does need to be typed in one go. Try to avoid backspace as it may screw something up.

If you make a mistake, type qdqqpq then try this line again.

For large N, this is very slow. It took around 27 minutes to run N=5000; consider yourself warned.

Algorithm:

This uses a basic recursive algorithm for finding primes. Given a list of all primes between 1 and A, A+1 is prime if it not divisible by any of the numbers in the list of primes. Start at A = 2 and add primes to the list as they are found. After N recursions, the list will contain all the primes up to N.

Complexity

This algorithm has a complexity of O(nN), where N is the input number and n is the number of primes up to N. Each recursion tests n numbers, and N recursions are performed, giving O(nN).

However, N ~ n*log(n), giving the final complexity as O(n2*log(n))(https://en.wikipedia.org/wiki/Prime_number_theorem#Approximations_for_the_nth_prime_number)

Explanation

It's not easy to discern the program flow from the vim commands, so I rewrote it in Python following the same flow. Like the Vim code, the python code will error out when it reaches the end. Python doesn't like too much recursion; if you try this code with N > 150 or so, it will reach the max recursion depth

```<code>N = 20
primes = range(2, N+1)

# Python needs these defined.
mark_p = b = a = -1

# Check new number for factors.
# This macro could be wrapped up in @d, but it saves space to leave it separate.
def p():
    global mark_d, mark_p, primes, a
    mark_d = 0
    print(primes)
    a = primes[mark_p]
    d()

# Checks factor and determine what to do next
def d():
    global mark_d, mark_p, a, b, primes
    b = primes[mark_d]
    if(a == b): # Number is prime, check the next number
        mark_p += 1
        p()
    else:
        if(a%b == 0): # Number is not prime, delete it and check next number
            del(primes[mark_p])
            p()
        else: # Number might be prime, try next possible factor
            mark_d += 1
            d()

mark_p = 0 #Start at first number
p()
</code>```

Now, to break down the actual keystrokes!

qpqqdq Clears out the @d and @p registers. This will ensure nothing runs when setting up these recursive macros.

A^V^Ayyp<Esc>3h"aC@a<Esc>0C1<Esc>@"dd Turns the input into a list of numbers from 2 to N+1. The N+1 entry is deleted as a side effect of setting up the @d macro.

Specifically, writes a macro that increments a number, then copies it on the next line, then it writes a 1 and executes this macro N times.

mpqdmd"bywo^Ra ^Rb 0 0 `pj@p ^Ra 0 ^R=@a%@b<Enter> `pdd@p 0 `dj@d<Esc>0*w*wyiWdd@0q writes the @d macro, which implements the d() function above. "If" statements are interesting to implement in Vim. By using the search operator *, it's possible to choose a certain path to follow. Breaking the command down further we get

mpqd Set the p mark here and start recording the @d macro. The p mark needs to be set so there is a known point to jump to as this runs

o^Ra ^Rb 0 0 `pj@p ^Ra 0 ^R=@a%@b<Enter> `pdd@p 0 `dj@d<Esc> Writes the if/else statement text

0*w*wyiWdd@0 actually executes the if statement.

Before executing this command, the line will contain @a @b 0 0 `pj@p @a 0 (@a%@b) `pdd@p 0 `dj@d

0 moves the cursor to the beginning of the line

*w*w Moves the cursor to the code to execute next

if @a == @b, that is `pj@p, which moves to the next number for @a and runs @p on it.

if @a != @b and @a%@b == 0, that is `pdd@p, which deletes the current number @a, then runs @p on the next one.

if @a != @b and @a%%b != 0, that is `dj@d, which checks the next number for @b to see if it is a factor of @a

yiWdd@0 yanks the command into the 0 register, deletes the line and runs the command

q ends the recording of the @d macro

When this is first run, the `pdd@p command is run, deleting the N+1 line.

qpmp"aywgg@dq writes the @p macro, which saves the number under the cursor, then goes to the first entry and runs @d on that.

gg@p actually executes @p so that it will iterate over the whole file.

Body:
This is so easy even my text editor can do this!

Vim: 143 keystrokes (115 actions): O(n^2*log(n)): Score: 101485.21

Submission:

qpqqdqA^V^Ayyp<Esc>3h"aC@a<Esc>0C1<Esc>@"ddmpqdmd"bywo^Ra ^Rb 0 0 `pj@p ^Ra 0 ^R=@a%@b<Enter> `pdd@p 0 `dj@d<Esc>0*w*wyiWdd@0qqpmp"aywgg@dqgg@p

Input: N should be on the first line of a blank document. After this is finished, each prime from 2 to N will be a separate line.

Running the Commands:

First, note that any commands with a caret in front of them mean you need to hold Ctrl and type the next letter (e.g. ^V is Ctrl-v and ^R is Ctrl-r).

This will overwrite anything in your @a, @b, @d, and @p registers.

Because this uses q commands, it can't just be placed in a macro. However, here are some tips for running it.

qpqqdq just clears registers

A^V^Ayyp<Esc>3h"aC@a<Esc>0C1<Esc>@"dd will create a list of numbers 2 to N+1. This is a break between the two main parts, so once this is done, you shouldn't need to do it again

mpqdmd"bywo^Ra ^Rb 0 0 `pj@p ^Ra 0 ^R=@a%@b<Enter> `pdd@p 0 `dj@d<Esc>0*w*wyiWdd@0qqpmp"aywgg@dqgg@p does need to be typed in one go. Try to avoid backspace as it may screw something up.

If you make a mistake, type qdqqpq then try this line again.

For large N, this is very slow. It took around 27 minutes to run N=5000; consider yourself warned.

Algorithm:

This uses a basic recursive algorithm for finding primes. Given a list of all primes between 1 and A, A+1 is prime if it not divisible by any of the numbers in the list of primes. Start at A = 2 and add primes to the list as they are found. After N recursions, the list will contain all the primes up to N.

Complexity

This algorithm has a complexity of O(nN), where N is the input number and n is the number of primes up to N. Each recursion tests n numbers, and N recursions are performed, giving O(nN).

However, N ~ n*log(n), giving the final complexity as O(n2*log(n))(https://en.wikipedia.org/wiki/Prime_number_theorem#Approximations_for_the_nth_prime_number)

Explanation

It's not easy to discern the program flow from the vim commands, so I rewrote it in Python following the same flow. Like the Vim code, the python code will error out when it reaches the end. Python doesn't like too much recursion; if you try this code with N > 150 or so, it will reach the max recursion depth

N = 20
primes = range(2, N+1)

# Python needs these defined.
mark_p = b = a = -1

# Check new number for factors.
# This macro could be wrapped up in @d, but it saves space to leave it separate.
def p():
    global mark_d, mark_p, primes, a
    mark_d = 0
    print(primes)
    a = primes[mark_p]
    d()

# Checks factor and determine what to do next
def d():
    global mark_d, mark_p, a, b, primes
    b = primes[mark_d]
    if(a == b): # Number is prime, check the next number
        mark_p += 1
        p()
    else:
        if(a%b == 0): # Number is not prime, delete it and check next number
            del(primes[mark_p])
            p()
        else: # Number might be prime, try next possible factor
            mark_d += 1
            d()

mark_p = 0 #Start at first number
p()

Now, to break down the actual keystrokes!

qpqqdq Clears out the @d and @p registers. This will ensure nothing runs when setting up these recursive macros.

A^V^Ayyp<Esc>3h"aC@a<Esc>0C1<Esc>@"dd Turns the input into a list of numbers from 2 to N+1. The N+1 entry is deleted as a side effect of setting up the @d macro.

Specifically, writes a macro that increments a number, then copies it on the next line, then it writes a 1 and executes this macro N times.

mpqdmd"bywo^Ra ^Rb 0 0 `pj@p ^Ra 0 ^R=@a%@b<Enter> `pdd@p 0 `dj@d<Esc>0*w*wyiWdd@0q writes the @d macro, which implements the d() function above. "If" statements are interesting to implement in Vim. By using the search operator *, it's possible to choose a certain path to follow. Breaking the command down further we get

mpqd Set the p mark here and start recording the @d macro. The p mark needs to be set so there is a known point to jump to as this runs

o^Ra ^Rb 0 0 `pj@p ^Ra 0 ^R=@a%@b<Enter> `pdd@p 0 `dj@d<Esc> Writes the if/else statement text

0*w*wyiWdd@0 actually executes the if statement.

Before executing this command, the line will contain @a @b 0 0 `pj@p @a 0 (@a%@b) `pdd@p 0 `dj@d

0 moves the cursor to the beginning of the line

*w*w Moves the cursor to the code to execute next

if @a == @b, that is `pj@p, which moves to the next number for @a and runs @p on it.

if @a != @b and @a%@b == 0, that is `pdd@p, which deletes the current number @a, then runs @p on the next one.

if @a != @b and @a%%b != 0, that is `dj@d, which checks the next number for @b to see if it is a factor of @a

yiWdd@0 yanks the command into the 0 register, deletes the line and runs the command

q ends the recording of the @d macro

When this is first run, the `pdd@p command is run, deleting the N+1 line.

qpmp"aywgg@dq writes the @p macro, which saves the number under the cursor, then goes to the first entry and runs @d on that.

gg@p actually executes @p so that it will iterate over the whole file.


答:
Tellurium, 5 bytes

```<code>[i|p]
</code>```

This is pretty simple to explain.
 It runs the command p (Does nothing, which is why it's good for this challenge) forever (i = infinity).

Title: Shortest infinite loop producing no output

Body:
Your task is to create the shortest infinite loop!

The point of this challenge is to create an infinite loop producing no output, unlike its possible duplicate. The reason to this is because the code might be shorter if no output is given.

Rules

Each submission must be a full program.

You must create the shortest infinite loop.

Even if your program runs out of memory eventually, it is still accepted as long as it is running the whole time from the start to when it runs out of memory. Also when it runs out of memory, it should still not print anything to STDERR.

The program must take no input (however, reading from a file is allowed), and should not print anything to STDOUT. Output to a file is also forbidden.

The program must not write anything to STDERR.

Feel free to use a language (or language version) even if it's newer than this challenge.
-Note that there must be an interpreter so the submission can be tested. It is allowed (and even encouraged) to write this interpreter yourself for a previously unimplemented language. :D

Submissions are scored in bytes, in an appropriate (pre-existing) encoding, usually (but not necessarily) UTF-8. Some languages, like Folders, are a bit tricky to score - if in doubt, please ask on Meta.

This is not about finding the language with the shortest infinite loop program. This is about finding the shortest infinite loop program in every language. Therefore, I will not accept an answer.

If your language of choice is a trivial variant of another (potentially more popular) language which already has an answer (think BASIC or SQL dialects, Unix shells or trivial Brainf**k-derivatives like Alphuck), consider adding a note to the existing answer that the same or a very similar solution is also the shortest in the other language.

There should be a website such as Wikipedia, Esolangs, or GitHub for the language. For example, if the language is CJam, then one could link to the site in the header like #[CJam](http://sourceforge.net/p/cjam/wiki/Home/), X bytes.

Standard loopholes are not allowed.

(I have taken some of these rules from Martin Büttner's "Hello World" challenge)

Please feel free to post in the comments to tell me how this challenge could be  improved.

Catalogue

This is a Stack Snippet which generates both an alphabetical catalogue of the used languages, and an overall leaderboard. To make sure your answer shows up, please start it with this Markdown header:

```<code># Language name, X bytes
</code>```

Obviously replacing Language name and X bytes with the proper items. If you want to link to the languages' website, use this template, as posted above:

```<code>#[Language name](http://link.to/the/language), X bytes
</code>```

Now, finally, here's the snippet: (Try pressing "Full page" for a better view.)

var QUESTION_ID=59347;var ANSWER_FILTER="!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe";var COMMENT_FILTER="!)Q2B_A2kjfAiU78X(md6BoYk";var OVERRIDE_USER=41805;var answers=[],answers_hash,answer_ids,answer_page=1,more_answers=true,comment_page;function answersUrl(index){return"//api.stackexchange.com/2.2/questions/"+QUESTION_ID+"/answers?page="+index+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+ANSWER_FILTER}function commentUrl(index,answers){return"//api.stackexchange.com/2.2/answers/"+answers.join(';')+"/comments?page="+index+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+COMMENT_FILTER}function getAnswers(){jQuery.ajax({url:answersUrl(answer_page++),method:"get",dataType:"jsonp",crossDomain:true,success:function(data){answers.push.apply(answers,data.items);answers_hash=[];answer_ids=[];data.items.forEach(function(a){a.comments=[];var id=+a.share_link.match(/\d+/);answer_ids.push(id);answers_hash[id]=a});if(!data.has_more)more_answers=false;comment_page=1;getComments()}})}function getComments(){jQuery.ajax({url:commentUrl(comment_page++,answer_ids),method:"get",dataType:"jsonp",crossDomain:true,success:function(data){data.items.forEach(function(c){if(c.owner.user_id===OVERRIDE_USER)answers_hash[c.post_id].comments.push(c)});if(data.has_more)getComments();else if(more_answers)getAnswers();else process()}})}getAnswers();var SCORE_REG=/<h\d>\s*([^\n,<]*(?:<(?:[^\n>]*>[^\n<]*<\/[^\n>]*>)[^\n,<]*)*),.*?(\d+)(?=[^\n\d<>]*(?:<(?:s>[^\n<>]*<\/s>|[^\n<>]+>)[^\n\d<>]*)*<\/h\d>)/;var OVERRIDE_REG=/^Override\s*header:\s*/i;function getAuthorName(a){return a.owner.display_name}function process(){var valid=[];answers.forEach(function(a){var body=a.body;a.comments.forEach(function(c){if(OVERRIDE_REG.test(c.body))body='
'+c.body.replace(OVERRIDE_REG,'')+'
'});var match=body.match(SCORE_REG);if(match)valid.push({user:getAuthorName(a),size:+match[2],language:match[1],link:a.share_link,});else console.log(body)});valid.sort(function(a,b){var aB=a.size,bB=b.size;return aB-bB});var languages={};var place=1;var lastSize=null;var lastPlace=1;valid.forEach(function(a){if(a.size!=lastSize)lastPlace=place;lastSize=a.size;++place;var answer=jQuery("#answer-template").html();answer=answer.replace("{{PLACE}}",lastPlace+".").replace("{{NAME}}",a.user).replace("{{LANGUAGE}}",a.language).replace("{{SIZE}}",a.size).replace("{{LINK}}",a.link);answer=jQuery(answer);jQuery("#answers").append(answer);var lang=a.language;lang=jQuery(''+lang+'').text();languages[lang]=languages[lang]||{lang:a.language,lang_raw:lang,user:a.user,size:a.size,link:a.link}});var langs=[];for(var lang in languages)if(languages.hasOwnProperty(lang))langs.push(languages[lang]);langs.sort(function(a,b){if(a.lang_raw.toLowerCase()>b.lang_raw.toLowerCase())return 1;if(a.lang_raw.toLowerCase()<b.lang_raw.toLowerCase())return-1;return 0});for(var i=0;i<langs.length;++i){var language=jQuery("#language-template").html();var lang=langs[i];language=language.replace("{{LANGUAGE}}",lang.lang).replace("{{NAME}}",lang.user).replace("{{SIZE}}",lang.size).replace("{{LINK}}",lang.link);language=jQuery(language);jQuery("#languages").append(language)}}```
<pre class="snippet-code-css lang-css prettyprint-override"><code>body{text-align:left!important}#answer-list{padding:10px;width:500px;float:left}#language-list{padding:10px;padding-right:40px;width:500px;float:left}table thead{font-weight:700}table td{padding:5px}</code>```

 <link rel="stylesheet" type="text/css" href="//cdn.sstatic.net/codegolf/all.css?v=83c949450c8b">

Shortest Solution by Language

Language	User	Score

Leaderboard

	Author	Language	Size

{{PLACE}}	{{NAME}}	{{LANGUAGE}}	{{SIZE}}	Link

{{LANGUAGE}}	{{NAME}}	{{SIZE}}	Link

```

Body:
Tellurium, 5 bytes

[i|p]

This is pretty simple to explain.
 It runs the command p (Does nothing, which is why it's good for this challenge) forever (i = infinity).


问:
Contaminated Squares

Introduction

Let's observe the following square, consisting only of the digits 0 - 9:

```<code>1034
4167
8414
3542
</code>```

The outer shell of this square is:

```<code>1034
4  7
8  4
3542
</code>```

It contains zeros, so we need to peel off the outer shell, leaving:

```<code>16
41
</code>```

The outer shell of this square is:

```<code>16
41
</code>```

It does not contain any zeros and is therefore a non-contaminated square. So basically, the definition of a non-contaminated square is when the outer shell of the square contains no zeros.

The Task

Given a square of digits (containing only non-negative integers) in any reasonable format, output the largest non-contaminated square by constantly peeling off the outer shell, in any reasonable format.

Test cases

Test case 1:

```<code>Input         Output

1234          1234
2345          2345
3456          3456
4567          4567
</code>```

Test case 2:

```<code>Input         Output

123           123
204           204
346           346
</code>```

Test case 3:

```<code>Input         Output

101           1
010
101
</code>```

Test case 4:

```<code>Input         Output

000           (none)
000
000
</code>```

This is code-golf, so the submission with the least amount of bytes wins!

答:
Pyth, <s>31</s> 30 bytes

```<code>L+hbeb.W!*F+1iRTs+yHyMHPtmPtdZ
</code>```

Test suite. (The last testcase errors)

Improvement: made part the outer-loop extractor a function (L+hbeb).

Previous 31-byte version:

```<code>.W!*F+1iRTs++hHm+hdedHeHPtmPtdZ
</code>```

How it works:

The code is basically: while the product of the outershell is zero, peel it.

Let us analyze the main code (Q is implicit here):

```<code>.W<lambda:H><lambda:Z>Q
</code>```

Start from Q (input), while first lambda, perform second lambda.

The first part would be the lambda in H:

```<code>!*F+1iRTs++hHm+hdedHeH
</code>```

The second part would be the lambda in Z:

```<code>PtmPtdZ
</code>```

The first part

```<code>!*F+1iRTs++hHm+hdedHeH
</code>```

Let us analyze this:

```<code>s++hHm+hdedHeH

s++             Concatenate:
   hH              1. the first row
     m+hdedH       2. the first and last item of each row
            eH     3. the last row
</code>```

Since Pyth uses prefix notation, this would then get evaluated:

```<code>!*F+1iRT

     iRT  Convert each to integer
 *F+1     Product
!         Negate. If any element of the outer shell is zero, this would return 1.
</code>```

The second part

```<code>PtmPtdZ
  mPtdZ   the inner of each row
Pt        the inner rows
</code>```

Title: Contaminated Squares

Body:
Pyth, <s>31</s> 30 bytes

L+hbeb.W!*F+1iRTs+yHyMHPtmPtdZ

Test suite. (The last testcase errors)

Improvement: made part the outer-loop extractor a function (L+hbeb).

Previous 31-byte version:

.W!*F+1iRTs++hHm+hdedHeHPtmPtdZ

How it works:

The code is basically: while the product of the outershell is zero, peel it.

Let us analyze the main code (Q is implicit here):

.W<lambda:H><lambda:Z>Q

Start from Q (input), while first lambda, perform second lambda.

The first part would be the lambda in H:

!*F+1iRTs++hHm+hdedHeH

The second part would be the lambda in Z:

PtmPtdZ

The first part

!*F+1iRTs++hHm+hdedHeH

Let us analyze this:

s++hHm+hdedHeH

s++             Concatenate:
   hH              1. the first row
     m+hdedH       2. the first and last item of each row
            eH     3. the last row

Since Pyth uses prefix notation, this would then get evaluated:

!*F+1iRT

     iRT  Convert each to integer
 *F+1     Product
!         Negate. If any element of the outer shell is zero, this would return 1.

The second part

PtmPtdZ
  mPtdZ   the inner of each row
Pt        the inner rows


问:
Print the AdamN tile
Adam7 is an interlacing algorithm for raster images, such as PNG. It is called the "Adam7" algorithm because it was invented by Adam M. Costello, and it is generated by following a certain pattern 7 times. One of the cool things about the Adam7 algorithm that makes it really fun for code golf, is that the pattern can be repeated an arbitrary number of times, as long as it's odd. Back when 1996 when the PNG standard was developed, using only 7 iterations was seen as sufficient, since the 9 iterations was too complex, and 5 iterations is not as efficient.

Here is the first iteration of the tile:

```<code>a
</code>```

Pretty simple. This is an "Adam1" tile. Here's how we get to the next iteration, the "Adam3" tile.

Since our last tile was 1x1, we double the height and width, and the next one will be 2x2. First, we start with an 'a' in the upper left corner.

```<code>a-
--
</code>```

Step 2, copy this pattern to the right, and increase the letter we're on by one.

```<code>ab
--
</code>```

Step 3, same as step 2, but copy down instead of right.

```<code>ab
cc
</code>```

Boom. The "Adam3" tile. Let's do the "Adam5" also, so you can actually see how the algorithm works. This tile will, again, be twice as large, so 4x4. Again, we start with a a in the upper left corner:

```<code>a---
----
----
----
</code>```

Double this pattern, increase the letter, and move it to the right:

```<code>a-b-
----
----
----
</code>```

Again, this time down.

```<code>a-b-
----
c-c-
----
</code>```

Again, this time to the right.

```<code>adbd
----
cdcd
----
</code>```

Again, this time down.

```<code>adbd
eeee
cdcd
eeee
</code>```

This is the "Adam5" tile. Here is the ASCII representation of the Adam7 tile:

```<code>afdfbfdf
gggggggg
efefefef
gggggggg
cfdfcfdf
gggggggg
efefefef
gggggggg
</code>```

And while we're at it, here is a fun animation of each step of the Adam7 tile (although it does several tiles side by side):

The challenge

Given a positive odd number N, output the "AdamN" tile. You can use any default method of IO. Since we're using the alphabet in lieu of numbers, you only need to handle inputs up to 25. You can choose to output lower-case or upper-case characters as long as you specify and it's consistent.

Sample IO

1:

```<code>a-
--
</code>```0

3:

```<code>a-
--
</code>```1

5:

```<code>a-
--
</code>```2

7:

```<code>afdfbfdf
gggggggg
efefefef
gggggggg
cfdfcfdf
gggggggg
efefefef
gggggggg
</code>```

9:

```<code>ahfhdhfhbhfhdhfh
iiiiiiiiiiiiiiii
ghghghghghghghgh
iiiiiiiiiiiiiiii
ehfhehfhehfhehfh
iiiiiiiiiiiiiiii
ghghghghghghghgh
iiiiiiiiiiiiiiii
chfhdhfhchfhdhfh
iiiiiiiiiiiiiiii
ghghghghghghghgh
iiiiiiiiiiiiiiii
ehfhehfhehfhehfh
iiiiiiiiiiiiiiii
ghghghghghghghgh
iiiiiiiiiiiiiiii
</code>```

As usual, this is code-golf, so standard loopholes apply, and shortest answer in bytes wins!

答:
MATL, 23 bytes

```<code>97tiq:+"TFX*tXa~@wZ(!]c
</code>```

Try it online!

This uses repeated Kronecker tensor product for extending the array, followed by transposition. At each iteration, new columns containing zeros are interleaved with the old; those zeros are then replaced by the appropriate new value (which increases at each iteration); and the matrix is transposed.

(One byte wasted because Octave's Kronecker product doesn't allow char input. This will be fixed for next release).

EXplanation

```<code>97       % Push 97 (ASCII for 'a')
t        % Duplicate
iq:      % Take input n. Range [1 2 ... n-1]
+        % Add. Gives [98 99 ... 97+n-1] (letters to be filled)
"        % For each
  TFX*   %   Kronecker product with [1 0]. This interleaves new columns with zeros
  tXa~   %   Duplicate. Logical index for the new columns
  @wZ(   %   Assign letter to those columns
  !      %   Transpose (zip)
]        % End if
c        % Convert to chat. Implicitly display
</code>```

Title: Print the AdamN tile

Body:
MATL, 23 bytes

97tiq:+"TFX*tXa~@wZ(!]c

Try it online!

This uses repeated Kronecker tensor product for extending the array, followed by transposition. At each iteration, new columns containing zeros are interleaved with the old; those zeros are then replaced by the appropriate new value (which increases at each iteration); and the matrix is transposed.

(One byte wasted because Octave's Kronecker product doesn't allow char input. This will be fixed for next release).

EXplanation

97       % Push 97 (ASCII for 'a')
t        % Duplicate
iq:      % Take input n. Range [1 2 ... n-1]
+        % Add. Gives [98 99 ... 97+n-1] (letters to be filled)
"        % For each
  TFX*   %   Kronecker product with [1 0]. This interleaves new columns with zeros
  tXa~   %   Duplicate. Logical index for the new columns
  @wZ(   %   Assign letter to those columns
  !      %   Transpose (zip)
]        % End if
c        % Convert to chat. Implicitly display


答:
Jelly, <s>19</s> 16 bytes

```<code>Fœ^F}P
ḊṖZµ⁺⁸ßç?
</code>```

Try it online! or verify all test cases.

How it works

```<code>ḊṖZµ⁺⁸ßç?  Main link. Argument: M (2D list)

Ḋ          Dequeue; remove the first row.
 Ṗ         Pop; remove the last row.
  Z        Zip; transpose rows with columns.
   µ       Combine the chain to the left into a link.
    ⁺      Copy the link, executing it twice.
           The copy removes the first and last column and restores the orientation.
       ç?  If the helper link returns a non-zero integer:
     ⁸       Return M unmodified.
      ß      Else, recursively call the main link on the "peeled" M.

Fœ^F}P     Helper link. Arguments: P ("peeled" M), M (unmodified)

F          Flatten P.
   F}      Flatten M.
 œ^        Perform multiset symmetric difference, removing the elements of P from
           the elements of M, respecting multiplicities, leaving precisely the
           elements of the outer shell.
     P     Return the product of the remaining elements.
</code>```

Title: Contaminated Squares

Body:
Introduction

Let's observe the following square, consisting only of the digits 0 - 9:

```<code>1034
4167
8414
3542
</code>```

The outer shell of this square is:

```<code>1034
4  7
8  4
3542
</code>```

It contains zeros, so we need to peel off the outer shell, leaving:

```<code>16
41
</code>```

The outer shell of this square is:

```<code>16
41
</code>```

It does not contain any zeros and is therefore a non-contaminated square. So basically, the definition of a non-contaminated square is when the outer shell of the square contains no zeros.

The Task

Given a square of digits (containing only non-negative integers) in any reasonable format, output the largest non-contaminated square by constantly peeling off the outer shell, in any reasonable format.

Test cases

Test case 1:

```<code>Input         Output

1234          1234
2345          2345
3456          3456
4567          4567
</code>```

Test case 2:

```<code>Input         Output

123           123
204           204
346           346
</code>```

Test case 3:

```<code>Input         Output

101           1
010
101
</code>```

Test case 4:

```<code>Input         Output

000           (none)
000
000
</code>```

This is code-golf, so the submission with the least amount of bytes wins!

Body:
Jelly, <s>19</s> 16 bytes

Fœ^F}P
ḊṖZµ⁺⁸ßç?

Try it online! or verify all test cases.

How it works

ḊṖZµ⁺⁸ßç?  Main link. Argument: M (2D list)

Ḋ          Dequeue; remove the first row.
 Ṗ         Pop; remove the last row.
  Z        Zip; transpose rows with columns.
   µ       Combine the chain to the left into a link.
    ⁺      Copy the link, executing it twice.
           The copy removes the first and last column and restores the orientation.
       ç?  If the helper link returns a non-zero integer:
     ⁸       Return M unmodified.
      ß      Else, recursively call the main link on the "peeled" M.

Fœ^F}P     Helper link. Arguments: P ("peeled" M), M (unmodified)

F          Flatten P.
   F}      Flatten M.
 œ^        Perform multiset symmetric difference, removing the elements of P from
           the elements of M, respecting multiplicities, leaving precisely the
           elements of the outer shell.
     P     Return the product of the remaining elements.


答:
MATL, <s>26</s> 21 bytes

```<code>t"t5LY)y5LZ)h?}6Lt3$)
</code>```

Input is in the following format

```<code>[1 0 3 4; 4 1 6 7; 8 4 1 4; 3 5 4 2]
</code>```

So the other four test cases are

```<code>[1 2 3 4; 2 3 4 5; 3 4 5 6; 4 5 6 7]
[1 0 1; 0 1 0; 1 0 1]
[1 2 3; 2 0 4; 3 4 6]
[0 0 0; 0 0 0; 0 0 0]
</code>```

The program errors in the last test case, but produces the correct output (which is nothing). Thanks to @Dennis for noticing!

Try it online!. Or verify all test cases (this includes wrapping code).

Explanation

This iterates as many times as the number of columns in the input matrix, which is more than enough. At each iteration, the shell is removed or kept depending on its values.

```<code>t            % Take a matrix as input. Duplicate
"            % For each column (i.e. repeat that many times)
  t5LY)      %   Duplicate top of the stack. Extract first and last rows
  y5LZ)      %   Duplicate the element below the top. Extract first and last columns
  h          %   Concatenate the two arrays into a row vector
  ?          %   If all its entries are non-zero: do nothing
  }          %   Else
    6Lt3$)   %     Get the central part
             % End if, end for. Implicitly display
</code>```

Title: Contaminated Squares

Body:
MATL, <s>26</s> 21 bytes

t"t5LY)y5LZ)h?}6Lt3$)

Input is in the following format

[1 0 3 4; 4 1 6 7; 8 4 1 4; 3 5 4 2]

So the other four test cases are

[1 2 3 4; 2 3 4 5; 3 4 5 6; 4 5 6 7]
[1 0 1; 0 1 0; 1 0 1]
[1 2 3; 2 0 4; 3 4 6]
[0 0 0; 0 0 0; 0 0 0]

The program errors in the last test case, but produces the correct output (which is nothing). Thanks to @Dennis for noticing!

Try it online!. Or verify all test cases (this includes wrapping code).

Explanation

This iterates as many times as the number of columns in the input matrix, which is more than enough. At each iteration, the shell is removed or kept depending on its values.

t            % Take a matrix as input. Duplicate
"            % For each column (i.e. repeat that many times)
  t5LY)      %   Duplicate top of the stack. Extract first and last rows
  y5LZ)      %   Duplicate the element below the top. Extract first and last columns
  h          %   Concatenate the two arrays into a row vector
  ?          %   If all its entries are non-zero: do nothing
  }          %   Else
    6Lt3$)   %     Get the central part
             % End if, end for. Implicitly display


答:
JavaScript, <s>105</s> 97 bytes

Saved 8 bytes thanks to @Patrick Roberts!

```<code>l=a=>a.slice(1,-1)
p=a=>l(a).map(l)
c=a=>a.join``.replace(/[^0]/g,"")
s=a=>c(p(a))<c(a)?s(p(a)):a
</code>```

Defines function s, which returns a 2D array of integers when provided a 2D array of integers as input.

How it Works

function l: given an array a, returns a copy without its first and last indexes.

function p: given a 2D array a, calls l to remove the first and last row, then for each remaining row calls l to remove the fist and last column. This performs the onion peeling.

function c: given a 2D array a, returns a string that only contains the 0s in the stringified form of a.

function s: given a 2D array a, calls c on the peeled form of the array given by p, and on the array itself. Compares these strings lexicographically to determine if the peeled form has less 0s than the original. If it does, then the original is contaminated, so call s recursively on the peeled form. Otherwise return the original.

Title: Contaminated Squares

Body:
JavaScript, <s>105</s> 97 bytes

Saved 8 bytes thanks to @Patrick Roberts!

l=a=>a.slice(1,-1)
p=a=>l(a).map(l)
c=a=>a.join``.replace(/[^0]/g,"")
s=a=>c(p(a))<c(a)?s(p(a)):a

Defines function s, which returns a 2D array of integers when provided a 2D array of integers as input.

How it Works

function l: given an array a, returns a copy without its first and last indexes.

function p: given a 2D array a, calls l to remove the first and last row, then for each remaining row calls l to remove the fist and last column. This performs the onion peeling.

function c: given a 2D array a, returns a string that only contains the 0s in the stringified form of a.

function s: given a 2D array a, calls c on the peeled form of the array given by p, and on the array itself. Compares these strings lexicographically to determine if the peeled form has less 0s than the original. If it does, then the original is contaminated, so call s recursively on the peeled form. Otherwise return the original.


问:
Shortest code for infinite disk I/O
(Just open 50 tabs in Google Chrome :D (just kidding, no you can't))

Shortest code for infinite disk I/O any language, C# example:

using System.IO;

namespace FileApp {
    static class Program {
        public static void Main() {
            do {
                File.WriteAllText("a", "a");
                File.Delete("a");
            } while (true);
        }
    }
}
```

You can't just fill the entire disk though, as then it would halt in the end and would be finite.

And you can't do reading only, infinite writing has to happen. (It has to kill my SSD after enough runtime.)

Get cracking! :)

答:
C99, 84 bytes

```<code>#include<stdio.h>
int main(){while(1){FILE*f=fopen("a","w");fputc(9,f);fclose(f);};}
</code>```

If you don't care about buffers, you can do this instead:

C99, 65 bytes

```<code>#include<stdio.h>
int main(){while(1){fputc(9,fopen("a","w"));};}
</code>```

I don't know if it closes automatically (no file handle), so please comment and I'll edit.

Lots of \ts to write (relax, they're not infinite!).

Title: Shortest code for infinite disk I/O

Body:
C99, 84 bytes

#include<stdio.h>
int main(){while(1){FILE*f=fopen("a","w");fputc(9,f);fclose(f);};}

If you don't care about buffers, you can do this instead:

C99, 65 bytes

#include<stdio.h>
int main(){while(1){fputc(9,fopen("a","w"));};}

I don't know if it closes automatically (no file handle), so please comment and I'll edit.

Lots of \ts to write (relax, they're not infinite!).


答:
Retina, <s>60</s> 57 bytes

Byte count assumes ISO 8859-1 encoding. The trailing linefeed is significant.

```<code>+`(?<=(?=.*0|[^_]+(¶0|0¶|0.*$))^[^_]*)(^.+¶|¶.+$|.?\b.?)

</code>```

Try it online!

Explanation

Due to the trailing linefeed, this finds all matches of the regex after the ` and removes them from the input. Due to the leading + this is done repeatedly until the output stops changing (which will be because the regex will stop matching).

As for the regex itself, it consists of two parts:

```<code>(?<=(?=.*0|[^_]+(¶0|0¶|0.*$))^[^_]*)
</code>```

This part checks whether there's a 0 anywhere in the outer shell. It does this by moving the regex engine's "cursor" to the beginning of the string with a lookbehind (we use [^_] to match both digits and linefeeds):

```<code>(?<=...^[^_]*)
</code>```

And then from that position we use a lookahead to find a 0 either in the first line, adjacent to a linefeed, or in the last line:

```<code>(?=.*0|[^_]+(¶0|0¶|0.*$))
</code>```

Then the actual match will consist either of the first line (including its trailing linefeed), the last line (including its leading linefeed) or the first or last character of a line, where we abuse the word boundary \b as a beginning/end of line anchor:

```<code>(^.+¶|¶.+$|.?\b.?)
</code>```

Title: Contaminated Squares

Body:
Retina, <s>60</s> 57 bytes

Byte count assumes ISO 8859-1 encoding. The trailing linefeed is significant.

+`(?<=(?=.*0|[^_]+(¶0|0¶|0.*$))^[^_]*)(^.+¶|¶.+$|.?\b.?)

Try it online!

Explanation

Due to the trailing linefeed, this finds all matches of the regex after the ` and removes them from the input. Due to the leading + this is done repeatedly until the output stops changing (which will be because the regex will stop matching).

As for the regex itself, it consists of two parts:

(?<=(?=.*0|[^_]+(¶0|0¶|0.*$))^[^_]*)

This part checks whether there's a 0 anywhere in the outer shell. It does this by moving the regex engine's "cursor" to the beginning of the string with a lookbehind (we use [^_] to match both digits and linefeeds):

(?<=...^[^_]*)

And then from that position we use a lookahead to find a 0 either in the first line, adjacent to a linefeed, or in the last line:

(?=.*0|[^_]+(¶0|0¶|0.*$))

Then the actual match will consist either of the first line (including its trailing linefeed), the last line (including its leading linefeed) or the first or last character of a line, where we abuse the word boundary \b as a beginning/end of line anchor:

(^.+¶|¶.+$|.?\b.?)


答:
Mathematica, 78 bytes

```<code>NestWhile[#[[a=2;;-2,a]]&,#,Count[{#[[b={1,-1}]],#[[;;,b]]},0,3]>0&]~Check~{}&
</code>```

Anonymous function, takes input as a matrix. Ignore any errors that may result during execution.

Title: Contaminated Squares

Body:
Mathematica, 78 bytes

NestWhile[#[[a=2;;-2,a]]&,#,Count[{#[[b={1,-1}]],#[[;;,b]]},0,3]>0&]~Check~{}&

Anonymous function, takes input as a matrix. Ignore any errors that may result during execution.


问:
Golf Text into DNA

Text to DNA golf

Challenge

Convert input into a DNA output.

Algorithm

Convert text into ASCII code points (e.g. codegolf -> [99, 111, 100, 101, 103, 111, 108, 102])

String the ASCII codes together (e.g. 99111100101103111108102)

Convert to binary (e.g. 10100111111001101001011010001000011001101011011110000110010111111011000000110)

Pad 0s onto the end to make an even number of characters (e.g. 101001111110011010010110100010000110011010110111100001100101111110110000001100)

Replace 00 with A, 01 with C, 10 with G, and 11 with T (e.g. GGCTTGCGGCCGGAGACGCGGTCTGACGCCTTGTAAATA)

Output

Test Cases

```<code>codegolf > GGCTTGCGGCCGGAGACGCGGTCTGACGCCTTGTAAATA
ppcg > GGCTAATTGTCGCACTT
} > TTGG (padding)
</code>```

Specifications

This is code-golf

Your program must accept spaces in input.

Your program must work for codegolf.

答:
Javascript ES7, <s>105</s> 103 bytes

```<code>s=>((+[for(c of s)c.charCodeAt()].join``).toString(2)+'0').match(/../g).map(x=>"ACGT"['0b'+x-0]).join``
</code>```

The ES7 part is the for(c of s) part.

ES6 version, <s>107</s> 105 bytes

```<code>s=>((+[...s].map(c=>c.charCodeAt()).join``).toString(2)+'0').match(/../g).map(x=>"ACGT"['0b'+x-0]).join``
</code>```

Ungolfed code

```<code>dna = (str)=>{
  var codes = +[for(c of str)c.charCodeAt()].join``;
  var binaries = (codes.toString(2)+'0').match(/../g);
  return binaries.map(x=>"ACGT"['0b'+x-0]).join``
}
</code>```

This is my first try at golfing on PPCG, feel free to correct me if something's wrong.

Thanks @AlexA for the small improvement.

Title: Golf Text into DNA

Body:
Javascript ES7, <s>105</s> 103 bytes

s=>((+[for(c of s)c.charCodeAt()].join``).toString(2)+'0').match(/../g).map(x=>"ACGT"['0b'+x-0]).join``

The ES7 part is the for(c of s) part.

ES6 version, <s>107</s> 105 bytes

s=>((+[...s].map(c=>c.charCodeAt()).join``).toString(2)+'0').match(/../g).map(x=>"ACGT"['0b'+x-0]).join``

Ungolfed code

dna = (str)=>{
  var codes = +[for(c of str)c.charCodeAt()].join``;
  var binaries = (codes.toString(2)+'0').match(/../g);
  return binaries.map(x=>"ACGT"['0b'+x-0]).join``
}

This is my first try at golfing on PPCG, feel free to correct me if something's wrong.

Thanks @AlexA for the small improvement.


Title: Print the AdamN tile

Body:
Adam7 is an interlacing algorithm for raster images, such as PNG. It is called the "Adam7" algorithm because it was invented by Adam M. Costello, and it is generated by following a certain pattern 7 times. One of the cool things about the Adam7 algorithm that makes it really fun for code golf, is that the pattern can be repeated an arbitrary number of times, as long as it's odd. Back when 1996 when the PNG standard was developed, using only 7 iterations was seen as sufficient, since the 9 iterations was too complex, and 5 iterations is not as efficient.

Here is the first iteration of the tile:

```<code>a
</code>```

Pretty simple. This is an "Adam1" tile. Here's how we get to the next iteration, the "Adam3" tile.

Since our last tile was 1x1, we double the height and width, and the next one will be 2x2. First, we start with an 'a' in the upper left corner.

```<code>a-
--
</code>```

Step 2, copy this pattern to the right, and increase the letter we're on by one.

```<code>ab
--
</code>```

Step 3, same as step 2, but copy down instead of right.

```<code>ab
cc
</code>```

Boom. The "Adam3" tile. Let's do the "Adam5" also, so you can actually see how the algorithm works. This tile will, again, be twice as large, so 4x4. Again, we start with a a in the upper left corner:

```<code>a---
----
----
----
</code>```

Double this pattern, increase the letter, and move it to the right:

```<code>a-b-
----
----
----
</code>```

Again, this time down.

```<code>a-b-
----
c-c-
----
</code>```

Again, this time to the right.

```<code>adbd
----
cdcd
----
</code>```

Again, this time down.

```<code>adbd
eeee
cdcd
eeee
</code>```

This is the "Adam5" tile. Here is the ASCII representation of the Adam7 tile:

```<code>afdfbfdf
gggggggg
efefefef
gggggggg
cfdfcfdf
gggggggg
efefefef
gggggggg
</code>```

And while we're at it, here is a fun animation of each step of the Adam7 tile (although it does several tiles side by side):

The challenge

Given a positive odd number N, output the "AdamN" tile. You can use any default method of IO. Since we're using the alphabet in lieu of numbers, you only need to handle inputs up to 25. You can choose to output lower-case or upper-case characters as long as you specify and it's consistent.

Sample IO

1:

```<code>a-
--
</code>```0

3:

```<code>a-
--
</code>```1

5:

```<code>a-
--
</code>```2

7:

```<code>afdfbfdf
gggggggg
efefefef
gggggggg
cfdfcfdf
gggggggg
efefefef
gggggggg
</code>```

9:

```<code>ahfhdhfhbhfhdhfh
iiiiiiiiiiiiiiii
ghghghghghghghgh
iiiiiiiiiiiiiiii
ehfhehfhehfhehfh
iiiiiiiiiiiiiiii
ghghghghghghghgh
iiiiiiiiiiiiiiii
chfhdhfhchfhdhfh
iiiiiiiiiiiiiiii
ghghghghghghghgh
iiiiiiiiiiiiiiii
ehfhehfhehfhehfh
iiiiiiiiiiiiiiii
ghghghghghghghgh
iiiiiiiiiiiiiiii
</code>```

As usual, this is code-golf, so standard loopholes apply, and shortest answer in bytes wins!

Body:
Perl, <s>110</s> <s>104</s> <s>100</s> <s>99</s> <s>91</s> <s>89</s> 87 + 1 (-p flag) = 88 bytes

#!perl -p
$==$_/2;$_=a.$/;$"=b;s/\w/$&.$"/ge,$"++,s/\n/$&.$"x2**$%.$&/ge,$"++until$=<++$%;$\=$_}{

Using:

> echo 5 | perl -pe '$==$_/2;$_=a.$/;$"=b;s/\w/$&.$"/ge,$"++,s/\n/$&.$"x2**$%.$&/ge,$"++until$=<++$%;$\=$_}{'

Ungolfed:

while (<>) {
# code above added by -p
    # $_ has input value
    # $/ = "\n" by default
    # $% = 0 by default
    my $n = $_ / 2;   # input
    my $s = "a" . $/; # "a\n"
    my $c = "b";      # "b"
    my $i = $%;       # 0
    while (++$i <= $n) {
        $s =~ s/(\w)/$1 . $c/ge;
        $c++;
        $s =~ s/(\n)/$1 . ($с x 2**$i) . $1/ge;
        $c++;
    }
    $\ = $s;
} {
# code below added by -p
    print;  # prints $_ (undef here) and $\
}

Ideone.


答:
Pyke, 29 bytes

```<code>"D3lt%sBR,"2*ER3*I
/)tOmtmOr;
</code>```

Try it here!

Also 29 bytes

```<code>QeQhQmhQme]4sBI
/)QtOmtmO=Qr;
</code>```

Try it here!

Title: Contaminated Squares

Body:
Pyke, 29 bytes

"D3lt%sBR,"2*ER3*I
/)tOmtmOr;

Try it here!

Also 29 bytes

QeQhQmhQme]4sBI
/)QtOmtmO=Qr;

Try it here!


答:
JavaScript (ES6), 74 bytes

```<code>f=s=>/^.*0|0\n|\n0|0.*$/.test(s)?f(s.replace(/^.*\n?|.(.*).|\n.*$/g,"$1")):s
</code>```

Takes input in the form of a string with newlines separating each row (but no leading or trailing newline). Explanation: /^.*0|0\n|\n0|0.*$/ is a regexp that matches contaminated squares, while /^.*\n?|.(.*).|\n.*$/ matches that parts of the square that need to be deleted, except for the (.*) which needs to be kept. (This is shorter than looking ahead or behind for the newline character.)

Title: Contaminated Squares

Body:
JavaScript (ES6), 74 bytes

f=s=>/^.*0|0\n|\n0|0.*$/.test(s)?f(s.replace(/^.*\n?|.(.*).|\n.*$/g,"$1")):s

Takes input in the form of a string with newlines separating each row (but no leading or trailing newline). Explanation: /^.*0|0\n|\n0|0.*$/ is a regexp that matches contaminated squares, while /^.*\n?|.(.*).|\n.*$/ matches that parts of the square that need to be deleted, except for the (.*) which needs to be kept. (This is shorter than looking ahead or behind for the newline character.)


答:
Perl 5, 63 + 3 = 66 bytes

```<code>$_=<>;s/\A.*\n?|^.|.$|\n.*\Z//mg while/\A.*0|0$|^0|0.*\Z/;print
</code>```

Requires the -0 flag. Input should not contain a trailing newline character.

Title: Contaminated Squares

Body:
Perl 5, 63 + 3 = 66 bytes

$_=<>;s/\A.*\n?|^.|.$|\n.*\Z//mg while/\A.*0|0$|^0|0.*\Z/;print

Requires the -0 flag. Input should not contain a trailing newline character.


Title: Print the AdamN tile

Body:
JavaScript (ES6), 114 bytes

f=n=>n<2?`a
`:f(n-2).replace(/./g,`$&`+(n+8).toString(36)).replace(/\n/g,`
${(n+9).toString(36).repeat(1<<n/2)}
`)


问:
Obfuscation Challenge
You are to write a program that does one of the following.

Only displays "Hello World" does nothing else

Quits and nothing else (no output, no errors.)

Takes one line of input, parses it as an integer, displays the first that many primes (or gives a nice error if it is given input that can't be parsed as an integer, or is less than 0.)

Given one line of input, it parses it has a stock symbol, and checks online for the current stock value and its change.

The catch, it should not be apparent which function it performs. Namely, for someone looking at your code, it should not be apparent which function it will do. Also, it may only perform and be able to perform one function (it can not pick and choose.) How good a program is is determined by how uncertain someone is that looks at it as to what its function is, and also how familiar that person is with that language.

BONUS:
If you in a clever way make it so although for any one compiler/intrpreter and platform, the program will also perform the same function, different compilers/interpreters or platforms, it will perform a different function. This bonus may only be collected if done cleverly.

BONUS:
If your program only contains code that is capable of one function (save nothing, as empty code is capable of that), and it is not possible to make a simple modification unrelated to the function to allow it to perform a different function.
For example: if you did

```<code>obfuscatedBool = 1g8uhad'l8fygrcetdu8y4fd/,.oe87fy4d --Magic
if obfuscatedBool: print "Hello World"
</code>```

Would not count as obfuscatedBool could be made True or False to make it print "Hello World" or do nothing respectively.

INFINITY BONUS: If you realize both bonuses simultaneously, you are magic.

NEGATIVE BONUS: Using libraries with specific abilities to do the functions.

Voters, take the bonuses in to consideration, because the program with the most votes wins!

Note: If you say what your program does, make sure to use spoiler syntax!

答:
JavaScript ES6

I'm late to the party, but I was still the life of it.

```<code>alert(eval(`[${[..."29234652749082823"].reduce((p,c)=>p+c+(c-~-[2<<2][""<<""]&&" "))
.match(/\S\d\S|.+?/g).filter(x=>x.trim()).map(t=>t>42?y.push(t):t,y=[]).reduce((c,p)
=>c+(p.constructor==[j=+[]][j].constructor?" ":p)).replace((y=y.shift(),` `),y.split
`7`)}]`).map(e=>e.toString( i--),i=4+[1<<3<<1<<2>>1][j]).map(_=>[_[j^j],_.slice(1)].
reduce((o,O)=>o.toUpperCase()+O)).join` `);
</code>```

 this prints Hello World.

I might explain it later.

Title: Obfuscation Challenge

Body:
JavaScript ES6

I'm late to the party, but I was still the life of it.

alert(eval(`[${[..."29234652749082823"].reduce((p,c)=>p+c+(c-~-[2<<2][""<<""]&&" "))
.match(/\S\d\S|.+?/g).filter(x=>x.trim()).map(t=>t>42?y.push(t):t,y=[]).reduce((c,p)
=>c+(p.constructor==[j=+[]][j].constructor?" ":p)).replace((y=y.shift(),` `),y.split
`7`)}]`).map(e=>e.toString( i--),i=4+[1<<3<<1<<2>>1][j]).map(_=>[_[j^j],_.slice(1)].
reduce((o,O)=>o.toUpperCase()+O)).join` `);

 this prints Hello World.

I might explain it later.