答:
Octave, 48 bytes

```<code>@(p,q)ifft(fft([p q*0]).*fft([q p*0]))(1:end-1)
</code>```

Try it here.

Explanation

Discrete convolution corresponds to multiplication of the (discrete-time) Fourier transforms. So one way to multiply the polynomials would be transform them, multiply the transformed sequences, and transform back.

If the discrete Fourier transform (DFT) is used instead of the Fourier transform, the result is the circular convolution of the original sequences of polynomial coefficients. The code follows this route. To make circular convolution equal to standard convolution, the sequences are zero-padded and the result is trimmed.

Body:
Octave, 48 bytes

@(p,q)ifft(fft([p q*0]).*fft([q p*0]))(1:end-1)

Try it here.

Explanation

Discrete convolution corresponds to multiplication of the (discrete-time) Fourier transforms. So one way to multiply the polynomials would be transform them, multiply the transformed sequences, and transform back.

If the discrete Fourier transform (DFT) is used instead of the Fourier transform, the result is the circular convolution of the original sequences of polynomial coefficients. The code follows this route. To make circular convolution equal to standard convolution, the sequences are zero-padded and the result is trimmed.


问:
Discrete Convolution or Polynomial Multiplication
Given two non empty lists of integers, your submission should calculate and return the discrete convolution of the two. Interestingly, if you consider the list elements as coefficients of polynomials, the convolution of the two lists represents the coefficients of the product of the two polynomials.

Definition

Given the lists A=[a(0),a(1),a(2),...,a(n)] and B=[b(0),b(1),b(2),...,b(m)] (setting a(k)=0 for k<0 and k>n and b(k)=0 for k<0 and k>m) then the convolution of the two is defined as A*B=[c(0),c(1),...,c(m+n)] where c(k) = sum [ a(x)*b(y) for all integers x y such that x+y=k]

Rules

Any convenient input and output formatting for your language is allowed.

Built-ins for convolution, creating convolution matrices, correlation and polynomial multiplication are not allowed.

Examples

```<code>[1,1]*[1] = [1,1]
[1,1]*[1,1] = [1,2,1]
[1,1]*[1,2,1] = [1,3,3,1]
[1,1]*[1,3,3,1] = [1,4,6,4,1]
[1,1]*[1,4,6,4,1] = [1,5,10,10,5,1]

[1,-1]*[1,1,1,1,1] = [1,0,0,0,0,-1]
[80085,1337]*[-24319,406] = [-1947587115,7,542822]
</code>```

答:
Matlab / Octave, 41 bytes

```<code>@(p,q)poly([roots(p);roots(q)])*p(1)*q(1)
</code>```

This defines an anonymous function. To call it, assign it to a variable or use ans.

Try it here.

Explanation

This exploits the facts that

The (possibly repeated) roots characterize a polynomial up to its leading coefficient.

The product of two polynomials has the roots of both.

The code computes the roots of the two polynomials (function roots) and concatenates them into a column array. From that it obtains the coefficients of the product polynomial with a leading 1 (function poly). Finally the result is multiplied by the leading coefficients of the two polynomials.

ContentLicense: CC BY-SA 3.0

Body:
Matlab / Octave, 41 bytes

@(p,q)poly([roots(p);roots(q)])*p(1)*q(1)

This defines an anonymous function. To call it, assign it to a variable or use ans.

Try it here.

Explanation

This exploits the facts that

The (possibly repeated) roots characterize a polynomial up to its leading coefficient.

The product of two polynomials has the roots of both.

The code computes the roots of the two polynomials (function roots) and concatenates them into a column array. From that it obtains the coefficients of the product polynomial with a leading 1 (function poly). Finally the result is multiplied by the leading coefficients of the two polynomials.


问:
Smallest integers after N divisible by 2, 3, and 4
Give credit to whom credit is due.

Objective Given an integer N > 0, out the smallest integers A, B, and C so that:

All of A, B, and C are strictly greater than N;

2 divides A;

3 divides B;

and 4 divides C.

This is a code-golf, so the shortest answer in bytes wins.

Test cases

```<code>N => A, B, C
1 => 2, 3, 4
4 => 6, 6, 8
43 => 44, 45, 44
123 => 124, 126, 124
420 => 422, 423, 424
31415 => 31416, 31416, 31416
1081177 => 1081178, 1081179, 1081180
</code>```

答:
Reng, 40 bytes

```<code>i1+#i2341ø>(1+)31j
i(2[¤,  q!^$]æl0eq!~
</code>```

1: init

```<code>i1+#i2341ø
</code>```

i1+#i sets the input to 1 + input; this is because we are to work on the numbers strictly greater than the input. 234 initializes the tape with our iteration values, and 1ø jumps to the beginning of the next line.

2a: loop

```<code>i(2[¤,  q!^$]æl0eq!~
</code>```

i( puts the input at the STOS, and 2[ makes a new stack with the top 2 elements. ¤ duplicates the stack, and , does modulus. If there is a remainder, q!^ breaks out of the loop to go to (b). Otherwise, we're fine to print. $ removes the extra thingy, ] closes the stack, and æ prints it nicely. l0wq!~ terminates iff the stack contains zero members.

2b: that other loop

```<code>          >(1+)31j
        q!^
</code>```

(1+) adds 1 to the STOS, and 31j jumps to the part of the loop that doesn't take stuff from the stack. And profit.

That extra whitespace is really bothering me. Take a GIF.

ContentLicense: CC BY-SA 4.0

Body:
Reng, 40 bytes

i1+#i2341ø>(1+)31j
i(2[¤,  q!^$]æl0eq!~

1: init

i1+#i2341ø

i1+#i sets the input to 1 + input; this is because we are to work on the numbers strictly greater than the input. 234 initializes the tape with our iteration values, and 1ø jumps to the beginning of the next line.

2a: loop

i(2[¤,  q!^$]æl0eq!~

i( puts the input at the STOS, and 2[ makes a new stack with the top 2 elements. ¤ duplicates the stack, and , does modulus. If there is a remainder, q!^ breaks out of the loop to go to (b). Otherwise, we're fine to print. $ removes the extra thingy, ] closes the stack, and æ prints it nicely. l0wq!~ terminates iff the stack contains zero members.

2b: that other loop

          >(1+)31j
        q!^

(1+) adds 1 to the STOS, and 31j jumps to the part of the loop that doesn't take stuff from the stack. And profit.

That extra whitespace is really bothering me. Take a GIF.


答:
Python, 90 bytes

```<code>lambda p,q:[sum((p+k*[0])[i]*(q+k*[0])[k-i]for i in range(k+1))for k in range(len(p+q)-1)]
</code>```

Title: Discrete Convolution or Polynomial Multiplication

Body:
Given two non empty lists of integers, your submission should calculate and return the discrete convolution of the two. Interestingly, if you consider the list elements as coefficients of polynomials, the convolution of the two lists represents the coefficients of the product of the two polynomials.

Definition

Given the lists A=[a(0),a(1),a(2),...,a(n)] and B=[b(0),b(1),b(2),...,b(m)] (setting a(k)=0 for k<0 and k>n and b(k)=0 for k<0 and k>m) then the convolution of the two is defined as A*B=[c(0),c(1),...,c(m+n)] where c(k) = sum [ a(x)*b(y) for all integers x y such that x+y=k]

Rules

Any convenient input and output formatting for your language is allowed.

Built-ins for convolution, creating convolution matrices, correlation and polynomial multiplication are not allowed.

Examples

```<code>[1,1]*[1] = [1,1]
[1,1]*[1,1] = [1,2,1]
[1,1]*[1,2,1] = [1,3,3,1]
[1,1]*[1,3,3,1] = [1,4,6,4,1]
[1,1]*[1,4,6,4,1] = [1,5,10,10,5,1]

[1,-1]*[1,1,1,1,1] = [1,0,0,0,0,-1]
[80085,1337]*[-24319,406] = [-1947587115,7,542822]
</code>```

Body:
Python, 90 bytes

lambda p,q:[sum((p+k*[0])[i]*(q+k*[0])[k-i]for i in range(k+1))for k in range(len(p+q)-1)]


答:
J, <s>10</s> 8 bytes

```<code>[:+//.*/
</code>```

Usage:

```<code>ppc =: [:+//.*/    NB. polynomial product coefficients
80085 1337 ppc _24319 406
_1947587115 7 542822
</code>```

Description: The program takes takes two lists, makes a multiplication table, then adds the numbers on the positive diagonals.

Body:
J, <s>10</s> 8 bytes

[:+//.*/

Usage:

ppc =: [:+//.*/    NB. polynomial product coefficients
80085 1337 ppc _24319 406
_1947587115 7 542822

Description: The program takes takes two lists, makes a multiplication table, then adds the numbers on the positive diagonals.


答:
JavaScript (ES6), 64 bytes

```<code>(a,b)=>a.map((n,i)=>b.map((m,j)=>r[j+=i]=m*n+(r[j]||0)),r=[])&&r
</code>```

Returns the empty array if either input is empty. Based on my answer to Polynomialception.

Body:
JavaScript (ES6), 64 bytes

(a,b)=>a.map((n,i)=>b.map((m,j)=>r[j+=i]=m*n+(r[j]||0)),r=[])&&r

Returns the empty array if either input is empty. Based on my answer to Polynomialception.


问:
Expand roots into a polynomial

Challenge

Given the roots of a polynomial separated by spaces as input, output the expanded form of the polynomial.

For example, the input

```<code>1 2
</code>```

represents this equation:

```<code>(x-1)(x-2)
</code>```

And should output:

```<code>x^2-3x+2
</code>```

The exact format of output is not important, it can be:

```<code>1x^2+-3x^1+2x^0
</code>```

or:

```<code>0 0 0
1x^3+0x^2+0x^1+0
</code>```

or:

```<code>3 14 15 92
1x^4+-124x^3+3241x^2+-27954x^1+57960
</code>```

Scoring/Rules

eval and likes are disallowed.

You may use any version of Python or any other language.

Title: Expand roots into a polynomial

Body:
JavaScript (ES6), 96 bytes

a=>a.map(x=>r.map((n,i)=>(r[i]-=x*a,a=n),++j,r.push(a=0)),r=[j=1])&&r.map(n=>n+`x^`+--j).join`+`


答:
Jelly, 9 bytes

```<code>0;+
×'Ṛç/
</code>```

Try it online! or verify all test cases.

How it works

```<code>×'Ṛç/  Main link. Arguments: p, q (lists)

×'     Spawned multiplication; multiply each item of p with each item of q.
  Ṛ    Reverse the rows of the result.
   ç/  Reduce the rows by the helper link.

0;+    Helper link. Arguments: p, q (lists)

0;     Prepend a 0 to p.
  +    Perform vectorized addition of the result and q.
</code>```

Body:
Jelly, 9 bytes

0;+
×'Ṛç/

Try it online! or verify all test cases.

How it works

×'Ṛç/  Main link. Arguments: p, q (lists)

×'     Spawned multiplication; multiply each item of p with each item of q.
  Ṛ    Reverse the rows of the result.
   ç/  Reduce the rows by the helper link.

0;+    Helper link. Arguments: p, q (lists)

0;     Prepend a 0 to p.
  +    Perform vectorized addition of the result and q.


答:
Julia, <s>62</s> 55 bytes

```<code>~=endof
p%q=[sum(diag(p*rot180(q'),-k))for k=1-~q:~p-1]
</code>```

Try it online!

Body:
Julia, <s>62</s> 55 bytes

~=endof
p%q=[sum(diag(p*rot180(q'),-k))for k=1-~q:~p-1]

Try it online!


问:
Shortest Pangrammatic Window
A pangram is a sentence or excerpt which contains all twenty-six letters of the alphabet, as is demonstrated in this code golf challenge. However, a pangrammatic window is a pangram in the form of some segment of text, which may end or begin halfway through a word, found somewhere within a larger work. These naturally occur everywhere, being proper subsets of true pangrams, so just verifying if something contains a pangrammatic window would be boring and also it was previously done.

So, we're interested in finding the smallest one there is in a given piece of text based on its letter length! In the shortest possible code in bytes, of course, to fit the theme.

Rules and Guidelines

Receive a string as the input and return  the string of the smallest pangrammatic window in the input if there is one. If there is not, return either a Boolean False or an empty string.

Whether a string is a pangrammatic window or not is case-insensitive and only depends on the 26 letters, not any punctuation or numbers or other odd symbols.

Similarly, a pangrammatic window's letter length is the total number of how many appearances of letters occur in it alone, and not simply the number of every character. The returned value must be smallest based on this count. We're linguists, after all, not programmers.

An output of a pangrammatic window must, however, must be an exact substring of the input, containing the same capitalization and punctuation, etc.

If there are multiple shortest pangrammatic windows of the same letter length, return any one of them.

Test Cases

```<code>'This isn't a pangram.'
==> False

'Everyone knows about that infamous Quick-Brown-Fox (the one who jumped over some lazy ignoramus of a dog so many years ago).'
==> 'Quick-Brown-Fox (the one who jumped over some lazy ig'

'"The five boxing wizards jump quickly." stated Johnny, before beginning to recite the alphabet with a bunch of semicolons in the middle. "ABCDEFGHI;;;;;;;;;;;;;;;JKLMNOPQRSTUVWXYZ!" he shouted to the heavens.'
==> 'ABCDEFGHI;;;;;;;;;;;;;;;JKLMNOPQRSTUVWXYZ'
</code>```

答:
Pyth - 22 bytes

\o/ FGITW!

```<code>h+ol@GrNZf}GS{rTZ.:z)k
</code>```

Test Suite.

Title: Shortest Pangrammatic Window

Body:
Pyth - 22 bytes

\o/ FGITW!

h+ol@GrNZf}GS{rTZ.:z)k

<a href="http://pyth.herokuapp.com/?code=h%2Bol%40GrNZf%7DGS%7BrTZ.%3Az%29k&test_suite=1&test_suite_input=This+isn%27t+a+pangram.%0AEveryone+knows+about+that+infamous+Quick-Brown-Fox+%28the+one+who+jumped+over+some+lazy+ignoramus+of+a+dog+so+many+years+ago%29.%0A%22The+five+boxing+wizards+jump+quickly.%22+stated+Johnny%2C+before+beginning+to+recite+the+alphabet+with+a+bunch+of+semicolons+in+the+middle.+%22ABCDEFGHI%3B%3B%3B%3B%3B%3B%3B%3B%3B%3B%3B%3B%3B%3B%3BJKLMNOPQRSTUVWXYZ%21%22+he+shouted+to+the+heavens.&debug=0" rel="nofollow noreferrer">Test Suite.


答:
JavaScript (ES6), <s>139</s> <s>138</s> 136 bytes

s=>[r=l="",...s].map((_,b,a)=>a.map((c,i)=>i>b&&(t+=c,z=parseInt(c,36))>9&&(v++,n+=!m[z],m[z]=n<26||l&&v>l||(r=t,l=v)),t=m=[],v=n=0))&&r
```

<p><em>Saved 2 bytes thanks to @Neil!</em></p>

<h2>Indented</h2>

<p><div class="snippet" data-lang="js" data-hide="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>var solution =

s=>
  [r=l="",...s].map((_,b,a)=> // b = index of start of window to check
    a.map((c,i)=>
      i>b&&(
        t+=c,
        z=parseInt(c,36)
      )>9&&(
        v++,
        n+=!m[z],
        m[z]=
          n<26||
          v>l&&l||(
            r=t,
            l=v
          )
      ),
      t=m=[],
      v=n=0
    )
  )
  &&r</code>```

<textarea cols="70" rows="6" id="input">Everyone knows about that infamous Quick-Brown-Fox (the one who jumped over some lazy ignoramus of a dog so many years ago).</textarea>
<button onclick="result.textContent=solution(input.value)">Go</button>
```</code>```

Title: Shortest Pangrammatic Window

Body:
A pangram is a sentence or excerpt which contains all twenty-six letters of the alphabet, as is demonstrated in this code golf challenge. However, a pangrammatic window is a pangram in the form of some segment of text, which may end or begin halfway through a word, found somewhere within a larger work. These naturally occur everywhere, being proper subsets of true pangrams, so just verifying if something contains a pangrammatic window would be boring and also it was previously done.

So, we're interested in finding the smallest one there is in a given piece of text based on its letter length! In the shortest possible code in bytes, of course, to fit the theme.

Rules and Guidelines

Receive a string as the input and return  the string of the smallest pangrammatic window in the input if there is one. If there is not, return either a Boolean False or an empty string.

Whether a string is a pangrammatic window or not is case-insensitive and only depends on the 26 letters, not any punctuation or numbers or other odd symbols.

Similarly, a pangrammatic window's letter length is the total number of how many appearances of letters occur in it alone, and not simply the number of every character. The returned value must be smallest based on this count. We're linguists, after all, not programmers.

An output of a pangrammatic window must, however, must be an exact substring of the input, containing the same capitalization and punctuation, etc.

If there are multiple shortest pangrammatic windows of the same letter length, return any one of them.

Test Cases

```<code>'This isn't a pangram.'
==> False

'Everyone knows about that infamous Quick-Brown-Fox (the one who jumped over some lazy ignoramus of a dog so many years ago).'
==> 'Quick-Brown-Fox (the one who jumped over some lazy ig'

'"The five boxing wizards jump quickly." stated Johnny, before beginning to recite the alphabet with a bunch of semicolons in the middle. "ABCDEFGHI;;;;;;;;;;;;;;;JKLMNOPQRSTUVWXYZ!" he shouted to the heavens.'
==> 'ABCDEFGHI;;;;;;;;;;;;;;;JKLMNOPQRSTUVWXYZ'
</code>```

Body:
JavaScript (ES6), <s>139</s> <s>138</s> 136 bytes

s=>[r=l="",...s].map((_,b,a)=>a.map((c,i)=>i>b&&(t+=c,z=parseInt(c,36))>9&&(v++,n+=!m[z],m[z]=n<26||l&&v>l||(r=t,l=v)),t=m=[],v=n=0))&&r

Saved 2 bytes thanks to @Neil!

Indented

var solution =

s=>
  [r=l="",...s].map((_,b,a)=> // b = index of start of window to check
    a.map((c,i)=>
      i>b&&(
        t+=c,
        z=parseInt(c,36)
      )>9&&(
        v++,
        n+=!m[z],
        m[z]=
          n<26||
          v>l&&l||(
            r=t,
            l=v
          )
      ),
      t=m=[],
      v=n=0
    )
  )
  &&r

<textarea cols="70" rows="6" id="input">Everyone knows about that infamous Quick-Brown-Fox (the one who jumped over some lazy ignoramus of a dog so many years ago).</textarea><br /><button onclick="result.textContent=solution(input.value)">Go</button><pre id="result"></pre>


答:
Actually, 22 bytes

```<code>╗52x"╝1`;╛@%Y@╜<*`╓"£M
</code>```

Try it online!

Fun fact: 3 bugs in Actually's interpreter were found and fixed while writing this program.

Not so fun fact: Those 3 bugs prevented this solution from being much shorter.

Explanation:

```<code>╗52x"╝1`;╛@%Y@╜<*`╓"£M
╗                       push input to reg0
 52x                    push range(2,5) ([2,3,4])
    "╝1`;╛@%Y@╜<*`╓"£M  map (for n in [2,3,4]):
     ╝                    push n to reg1
      1`;╛@%Y@╜<*`╓       find the smallest integer k where:
        ;╛@%Y               k is divisible by n and...
             @╜<*           is greater than the input
</code>```

Title: Smallest integers after N divisible by 2, 3, and 4

Body:
Give credit to whom credit is due.

Objective Given an integer N > 0, out the smallest integers A, B, and C so that:

All of A, B, and C are strictly greater than N;

2 divides A;

3 divides B;

and 4 divides C.

This is a code-golf, so the shortest answer in bytes wins.

Test cases

```<code>N => A, B, C
1 => 2, 3, 4
4 => 6, 6, 8
43 => 44, 45, 44
123 => 124, 126, 124
420 => 422, 423, 424
31415 => 31416, 31416, 31416
1081177 => 1081178, 1081179, 1081180
</code>```

Body:
Actually, 22 bytes

╗52x"╝1`;╛@%Y@╜<*`╓"£M

Try it online!

Fun fact: 3 bugs in Actually's interpreter were found and fixed while writing this program.

Not so fun fact: Those 3 bugs prevented this solution from being much shorter.

Explanation:

╗52x"╝1`;╛@%Y@╜<*`╓"£M
╗                       push input to reg0
 52x                    push range(2,5) ([2,3,4])
    "╝1`;╛@%Y@╜<*`╓"£M  map (for n in [2,3,4]):
     ╝                    push n to reg1
      1`;╛@%Y@╜<*`╓       find the smallest integer k where:
        ;╛@%Y               k is divisible by n and...
             @╜<*           is greater than the input


答:
Ruby, 100 bytes

Returns nil if no window is found.

```<code>->s{r=0..s.size
(r.map{|i|s[i,r.find{|j|(?a..?z).all?{|c|s[i,j]=~/#{c}/i}}||0]}-['']).min_by &:size}
</code>```

Title: Shortest Pangrammatic Window

Body:
Ruby, 100 bytes

Returns nil if no window is found.

->s{r=0..s.size
(r.map{|i|s[i,r.find{|j|(?a..?z).all?{|c|s[i,j]=~/#{c}/i}}||0]}-['']).min_by &:size}


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

答:
Dyalog APL 15.0, 17 bytes (non-competing)

```<code>(⊢⊣⊃⎕NPUT⊢)⍣≢'A'1
</code>```

Chrome currently renders U+2262 wrong. The above line should look like (⊢⊣⊃⎕NPUT⊢)⍣̸≡'A'1.

This is non-competing because version 15 has not been released yet.

Applies ⍣ the function (⊢⊣⊃⎕NPUT⊢) on 'A'1 until the input is changed (i.e. never):

⊢⊣⊃⎕NPUT⊢ is a function train:

```<code>┌─┼───┐
⊢ ⊣ ┌─┼─────┐
    ⊃ ⎕NPUT ⊢
</code>```

The rightmost ⊢ returns 'A'1 unmodified; this (filename, overwrite-flag) will be the right argument to `⎕NPUT'.

'⊃' returns the first element of 'A'1 ('A'); this is the data to be written.

Then ⎕NPUT is run, and reports how many bytes were written (2 or 3 depending on OS); this becomes the right argument to the ⊣.

The leftmost ⊢ again returns 'A'1 unmodified; this is the left argument to the ⊢.

⊣ ignores its right argument and returns the left argument ('A'1), this becomes the new value fed to ⍣.

Since the new value is identical to the old one, the operation is continued (forever).

Title: Shortest code for infinite disk I/O

Body:
Dyalog APL 15.0, 17 bytes (non-competing)

(⊢⊣⊃⎕NPUT⊢)⍣≢'A'1

Chrome currently renders U+2262 wrong. The above line should look like (⊢⊣⊃⎕NPUT⊢)⍣̸≡'A'1.

This is non-competing because version 15 has not been released yet.

Applies ⍣ the function (⊢⊣⊃⎕NPUT⊢) on 'A'1 until the input is changed (i.e. never):

⊢⊣⊃⎕NPUT⊢ is a function train:

┌─┼───┐
⊢ ⊣ ┌─┼─────┐
    ⊃ ⎕NPUT ⊢

The rightmost ⊢ returns 'A'1 unmodified; this (filename, overwrite-flag) will be the right argument to `⎕NPUT'.

'⊃' returns the first element of 'A'1 ('A'); this is the data to be written.

Then ⎕NPUT is run, and reports how many bytes were written (2 or 3 depending on OS); this becomes the right argument to the ⊣.

The leftmost ⊢ again returns 'A'1 unmodified; this is the left argument to the ⊢.

⊣ ignores its right argument and returns the left argument ('A'1), this becomes the new value fed to ⍣.

Since the new value is identical to the old one, the operation is continued (forever).


问:
Split a Shakespeare Script
Mr. William Shakespeare wrote plays. A lot of plays. In this tarball containing every single one of his works, each one of his plays is one long file.

It needs to be split into Scenes for a stage production. Because actors are impatient, your code needs to be as short as possible.

Task:

Your task is to write a program or function to split the plays contained in this file into separate files, numbered sequentially starting from 1, where each one contains a scene. You should retain all whitespace and titles.

Input:

Input will be a single play via stdin, or the filename as a parameter. You can choose. The play will look something like:

```<code> TITUS ANDRONICUS

    DRAMATIS PERSONAE

SATURNINUS  son to the late Emperor of Rome, and afterwards
    declared Emperor.

BASSIANUS   brother to Saturninus; in love with Lavinia.

TITUS ANDRONICUS    a noble Roman, general against the Goths.

MARCUS ANDRONICUS   tribune of the people, and brother to Titus.

LUCIUS  |
    |
QUINTUS |
    |  sons to Titus Andronicus.
MARTIUS |
    |
MUTIUS  |

Young LUCIUS    a boy,
[...]
ACT I

SCENE I Rome. Before the Capitol.

    [The Tomb of the ANDRONICI appearing; the Tribunes
    and Senators aloft. Enter, below, from one side,
    SATURNINUS and his Followers; and, from the other
    side, BASSIANUS and his Followers; with drum and colours]

SATURNINUS  Noble patricians
[...]
ACT I

SCENE II    A forest near Rome. Horns and cry of hounds heard.

    [Enter TITUS ANDRONICUS, with Hunters, &c., MARCUS,
    LUCIUS, QUINTUS, and MARTIUS]

TITUS ANDRONICUS    The hunt is up, the morn is bright and grey,
    The fields are
[...]
ACT II

SCENE I Rome. Before the Palace.

    [Enter AARON]

AARON   Now climbeth Tamora
[...]</code>```

Output:

The output should look something like this:

```ACT I

SCENE I Rome. Before the Capitol.

    [The Tomb of the ANDRONICI appearing; the Tribunes
    and Senators aloft. Enter, below, from one side,
    SATURNINUS and his Followers; and, from the other
    side, BASSIANUS and his Followers; with drum and colours]

SATURNINUS  Noble patricians...```
```
ACT I

SCENE II    A forest near Rome. Horns and cry of hounds heard.

    [Enter TITUS ANDRONICUS, with Hunters, &c., MARCUS,
    LUCIUS, QUINTUS, and MARTIUS]

TITUS ANDRONICUS    The hunt is up, the morn is bright and grey,
    The fields are...```
```ACT II

SCENE I Rome. Before the Palace.

    [Enter AARON]

AARON   Now climbeth Tamora ...```

etc.

Output either into numbered files, or to the stdout stream (returning for functions) with a deliminator of your choice.

Bonuses:

10% If you save the bit before Act 1 into file 0. Note: It must not break if the bit before Act 1 is empty.

15% If you can take both stdin and a file path parameter inputs

20% If you can output both into files and to stdout / return.

<s>200 reputation if you can make the smallest SPL program.</s> This bounty has been awarded.

Leaderboards

Here is a Stack Snippet to generate both a regular leaderboard and an overview of winners by language.

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 leaderboard snippet:

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

body{text-align:left!important}#answer-list,#language-list{padding:10px;width:290px;float:left}table thead{font-weight:700}table td{padding:5px}```
<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> <link rel="stylesheet" type="text/css" href="//cdn.sstatic.net/codegolf/all.css?v=83c949450c8b"> <div id="answer-list"> <h2>Leaderboard</h2> <table class="answer-list"> <thead> <tr><td></td><td>Author</td><td>Language</td><td>Size</td></tr></thead> <tbody id="answers"> </tbody> </table> </div><div id="language-list"> <h2>Winners by Language</h2> <table class="language-list"> <thead> <tr><td>Language</td><td>User</td><td>Score</td></tr></thead> <tbody id="languages"> </tbody> </table> </div><table style="display: none"> <tbody id="answer-template"> <tr><td>{{PLACE}}</td><td>{{NAME}}</td><td>{{LANGUAGE}}</td><td>{{SIZE}}</td><td>Link</td></tr></tbody> </table> <table style="display: none"> <tbody id="language-template"> <tr><td>{{LANGUAGE}}</td><td>{{NAME}}</td><td>{{SIZE}}</td><td>Link</td></tr></tbody> </table><script>var QUESTION_ID=68997,OVERRIDE_USER=43394;function answersUrl(e){return"https://api.stackexchange.com/2.2/questions/"+QUESTION_ID+"/answers?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+ANSWER_FILTER}function commentUrl(e,s){return"https://api.stackexchange.com/2.2/answers/"+s.join(";")+"/comments?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+COMMENT_FILTER}function getAnswers(){jQuery.ajax({url:answersUrl(answer_page++),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){answers.push.apply(answers,e.items),answers_hash=[],answer_ids=[],e.items.forEach(function(e){e.comments=[];var s=+e.share_link.match(/\d+/);answer_ids.push(s),answers_hash[s]=e}),e.has_more||(more_answers=!1),comment_page=1,getComments()}})}function getComments(){jQuery.ajax({url:commentUrl(comment_page++,answer_ids),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){e.items.forEach(function(e){e.owner.user_id===OVERRIDE_USER&&answers_hash[e.post_id].comments.push(e)}),e.has_more?getComments():more_answers?getAnswers():process()}})}function getAuthorName(e){return e.owner.display_name}function process(){var e=[];answers.forEach(function(s){var r=s.body;s.comments.forEach(function(e){OVERRIDE_REG.test(e.body)&&(r="<h1>"+e.body.replace(OVERRIDE_REG,"")+"</h1>")});var a=r.match(SCORE_REG);a&&e.push({user:getAuthorName(s),size:+a[2],language:a[1],link:s.share_link})}),e.sort(function(e,s){var r=e.size,a=s.size;return r-a});var s={},r=1,a=null,n=1;e.forEach(function(e){e.size!=a&&(n=r),a=e.size,++r;var t=jQuery("#answer-template").html();t=t.replace("{{PLACE}}",n+".").replace("{{NAME}}",e.user).replace("{{LANGUAGE}}",e.language).replace("{{SIZE}}",e.size).replace("{{LINK}}",e.link),t=jQuery(t),jQuery("#answers").append(t);var o=e.language;/<a/.test(o)&&(o=jQuery(o).text()),s[o]=s[o]||{lang:e.language,user:e.user,size:e.size,link:e.link}});var t=[];for(var o in s)s.hasOwnProperty(o)&&t.push(s[o]);t.sort(function(e,s){return e.lang>s.lang?1:e.lang<s.lang?-1:0});for(var c=0;c<t.length;++c){var i=jQuery("#language-template").html(),o=t[c];i=i.replace("{{LANGUAGE}}",o.lang).replace("{{NAME}}",o.user).replace("{{SIZE}}",o.size).replace("{{LINK}}",o.link),i=jQuery(i),jQuery("#languages").append(i)}}var ANSWER_FILTER="!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe",COMMENT_FILTER="!)Q2B_A2kjfAiU78X(md6BoYk",answers=[],answers_hash,answer_ids,answer_page=1,more_answers=!0,comment_page;getAnswers();var SCORE_REG=/<h\d>\s*([^\n,]*[^\s,]),.*?([\d\.]+)(?=[^\n\d<>]*(?:<(?:s>[^\n<>]*<\/s>|[^\n<>]+>)[^\n\d<>]*)*<\/h\d>)/,OVERRIDE_REG=/^Override\s*header:\s*/i;</script></code>```

答:
Ruby, 30 - 10% - 15% = <s>23.715</s> 22.95 bytes

Splits input on $. 15% bonus applies because Ruby redirects $< to point at the file passed into ARGV by default if it's supplied, or STDIN if not.

-1 byte by leveraging gsub similar to @Downgoat ES6 solution but I'm still leveraging the hope that ACT only ever appears at the ACT labels and not inside any other word, just because

```<code>$><<$<.read.gsub("ACT","$ACT")
</code>```

Also, my 41.004 (originally 67) byte solution that also does file output. Starring probably the only time the each command saves bytes over map in Ruby, because each returns the array passed in unadulterated after running its block, unlike map.

```<code>i=-1;$><<$<.read.split(/(?=ACT)/).each{|s|open("#{i+=1}",?w)<<s}*?$
</code>```

Title: Split a Shakespeare Script

Body:
Ruby, 30 - 10% - 15% = <s>23.715</s> 22.95 bytes

Splits input on $. 15% bonus applies because Ruby redirects $< to point at the file passed into ARGV by default if it's supplied, or STDIN if not.

-1 byte by leveraging gsub similar to @Downgoat ES6 solution but I'm still leveraging the hope that ACT only ever appears at the ACT labels and not inside any other word, just because

$><<$<.read.gsub("ACT","$ACT")

Also, my 41.004 (originally 67) byte solution that also does file output. Starring probably the only time the each command saves bytes over map in Ruby, because each returns the array passed in unadulterated after running its block, unlike map.

i=-1;$><<$<.read.split(/(?=ACT)/).each{|s|open("#{i+=1}",?w)<<s}*?$


问:
Add without addition (or any of the 4 basic arithmetic operators)
Problem:

Your goal is to add two input numbers without using any of the following math operators: +,-,*,/.

Additionally, you can't use any built-in functions that are designed to replace those math operators.

Scoring:

Smallest code (in number of bytes) wins.

Update

Most of the programs i've seen either concatenate two arrays containing their numbers, or make first number of a character, append second number characters, then count them all.

Shortest array counter: APL with 8 chars, by Tobia

Shortest array concatenation: Golfscript with 4 chars, by Doorknob

Shortest logarithmic solution: TI-89 Basic with 19 chars, by Quincunx

Integration solution: Mathematica with 45 chars, by Michael Stern

Coolest, in my opinion: bitwise operators in javascript, by dave

答:
Python 2, Python 3, 41 bytes

```<code>i,j=input(),input()
while j>0:i=-~i;j=~-j
</code>```

If using the - number operator is allowed.

Python 2, Python 3, 40 bytes

```<code>i,j=input(),input()
while j>0:i=-~i;j-=1
</code>```

If using the - number and literal -= number operators is allowed.

Works on positive integers. Takes a and b and prints a+b.

Body:
Python 2, Python 3, 41 bytes

i,j=input(),input()
while j>0:i=-~i;j=~-j

If using the - number operator is allowed.

Python 2, Python 3, 40 bytes

i,j=input(),input()
while j>0:i=-~i;j-=1

If using the - number and literal -= number operators is allowed.

Works on positive integers. Takes a and b and prints a+b.


问:
Is it a pangram?
Write a function or program that takes as its input a string and prints a truthy value if the string is a pangram (a sequence of letters containing at least one of each letter in the English alphabet) and a falsey value otherwise.

Case of letters should be ignored; If the string is abcdefghijklmnopqrstuvwXYZ, then the function should still return a truthy value. Note that the string can contain any other characters in it, so 123abcdefghijklm NOPQRSTUVWXYZ321 would return a truthy value. An empty input should return a falsey value.

Test cases

```<code>AbCdEfGhIjKlMnOpQrStUvWxYz

==> True

ACEGIKMOQSUWY
BDFHJLNPRTVXZ

==> True

public static void main(String[] args)

==> False

The quick brown fox jumped over the lazy dogs. BOING BOING BOING

==> True
</code>```

This is code golf. Standard rules apply. Shortest code in bytes wins.

答:
Batch, 126 + 2 = 128 bytes

```<code>@set p="%*"
@for %%a in (a b c d e f g h i j k l m n o p q r s t u v w x y z)do @set q=!p:%%a=!&if !q!==!p! exit/b 1
@exit/b
</code>```

Requires CMD /V /C <filename> <input string> so I added 2 bytes for the /V. Alternative 87 + 2 + 26 = 115 byte version:

```<code>@set p="%*"
@for %%a in (?)do set q=!p:%%a=!&if !q!==%p% exit/b 1
@exit/b
</code>```

(+26 for the files named a, b, c ... z that need to exist in the current directory.)

Title: Is it a pangram?

Body:
Batch, 126 + 2 = 128 bytes

@set p="%*"
@for %%a in (a b c d e f g h i j k l m n o p q r s t u v w x y z)do @set q=!p:%%a=!&if !q!==!p! exit/b 1
@exit/b

Requires CMD /V /C <filename> <input string> so I added 2 bytes for the /V. Alternative 87 + 2 + 26 = 115 byte version:

@set p="%*"
@for %%a in (?)do set q=!p:%%a=!&if !q!==%p% exit/b 1
@exit/b

(+26 for the files named a, b, c ... z that need to exist in the current directory.)


问:
Generate 100 Java Tuple classes
Write a script that writes to standard output, or your language's equivalent, 100 lines of (valid) Java code that begins with:

```<code>class Tuple1 {public Object _0;}
class Tuple2 {public Object _0,_1;}
class Tuple3 {public Object _0,_1,_2;}
class Tuple4 {public Object _0,_1,_2,_3;}
class Tuple5 {public Object _0,_1,_2,_3,_4;}
class Tuple6 {public Object _0,_1,_2,_3,_4,_5;}
class Tuple7 {public Object _0,_1,_2,_3,_4,_5,_6;}
class Tuple8 {public Object _0,_1,_2,_3,_4,_5,_6,_7;}
class Tuple9 {public Object _0,_1,_2,_3,_4,_5,_6,_7,_8;}
class Tuple10 {public Object _0,_1,_2,_3,_4,_5,_6,_7,_8,_9;}
class Tuple11 {public Object _0,_1,_2,_3,_4,_5,_6,_7,_8,_9,_10;}
class Tuple12 {public Object _0,_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11;}
</code>```

The last line should begin with class Tuple100.

This is code-golf, so the shortest code in bytes wins!

Title: Generate 100 Java Tuple classes

Body:
Javascript ES6, <s>128</s> 122 chars

for(s="class Tuple1 {public Object _0;}",q=0;q++<100;s=s.replace(/\d+(?!\d|,)( )?/g,(m,s)=>[q+1+s][+s]||m+",_"+q))alert(s)


答:
PowerShell v2+, 218 bytes

```<code>param($a)$z=@{};(0..($b=$a.length-1)|%{($i=$_)..$b|%{-join$a[$i..$_]}})|%{$y=$_;$j=1;65..90|%{$j*=$y.ToUpper().IndexOf([char]$_)+1};if($j){$z[($y-replace'[^A-Za-z]').Length]=$y}}
($z.GetEnumerator()|sort Name)[0].Value
</code>```

Yeah, so substring manipulation (there aren't any built-ins) isn't really PowerShell's strong suit...

We take input param($a) and set a new empty hashtable $z. This will be our storage of candidate pangrammatic substrings.

Using a slight modification of my code from Exploded Substrings, we construct all substrings of the input. Yep, even one-character punctuation-only substrings. This is code-golf, not fastest-code. ;-)

All of those substrings are encapsulated in parens and piped into another loop with |%{...}. We temporarily set $y to our current substring, set a helper counter $j, and start another loop 65..90|%{...}, conveniently over the ASCII char codes for capital letters. Each inner loop, we take $y, make it all uppercase, and pull out the .IndexOf that particular char. Since this will return -1 if not found, we +1 the result before multiplying it into $j. This ensures that if any one character isn't found, $j will equal zero.

Which is exactly what the if is all about. If $j is non-zero, that means that every letter was found at least once in the substring $y, so we need to add that to our candidate pool. We do so by taking $y and -replaceing every non-letter with nothing, which gets us the letter-length of that substring. We use that as the index into hashtable $z and store $y at that index. This has the quirk of overwriting substrings of the same letter-length with the one that occurs "furthest" in the original string, but that's allowed by the rules, since we're only concerned about letter-length.

Finally, we need to sort through $z and pull out the smallest. We have to use the .GetEnumerator call in order to sort on the objects inside $z, then sort those on Name (i.e., the length index from above), selecting the [0]th one (i.e., the shortest), and outputting its .Value (i.e., the substring). If no such substring fits, this will toss an error (Cannot index into a null array) when it tries to index into $z, and output nothing, which is falsey in PowerShell. (the third test case below has an explicit cast as [bool] to show this)

Test Cases

```<code>PS C:\Tools\Scripts> .\golfing\shortest-pangrammatic-window.ps1 '"The five boxing wizards jump quickly." stated Johnny, before beginning to recite the alphabet with a bunch of semicolons in the middle. "ABCDEFGHI;;;;;;;;;;;;;;;JKLMNOPQRSTUVWXYZ!" he shouted to the heavens.'
ABCDEFGHI;;;;;;;;;;;;;;;JKLMNOPQRSTUVWXYZ!"

PS C:\Tools\Scripts> .\golfing\shortest-pangrammatic-window.ps1 'Everyone knows about that infamous Quick-Brown-Fox (the one who jumped over some lazy ignoramus of a dog so many years ago).'
Quick-Brown-Fox (the one who jumped over some lazy ig

PS C:\Tools\Scripts> [bool](.\golfing\shortest-pangrammatic-window.ps1 "This isn't a pangram.")
Cannot index into a null array.
At C:\Tools\Scripts\golfing\shortest-pangrammatic-window.ps1:2 char:1
+ ($z.GetEnumerator()|sort Name)[0].Value
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : NullArray

False
</code>```

Title: Shortest Pangrammatic Window

Body:
PowerShell v2+, 218 bytes

param($a)$z=@{};(0..($b=$a.length-1)|%{($i=$_)..$b|%{-join$a[$i..$_]}})|%{$y=$_;$j=1;65..90|%{$j*=$y.ToUpper().IndexOf([char]$_)+1};if($j){$z[($y-replace'[^A-Za-z]').Length]=$y}}
($z.GetEnumerator()|sort Name)[0].Value

Yeah, so substring manipulation (there aren't any built-ins) isn't really PowerShell's strong suit...

We take input param($a) and set a new empty hashtable $z. This will be our storage of candidate pangrammatic substrings.

Using a slight modification of my code from Exploded Substrings, we construct all substrings of the input. Yep, even one-character punctuation-only substrings. This is code-golf, not fastest-code. ;-)

All of those substrings are encapsulated in parens and piped into another loop with |%{...}. We temporarily set $y to our current substring, set a helper counter $j, and start another loop 65..90|%{...}, conveniently over the ASCII char codes for capital letters. Each inner loop, we take $y, make it all uppercase, and pull out the .IndexOf that particular char. Since this will return -1 if not found, we +1 the result before multiplying it into $j. This ensures that if any one character isn't found, $j will equal zero.

Which is exactly what the if is all about. If $j is non-zero, that means that every letter was found at least once in the substring $y, so we need to add that to our candidate pool. We do so by taking $y and -replaceing every non-letter with nothing, which gets us the letter-length of that substring. We use that as the index into hashtable $z and store $y at that index. This has the quirk of overwriting substrings of the same letter-length with the one that occurs "furthest" in the original string, but that's allowed by the rules, since we're only concerned about letter-length.

Finally, we need to sort through $z and pull out the smallest. We have to use the .GetEnumerator call in order to sort on the objects inside $z, then sort those on Name (i.e., the length index from above), selecting the [0]th one (i.e., the shortest), and outputting its .Value (i.e., the substring). If no such substring fits, this will toss an error (Cannot index into a null array) when it tries to index into $z, and output nothing, which is falsey in PowerShell. (the third test case below has an explicit cast as [bool] to show this)

Test Cases

PS C:\Tools\Scripts> .\golfing\shortest-pangrammatic-window.ps1 '"The five boxing wizards jump quickly." stated Johnny, before beginning to recite the alphabet with a bunch of semicolons in the middle. "ABCDEFGHI;;;;;;;;;;;;;;;JKLMNOPQRSTUVWXYZ!" he shouted to the heavens.'
ABCDEFGHI;;;;;;;;;;;;;;;JKLMNOPQRSTUVWXYZ!"

PS C:\Tools\Scripts> .\golfing\shortest-pangrammatic-window.ps1 'Everyone knows about that infamous Quick-Brown-Fox (the one who jumped over some lazy ignoramus of a dog so many years ago).'
Quick-Brown-Fox (the one who jumped over some lazy ig

PS C:\Tools\Scripts> [bool](.\golfing\shortest-pangrammatic-window.ps1 "This isn't a pangram.")
Cannot index into a null array.
At C:\Tools\Scripts\golfing\shortest-pangrammatic-window.ps1:2 char:1
+ ($z.GetEnumerator()|sort Name)[0].Value
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : NullArray

False


答:
PHP, 92 bytes

The code:

```<code>echo!array_diff(range(a,z),array_keys(array_count_values(str_split(strtolower($argv[1])))));
</code>```

There is not much golfing in it (the clear code is 102 bytes).

Prepend it with the PHP marker <?php  (technically, it is not part of the code), put it into a file (is-it-a-pangram.php) and run it like:

```<code>$ php -d error_reporting=0 is-it-a-pangram.php '123abcdefghijklm NOPQRSTUVWXYZ321'
</code>```

Or put the code directly in the command line:

```<code>$php -d error_reporting=0 '... the code here ...' AbCdEfGhIjKlMnOpQrStUvWxYz
</code>```

It outputs 1 when the input string is a pangram; it doesn't output anything when the string is not a pangram. This is the default representation for boolean values in PHP.

An unambiguous output can be obtained by adding a + sign in front of the echo-ed expression (echo+!array_diff(...);). This way, the boolean value is converted to an integer (1 or 0).

How the code works

It makes the input string lowercase, splits it to individual characters, count the number of occurrences for each character that appears in the string, then makes the difference between the alphabet characters (a to z) and the characters found in the string. If the difference is not empty then not all the letters are found in the string (i.e. the string is not a pangram).

The code and the testcase (using the samples provided in the question) can be found on Github.

Title: Is it a pangram?

Body:
Write a function or program that takes as its input a string and prints a truthy value if the string is a pangram (a sequence of letters containing at least one of each letter in the English alphabet) and a falsey value otherwise.

Case of letters should be ignored; If the string is abcdefghijklmnopqrstuvwXYZ, then the function should still return a truthy value. Note that the string can contain any other characters in it, so 123abcdefghijklm NOPQRSTUVWXYZ321 would return a truthy value. An empty input should return a falsey value.

Test cases

```<code>AbCdEfGhIjKlMnOpQrStUvWxYz

==> True

ACEGIKMOQSUWY
BDFHJLNPRTVXZ

==> True

public static void main(String[] args)

==> False

The quick brown fox jumped over the lazy dogs. BOING BOING BOING

==> True
</code>```

This is code golf. Standard rules apply. Shortest code in bytes wins.

Body:
PHP, 92 bytes

The code:

echo!array_diff(range(a,z),array_keys(array_count_values(str_split(strtolower($argv[1])))));

There is not much golfing in it (the clear code is 102 bytes).

Prepend it with the PHP marker <?php  (technically, it is not part of the code), put it into a file (is-it-a-pangram.php) and run it like:

$ php -d error_reporting=0 is-it-a-pangram.php '123abcdefghijklm NOPQRSTUVWXYZ321'

Or put the code directly in the command line:

$php -d error_reporting=0 '... the code here ...' AbCdEfGhIjKlMnOpQrStUvWxYz

It outputs 1 when the input string is a pangram; it doesn't output anything when the string is not a pangram. This is the default representation for boolean values in PHP.

An unambiguous output can be obtained by adding a + sign in front of the echo-ed expression (echo+!array_diff(...);). This way, the boolean value is converted to an integer (1 or 0).

How the code works

It makes the input string lowercase, splits it to individual characters, count the number of occurrences for each character that appears in the string, then makes the difference between the alphabet characters (a to z) and the characters found in the string. If the difference is not empty then not all the letters are found in the string (i.e. the string is not a pangram).

The code and the testcase (using the samples provided in the question) can be found on Github.


答:
Pyth, <s>20</s> <s>16</s> 14 bytes

```<code>hol@GNf!-GrT0.:
</code>```

Explanation:

```<code>             .: - substrings of input()
      f!-GrT0   - filter to ones which contain the alphabet
 ol@GN          - sort by number of alphabetical chars
h               - ^[0]

      f!-GrT0   - filter(lambda T:V, substrings)
          rT0   -    T.lower()
        -G      -   alphabet-^
       !        -  not ^

 o              - sort(^, lambda N:V)
   @GN          -   filter_presence(alphabet, N)
  l             -  len(^)
</code>```

Try it here!

When there isn't a correct solution, the program exits with an error with no output to stdout.

Title: Shortest Pangrammatic Window

Body:
Pyth, <s>20</s> <s>16</s> 14 bytes

hol@GNf!-GrT0.:

Explanation:

             .: - substrings of input()
      f!-GrT0   - filter to ones which contain the alphabet
 ol@GN          - sort by number of alphabetical chars
h               - ^[0]

      f!-GrT0   - filter(lambda T:V, substrings)
          rT0   -    T.lower()
        -G      -   alphabet-^
       !        -  not ^

 o              - sort(^, lambda N:V)
   @GN          -   filter_presence(alphabet, N)
  l             -  len(^)

<a href="http://pyth.herokuapp.com/?code=hol%40GNf!-GrT0.%3A&test_suite=1&test_suite_input=%22This+isn%27t+a+pangram.%22%0A%22Everyone+knows+about+that+infamous+Quick-Brown-Fox+%28the+one+who+jumped+over+some+lazy+ignoramus+of+a+dog+so+many+years+ago%29.%22%0A%27%22The+five+boxing+wizards+jump+quickly.%22+stated+Johnny%2C+before+beginning+to+recite+the+alphabet+with+a+bunch+of+semicolons+in+the+middle.+%22ABCDEFGHI%3B%3B%3B%3B%3B%3B%3B%3B%3B%3B%3B%3B%3B%3B%3BJKLMNOPQRSTUVWXYZ!%22+he+shouted+to+the+heavens.%27&debug=0" rel="noreferrer">Try it here!

When there isn't a correct solution, the program exits with an error with no output to stdout.


答:
Python 3, <s>171, 167, 163, 157</s>, 149 bytes.

Saved 4 bytes thanks to DSM.

Saved 8 bytes thanks to RootTwo.

```<code>lambda x,r=range:min([x[i:j]for i in r(len(x))for j in r(len(x))if{*map(chr,r(65,91))}<={*x[i:j].upper()}]or' ',key=lambda y:sum(map(str.isalpha,y)))
</code>```

Having to sort based on the number of letters is killing me.

Test cases:

```<code>assert f("This isn't a pangram.") == ' '
assert f("Everyone knows about that infamous Quick-Brown-Fox (the one who jumped over some lazy ignoramus of a dog so many years ago).") == ' Quick-Brown-Fox (the one who jumped over some lazy ig', f("Everyone knows about that infamous Quick-Brown-Fox (the one who jumped over some lazy ignoramus of a dog so many years ago).")
assert f('"The five boxing wizards jump quickly." stated Johnny, before beginning to recite the alphabet with a bunch of semicolons in the middle. "ABCDEFGHI;;;;;;;;;;;;;;;JKLMNOPQRSTUVWXYZ!" he shouted to the heavens.') == '. "ABCDEFGHI;;;;;;;;;;;;;;;JKLMNOPQRSTUVWXYZ', f('"The five boxing wizards jump quickly." stated Johnny, before beginning to recite the alphabet with a bunch of semicolons in the middle. "ABCDEFGHI;;;;;;;;;;;;;;;JKLMNOPQRSTUVWXYZ!" he shouted to the heavens.')
</code>```

Title: Shortest Pangrammatic Window

Body:
Python 3, <s>171, 167, 163, 157</s>, 149 bytes.

Saved 4 bytes thanks to DSM.

Saved 8 bytes thanks to RootTwo.

lambda x,r=range:min([x[i:j]for i in r(len(x))for j in r(len(x))if{*map(chr,r(65,91))}<={*x[i:j].upper()}]or' ',key=lambda y:sum(map(str.isalpha,y)))

Having to sort based on the number of letters is killing me.

Test cases:

assert f("This isn't a pangram.") == ' '
assert f("Everyone knows about that infamous Quick-Brown-Fox (the one who jumped over some lazy ignoramus of a dog so many years ago).") == ' Quick-Brown-Fox (the one who jumped over some lazy ig', f("Everyone knows about that infamous Quick-Brown-Fox (the one who jumped over some lazy ignoramus of a dog so many years ago).")
assert f('"The five boxing wizards jump quickly." stated Johnny, before beginning to recite the alphabet with a bunch of semicolons in the middle. "ABCDEFGHI;;;;;;;;;;;;;;;JKLMNOPQRSTUVWXYZ!" he shouted to the heavens.') == '. "ABCDEFGHI;;;;;;;;;;;;;;;JKLMNOPQRSTUVWXYZ', f('"The five boxing wizards jump quickly." stated Johnny, before beginning to recite the alphabet with a bunch of semicolons in the middle. "ABCDEFGHI;;;;;;;;;;;;;;;JKLMNOPQRSTUVWXYZ!" he shouted to the heavens.')


问:
Zeroes at the end of a factorial
Write a program or function that finds the number of zeroes at the end of n! in base 10, where n is an input number (in any desired format).

It can be assumed that n is a positive integer, meaning that n! is also an integer. There are no zeroes after a decimal point in n!. Also, it can be assumed that your programming language can handle the value of n and n!.

Test cases

```<code>1
==> 0

5
==> 1

100
==> 24

666
==> 165

2016
==> 502

1234567891011121314151617181920
==> 308641972752780328537904295461
</code>```

This is code golf. Standard rules apply. The shortest code in bytes wins.

答:
Julia, <s>21</s> 19 bytes

```<code>!n=n<5?0:!(n÷=5)+n
</code>```

Uses the recursive formula from xnor's answer.

Try it online!

Title: Zeroes at the end of a factorial

Body:
Julia, <s>21</s> 19 bytes

!n=n<5?0:!(n÷=5)+n

Uses the recursive formula from xnor's answer.

Try it online!


答:
Labyrinth, 19 bytes

```<code>:?
:
#/)
\ #
!"*@
"
</code>```

Try it online!

This outputs the results in the order C, B, A separated by linefeeds.

Explanation

As usual, a short Labyrinth primer:

Labyrinth has two stacks of arbitrary-precision integers, main and aux(iliary), which are initially filled with an (implicit) infinite amount of zeros. We'll only be using main for this answer.

The source code resembles a maze, where the instruction pointer (IP) follows corridors when it can (even around corners). The code starts at the first valid character in reading order, i.e. in the top left corner in this case. When the IP comes to any form of junction (i.e. several adjacent cells in addition to the one it came from), it will pick a direction based on the top of the main stack. The basic rules are: turn left when negative, keep going ahead when zero, turn right when positive. And when one of these is not possible because there's a wall, then the IP will take the opposite direction. The IP also turns around when hitting dead ends.

Despite the two no-ops (") which make the layout seem a bit wasteful, I'm quite happy with this solution, because its control flow is actually quite subtle.

The IP starts in the top left corner on the : going right. It will immediately hit a dead end on the ? and turn around, so that the program actually starts with this linear piece of code:

```<code>:   Duplicate top of main stack. This will duplicate one of the implicit zeros
    at the bottom. While this may seem like a no-op it actually increases
    the stack depth to 1, because the duplicated zero is *explicit*.
?   Read n and push it onto main.
:   Duplicate.
:   Duplicate.
</code>```

That means we've now got three copies of n on the main stack, but its depth is 4. That's convenient because it means we can the stack depth to retrieve the current multiplier while working through the copies of the input.

The IP now enters a (clockwise) 3x3 loop. Note that #, which pushes the stack depth, will always push a positive value such that we know the IP will always turn east at this point.

The loop body is this:

```<code>#   Push the stack depth, i.e. the current multiplier k.
/   Compute n / k (rounding down).
)   Increment.
#   Push the stack depth again (this is still k).
*   Multiply. So we've now computed (n/k+1)*k, which is the number
    we're looking for. Note that this number is always positive so
    we're guaranteed that the IP turns west to continue the loop.
"   No-op.
!   Print result. If we've still got copies of n left, the top of the
    stack is positive, so the IP turns north and does another round.
    Otherwise, see below...
\   Print a linefeed.
    Then we enter the next loop iteration.
</code>```

After the loop was traversed (up to !) three times, all copies of n are used up and the zero underneath is revealed. Due to the " at the bottom (which otherwise seems pretty useless) this position is a junction. That means with a zero on top of the stack, the IP tries to go straight ahead (west), but because there's a wall it actually makes a 180 degree turn and moves back east as if it had hit a dead end.

As a result, the following bit is now executed:

```<code>"   No-op.
*   Multiply two zeros on top of the stack, i.e. also a no-op.
    The top of the stack is now still zero, so the IP keeps moving east.
@   Terminate the program.
</code>```

Body:
Labyrinth, 19 bytes

:?
:
#/)
\ #
!"*@
"

Try it online!

This outputs the results in the order C, B, A separated by linefeeds.

Explanation

As usual, a short Labyrinth primer:

Labyrinth has two stacks of arbitrary-precision integers, main and aux(iliary), which are initially filled with an (implicit) infinite amount of zeros. We'll only be using main for this answer.

The source code resembles a maze, where the instruction pointer (IP) follows corridors when it can (even around corners). The code starts at the first valid character in reading order, i.e. in the top left corner in this case. When the IP comes to any form of junction (i.e. several adjacent cells in addition to the one it came from), it will pick a direction based on the top of the main stack. The basic rules are: turn left when negative, keep going ahead when zero, turn right when positive. And when one of these is not possible because there's a wall, then the IP will take the opposite direction. The IP also turns around when hitting dead ends.

Despite the two no-ops (") which make the layout seem a bit wasteful, I'm quite happy with this solution, because its control flow is actually quite subtle.

The IP starts in the top left corner on the : going right. It will immediately hit a dead end on the ? and turn around, so that the program actually starts with this linear piece of code:

:   Duplicate top of main stack. This will duplicate one of the implicit zeros
    at the bottom. While this may seem like a no-op it actually increases
    the stack depth to 1, because the duplicated zero is *explicit*.
?   Read n and push it onto main.
:   Duplicate.
:   Duplicate.

That means we've now got three copies of n on the main stack, but its depth is 4. That's convenient because it means we can the stack depth to retrieve the current multiplier while working through the copies of the input.

The IP now enters a (clockwise) 3x3 loop. Note that #, which pushes the stack depth, will always push a positive value such that we know the IP will always turn east at this point.

The loop body is this:

#   Push the stack depth, i.e. the current multiplier k.
/   Compute n / k (rounding down).
)   Increment.
#   Push the stack depth again (this is still k).
*   Multiply. So we've now computed (n/k+1)*k, which is the number
    we're looking for. Note that this number is always positive so
    we're guaranteed that the IP turns west to continue the loop.
"   No-op.
!   Print result. If we've still got copies of n left, the top of the
    stack is positive, so the IP turns north and does another round.
    Otherwise, see below...
\   Print a linefeed.
    Then we enter the next loop iteration.

After the loop was traversed (up to !) three times, all copies of n are used up and the zero underneath is revealed. Due to the " at the bottom (which otherwise seems pretty useless) this position is a junction. That means with a zero on top of the stack, the IP tries to go straight ahead (west), but because there's a wall it actually makes a 180 degree turn and moves back east as if it had hit a dead end.

As a result, the following bit is now executed:

"   No-op.
*   Multiply two zeros on top of the stack, i.e. also a no-op.
    The top of the stack is now still zero, so the IP keeps moving east.
@   Terminate the program.


问:
Determine whether strings are anagrams

Challenge

Given two strings, work out if they both have exactly the same characters in them.

Example

Input

word, wrdo

This returns true because they are the same but just scrambled.

Input

word, wwro

This returns false.

Input

boat, toba

This returns true

Rules

Here are the rules!

Assume input will be at least 1 char long, and no longer than 8 chars.

No special characters, only a–z

All inputs can be assumed to be lowercase

Test Cases

```<code>boat, boat = true
toab, boat = true
oabt, toab = true
a, aa = false
zzz, zzzzzzzz = false
zyyyzzzz, yyzzzzzy = true
sleepy, pyels = false
p,p = true
</code>```

答:
Pyke, 4 bytes

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

Try it here!

Also 4 bytes

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

Try it here!

Title: Determine whether strings are anagrams

Body:
Pyke, 4 bytes

mSXq

Try it here!

Also 4 bytes

SRSq

Try it here!


答:
Haskell, 180 bytes

This was hard, but really fun without imports.

```<code>l=['a'..'z']
u=['A'..'Z']
f&[]=[];f&x=x:f&f x
g#h=(.g).h.g
f x|v<-[y|y<-(tail&)=<<(init&x),and$zipWith((`elem`y)#(||))l u]=last$[]:[z|z<-v,all((length.filter(`elem`l++u))#(<=)$z)v]
</code>```

Much less golfed:

```<code>lowerCase = ['a'..'z']
upperCase = ['A'..'Z']

f & x = takeWhile (not . null) $ iterate f x

(#) = flip on

subStrings x = (tail &) =<< (init & x)

pangram p = and $ zipWith ((`elem` p) # (||)) lowerCase upperCase

leqLetters x y = (length . filter (`elem` lowerCase ++ upperCase)) # (<=)

fewestLetters xs = [ x | x <- xs, all (leqLetters x) xs]

safeHead [] = ""
safeHead xs = head xs

f x = safeHead . fewestLetters . filter pangram . subStrings
</code>```

Surprise, surprise: it's really slow.

Title: Shortest Pangrammatic Window

Body:
A pangram is a sentence or excerpt which contains all twenty-six letters of the alphabet, as is demonstrated in this code golf challenge. However, a pangrammatic window is a pangram in the form of some segment of text, which may end or begin halfway through a word, found somewhere within a larger work. These naturally occur everywhere, being proper subsets of true pangrams, so just verifying if something contains a pangrammatic window would be boring and also it was previously done.

So, we're interested in finding the smallest one there is in a given piece of text based on its letter length! In the shortest possible code in bytes, of course, to fit the theme.

Rules and Guidelines

Receive a string as the input and return  the string of the smallest pangrammatic window in the input if there is one. If there is not, return either a Boolean False or an empty string.

Whether a string is a pangrammatic window or not is case-insensitive and only depends on the 26 letters, not any punctuation or numbers or other odd symbols.

Similarly, a pangrammatic window's letter length is the total number of how many appearances of letters occur in it alone, and not simply the number of every character. The returned value must be smallest based on this count. We're linguists, after all, not programmers.

An output of a pangrammatic window must, however, must be an exact substring of the input, containing the same capitalization and punctuation, etc.

If there are multiple shortest pangrammatic windows of the same letter length, return any one of them.

Test Cases

```<code>'This isn't a pangram.'
==> False

'Everyone knows about that infamous Quick-Brown-Fox (the one who jumped over some lazy ignoramus of a dog so many years ago).'
==> 'Quick-Brown-Fox (the one who jumped over some lazy ig'

'"The five boxing wizards jump quickly." stated Johnny, before beginning to recite the alphabet with a bunch of semicolons in the middle. "ABCDEFGHI;;;;;;;;;;;;;;;JKLMNOPQRSTUVWXYZ!" he shouted to the heavens.'
==> 'ABCDEFGHI;;;;;;;;;;;;;;;JKLMNOPQRSTUVWXYZ'
</code>```

Body:
Haskell, 180 bytes

This was hard, but really fun without imports.

l=['a'..'z']
u=['A'..'Z']
f&[]=[];f&x=x:f&f x
g#h=(.g).h.g
f x|v<-[y|y<-(tail&)=<<(init&x),and$zipWith((`elem`y)#(||))l u]=last$[]:[z|z<-v,all((length.filter(`elem`l++u))#(<=)$z)v]

Much less golfed:

lowerCase = ['a'..'z']
upperCase = ['A'..'Z']

f & x = takeWhile (not . null) $ iterate f x

(#) = flip on

subStrings x = (tail &) =<< (init & x)

pangram p = and $ zipWith ((`elem` p) # (||)) lowerCase upperCase

leqLetters x y = (length . filter (`elem` lowerCase ++ upperCase)) # (<=)

fewestLetters xs = [ x | x <- xs, all (leqLetters x) xs]

safeHead [] = ""
safeHead xs = head xs

f x = safeHead . fewestLetters . filter pangram . subStrings

Surprise, surprise: it's really slow.


答:
Pyke, 6 bytes

```<code>l1GR-!
</code>```

Try it here!

```<code>l1     -   input().lower()
  G -  -  set_difference(alphabet,^)
     ! - not ^
</code>```

Title: Is it a pangram?

Body:
Pyke, 6 bytes

l1GR-!

Try it here!

l1     -   input().lower()
  G -  -  set_difference(alphabet,^)
     ! - not ^


问:
Compress your code in an image
This is a quine variation.

Introduction

We all write short code, because some obscure reasons, but whatever we do, the'll take up at least 144 pixels/byte (with a 12px font). But what would happen, if we would encode our code in images? This is your task today.

Challenge

You task is to read in your own source code (non-proper quines are allowed, e.g. literally reading the source file), and create an image out of it, by setting the red, green and blue components of a pixel based on the ASCII value of the character.

Example:

We have the string "Hello world!"

```<code>Hello world!
</code>```

Let's convert this to ASCII values:

```<code>72 101 108 108 111 32 119 111 114 108 100 33
</code>```

Map the RGB values to it (If the source code's length is not divisible by 3, use 0s as the remaining characters):

```<code> __________________________________________________
| R | G | B || R | G | B || R | G | B || R | G | B |
----------------------------------------------------
|72 |101|108||108|111|32 ||119|111|114||108|100|33 |
----------------------------------------------------
</code>```

We then create the image with the smallest area out of it. We have 4 sets of RGB values, so the smallest image will be a 2*2 image, going from the top left pixel to the right:

And we get this awfully colored image (resized, so it's at least visible, also proves the fact how small it can get)

Rules/Additional information

There's no input

The output should be as a separate file, or in a separate window.

For multibyte characters, split the character in 2 bytes.

The source code must be at least 1 byte long

The image should be the one from the possible sizes, wich has the closest width/height ratio to 1

The pixel count on the image should exactly be ceil(byte count / 3), no extra pixels should be added

Scoring

This is a code-golf, so the smallest answer in bytes wins.

答:
Javascript(ES6) <s>324</s> <s>312</s> 309 Bytes

I'm sure this could be golfed a bit:

```<code>f=()=>{s="f="+f;l=s.length/3;c=document.createElement('canvas');for(i=0;++i<l/i;l%i?0:w=i,h=l/w);c.s=c.setAttribute;c.s("width",w);c.s("height",h);(i=(t=c.getContext('2d')).createImageData(w,h)).data.map((a,b)=>i.data[b]=b%4<3?s.charCodeAt(b-~~(b/4)):255);t.putImageData(i,0,0);open(c.toDataURL('image/png'))}
</code>```

creates a canvas

builds image in it

Opens data url for image in new tab

New lines for readability:

```<code>f=()=>{
    s="f="+f;l=s.length/3;
    c=document.createElement('canvas');
    for(i=0;++i<l/i;l%i?0:w=i,h=l/w);
    c.s=c.setAttribute;
    c.s("width",w);
    c.s("height",h);
    (i=(t=c.getContext('2d')).createImageData(w,h)).data.map((a,b)=>i.data[b]=b%4<3?s.charCodeAt(b-~~(b/4)):255);
    t.putImageData(i,0,0);
    open(c.toDataURL('image/png'))
}
</code>```

Output

Title: Compress your code in an image

Body:
Javascript(ES6) <s>324</s> <s>312</s> 309 Bytes

I'm sure this could be golfed a bit:

f=()=>{s="f="+f;l=s.length/3;c=document.createElement('canvas');for(i=0;++i<l/i;l%i?0:w=i,h=l/w);c.s=c.setAttribute;c.s("width",w);c.s("height",h);(i=(t=c.getContext('2d')).createImageData(w,h)).data.map((a,b)=>i.data[b]=b%4<3?s.charCodeAt(b-~~(b/4)):255);t.putImageData(i,0,0);open(c.toDataURL('image/png'))}

creates a canvas

builds image in it

Opens data url for image in new tab

New lines for readability:

f=()=>{
    s="f="+f;l=s.length/3;
    c=document.createElement('canvas');
    for(i=0;++i<l/i;l%i?0:w=i,h=l/w);
    c.s=c.setAttribute;
    c.s("width",w);
    c.s("height",h);
    (i=(t=c.getContext('2d')).createImageData(w,h)).data.map((a,b)=>i.data[b]=b%4<3?s.charCodeAt(b-~~(b/4)):255);
    t.putImageData(i,0,0);
    open(c.toDataURL('image/png'))
}

Output


问:
Output the Current Time

Challenge

You must output the current time continuously (until cancelled by an interrupt), once every second, by any of the following means:

It must be in 24-hour or AM/PM format.

If it is the former, it must be spaced out with colons (i.e. 15:47:36).

If it is the latter, it must be spaced out with colons and have the AM/PM following (i.e. 3:47:36 PM)

It may be pulled from the internet.

It may be the system time.

It must output any naturally accessible form of output which supports text that you choose.

Output may have extra information aside of the time in it, but you must guarantee one, and only one, output of time per second.

The continuous output must be a second apart - if you choose to wait until the second changes between outputs, that is fine. If you wait a second between each output, that is perfectly acceptable, despite the eventual loss of accuracy.

Since this is a catalog, languages created after this challenge are allowed to compete. 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. Other than that, all the standard rules of code-golf must be obeyed. Submissions in most languages will be scored in bytes in an appropriate preexisting encoding (usually UTF-8).

Catalog

The Stack Snippet at the bottom of this post generates the catalog 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>```

var QUESTION_ID=65020,OVERRIDE_USER=44713;function answersUrl(e){return"//api.stackexchange.com/2.2/questions/"+QUESTION_ID+"/answers?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+ANSWER_FILTER}function commentUrl(e,s){return"//api.stackexchange.com/2.2/answers/"+s.join(";")+"/comments?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+COMMENT_FILTER}function getAnswers(){jQuery.ajax({url:answersUrl(answer_page++),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){answers.push.apply(answers,e.items),answers_hash=[],answer_ids=[],e.items.forEach(function(e){e.comments=[];var s=+e.share_link.match(/\d+/);answer_ids.push(s),answers_hash[s]=e}),e.has_more||(more_answers=!1),comment_page=1,getComments()}})}function getComments(){jQuery.ajax({url:commentUrl(comment_page++,answer_ids),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){e.items.forEach(function(e){e.owner.user_id===OVERRIDE_USER&&answers_hash[e.post_id].comments.push(e)}),e.has_more?getComments():more_answers?getAnswers():process()}})}function getAuthorName(e){return e.owner.display_name}function process(){var e=[];answers.forEach(function(s){var r=s.body;s.comments.forEach(function(e){OVERRIDE_REG.test(e.body)&&(r="
"+e.body.replace(OVERRIDE_REG,"")+"
")});var a=r.match(SCORE_REG);a&&e.push({user:getAuthorName(s),size:+a[2],language:a[1],link:s.share_link})}),e.sort(function(e,s){var r=e.size,a=s.size;return r-a});var s={},r=1,a=null,n=1;e.forEach(function(e){e.size!=a&&(n=r),a=e.size,++r;var t=jQuery("#answer-template").html();t=t.replace("{{PLACE}}",n+".").replace("{{NAME}}",e.user).replace("{{LANGUAGE}}",e.language).replace("{{SIZE}}",e.size).replace("{{LINK}}",e.link),t=jQuery(t),jQuery("#answers").append(t);var o=e.language;/s.lang?1:e.lang<s.lang?-1:0});for(var c=0;c<t.length;++c){var i=jQuery("#language-template").html(),o=t[c];i=i.replace("{{LANGUAGE}}",o.lang).replace("{{NAME}}",o.user).replace("{{SIZE}}",o.size).replace("{{LINK}}",o.link),i=jQuery(i),jQuery("#languages").append(i)}}var ANSWER_FILTER="!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe",COMMENT_FILTER="!)Q2B_A2kjfAiU78X(md6BoYk",answers=[],answers_hash,answer_ids,answer_page=1,more_answers=!0,comment_page;getAnswers();var SCORE_REG=/<h\d>\s*([^\n,]*[^\s,]),.*?(\d+)(?=[^\n\d<>]*(?:<(?:s>[^\n<>]*<\/s>|[^\n<>]+>)[^\n\d<>]*)*<\/h\d>)/,OVERRIDE_REG=/^Override\s*header:\s*/i;```
<pre class="snippet-code-css lang-css prettyprint-override"><code>body{text-align:left!important}#answer-list,#language-list{padding:10px;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">

Leaderboard

	Author	Language	Size

Winners by Language

Language	User	Score

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

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

```

答:
Pure bash, <s>116 113</s> 96 bytes

Using bash version >= 5.0, there is a new EPOCHREALTIME variable:

```<code>for((;;)){
IFS=. read s m<<<$EPOCHREALTIME
printf '%(%c)T\n'
sleep .$[(3000000-10#$m)%1000000]
}
</code>```

This will output something like:

```<code>mar 03 jan 2023 10:28:27
mar 03 jan 2023 10:28:28
mar 03 jan 2023 10:28:29
...
</code>```

Note: In order to save 3 byte, I've done something to not do: mixing  time() (printf '%()T') and gettimeofday() ($EPOCHREALTIME). See: WARNING! About mixing $EPOCHSECONDS and $EPOCHREALTIME (better line 3 would be: printf '%(%c)T.%s\n' $s)!!

With a little more precision:

```<code>for((;;)){
IFS=. read s m<<<$EPOCHREALTIME
printf '%(%c)T.%s\n' $s $m
read -rn1 -t .$[(3000000-10#$m)%1000000] _
}
</code>```

Will output something like:

```<code>mar 03 jan 2023 10:52:44.183297
mar 03 jan 2023 10:52:45.000324
mar 03 jan 2023 10:52:46.000424
mar 03 jan 2023 10:52:47.000300
mar 03 jan 2023 10:52:48.000341
...
</code>```

Title: Output the Current Time

Body:
Pure bash, <s>116 113</s> 96 bytes

Using bash version >= 5.0, there is a new EPOCHREALTIME variable:

for((;;)){
IFS=. read s m<<<$EPOCHREALTIME
printf '%(%c)T\n'
sleep .$[(3000000-10#$m)%1000000]
}

This will output something like:

mar 03 jan 2023 10:28:27
mar 03 jan 2023 10:28:28
mar 03 jan 2023 10:28:29
...

Note: In order to save 3 byte, I've done something to not do: mixing  time() (printf '%()T') and gettimeofday() ($EPOCHREALTIME). See: WARNING! About mixing $EPOCHSECONDS and $EPOCHREALTIME (better line 3 would be: printf '%(%c)T.%s\n' $s)!!

With a little more precision:

for((;;)){
IFS=. read s m<<<$EPOCHREALTIME
printf '%(%c)T.%s\n' $s $m
read -rn1 -t .$[(3000000-10#$m)%1000000] _
}

Will output something like:

mar 03 jan 2023 10:52:44.183297
mar 03 jan 2023 10:52:45.000324
mar 03 jan 2023 10:52:46.000424
mar 03 jan 2023 10:52:47.000300
mar 03 jan 2023 10:52:48.000341
...


问:
How to find the item in a list whose f(item) is the smallest?
I have a list, l and a function f. f is not strictly increasing or decreasing. How can I find the item in the list whose f(item) is the smallest? For example, let's say the list is:

```<code>l = [1, 2, 3, 4]
</code>```

and list(f(x)for x in l) is:

```<code>[2, 9, 0, 3]
</code>```

f(3) is smaller than f of any of the other ones, so it should print "3". What's the shortest way to do this? I initially tried:

```<code>min(f(x) for x in l)
</code>```

But this gives 0, not 3. If I was shooting for readability, not brevity, I would do:

```<code>index = 0
smallest = f(l[0])
for i in range(len(l)):
    value = f(l[i])
    if value < smallest:
        smallest = value
        index = i
</code>```

This is fine, but horrendous for code-golf. Even if it was golfed

```<code>i,s=0,f(l[0])
for x in range(len(l)):
 v=f(l[x])
 if v<s:s,i=v,x
</code>```

This is a bad solution. The shortest solution I can think of is:

```<code>g=[f(x)for x in l];print(l[g.index(min(g))])
</code>```

(44 bytes) How can I golf this down further?

答:
Use key property of min

As @vaultah said, use min(l,key=f). min(l,key=f) takes the minimum of f(i) for i in l.

It is also possible to apply this to max, and sorted. For example, max(l,key=f) is the maximum of f(i) for i in l. For sorted, the usage would be: sorted(l,key=f).


答:
APL (Dyalog), 33 bytes

Requires ⎕IO←0 which is default on many systems. Also, AutoFormat should be off to preserve the program exactly as given.

```<code>(⊂⎕NPUT⊃)'P',⍕⎕AV⍳'␍ɫ␉⍣',⊃⌽⎕NR'f'
</code>```

Hex B9 BA FD 4E 50 55 54 BB F8 0D 50 0D C2 CD FD 41 56 B2 0D 03 0B 01 FF 0D C2 BB C8 FD 4E 52 0D 16 0D

Unicode 28 2282 2395 4E 50 55 54 2283 29 27 50 27 2C 2355 2395 41 56 2373 27 0D 026B 08 2363 27 2C 2283 233D 2395 4E 52 27 66 27

Creates P:
P3 11 1 255 185 186 253 78 80 85 84 187 248 13 80 13 194 205 253 65 86 178 13 3 11 1 255 13 194 187 200 253 78 82 13 22 13

Which you save and drop here to see:

⎕NR'f' Nested Representation of the program f

⊃⌽ pick the last (lit. first of the reversed) element (line)

'␍ɫ␉⍣', prepend the four characters (filetype, width, height, max)

⎕AV⍳ find corresponding indices in the Atomic Vector (the character set

⍕ format as text

'P', prepend a letter

(…) apply the following tacit function:

 ⊂ take the entire argument [and into a]

 ⎕NPUT Native [file,] Put [it, with a filename consisting of]

 ⊃ the first character ("P")

Title: Compress your code in an image

Body:
This is a quine variation.

Introduction

We all write short code, because some obscure reasons, but whatever we do, the'll take up at least 144 pixels/byte (with a 12px font). But what would happen, if we would encode our code in images? This is your task today.

Challenge

You task is to read in your own source code (non-proper quines are allowed, e.g. literally reading the source file), and create an image out of it, by setting the red, green and blue components of a pixel based on the ASCII value of the character.

Example:

We have the string "Hello world!"

```<code>Hello world!
</code>```

Let's convert this to ASCII values:

```<code>72 101 108 108 111 32 119 111 114 108 100 33
</code>```

Map the RGB values to it (If the source code's length is not divisible by 3, use 0s as the remaining characters):

```<code> __________________________________________________
| R | G | B || R | G | B || R | G | B || R | G | B |
----------------------------------------------------
|72 |101|108||108|111|32 ||119|111|114||108|100|33 |
----------------------------------------------------
</code>```

We then create the image with the smallest area out of it. We have 4 sets of RGB values, so the smallest image will be a 2*2 image, going from the top left pixel to the right:

And we get this awfully colored image (resized, so it's at least visible, also proves the fact how small it can get)

Rules/Additional information

There's no input

The output should be as a separate file, or in a separate window.

For multibyte characters, split the character in 2 bytes.

The source code must be at least 1 byte long

The image should be the one from the possible sizes, wich has the closest width/height ratio to 1

The pixel count on the image should exactly be ceil(byte count / 3), no extra pixels should be added

Scoring

This is a code-golf, so the smallest answer in bytes wins.

Body:
APL (Dyalog), 33 bytes

Requires ⎕IO←0 which is default on many systems. Also, AutoFormat should be off to preserve the program exactly as given.

(⊂⎕NPUT⊃)'P',⍕⎕AV⍳'␍ɫ␉⍣',⊃⌽⎕NR'f'

Hex B9 BA FD 4E 50 55 54 BB F8 0D 50 0D C2 CD FD 41 56 B2 0D 03 0B 01 FF 0D C2 BB C8 FD 4E 52 0D 16 0D

Unicode 28 2282 2395 4E 50 55 54 2283 29 27 50 27 2C 2355 2395 41 56 2373 27 0D 026B 08 2363 27 2C 2283 233D 2395 4E 52 27 66 27

Creates P:
P3 11 1 255 185 186 253 78 80 85 84 187 248 13 80 13 194 205 253 65 86 178 13 3 11 1 255 13 194 187 200 253 78 82 13 22 13

Which you save and drop here to see:

⎕NR'f' Nested Representation of the program f

⊃⌽ pick the last (lit. first of the reversed) element (line)

'␍ɫ␉⍣', prepend the four characters (filetype, width, height, max)

⎕AV⍳ find corresponding indices in the Atomic Vector (the character set

⍕ format as text

'P', prepend a letter

(…) apply the following tacit function:

 ⊂ take the entire argument [and into a]

 ⎕NPUT Native [file,] Put [it, with a filename consisting of]

 ⊃ the first character ("P")


问:
Grow a Treemote!
This is my friend Thomas. He is half tree, half emoticon.

```<code>|    |
| :D |
|    |
</code>```

He is lonely. Let's make him some friends!

Given a text-based emoticon as input (e.g. ಠ_ಠ, :P, >_>, not , , or ), output the corresponding treemote.

A treemote's length is how many characters it is lon (basically most builtin length functions for strings). So ಠ_ಠ has length 3.

The syntax for a treemote of length n is as follows:

```<code>|< 2+n spaces>| * ceil(n/2)
| <emote> | (note the spaces)
|< 2+n spaces>| * ceil(n/2)
</code>```

So any treemote of length 3 would look like:

```<code>|     |
|     |
| ಠ_ಠ |
|     |
|     |
</code>```

He has ceil(n/2) newline separated trunk segments on either side, each with 2 + n spaces inside.

Challenge: Given the text-based emoticon, output the corresponding treemote.

Other rules:

This is code-golf, which means I want you to write short code.

Standard loopholes disallowed.

You must support non-ascii characters unless your language can't handle them.

Test Cases:

```<code>^_^

|     |
|     |
| ^_^ |
|     |
|     |

\o/

|     |
|     |
| \o/ |
|     |
|     |

(✿◠‿◠)

|        |
|        |
|        |
| (✿◠‿◠) |
|        |
|        |
|        |

D:

|    |
| D: |
|    |

( ͡° ͜ʖ ͡°)

|             |
|             |
|             |
|             |
|             |
|             |
| ( ͡° ͜ʖ ͡°) |
|             |
|             |
|             |
|             |
|             |
|             |
</code>```

答:
Python 3.5, <s>76</s> <s>75</s> 73 bytes:

(Thanks to Blue for a tip which saved 2 bytes!)

```<code>def i(n):q=len(n);z=('|'+' '*(2+q)+'|\n')*-(-q//2);print(z+'| '+n+' |\n'+z)
</code>```

Try It Online! (Ideone)

Also, here is a noncompeting Python 2.7.5 version since it is much longer at  87 bytes.

```<code>def i(n):q=len(n.decode('utf-8'));z=('|'+' '*(2+q)+'|\n')*-(-q/2);print z+'| '+n+' |\n'+z
</code>```

This is because Python 2's default encoding is ascii, and therefore, characters such as ಠ outside the 128 unicode point range count as more than 1 byte (list('ಠ') yields ['\xe0', '\xb2', '\xa0']). The only workaround I could think of for this was to first decode the input using utf-8, and then move on with this utf-8 decoded string.

Try This Python 2 Version Online! (Ideone)

Title: Grow a Treemote!

Body:
Python 3.5, <s>76</s> <s>75</s> 73 bytes:

(Thanks to Blue for a tip which saved 2 bytes!)

def i(n):q=len(n);z=('|'+' '*(2+q)+'|\n')*-(-q//2);print(z+'| '+n+' |\n'+z)

Try It Online! (Ideone)

Also, here is a noncompeting Python 2.7.5 version since it is much longer at  87 bytes.

def i(n):q=len(n.decode('utf-8'));z=('|'+' '*(2+q)+'|\n')*-(-q/2);print z+'| '+n+' |\n'+z

This is because Python 2's default encoding is ascii, and therefore, characters such as ಠ outside the 128 unicode point range count as more than 1 byte (list('ಠ') yields ['\xe0', '\xb2', '\xa0']). The only workaround I could think of for this was to first decode the input using utf-8, and then move on with this utf-8 decoded string.

Try This Python 2 Version Online! (Ideone)


答:
Vitsy, 43 bytes

```<code>IV2m3mz4m2m
3mV\D4m
V1+2/\[1m]
' || '
}}ZaO</code>```

Explanation:

```<code>IV2m3mz4m2m

I            Grab the length of the input string.
 V           Save that value to a global final variable.
  2m         Call the method at line index 2.
    3m       Call the method at line index 3.
      z      Push the entire input to the stack.
       4m    Call the method at line index 4.
         2m  Call the method at line index 2.

3mV\D4m

3m           Call the method at line index 3.
  V          Push the global variable to the stack.
   \D        Duplicate the top item on the stack that many times.
     4m      Call the method at line index 4.

V1+2/\[1m]

V            Push the global variable to the stack.
 1+          Add one to the top value.
             REASONING: We want ceil(V/2), and since repeat commands follow the floor value of repeats, we want ceil(V/2)+.5, so we add one to make this work right.
   2/        Divide by two.
     \[1m]   Call method 1 that top value of the stack times.

' || '

' || '       Push ' || ', the string, to the stack.

}}ZaO

}}           Push the bottom item of the stack to the top twice.
  Z          Output everything in the stack.
   aO        Output a newline.
</code>```

Try it online!

<s>Note that, due to a bug in TIO, input with unicode characters will not work. You'll have to use the local version instead for those.</s> Thanks, @Dennis!

Title: Grow a Treemote!

Body:
This is my friend Thomas. He is half tree, half emoticon.

```<code>|    |
| :D |
|    |
</code>```

He is lonely. Let's make him some friends!

Given a text-based emoticon as input (e.g. ಠ_ಠ, :P, >_>, not , , or ), output the corresponding treemote.

A treemote's length is how many characters it is lon (basically most builtin length functions for strings). So ಠ_ಠ has length 3.

The syntax for a treemote of length n is as follows:

```<code>|< 2+n spaces>| * ceil(n/2)
| <emote> | (note the spaces)
|< 2+n spaces>| * ceil(n/2)
</code>```

So any treemote of length 3 would look like:

```<code>|     |
|     |
| ಠ_ಠ |
|     |
|     |
</code>```

He has ceil(n/2) newline separated trunk segments on either side, each with 2 + n spaces inside.

Challenge: Given the text-based emoticon, output the corresponding treemote.

Other rules:

This is code-golf, which means I want you to write short code.

Standard loopholes disallowed.

You must support non-ascii characters unless your language can't handle them.

Test Cases:

```<code>^_^

|     |
|     |
| ^_^ |
|     |
|     |

\o/

|     |
|     |
| \o/ |
|     |
|     |

(✿◠‿◠)

|        |
|        |
|        |
| (✿◠‿◠) |
|        |
|        |
|        |

D:

|    |
| D: |
|    |

( ͡° ͜ʖ ͡°)

|             |
|             |
|             |
|             |
|             |
|             |
| ( ͡° ͜ʖ ͡°) |
|             |
|             |
|             |
|             |
|             |
|             |
</code>```

Body:
Vitsy, 43 bytes

IV2m3mz4m2m
3mV\D4m
V1+2/\[1m]
' || '
}}ZaO

Explanation:

IV2m3mz4m2m

I            Grab the length of the input string.
 V           Save that value to a global final variable.
  2m         Call the method at line index 2.
    3m       Call the method at line index 3.
      z      Push the entire input to the stack.
       4m    Call the method at line index 4.
         2m  Call the method at line index 2.

3mV\D4m

3m           Call the method at line index 3.
  V          Push the global variable to the stack.
   \D        Duplicate the top item on the stack that many times.
     4m      Call the method at line index 4.

V1+2/\[1m]

V            Push the global variable to the stack.
 1+          Add one to the top value.
             REASONING: We want ceil(V/2), and since repeat commands follow the floor value of repeats, we want ceil(V/2)+.5, so we add one to make this work right.
   2/        Divide by two.
     \[1m]   Call method 1 that top value of the stack times.

' || '

' || '       Push ' || ', the string, to the stack.

}}ZaO

}}           Push the bottom item of the stack to the top twice.
  Z          Output everything in the stack.
   aO        Output a newline.

Try it online!

<s>Note that, due to a bug in TIO, input with unicode characters will not work. You'll have to use the local version instead for those.</s> Thanks, @Dennis!


答:
Dyalog APL, <s>37</s> <s>34</s> 33 bytes

```<code>{↑'|'{⍺⍵⍺}¨b,(⊂⍵),b←' '/⍨⌈0.5×≢⍵}
</code>```

Chrome users: See footnote*

Test cases

```<code>      f←{↑'|'{⍺⍵⍺}¨b,(⊂⍵),b←' '/⍨⌈0.5×≢⍵}

      f,'☺' ⍝ the , is necessary to create a 1 char string instead of a character scalar
|   |
| ☺ |
|   |
      f':D'
|    |
| :D |
|    |
      f'^_^'
|     |
|     |
| ^_^ |
|     |
|     |
</code>```

*Chrome misdisplays the two characters ≢⍵ (U+2262,U+2375) as ≢⍵ (U+2261,U+0338,U+2375) instead of as ̸≡⍵ (U+0338,U+2262,U+2375), so here is a display version for Chrome: {↑'|'{⍺⍵⍺}¨b,(⊂⍵),b←' '/⍨⌈0.5×̸̸≡⍵}

Title: Grow a Treemote!

Body:
Dyalog APL, <s>37</s> <s>34</s> 33 bytes

{↑'|'{⍺⍵⍺}¨b,(⊂⍵),b←' '/⍨⌈0.5×≢⍵}

Chrome users: See footnote*

Test cases

      f←{↑'|'{⍺⍵⍺}¨b,(⊂⍵),b←' '/⍨⌈0.5×≢⍵}

      f,'☺' ⍝ the , is necessary to create a 1 char string instead of a character scalar
|   |
| ☺ |
|   |
      f':D'
|    |
| :D |
|    |
      f'^_^'
|     |
|     |
| ^_^ |
|     |
|     |

*Chrome misdisplays the two characters ≢⍵ (U+2262,U+2375) as ≢⍵ (U+2261,U+0338,U+2375) instead of as ̸≡⍵ (U+0338,U+2262,U+2375), so here is a display version for Chrome: {↑'|'{⍺⍵⍺}¨b,(⊂⍵),b←' '/⍨⌈0.5×̸̸≡⍵}


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

```<code>I| A |ByWo=ceil(len(""")/2.0)
 dF.d0kwviWr Yu@-pH@-P
</code>```

Unfortunately, V has next to nothing in terms of mathematical operations. The divide and ceil functions drastically inflated the byte count.

Since this contains a bunch of nasty unprintables, here is a reversible hexdump:

```<code>00000000: 497c 201b 4120 7c1b 4279 576f 123d 6365  I| .A |.ByWo.=ce
00000010: 696c 286c 656e 2822 1222 2229 2f32 2e30  il(len("."")/2.0
00000020: 290d 201b 6446 2e64 306b 7776 6957 7220  ). .dF.d0kwviWr
00000030: 5975 402d 7048 402d 50                   Yu@-pH@-P
</code>```

Explanation:

```<code>I| A |                                #Add surrounding bars
      B                               #Move back
       yW                             #Yank a word
         o                            #Open a new line
          <C-r>=                      #Evaluate

          <C-r>"                      #Insert the yanked text into our evaluation
ceil(len("      ")/2.0)<cr>           #Evaluate ceil(len(text)/2) and insert it

 dF.                                  #Append a space and delete backward to a (.)
                                      #By default, this will be in register "-
    d0                                #Delete this number into register a
      kw                              #Move up, and forward a word
        viWr                          #Replace the emoticon with spaces
             Yu                       #Yank this line, and undo
                                      #(so we can get the emoticon back)
               @-p                    #Paste this text "- times.
                  H                   #Move to the beginning
                   @-P                #Paste this text "- times behind the cursor.
</code>```

Title: Grow a Treemote!

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

I| A |ByWo=ceil(len(""")/2.0)
 dF.d0kwviWr Yu@-pH@-P

Unfortunately, V has next to nothing in terms of mathematical operations. The divide and ceil functions drastically inflated the byte count.

Since this contains a bunch of nasty unprintables, here is a reversible hexdump:

00000000: 497c 201b 4120 7c1b 4279 576f 123d 6365  I| .A |.ByWo.=ce
00000010: 696c 286c 656e 2822 1222 2229 2f32 2e30  il(len("."")/2.0
00000020: 290d 201b 6446 2e64 306b 7776 6957 7220  ). .dF.d0kwviWr
00000030: 5975 402d 7048 402d 50                   Yu@-pH@-P

Explanation:

I| A |                                #Add surrounding bars
      B                               #Move back
       yW                             #Yank a word
         o                            #Open a new line
          <C-r>=                      #Evaluate

          <C-r>"                      #Insert the yanked text into our evaluation
ceil(len("      ")/2.0)<cr>           #Evaluate ceil(len(text)/2) and insert it

 dF.                                  #Append a space and delete backward to a (.)
                                      #By default, this will be in register "-
    d0                                #Delete this number into register a
      kw                              #Move up, and forward a word
        viWr                          #Replace the emoticon with spaces
             Yu                       #Yank this line, and undo
                                      #(so we can get the emoticon back)
               @-p                    #Paste this text "- times.
                  H                   #Move to the beginning
                   @-P                #Paste this text "- times behind the cursor.


答:
05AB1E, <s>27</s> 25 bytes

Code:

```<code>g©Ìð×"|ÿ|
"®;î×©„| Â¹s¶®J
</code>```

Explanation:

```<code>g                  # Push the length of the input string.
 ©                 # Copy that to the register.
  Ì                # Increment by 2.
   ð×              # Multiply by spaces.
     "|ÿ|\n"       # ÿ is used for interpolation and push the string "|spaces|\n".
                   #
 ®                 # Retrieve the value from the register.
  ;î               # Divide by 2 and round up.
    ×              # Multiply that by "|spaces|".
     ©             # Copy this into the register.
      „|           # Push the string "| ".
         Â         # Bifurcate, pushing the string and the string reversed.
          ¹s       # Push input and swap.
            ¶      # Push a newline character.
             ®J    # Retrieve the value from the register and join everything in the stack.
                   # Implicitly output this.
</code>```

Uses CP-1252 encoding. Try it online!.

Title: Grow a Treemote!

Body:
05AB1E, <s>27</s> 25 bytes

Code:

g©Ìð×"|ÿ|
"®;î×©„| Â¹s¶®J

Explanation:

g                  # Push the length of the input string.
 ©                 # Copy that to the register.
  Ì                # Increment by 2.
   ð×              # Multiply by spaces.
     "|ÿ|\n"       # ÿ is used for interpolation and push the string "|spaces|\n".
                   #
 ®                 # Retrieve the value from the register.
  ;î               # Divide by 2 and round up.
    ×              # Multiply that by "|spaces|".
     ©             # Copy this into the register.
      „|           # Push the string "| ".
         Â         # Bifurcate, pushing the string and the string reversed.
          ¹s       # Push input and swap.
            ¶      # Push a newline character.
             ®J    # Retrieve the value from the register and join everything in the stack.
                   # Implicitly output this.

Uses CP-1252 encoding. Try it online!.


答:
JavaScript ES6, <s>83</s> 78 bytes

```<code>e=>(a=`| ${" ".repeat(n=e.length)} |
`.repeat(Math.ceil(n/2)))+`| ${e} |
${a}`
</code>```

Title: Grow a Treemote!

Body:
JavaScript ES6, <s>83</s> 78 bytes

e=>(a=`| ${" ".repeat(n=e.length)} |
`.repeat(Math.ceil(n/2)))+`| ${e} |
${a}`


答:
Pyke, 31 bytes

```<code>"||
"1dQlO*:Ql_2f_*iO"|  |"2Q:i
</code>```

Try it here!

Thanks @R.Kap  for saving a byte with the floor divide trick

Title: Grow a Treemote!

Body:
Pyke, 31 bytes

"||
"1dQlO*:Ql_2f_*iO"|  |"2Q:i

Try it here!

Thanks @R.Kap  for saving a byte with the floor divide trick


答:
Javascript ES6 - 216 bytes

```<code>f=(  )=>((d=(x=(v=document.createElement`canvas`).getContext`2d`).createImageData(v.width=9,v.height=8)).data.set([..."f="+f].reduce((p,c,i)=>(c=c.charCodeAt(0),[...p,...i%3<2?[c]:[c,255]]))),x.putImageData(d,0,0),v)
</code>```

Ungolfed:

```<code>f=(  )=>(                                           // define function f (extra spaces to account for missing pixel + alpha channel calculation)
 (d=(x=(v=document.createElement`canvas`).          // assign html5 canvas to v
          getContext`2d`).                          // assign graphics context to x
          createImageData(v.width=9,v.height=8)).   // create & assign ImageData to d
                                                    //   set width and height of both d and v
 data.set([..."f="+f].                              // get f's source, convert to array of chars
   reduce((p,c,i)=>(c=c.charCodeAt(0),              // convert char array to int array
                    [...p,...i%3<2?[c]:[c,255]]))), // insert alpha values 255
 x.putImageData(d,0,0),                             // draw source RGBA array to canvas
 v)                                                 // return canvas
</code>```

Note: f returns a canvas.

Example run (assumes there's a  to append to):

```<code>document.body.appendChild(f())
</code>```

Should dump the following image to the page (enlarged):

Title: Compress your code in an image

Body:
Javascript ES6 - 216 bytes

f=(  )=>((d=(x=(v=document.createElement`canvas`).getContext`2d`).createImageData(v.width=9,v.height=8)).data.set([..."f="+f].reduce((p,c,i)=>(c=c.charCodeAt(0),[...p,...i%3<2?[c]:[c,255]]))),x.putImageData(d,0,0),v)

Ungolfed:

f=(  )=>(                                           // define function f (extra spaces to account for missing pixel + alpha channel calculation)
 (d=(x=(v=document.createElement`canvas`).          // assign html5 canvas to v
          getContext`2d`).                          // assign graphics context to x
          createImageData(v.width=9,v.height=8)).   // create & assign ImageData to d
                                                    //   set width and height of both d and v
 data.set([..."f="+f].                              // get f's source, convert to array of chars
   reduce((p,c,i)=>(c=c.charCodeAt(0),              // convert char array to int array
                    [...p,...i%3<2?[c]:[c,255]]))), // insert alpha values 255
 x.putImageData(d,0,0),                             // draw source RGBA array to canvas
 v)                                                 // return canvas

Note: f returns a canvas.

Example run (assumes there's a <body> to append to):

document.body.appendChild(f())

Should dump the following image to the page (enlarged):


问:
Make an error quine!
Your challenge: write a "program", for a language of your choice, that causes the compiler/interpreter/runtime to produce error output when compiling/running your program which is identical to your program's source code.

Rules:

Your program may be specific to a particular version or implementation of your language's compiler/interpreter/runtime environment. If so, please specify the particulars.

Only standard compiler/interpreter/runtime options are permitted. You cannot pass some weird flag to your compiler to get a specific result.

The program does not need to be syntactically or semantically valid, but I may give a bounty to the best syntactically valid submission.

The program must not produce any output of its own (e.g. by calling a print or output function). All output generated upon attempting to compile/run the program must originate from the compiler/interpreter/runtime.

The complete output of the compiler/interpreter/runtime must be exactly identical to your program source code.

The compiler/interpreter/runtime must generate at least one error message when invoked with your program.

This is a popularity contest. Most creative answer, as determined by upvotes, wins. If you can give a good case for using a standard loophole, you may do so.

答:
Factor

```<code>No word named "No" found in current vocabulary search path
</code>```

Guess what it prints?

```<code>No word named "No" found in current vocabulary search path
</code>```

Title: Make an error quine!

Body:
Factor

No word named "No" found in current vocabulary search path

Guess what it prints?

No word named "No" found in current vocabulary search path