答:
05AB1E, 16 bytes

```<code>l'f¡vy'w¡`FDïˆ}\
</code>```

Explanation

```<code>                   # implicit input
l                  # convert to lower case: 'f1w5f2w3'
 'f¡               # split on "f": ['','1w5','2w3']
    v              # for each: ex '1w5'
     y'w¡          # split on "w": ['1','5']
         `         # flatten: '5','1'
          FDïˆ}    # N times do; duplicate, convert to int, push to global array: [1,1,1,1,1]
               \   # discard last copy
                   # implicitly print list at the end of the program
</code>```

Try it online

Title: Text animation format Code Golf

Body:
Working with old files from DOS, I found an ancient text animation format, that specify how much time each frame must be shown in the screen. It's very simple:

F1W5F2W3

This example above indicates that Frame 1 must be shown for 5 units of time, and frame 2 for 3 units more. Now I want to convert it to:

1, 1, 1, 1, 1, 2, 2, 2

In the converted example below, frame 1 is repeated 5 times, and frame 2 three times.

Rules: The only allowed letters are F and W (and the lowercase counterparts, f and w). Numbers can go up to 255. Total input String with no more than 255 chars.

Other examples:

Input: F10W3F11W3F10W3F12W3

Output: 10, 10, 10, 11, 11, 11, 10, 10, 10, 12, 12, 12

Input: f1w0f2w10

Output: 2, 2, 2, 2, 2, 2, 2, 2, 2, 2

Short code wins.

Edited - Accepted formats:
Any answer containing the output and ignoring spaces. Ex: 1, 1, 2, 2 or [1,1,2,2] or (1,1,2,2). But NOT 1 1 2 2 or [1; 1; 2; 2] or [1 1 2 2].

Body:
05AB1E, 16 bytes

l'f¡vy'w¡`FDïˆ}\

Explanation

                   # implicit input
l                  # convert to lower case: 'f1w5f2w3'
 'f¡               # split on "f": ['','1w5','2w3']
    v              # for each: ex '1w5'
     y'w¡          # split on "w": ['1','5']
         `         # flatten: '5','1'
          FDïˆ}    # N times do; duplicate, convert to int, push to global array: [1,1,1,1,1]
               \   # discard last copy
                   # implicitly print list at the end of the program

Try it online


问:
Implement this key cipher

Implement this key cipher

Goal

Use the algorithm (explained in the Algorithm section) to implement a certain cipher.

The program must read input from STDIN or the closest available equivalent, use the algorithm to generate the ciphertext and a key.

The ciphertext and the key will be written to STDOUT or the closest available equivalent. Any format is allowed, as long as it outputs the ciphertext and the key.

Algorithm

Convert the characters in the string into the respective ASCII values. For example:

Hello -> 72 101 108 108 111

Next, you will need to generate a key as long as the string with random numbers in the range of 0-9.

Hello -> 62841

Add the integers in the random number sequence to the ASCII values of the string. In the above examples, 72 would become 78, and 101 would become 104.

72 + 6 = 78, 101 + 2 = 103, 108 + 8 = 116, etc

Next, convert the new values back to characters. In the above examples, the text Hello has become Ngtpp.

Examples

(These are simply examples of what the output might look like. The output can and will vary.)

```<code>Hello World

Lfrlu)_supg
41606984343
</code>```

```<code>This will be encoded

Zhjs$~koo gj$iuhofgj
60104723305544750226
</code>```

Rules

You can assume that the input will only contain characters in the range a-z, A-Z, and spaces.

Submissions must be full programs or functions.

Submissions will be scored in bytes.

Standard loopholes are forbidden.

This is code-golf, so the shortest code wins.

(This is one of my first challenges, if there's something wrong with it, feel free to tell me how I could improve it.)

答:
C#, 174 bytes

```<code>using static System.Console;class b{static void Main(){var c=new System.Random();var d="\n";foreach(var e in ReadLine()){var f=c.Next(10);Write((char)(e+f));d+=f;}Write(d);}}
</code>```

Ungolfed:

```<code>using static System.Console;

class b
{
    static void Main()
    {
        var c = new System.Random();
        var d = "\n";

        foreach (var e in ReadLine())
        {
            var f = c.Next(10);
            Write((char)(e + f));
            d += f;
        }

        Write(d);
    }
}
</code>```

Pretty straightforward, really.

ContentLicense: CC BY-SA 3.0

Title: Implement this key cipher

Body:
C#, 174 bytes

using static System.Console;class b{static void Main(){var c=new System.Random();var d="\n";foreach(var e in ReadLine()){var f=c.Next(10);Write((char)(e+f));d+=f;}Write(d);}}

Ungolfed:

using static System.Console;

class b
{
    static void Main()
    {
        var c = new System.Random();
        var d = "\n";

        foreach (var e in ReadLine())
        {
            var f = c.Next(10);
            Write((char)(e + f));
            d += f;
        }

        Write(d);
    }
}

Pretty straightforward, really.


问:
The Letter A without A
Your task is to display the letter "A" alone, without anything else, except any form of trailing newlines if you cannot avoid them, doing so in a program and/or snippet. Code that returns (instead of printing) is allowed.

Both the lowercase and uppercase versions of the letter "A" are acceptable (that is, unicode U+0061 or unicode U+0041. Other character encodings that aren't Unicode are allowed, but either way, the resulting output of your code must be the latin letter "A", and not any lookalikes or homoglyphs)

You must not use any of the below characters in your code, regardless of the character encoding that you pick:

"A", whether uppercase or lowercase.

"U", whether lowercase or uppercase.

X, whether uppercase or lowercase.

+

&

#

0

1

4

5

6

7

9

Cheating, loopholes, etc, are not allowed.

Since this is code-golf, the shortest solution, in bytes, that follows all the rules, is the winner.

Validity Checker

This Stack Snippet checks to make sure your code doesn't use the restricted characters. It might not work properly for some character encodings.

var t = prompt("Input your code.");

if (/[AaUuXx+&#0145679]/.test(t)) {
  alert("Contains a disallowed character!");
} else {
  alert("No disallowed characters");
}```
</div>
</div>
</p>

<p><em>This Stack Snippet that makes sure you don't have a disallowed character is also available on JSFiddle.</em></p>

<h3>Leaderboard</h3>

<p><div class="snippet" data-lang="js" data-hide="true" data-console="false" data-babel="false">
<div class="snippet-code snippet-currently-hidden">
<pre class="snippet-code-js lang-js prettyprint-override"><code>var QUESTION_ID=90349,OVERRIDE_USER=58717;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;</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></code>```

答:
Java, 55 bytes

void f(){System.err.write('c'-2);System.err.println();}
```

Since the code has to print it, one of the two built-in writers are required. System.out is, well, out, because it contains u. System.err works, however.

The next hurdle is Java's handling of char and int. Since it is not allowed to cast to char because it contains a, and because 'c' - 2 gets promoted to int, another mechanism is required. System.err is a PrintWriter, which has a write(char) method but not write(int). Putting 'c' - 2 in there forces it to char without a cast.

Finally, every time I ran the program the buffer for System.err would not flush like it is supposed to, and the program printed nothing. So I had to flush it manually. However, System.err.flush() is not allowed, so I called println() which implicitly flushes the underlying stream.

Title: The Letter A without A

Body:
Java, 55 bytes

void f(){System.err.write('c'-2);System.err.println();}

Since the code has to print it, one of the two built-in writers are required. System.out is, well, out, because it contains u. System.err works, however.

The next hurdle is Java's handling of char and int. Since it is not allowed to cast to char because it contains a, and because 'c' - 2 gets promoted to int, another mechanism is required. System.err is a PrintWriter, which has a write(char) method but not write(int). Putting 'c' - 2 in there forces it to char without a cast.

Finally, every time I ran the program the buffer for System.err would not flush like it is supposed to, and the program printed nothing. So I had to flush it manually. However, System.err.flush() is not allowed, so I called println() which implicitly flushes the underlying stream.


问:
The Permutation Pigeon-hole Principle
In the game of sudoku, many players like to "pencil in" possible numbers that can go in each square:

The above row can be represented as an array:

```<code>[[1,2,9], [6], [5], [7], [1,2,9], [1,2,9], [3], [1,2,4], [8]]
</code>```

Now, notice that there is only 1 place where a 4 can go.  This effectively lets us simplify the above list to:

```<code>[[1,2,9], [6], [5], [7], [1,2,9], [1,2,9], [3], [4], [8]]
</code>```

The goal of this challenge is to take a list of possible numbers in a permutation, and deduce which possibilities can be eliminated.

As another example, lets say you have the following array of possibilities:

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

The last two places must be filled with 1 and 2.  Therefore, we can remove those possibilities from the first two elements in the array:

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

As another example:

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

Its impossible to construct a permutation from the above possibilities, as there's only 1 location for both 1 and 3, and you would want to return an empty array.

You need to input a list of possibilities and output the remaining possibilities after the maximum number of possibilities have been eliminated.

If a particular array is impossible, you either need to return an empty array, or an array where one of the subarrays is empty.

You may assume that the array will be well-formed, and have at least 1 element.

Given an array of size N, you can assume the numbers in the subarray will always be in the range [0:N), and that N <= 10

You may not assume that every number from 0 to N-1 will be present

You may assume that numbers within a single subarray are unique.

If a subarray contains only a single possibility, you can either represent the possibility in an array or by itself.  [[1],[2],[0]], [1,2,0], [[1,2],0,[1,2]] are all valid.

You may accept the array either in a reasonable string format or in list/array format.

Subarrays can be in any order.

Instead of dealing with ragged arrays, you can pad empty places with -1.

Test cases

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

This is a code-golf so make your answers as short as possible!

答:
Haskell, 100 bytes

```<code>import Data.List
p z=map nub$transpose$filter(and.(flip$zipWith elem)z)$permutations[0..length z-1]
</code>```

Title: The Permutation Pigeon-hole Principle

Body:
Haskell, 100 bytes

import Data.List
p z=map nub$transpose$filter(and.(flip$zipWith elem)z)$permutations[0..length z-1]


答:
Jelly, 10 bytes

```<code>Œp⁼Q$ÐfZQ€
</code>```

Try it online!

```<code>Œp⁼Q$ÐfZQ€   Main chain, argument: z

Œp           Cartesian product
  ⁼Q$Ðf      Filter for those that remain unchanged when uniquified
       Z     Transpose
        Q€   Uniquify each subarray
</code>```

Title: The Permutation Pigeon-hole Principle

Body:
In the game of sudoku, many players like to "pencil in" possible numbers that can go in each square:

The above row can be represented as an array:

```<code>[[1,2,9], [6], [5], [7], [1,2,9], [1,2,9], [3], [1,2,4], [8]]
</code>```

Now, notice that there is only 1 place where a 4 can go.  This effectively lets us simplify the above list to:

```<code>[[1,2,9], [6], [5], [7], [1,2,9], [1,2,9], [3], [4], [8]]
</code>```

The goal of this challenge is to take a list of possible numbers in a permutation, and deduce which possibilities can be eliminated.

As another example, lets say you have the following array of possibilities:

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

The last two places must be filled with 1 and 2.  Therefore, we can remove those possibilities from the first two elements in the array:

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

As another example:

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

Its impossible to construct a permutation from the above possibilities, as there's only 1 location for both 1 and 3, and you would want to return an empty array.

You need to input a list of possibilities and output the remaining possibilities after the maximum number of possibilities have been eliminated.

If a particular array is impossible, you either need to return an empty array, or an array where one of the subarrays is empty.

You may assume that the array will be well-formed, and have at least 1 element.

Given an array of size N, you can assume the numbers in the subarray will always be in the range [0:N), and that N <= 10

You may not assume that every number from 0 to N-1 will be present

You may assume that numbers within a single subarray are unique.

If a subarray contains only a single possibility, you can either represent the possibility in an array or by itself.  [[1],[2],[0]], [1,2,0], [[1,2],0,[1,2]] are all valid.

You may accept the array either in a reasonable string format or in list/array format.

Subarrays can be in any order.

Instead of dealing with ragged arrays, you can pad empty places with -1.

Test cases

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

This is a code-golf so make your answers as short as possible!

Body:
Jelly, 10 bytes

Œp⁼Q$ÐfZQ€

Try it online!

Œp⁼Q$ÐfZQ€   Main chain, argument: z

Œp           Cartesian product
  ⁼Q$Ðf      Filter for those that remain unchanged when uniquified
       Z     Transpose
        Q€   Uniquify each subarray


答:
Perl 6: 55 or 70 bytes

As an anonymous function that takes a string parameter, and returns a list of two strings (54 characters, 55 bytes):

```<code>{my @n=^9 .roll(.ords);(.ords Z+@n)».chr.join,@n.join}
</code>```

As a program that reads from STDIN and writes to STDOUT (69 characters, 70 bytes):

```<code>my @a=get.ords;my @n=^9 .roll(@a);say (@a Z+@n)».chr.join;say @n.join
</code>```

Title: Implement this key cipher

Body:
Implement this key cipher

Goal

Use the algorithm (explained in the Algorithm section) to implement a certain cipher.

The program must read input from STDIN or the closest available equivalent, use the algorithm to generate the ciphertext and a key.

The ciphertext and the key will be written to STDOUT or the closest available equivalent. Any format is allowed, as long as it outputs the ciphertext and the key.

Algorithm

Convert the characters in the string into the respective ASCII values. For example:

Hello -> 72 101 108 108 111

Next, you will need to generate a key as long as the string with random numbers in the range of 0-9.

Hello -> 62841

Add the integers in the random number sequence to the ASCII values of the string. In the above examples, 72 would become 78, and 101 would become 104.

72 + 6 = 78, 101 + 2 = 103, 108 + 8 = 116, etc

Next, convert the new values back to characters. In the above examples, the text Hello has become Ngtpp.

Examples

(These are simply examples of what the output might look like. The output can and will vary.)

```<code>Hello World

Lfrlu)_supg
41606984343
</code>```

```<code>This will be encoded

Zhjs$~koo gj$iuhofgj
60104723305544750226
</code>```

Rules

You can assume that the input will only contain characters in the range a-z, A-Z, and spaces.

Submissions must be full programs or functions.

Submissions will be scored in bytes.

Standard loopholes are forbidden.

This is code-golf, so the shortest code wins.

(This is one of my first challenges, if there's something wrong with it, feel free to tell me how I could improve it.)

Body:
Perl 6: 55 or 70 bytes

As an anonymous function that takes a string parameter, and returns a list of two strings (54 characters, 55 bytes):

{my @n=^9 .roll(.ords);(.ords Z+@n)».chr.join,@n.join}

As a program that reads from STDIN and writes to STDOUT (69 characters, 70 bytes):

my @a=get.ords;my @n=^9 .roll(@a);say (@a Z+@n)».chr.join;say @n.join


问:
The Great Pyramid of ASCII

Introduction

It's 2600 BC and people are building pyramids now. They already made the basis of the pyramid but don't know how to continue. So, they called you for help.

The rules of making a pyramid is quite simple. For the layer above the previous layer, all you need to do is follow this step-by-step hand guide:

Cut the edges off the previous layer.

Above the / character, there must be a \ character and vice versa. This applies to every character except the edges.

The leftmost character is always a / and the rightmost character is always \.

Let's take an example of a basis for a pyramid:

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

We cut off the edges, leaving:

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

We change the forward slashes with backward slashes and vice versa:

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

The leftmost character is always a / and the rightmost character is always a \, so we change that:

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

We place this layer on the previous layer:

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

We continue until the top is reached (which looks like /\). So, eventually we get:

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

This is what you need to output.

The task

Given the basis of a pyramid (with a length greater than 3), output the full pyramid. You can safely assume that the leftmost character is / and the rightmost character is a \. You can also assume that the length of the basis is always even. The use of trailing spaces is allowed. The use of leading spaces is also allowed, as long as the pyramid stays in place. The use of 1 trailing and 1 leading newlines is allowed.

Test cases

```<code>Input: /\\\
Output:
 /\
/\\\

Input: //\\///\/\
Output:
    /\
   /\\\
  /\///\
 ///\\\/\
//\\///\/\

Input: /////////////\
Output:
      /\
     /\\\
    /////\
   /\\\\\\\
  /////////\
 /\\\\\\\\\\\
/////////////\
</code>```

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

答:
C#, 250 bytes

```<code>s=>{int j=s.Length/2,i=0;var l=new string[j];l[j-1]=s;while(++i<j){var n=l[j-i].Trim().Substring(1,l[j-i].Trim().Length-2);l[j-i-1]=new string(' ',i)+"/"+n.Replace("/","#").Replace(@"\","/").Replace("#",@"\").Substring(1,n.Length-2)+@"\";}return l;};
</code>```

Can definitely be golfed further but my brain went dead so I decided to leave it as it is for the moment.

Title: The Great Pyramid of ASCII

Body:
C#, 250 bytes

s=>{int j=s.Length/2,i=0;var l=new string[j];l[j-1]=s;while(++i<j){var n=l[j-i].Trim().Substring(1,l[j-i].Trim().Length-2);l[j-i-1]=new string(' ',i)+"/"+n.Replace("/","#").Replace(@"\","/").Replace("#",@"\").Substring(1,n.Length-2)+@"\";}return l;};

Can definitely be golfed further but my brain went dead so I decided to leave it as it is for the moment.


问:
Print every printable ASCII character without using it
In a programming language of your choice, write 95 programs, each of which outputs a different one of the 95 printable ASCII characters without that character occurring anywhere in the program.

For example, if your language was Python, your program that outputs the character P might be

```<code>print(chr(80))
</code>```

because P has ASCII code 80. This program is valid because P never appears in the source code. However, for the program that outputs lowercase p, something like

```<code>print(chr(112))
</code>```

would be invalid because, while it does print p, p is present in the code. A valid program could be

```<code>exec(chr(112)+'rint(chr(112))')
</code>```

which prints p but does not contain p.

Your goal is to make each of your 95 programs as short as possible. Your score is the sum of the character lengths of all your programs.

If for any reason you are unable to write valid programs for some characters, you may mark those characters as "Did Not Program" or DNP, and omit programs for them entirely. This way syntactically strict languages will be able to compete.

The winning answer is the answer that has the lowest score of the set of answers that have the fewest DNP's.

Rules

The source code of all of your programs may only contain printable ASCII plus tabs and newlines, all of which are counted as one character. (Because in a different encoding it would be easy to omit characters that don't exist!)

Note: This rule seems necessary but there are many languages with different encodings and I'm sure it'd be cool to see the answers for them. Therefore you can break this rule, you can use whatever characters you want, but then your answer becomes non-competitive, it cannot win.

The programs must be actual, full programs, according to your language's standard conventions. Functions and REPL snippets are not allowed.

Each program's output should go to stdout or your language's accepted alternative.

Programs should not prompt for or require input. (If prompting for input is inherent to your language, that's ok.)

Programs should be deterministic, finite in run time, and independent. e.g. it shouldn't matter if one is run in a folder separate from the other programs.

A program's output should be the precise printable ASCII character it corresponds to, optionally followed by a single trailing newline, nothing more, nothing less.

Be sure to include information on all 95 (ideally) programs in your answer, as well as your score and any DNP's. You don't have to list all programs that follow a simple pattern like "print(chr(80)), print(chr(81)), print(chr(82))..." but make sure you're sure they all would work and that your score is added correctly.

For reference, here are the 95 printable ASCII your programs must output:

```<code> !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~
</code>```

答:
dc, 314 287 286 bytes

Every character save for '5' and 'P' can be output via xxP where xx is the ASCII code point. 32P, 65P, 112P, etc. For 32-99, excepting 53 ('5') and 80 ('P'), that's 198 bytes. 100-126 gives us an additional 108 bytes, subtotal 306 bytes. Thanks to @Deliot for making me realize I'm sane... dc reserves the words/digits A-F for base >10 input, and doesn't really do any checks relating to inputting a digit beyond the scope of the input radix. This doesn't seem to work with cygwin's dc, but does with Darwin's and Ubuntu's: dc still interprets the number as decimal, but replaces A-F digits with 10-15 including a carry. So A0 becomes 100, AF becomes 115, etc. This adds 81 bytes for a subtotal of 279.

xxa converts a value on the stack to a single character, and n will print it, so that takes care of 'P' - 80an with an additional 4 bytes, subtotal 310 283.

For '5' we can rely on UCHAR_MAX overflow. 53+256=309, which has no 5s in it, so 309P it is use the same A-F behavior with 4DP (thanks @Joe), add 4 3 bytes for a total of 314 287 286.

All of it:

```<code>32P
33P
34P
35P
36P
37P
38P
39P
40P
41P
42P
43P
44P
45P
46P
47P
48P
49P
50P
51P
52P
4DP
54P
55P
56P
57P
58P
59P
60P
61P
62P
63P
64P
65P
66P
67P
68P
69P
70P
71P
72P
73P
74P
75P
76P
77P
78P
79P
80an
81P
82P
83P
84P
85P
86P
87P
88P
89P
90P
91P
92P
93P
94P
95P
96P
97P
98P
99P
A0P
A1P
A2P
A3P
A4P
A5P
A6P
A7P
A8P
A9P
B0P
B1P
B2P
B3P
B4P
B5P
B6P
B7P
B8P
B9P
C0P
C1P
C2P
C3P
C4P
C5P
C6P
</code>```

Body:
dc, 314 287 286 bytes

Every character save for '5' and 'P' can be output via xxP where xx is the ASCII code point. 32P, 65P, 112P, etc. For 32-99, excepting 53 ('5') and 80 ('P'), that's 198 bytes. 100-126 gives us an additional 108 bytes, subtotal 306 bytes. Thanks to @Deliot for making me realize I'm sane... dc reserves the words/digits A-F for base >10 input, and doesn't really do any checks relating to inputting a digit beyond the scope of the input radix. This doesn't seem to work with cygwin's dc, but does with Darwin's and Ubuntu's: dc still interprets the number as decimal, but replaces A-F digits with 10-15 including a carry. So A0 becomes 100, AF becomes 115, etc. This adds 81 bytes for a subtotal of 279.

xxa converts a value on the stack to a single character, and n will print it, so that takes care of 'P' - 80an with an additional 4 bytes, subtotal 310 283.

For '5' we can rely on UCHAR_MAX overflow. 53+256=309, which has no 5s in it, so 309P it is use the same A-F behavior with 4DP (thanks @Joe), add 4 3 bytes for a total of 314 287 286.

All of it:

32P
33P
34P
35P
36P
37P
38P
39P
40P
41P
42P
43P
44P
45P
46P
47P
48P
49P
50P
51P
52P
4DP
54P
55P
56P
57P
58P
59P
60P
61P
62P
63P
64P
65P
66P
67P
68P
69P
70P
71P
72P
73P
74P
75P
76P
77P
78P
79P
80an
81P
82P
83P
84P
85P
86P
87P
88P
89P
90P
91P
92P
93P
94P
95P
96P
97P
98P
99P
A0P
A1P
A2P
A3P
A4P
A5P
A6P
A7P
A8P
A9P
B0P
B1P
B2P
B3P
B4P
B5P
B6P
B7P
B8P
B9P
C0P
C1P
C2P
C3P
C4P
C5P
C6P


问:
What base is this number in?
Here's a nice easy challenge:

Given a string that represents a number in an unknown base, determine the lowest possible base that number might be in. The string will only contain 0-9, a-z. If you like, you may choose to take uppercase letters instead of lowercase, but please specify this. You must output this lowest possible base in decimal.

Here is a more concrete example. If the input string was "01234", it is impossible for this number to be in binary, since 2, 3, and 4 are all undefined in binary. Similarly, this number cannot be in base 3, or base 4. Therefore, this number must be in base-5, or a higher base, so you should output '5'.

Your code must work for any base between base 1 (unary, all '0's) and base 36 ('0-9' and 'a-z').

You may take input and provide output in any reasonable format. Base-conversion builtins are allowed. As usual, standard loopholes apply, and the shortest answer in bytes is the winner!

Test IO:

```<code>#Input          #Output
00000       --> 1
123456      --> 7
ff          --> 16
4815162342  --> 9
42          --> 5
codegolf    --> 25
0123456789abcdefghijklmnopqrstuvwxyz    --> 36
</code>```

答:
C# REPL, 17 bytes

```<code>x=>(x.Max()-8)%39
</code>```

Just ported @Dennis's answer to C#.

Title: What base is this number in?

Body:
C# REPL, 17 bytes

x=>(x.Max()-8)%39

Just ported @Dennis's answer to C#.


问:
When does (x == x+2)?
The challenge: Define x in such a way that the expression (x == x+2) would evaluate to true.

I tagged the question with C, but answers in other languages are welcome, as long as they're creative or highlight an interesting aspect of the language.

I intend to accept a C solution, but other languages can get my vote.

Correct - works on standard-compliant implementations. Exception - assuming an implementation of the basic types, if it's a common implementation (e.g. assuming int is 32bit 2's complement) is OK.

Simple - should be small, use basic language features.

Interesting - it's subjective, I admit. I have some examples for what I consider interesting, but I don't want to give hints. Update: Avoiding the preprocessor is interesting.

Quick - The first good answer will be accepted.

After getting 60 answers (I never expected such prticipation), It may be good to summarize them.

The 60 answers divide into 7 groups, 3 of which can be implemented in C, the rest in other languages:

The C preprocessor. #define x 2|0 was suggested, but there are many other possibilities.

Floating point. Large numbers, infinity or NaN all work.

Pointer arithmetic. A pointer to a huge struct causes adding 2 to wrap around.

The rest don't work with C:

Operator overloading - A + that doesn't add or a == that always returns true.

Making x a function call (some languages allow it without the x() syntax). Then it can return something else each time.

A one-bit data type. Then x == x+2 (mod 2).

Changing 2 - some language let you assign 0 to it.

答:
If it is ok to exploit the question a little bit, then I will add some new Java. The trick is for sure not new, but perhaps interesting that this is possible in Java.

```<code>static void pleaseDoNotDoThis() throws Exception {
    Field field = Boolean.class.getField("FALSE");
    field.setAccessible(true);
    Field modifiersField = Field.class.getDeclaredField("modifiers");
    modifiersField.setAccessible(true);
    modifiersField.setInt(field, field.getModifiers() & ~Modifier.FINAL);
    field.set(null, true);
}

public static void main(String args[]) throws Exception {
    pleaseDoNotDoThis();
    doit(1);
    doit("NO");
    doit(null);
    doit(Math.PI);
}

static void doit(long x) {
    System.out.format("(x == x + 2) = (%d == %d) = %s\n", x, x+2, (x == x + 2));
}

static void doit(String x) {
    System.out.format("(x == x + 2) = (%s == %s) = %s\n", x, x+2, (x == x + 2));
}

static void doit(double x) {
    System.out.format("(x == x + 2) = (%f == %f) = %s\n", x, x+2, (x == x + 2));
}
</code>```

And the results:

```<code>(x == x + 2) = (1 == 3) = true
(x == x + 2) = (NO == NO2) = true
(x == x + 2) = (null == null2) = true
(x == x + 2) = (3,141593 == 5,141593) = true
(x == x + 2) = (Infinity == Infinity) = true
</code>```

Title: When does (x == x+2)?

Body:
If it is ok to exploit the question a little bit, then I will add some new Java. The trick is for sure not new, but perhaps interesting that this is possible in Java.

static void pleaseDoNotDoThis() throws Exception {
    Field field = Boolean.class.getField("FALSE");
    field.setAccessible(true);
    Field modifiersField = Field.class.getDeclaredField("modifiers");
    modifiersField.setAccessible(true);
    modifiersField.setInt(field, field.getModifiers() & ~Modifier.FINAL);
    field.set(null, true);
}

public static void main(String args[]) throws Exception {
    pleaseDoNotDoThis();
    doit(1);
    doit("NO");
    doit(null);
    doit(Math.PI);
}

static void doit(long x) {
    System.out.format("(x == x + 2) = (%d == %d) = %s\n", x, x+2, (x == x + 2));
}

static void doit(String x) {
    System.out.format("(x == x + 2) = (%s == %s) = %s\n", x, x+2, (x == x + 2));
}

static void doit(double x) {
    System.out.format("(x == x + 2) = (%f == %f) = %s\n", x, x+2, (x == x + 2));
}

And the results:

(x == x + 2) = (1 == 3) = true
(x == x + 2) = (NO == NO2) = true
(x == x + 2) = (null == null2) = true
(x == x + 2) = (3,141593 == 5,141593) = true
(x == x + 2) = (Infinity == Infinity) = true


问:
The Alphabet Chromosome

Introduction

Alphabet challenges are in our DNA, so let's show it.

Challenge

Print the following the text exactly:

```<code>AaBbCc        cCbBaA
BbCcDd        dDcCbB
EeFfGg        gGfFeE
HhIiJj        jJiIhH
KkLlMm        mMlLkK
NnOoPp        pPoOnN
QqRrSs        sSrRqQ
TtUuVv        vVuUtT
   WwXx      xXwW
       Yy  yY
         ZZ
         zz
         ZZ
       Yy  yY
   WwXx      xXwW
TtUuVv        vVuUtT
QqRrSs        sSrRqQ
NnOoPp        pPoOnN
KkLlMm        mMlLkK
HhIiJj        jJiIhH
EeFfGg        gGfFeE
BbCcDd        dDcCbB
AaBbCc        cCbBaA
</code>```

Rules

You must match the case of each letter

Trailing and/or leading newlines and/or spaces are allowed

Winning

Shortest code in bytes wins.

答:
Matricks, 105 bytes (noncompeting)

Whoa, I found a lot of bugs. The only hard part of this challenge was the cross in the middle. That makes almost half the byte count.

Run with the -A 1 flag

```<code>m+/c2+66+*r3*32%c2 7 6v{k-{}1z-L1Q}u{q-Lc2k+{}2b0b0b0a[a0a0u[a89a121]a[u0u90]]}a{Y}u[mQc9a122a122]u{z1cX}
</code>```

Explanation:

```
m+/c2+66+*r3*32%c2 7 6                       # Construct the "normal" block
v{k-{}1z-L1Q}                                # Add the "abnormal" part above
u{q-Lc2k+{}2b0b0b0a[a0a0u[a89a121]a[u0u90]]} # Make the 1/4 of the weird diagonal
a{Y}u[mQc9a122a122]u{z1cX}                   # Mirror the block just created, adding
                                             # lowercase zs in between halves

```

Another bug I haven't fixed yet is that the last part, u{z1cX} doesn't work when you put the cut after the X. Will investigate/fix.

Title: The Alphabet Chromosome

Body:
Matricks, 105 bytes (noncompeting)

Whoa, I found a lot of bugs. The only hard part of this challenge was the cross in the middle. That makes almost half the byte count.

Run with the -A 1 flag

m+/c2+66+*r3*32%c2 7 6v{k-{}1z-L1Q}u{q-Lc2k+{}2b0b0b0a[a0a0u[a89a121]a[u0u90]]}a{Y}u[mQc9a122a122]u{z1cX}

Explanation:

m+/c2+66+*r3*32%c2 7 6                       # Construct the "normal" block
v{k-{}1z-L1Q}                                # Add the "abnormal" part above
u{q-Lc2k+{}2b0b0b0a[a0a0u[a89a121]a[u0u90]]} # Make the 1/4 of the weird diagonal
a{Y}u[mQc9a122a122]u{z1cX}                   # Mirror the block just created, adding
                                             # lowercase zs in between halves

Another bug I haven't fixed yet is that the last part, u{z1cX} doesn't work when you put the cut after the X. Will investigate/fix.


问:
My triangle needs more nodes
Consider the standard equilateral triangle, with nodes labeled using barycentric coordinates:

We can turn this 3 node triangle into a 6 node triangle by adding a new line of 3 vertices (one more than was present on a side of the original 3 node triangle), remove any internal edges (but not internal nodes) and re-normalize the coordinates:

Repeating the process to go from a 6 node triangle to a 10 node triangle, add a line of 4 vertices (again, one more than was present on a side of the original 6 node triangle), remove any internal edges (but not internal nodes) and re-normalize the coordinates:

This process can be repeated indefinitely. The goal of this challenge is given an integer N representing how many times this process has been performed, output all the nodes for the associated triangle in barycentric coordinates.

Input

Your program/function should take as input a single non-negative integer N representing how many times this process has been applied. Note that for N=0, you should output the original triangle with 3 nodes.

The input may come from any source (function parameter, stdio, etc.).

Output

Your program/function should output all the nodes in normalized barycentric coordinates. The order of the nodes does not matter.
A number can be specified as a fraction (fraction reduction not required) or a floating point number. You may also output "scaled" vectors to specify a node. For example, all 3 of the following outputs are equivalent and allowed:

```<code>0.5,0.5,0

1/2,2/4,0

[1,1,0]/2
</code>```

If using floating point output, your output should be accurate to within 1%. The output may be to any sink desired (stdio, return value, return parameter, etc.). Note that even though the barycentric coordinates are uniquely determined by only 2 numbers per node, you should output all 3 numbers per node.

Examples

Example cases are formatted as:

```<code>N
x0,y0,z0
x1,y1,z1
x2,y2,z2
...
</code>```

where the first line is the input N, and all following lines form a node x,y,z which should be in the output exactly once. All numbers are given as approximate floating point numbers.

```<code>0
1,0,0
0,1,0
0,0,1

1
1,0,0
0,1,0
0,0,1
0.5,0,0.5
0.5,0.5,0
0,0.5,0.5

2
1,0,0
0,1,0
0,0,1
0.667,0,0.333
0.667,0.333,0
0.333,0,0.667
0.333,0.333,0.333
0.333,0.667,0
0,0.333,0.667
0,0.667,0.333

3
1,0,0
0.75,0,0.25
0.75,0.25,0
0.5,0,0.5
0.5,0.25,0.25
0.5,0.5,0
0.25,0,0.75
0.25,0.25,0.5
0.25,0.5,0.25
0.25,0.75,0
0,0,1
0,0.25,0.75
0,0.5,0.5
0,0.75,0.25
0,1,0
</code>```

Scoring

This is code golf; shortest code in bytes wins. Standard loopholes apply. You may use any built-ins desired.

答:
Python 3, 87 bytes

This is actually supposed to be a comment to the solution by TheBikingViking but I don't have enough reputation for comments.

One can save a few bytes by only iterating over the variables i,j and using the fact that with the third one they add up to n+1.

```<code>def f(n):d=n+1;r=range(n+2);print([[i/d,j/d,(d-i-j)/d]for i in r for j in r if d>=i+j])
</code>```

Title: My triangle needs more nodes

Body:
Python 3, 87 bytes

This is actually supposed to be a comment to the solution by TheBikingViking but I don't have enough reputation for comments.

One can save a few bytes by only iterating over the variables i,j and using the fact that with the third one they add up to n+1.

def f(n):d=n+1;r=range(n+2);print([[i/d,j/d,(d-i-j)/d]for i in r for j in r if d>=i+j])


问:
Given a list of Tetris moves, return the number of completed lines

Description

We consider a slightly simplified version of Tetris where each move consists of:

rotating the piece clockwise, 0 to 3 times

positioning the piece at a given column

fast drop

The goal is to determine the number of completed lines, given a list of such Tetris moves.

Completed rows are removed as pieces are dropped, following standard Tetris rules.

Playfield

The playfield is 10-column wide. There's no Game Over and it is assumed that there's always enough space and time to perform the above actions, no matter the configuration of the playfield. The height of the playfield doesn't really matter here, but you can use the standard 22 rows as an upper limit.

Shapes of Tetrominoes

Input / Output

Input

A comma separated list of Tetris moves encoded with 3 characters. The first two character describe the Tetromino shape to use and the last one describes the position where it's dropped.

Tetromino: I, O, T, L, J, Z or S, in the same order as above.

Number of clockwise rotations: 0 to 3

Column: 0 to 9. This is the column in which the top-left corner of the piece (marked with an x on the above picture) is located after the rotation 1

It is assumed that all moves in the provided list are valid. There's no need to check for invalid entries such as I07 (horizontal I shape put too far on the right).

1 You are free to either implement a real rotation algorithm or to hardcode all the different shapes, as long as the x is located in the column given by the third character of the move.

Output

Number of completed lines.

Example

O00,T24 will generate the first position and O00,T24,S02,T01,L00,Z03,O07,L06,I05 will generate the second position.

Therefore, the following sequence will generate a Tetris and should return 4:

```<code>O00,T24,S02,T01,L00,Z03,O07,L06,I05,I19
</code>```

Test cases

```<code>1) "O00,T24,S02,T01,L00,Z03,O07,L06,I05,I19" -> 4
2) "S00,J03,L27,Z16,Z18,I10,T22,I01,I05,O01,L27,O05,S13" -> 5
3) "I01,T30,J18,L15,J37,I01,S15,L07,O03,O03,L00,Z00,T38,T01,S06,L18,L14" -> 4
4) "S14,T00,I13,I06,I05,I19,L20,J26,O07,Z14,Z10,Z12,O01,L27,L04,I03,S07,I01,T25,J23,J27,O01,
    I10,I10" -> 8
5) "O00,T24,L32,T16,L04,Z11,O06,L03,I18,J30,L23,Z07,I19,T05,T18,L30,I01,I01,I05,T02" -> 8
</code>```

Test page

You can use this JSFiddle to test a move list.

答:
Ruby, <s>474</s> <s>443</s> <s>428</s> 379 + 48 = 427 bytes

-1 thanks to @Titus

This can definitely be golfed more.

Reads a binary dictionary of pieces (see below) from STDIN or a filename and takes a move list as an argument, e.g. $ cat pieces | ruby script.rb O00,T24,S02,....

q=$*.pop
z=$<.read.unpack('S*')
b=c=g=i=0
x=10
u=1023
r=->n{n&2**x-1>0?n:r[n>>x]}
y=->n{n>0?[n&u]+y[n>>x]:[]}
l=->c,n{z.find{|m|m>>x==c<<2|n.to_i}||l[c,n-2]}
q.scan(/(\w)(\d)(\d)/){n=l["IOTLJSZ".index($1),$2.to_i]
v=(n&1|(n&6)<<9|(n&56)<<17|(n&960)<<24)<<$3.to_i
(y[b].size+1).times{t=b<<40
t&v>0&&break
g=t|v
v<<=x}
b=0
a=y[r[g]]
a.grep_v(u){|o|b|=o<<x*i
i+=1}
c+=a.count u}
p c
```

<p>Binary piece data (xxd format)</p>

<pre class="lang-none prettyprint-override"><code>0000000: c003 4b04 d810 d814 b820 9c24 d029 5a2c  ..K...... .$.)Z,
0000010: 7830 9634 e039 ca3c 3841 d444 c849 4e4c  x0.4.9.<8A.D.INL
0000020: 9861 9869 5c64 5c6c f050 f058 9a54 9a5c  .a.i\d\l.P.X.T.\
</code>```

See it on repl.it (with hard-coded arguments, dictionary): https://repl.it/Cqft/2

Ungolfed & explanation

# Move list from ARGV
q = $*.pop

# Read piece dictionary; pieces are 16-bit integers: 3 for letter,
# 2 for rotation, 10 for shape (and 1 wasted)
z = $<.read.unpack('S*')

# Empty board and various counters
b = c = g = i = 0
x = 10 # Magic numbers
u = 1023

# A function to remove empty lines
r = ->n{ n & 2**x - 1 > 0 ? n : r[n >> x] }

# A function to split the board into lines
y = ->n{ n > 0 ? [n & u] + y[n >> x] : [] }

# A function to lookup a piece by letter and rotation index
l = ->c,n{ z.find {|m| m >> x == c << 2 | n.to_i } || l[c, n-2] }

# Read the move list
q.scan(/(\w)(\d)(\d)/) {
  # Look up the piece
  n = l["IOTLJSZ".index($1), $2.to_i]

  # Convert the 10-bit piece to a 40-bit piece (4 rows of 10 columns)
  v = (n & 1 |
        (n & 6) << 9 |
        (n & 56) << 17 |
        (n & 960) << 24
      ) << $3.to_i # Shift by the appropriate number of columns

  # Drop the piece onto the board
  (y[b].size + 1).times {
    t = b << 40
    t & v > 0 && break
    g = t | v
    v <<= x
  }

  # Clear completed rows
  b = 0
  a = y[r[g]]
  a.grep_v(u) {|o|
    b |= o << x * i
    i += 1
  }

  c += a.count u # Count cleared rows
}
p c
```

Body:
Ruby, <s>474</s> <s>443</s> <s>428</s> 379 + 48 = 427 bytes

-1 thanks to @Titus

This can definitely be golfed more.

Reads a binary dictionary of pieces (see below) from STDIN or a filename and takes a move list as an argument, e.g. $ cat pieces | ruby script.rb O00,T24,S02,....

q=$*.pop
z=$<.read.unpack('S*')
b=c=g=i=0
x=10
u=1023
r=->n{n&2**x-1>0?n:r[n>>x]}
y=->n{n>0?[n&u]+y[n>>x]:[]}
l=->c,n{z.find{|m|m>>x==c<<2|n.to_i}||l[c,n-2]}
q.scan(/(\w)(\d)(\d)/){n=l["IOTLJSZ".index($1),$2.to_i]
v=(n&1|(n&6)<<9|(n&56)<<17|(n&960)<<24)<<$3.to_i
(y[b].size+1).times{t=b<<40
t&v>0&&break
g=t|v
v<<=x}
b=0
a=y[r[g]]
a.grep_v(u){|o|b|=o<<x*i
i+=1}
c+=a.count u}
p c

Binary piece data (xxd format)

0000000: c003 4b04 d810 d814 b820 9c24 d029 5a2c  ..K...... .$.)Z,
0000010: 7830 9634 e039 ca3c 3841 d444 c849 4e4c  x0.4.9.<8A.D.INL
0000020: 9861 9869 5c64 5c6c f050 f058 9a54 9a5c  .a.i\d\l.P.X.T.\

See it on repl.it (with hard-coded arguments, dictionary): https://repl.it/Cqft/2

Ungolfed & explanation

# Move list from ARGV
q = $*.pop

# Read piece dictionary; pieces are 16-bit integers: 3 for letter,
# 2 for rotation, 10 for shape (and 1 wasted)
z = $<.read.unpack('S*')

# Empty board and various counters
b = c = g = i = 0
x = 10 # Magic numbers
u = 1023

# A function to remove empty lines
r = ->n{ n & 2**x - 1 > 0 ? n : r[n >> x] }

# A function to split the board into lines
y = ->n{ n > 0 ? [n & u] + y[n >> x] : [] }

# A function to lookup a piece by letter and rotation index
l = ->c,n{ z.find {|m| m >> x == c << 2 | n.to_i } || l[c, n-2] }

# Read the move list
q.scan(/(\w)(\d)(\d)/) {
  # Look up the piece
  n = l["IOTLJSZ".index($1), $2.to_i]

  # Convert the 10-bit piece to a 40-bit piece (4 rows of 10 columns)
  v = (n & 1 |
        (n & 6) << 9 |
        (n & 56) << 17 |
        (n & 960) << 24
      ) << $3.to_i # Shift by the appropriate number of columns

  # Drop the piece onto the board
  (y[b].size + 1).times {
    t = b << 40
    t & v > 0 && break
    g = t | v
    v <<= x
  }

  # Clear completed rows
  b = 0
  a = y[r[g]]
  a.grep_v(u) {|o|
    b |= o << x * i
    i += 1
  }

  c += a.count u # Count cleared rows
}
p c


答:
05AB1E, 31 bytes

```<code>Dg;GDðK¦¦¨¨„/\Â‡'\«R'/«ðN×«R}r»
</code>```

Explanation

```<code>Dg;G                        }    # for N in [1..len(input)/2-1]
    D                            # make a copy of previous layer
     ðK                          # remove all spaces
       ¦¦¨¨                      # remove first 2 and last 2 chars
           „/\Â‡                 # replace '/' with '\' and vice versa
                '\«              # add a backslash at the end
                   R             # reverse
                    '/«          # ad a slash at the end
                       ðN×«      # add N spaces
                           R     # reverse back
                             r»  # reverse stack and join on newline
                                 # implicitly print
</code>```

Try it online

Title: The Great Pyramid of ASCII

Body:
Introduction

It's 2600 BC and people are building pyramids now. They already made the basis of the pyramid but don't know how to continue. So, they called you for help.

The rules of making a pyramid is quite simple. For the layer above the previous layer, all you need to do is follow this step-by-step hand guide:

Cut the edges off the previous layer.

Above the / character, there must be a \ character and vice versa. This applies to every character except the edges.

The leftmost character is always a / and the rightmost character is always \.

Let's take an example of a basis for a pyramid:

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

We cut off the edges, leaving:

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

We change the forward slashes with backward slashes and vice versa:

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

The leftmost character is always a / and the rightmost character is always a \, so we change that:

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

We place this layer on the previous layer:

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

We continue until the top is reached (which looks like /\). So, eventually we get:

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

This is what you need to output.

The task

Given the basis of a pyramid (with a length greater than 3), output the full pyramid. You can safely assume that the leftmost character is / and the rightmost character is a \. You can also assume that the length of the basis is always even. The use of trailing spaces is allowed. The use of leading spaces is also allowed, as long as the pyramid stays in place. The use of 1 trailing and 1 leading newlines is allowed.

Test cases

```<code>Input: /\\\
Output:
 /\
/\\\

Input: //\\///\/\
Output:
    /\
   /\\\
  /\///\
 ///\\\/\
//\\///\/\

Input: /////////////\
Output:
      /\
     /\\\
    /////\
   /\\\\\\\
  /////////\
 /\\\\\\\\\\\
/////////////\
</code>```

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

Body:
05AB1E, 31 bytes

Dg;GDðK¦¦¨¨„/\Â‡'\«R'/«ðN×«R}r»

Explanation

Dg;G                        }    # for N in [1..len(input)/2-1]
    D                            # make a copy of previous layer
     ðK                          # remove all spaces
       ¦¦¨¨                      # remove first 2 and last 2 chars
           „/\Â‡                 # replace '/' with '\' and vice versa
                '\«              # add a backslash at the end
                   R             # reverse
                    '/«          # ad a slash at the end
                       ðN×«      # add N spaces
                           R     # reverse back
                             r»  # reverse stack and join on newline
                                 # implicitly print

Try it online


答:
Python 2, <s>331</s> <s>241</s> 229 bytes

<s>Will golf it more later.</s>

```<code>l=("AaBbCc|BbCcDd|EeFfGg|HhIiJj|KkLlMm|NnOoPp|QqRrSs|TtUuVv|   WwXx|%sYy"%(" "*7)).split("|");n=0;v=1;p='for i in([8]*8+[6,2])[::v]:print l[n]+" "*i+l[n][::-1];n+=v';exec p;v=-1;n=9;print"{0}ZZ\n{0}zz\n{0}ZZ".format(" "*9);exec p
</code>```

Title: The Alphabet Chromosome

Body:
Introduction

Alphabet challenges are in our DNA, so let's show it.

Challenge

Print the following the text exactly:

```<code>AaBbCc        cCbBaA
BbCcDd        dDcCbB
EeFfGg        gGfFeE
HhIiJj        jJiIhH
KkLlMm        mMlLkK
NnOoPp        pPoOnN
QqRrSs        sSrRqQ
TtUuVv        vVuUtT
   WwXx      xXwW
       Yy  yY
         ZZ
         zz
         ZZ
       Yy  yY
   WwXx      xXwW
TtUuVv        vVuUtT
QqRrSs        sSrRqQ
NnOoPp        pPoOnN
KkLlMm        mMlLkK
HhIiJj        jJiIhH
EeFfGg        gGfFeE
BbCcDd        dDcCbB
AaBbCc        cCbBaA
</code>```

Rules

You must match the case of each letter

Trailing and/or leading newlines and/or spaces are allowed

Winning

Shortest code in bytes wins.

Body:
Python 2, <s>331</s> <s>241</s> 229 bytes

<s>Will golf it more later.</s>

l=("AaBbCc|BbCcDd|EeFfGg|HhIiJj|KkLlMm|NnOoPp|QqRrSs|TtUuVv|   WwXx|%sYy"%(" "*7)).split("|");n=0;v=1;p='for i in([8]*8+[6,2])[::v]:print l[n]+" "*i+l[n][::-1];n+=v';exec p;v=-1;n=9;print"{0}ZZ\n{0}zz\n{0}ZZ".format(" "*9);exec p


问:
Official Dyalog APL 2016 Year Game
If you think this could be fun, but too much work, consider participating in this much smaller challenge.

A bit of fun (and possibly frustration!) for 2016... Dyalog's "puzzle of the year". Enjoy!

The Objective

Find Dyalog APL (download) expressions (other languages are allowed, see Eligibility below) involving exactly the digits 2 0 1 6 in that order to equal the numbers 0 to 100. For example:

20=16

×2016

2⌊016

2+0+1*6

...

The aim is to use as few characters as possible in each expression (the minimum number of characters for an expression is 5 – the four digits 2 0 1 6 and a single primitive function/operator).

The Rules

Each expression must contain the digits 2 0 1 6 (in that order) and
no other digits. Pre-set constants and variables are also not allowed.

In addition to the four digits 2 0 1 6, only built-in symbols and names, parentheses/braces, spaces, high minus signs and
decimal points can be used. The resultant expressions must be
deterministic (that is, give the same result on repeated
evaluations). For non-APLs, functions/operators with a name are also allowed; same rules as here.

Assume all default settings for your language. For Dyalog APL, this means ⎕ML and ⎕IO are both 1, and ⎕PP is 10.

Each entry comprising correct expressions for all the numbers from 0
to 100 inclusive will be rated according to the number of characters
used by those expressions excluding redundant spaces (minimum 505 for
all 101 expressions).

Eligibility

Anyone can enter. You may answer in any language, but only APL answers will be considered for accepting. If you use another language than APL, you may use snippets, programs, functions, etc. as alternatives to expressions, and you may print, leave the number in an accessible memory location, or otherwise return the result, as long as your code directly evaluates to the desired number as any standard numeric data type for your language.

Closing Date

30 November 2016.

Prizes

Have your answer accepted

Be immortalised in Dyalog's 2016 Hall of Fame!

Submitting Your Entry

After 30 November 2016, I will accept the shortest answer, and submit your answer, in your name, to Dyalog's 2016 Hall of Fame.

FAQ

Is J (e.g. 37=⌈⍟!20J16) allowed?

No: In addition to the four digits 2 0 1 6, only only built-in symbols and names, parentheses/braces, spaces, high minus signs and decimal points can be used.

Is output as a string acceptable?

No: equal the numbers 0 to 100.

Physical digits, or data digits?

Data digits, as per OP: same rules as here, where one of the examples contain LOG10(.

Is assigning variables then using them as part of the expression (e.g. 56=a+16+a←20) allowed?

Yes, but you may not use an assignment from one expression in another one.

I have explicit written permission to post this challenge here from the original author of this challenge. Feel free to verify by following the provided link and contacting the author. I gave the original competition author the link to this page within the minute I posted it, so they can check if I submit someone's answer as my own.

Title: Official Dyalog APL 2016 Year Game

Body:
CJam, <s>792</s> 791 bytes

I kind of got lazy near the end, a lot of them just ended up being increments and decrements (101 is a lot!), although I'm not sure if there is any other way for a few of the numbers. There's still plenty of time to golf it if I need to.

Around #40 there are some winky faces ;)

2016!          e# 0
2016g
2016g)
201 6%
20 16-
20)16-
20 1>6*
20 1>6+
201mQ6-
201mQ6-)
2 01 6*(*      e# 10
2 01*6*(
2 01*6*
2~016+
-2 016+
2)016(|
20;16
2(016+
2 016+
2)016+
20 16|         e# 20
20)16|
20 1*6|
20 1|6|
20 16mQ+
20_*16/
20 1 6*+
20 1+6+
20 1)6++
20)1)6++
2 016(*        e# 30
2 016*(
2 016*
201 6/
2 016)*
20(16+
20 16+
20)16+
20)16)+
20_+16;(
20_+16;        e# 40
20_+16;)
20)_+16;
20)_+16;)
20(1m<6+
2)016(*
20 1m<6+
2)016*(
2)016*
2)016*)
2)016)*(       e# 50
2)016)*
20 16_++
20)1 6(m<+
20(_16++
20_16++(
20_16++
20_16++)
20)_16++
20)_16++)
20 16mQ(*      e# 60
20 16mQ(*)
2 01*6#((
2 01*6#(
2 01*6#
2 01*6#)
201_+6/(
201_+6/
201_+6/)
201mQ6(*(
201mQ6(*       e# 70
20_16_+++(
20_16_+++
20_16_+++)
20)_16_+++
20(16mQ*(
20(16mQ*
20(16mQ*)
20_16^*((
20_16^*(
20_16^*        e# 80
2)016mQ#
201mQ6*((
201mQ6*(
201mQ6*
201mQ6*)
201mQ6*))
201mQ6*)))
[20_16__]:+
[20_16__]:+)
[20)_16__]:+   e# 90
[20_16)__]:+
[20__16_]:+
20(1*6(*((
20(1*6(*(
20(1*6(*
20(1*6(*)
201mQ6)*(
201mQ6)*
20 1*6(*(
20 1*6(*       e# 100


答:
Vim (no external tools), 106 bytes

Newlines for clarity:

```<code>:h<_↵↵↵YZZPllabc♥
:s/./\u&&/g↵
qa6li↵♥q7@a3i ♥fY
i↵    →→↵  →↵→ð♥
ʌHA ♥9l
qbmaʌ99jY$P`ah@bq@b
y11G:g//m0↵P
</code>```

Here ↵ is Return, → is Right, ♥ is Escape, ʌ is CTRL-V, and ð is Delete.

Title: The Alphabet Chromosome

Body:
Vim (no external tools), 106 bytes

Newlines for clarity:

:h<_↵↵↵YZZPllabc♥
:s/./\u&&/g↵
qa6li↵♥q7@a3i ♥fY
i↵    →→↵  →↵→ð♥
ʌHA ♥9l
qbmaʌ99jY$P`ah@bq@b
y11G:g//m0↵P

Here ↵ is Return, → is Right, ♥ is Escape, ʌ is CTRL-V, and ð is Delete.


答:
Ruby, 62

I'd be surprised if this can't be improved on:

->x{0.step(1,i=1.0/(x+1)){|a|0.step(1-a,i){|b|p [a,b,1-a-b]}}}
```

Taking the advice latent in the puzzle, this calculates the second node options based on the first, and the third node by subtracting the first two.

Title: My triangle needs more nodes

Body:
Consider the standard equilateral triangle, with nodes labeled using barycentric coordinates:

We can turn this 3 node triangle into a 6 node triangle by adding a new line of 3 vertices (one more than was present on a side of the original 3 node triangle), remove any internal edges (but not internal nodes) and re-normalize the coordinates:

Repeating the process to go from a 6 node triangle to a 10 node triangle, add a line of 4 vertices (again, one more than was present on a side of the original 6 node triangle), remove any internal edges (but not internal nodes) and re-normalize the coordinates:

This process can be repeated indefinitely. The goal of this challenge is given an integer N representing how many times this process has been performed, output all the nodes for the associated triangle in barycentric coordinates.

Input

Your program/function should take as input a single non-negative integer N representing how many times this process has been applied. Note that for N=0, you should output the original triangle with 3 nodes.

The input may come from any source (function parameter, stdio, etc.).

Output

Your program/function should output all the nodes in normalized barycentric coordinates. The order of the nodes does not matter.
A number can be specified as a fraction (fraction reduction not required) or a floating point number. You may also output "scaled" vectors to specify a node. For example, all 3 of the following outputs are equivalent and allowed:

```<code>0.5,0.5,0

1/2,2/4,0

[1,1,0]/2
</code>```

If using floating point output, your output should be accurate to within 1%. The output may be to any sink desired (stdio, return value, return parameter, etc.). Note that even though the barycentric coordinates are uniquely determined by only 2 numbers per node, you should output all 3 numbers per node.

Examples

Example cases are formatted as:

```<code>N
x0,y0,z0
x1,y1,z1
x2,y2,z2
...
</code>```

where the first line is the input N, and all following lines form a node x,y,z which should be in the output exactly once. All numbers are given as approximate floating point numbers.

```<code>0
1,0,0
0,1,0
0,0,1

1
1,0,0
0,1,0
0,0,1
0.5,0,0.5
0.5,0.5,0
0,0.5,0.5

2
1,0,0
0,1,0
0,0,1
0.667,0,0.333
0.667,0.333,0
0.333,0,0.667
0.333,0.333,0.333
0.333,0.667,0
0,0.333,0.667
0,0.667,0.333

3
1,0,0
0.75,0,0.25
0.75,0.25,0
0.5,0,0.5
0.5,0.25,0.25
0.5,0.5,0
0.25,0,0.75
0.25,0.25,0.5
0.25,0.5,0.25
0.25,0.75,0
0,0,1
0,0.25,0.75
0,0.5,0.5
0,0.75,0.25
0,1,0
</code>```

Scoring

This is code golf; shortest code in bytes wins. Standard loopholes apply. You may use any built-ins desired.

Body:
Ruby, 62

I'd be surprised if this can't be improved on:

->x{0.step(1,i=1.0/(x+1)){|a|0.step(1-a,i){|b|p [a,b,1-a-b]}}}

Taking the advice latent in the puzzle, this calculates the second node options based on the first, and the third node by subtracting the first two.


答:
FerNANDo, 1786 (19x94) bytes (1 DNP)

Did not program  (space).

The programs follow a pattern. The first one (!) is as follows:

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

This sets b to 1 (a is by default 0), and then outputs the ASCII character represented by the binary 00100001 (constructed using a and b). This can be repeated for any ASCII character using the same length of source code. To make the programs that print a and b, use the same code but name the variables c and d instead:

a:

```<code>d c
c d d c c c c d
</code>```

b:

```<code>d c
c d d c c c d c
</code>```

Try it online!

Title: Print every printable ASCII character without using it

Body:
In a programming language of your choice, write 95 programs, each of which outputs a different one of the 95 printable ASCII characters without that character occurring anywhere in the program.

For example, if your language was Python, your program that outputs the character P might be

```<code>print(chr(80))
</code>```

because P has ASCII code 80. This program is valid because P never appears in the source code. However, for the program that outputs lowercase p, something like

```<code>print(chr(112))
</code>```

would be invalid because, while it does print p, p is present in the code. A valid program could be

```<code>exec(chr(112)+'rint(chr(112))')
</code>```

which prints p but does not contain p.

Your goal is to make each of your 95 programs as short as possible. Your score is the sum of the character lengths of all your programs.

If for any reason you are unable to write valid programs for some characters, you may mark those characters as "Did Not Program" or DNP, and omit programs for them entirely. This way syntactically strict languages will be able to compete.

The winning answer is the answer that has the lowest score of the set of answers that have the fewest DNP's.

Rules

The source code of all of your programs may only contain printable ASCII plus tabs and newlines, all of which are counted as one character. (Because in a different encoding it would be easy to omit characters that don't exist!)

Note: This rule seems necessary but there are many languages with different encodings and I'm sure it'd be cool to see the answers for them. Therefore you can break this rule, you can use whatever characters you want, but then your answer becomes non-competitive, it cannot win.

The programs must be actual, full programs, according to your language's standard conventions. Functions and REPL snippets are not allowed.

Each program's output should go to stdout or your language's accepted alternative.

Programs should not prompt for or require input. (If prompting for input is inherent to your language, that's ok.)

Programs should be deterministic, finite in run time, and independent. e.g. it shouldn't matter if one is run in a folder separate from the other programs.

A program's output should be the precise printable ASCII character it corresponds to, optionally followed by a single trailing newline, nothing more, nothing less.

Be sure to include information on all 95 (ideally) programs in your answer, as well as your score and any DNP's. You don't have to list all programs that follow a simple pattern like "print(chr(80)), print(chr(81)), print(chr(82))..." but make sure you're sure they all would work and that your score is added correctly.

For reference, here are the 95 printable ASCII your programs must output:

```<code> !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~
</code>```

Body:
FerNANDo, 1786 (19x94) bytes (1 DNP)

Did not program  (space).

The programs follow a pattern. The first one (!) is as follows:

b a
a a b a a a a b

This sets b to 1 (a is by default 0), and then outputs the ASCII character represented by the binary 00100001 (constructed using a and b). This can be repeated for any ASCII character using the same length of source code. To make the programs that print a and b, use the same code but name the variables c and d instead:

a:

d c
c d d c c c c d

b:

d c
c d d c c c d c

Try it online!


问:
Russian Roulette
Write a program which plays Russian Roulette!

If the program is started,

there should be a 5 in 6 chance of it ending normally after printing "I survived!"

there should be a 1 in 6 chance of the program crashing. (segmentation fault, etc.)

No input, and no other outputs are allowed.

The randomness must be fair: it must have a uniform probability distribution. This means an uninitialized variable (or a RNG without seed) MOD 6 will not be sufficient.

If the solution works with only one dedicated operating system / platform, you will receive a 6 byte penalty to the score.

Shortest code wins, not sooner than 10 days after first valid answer.

答:
Ruby, 24-28

```<code>p rand(6)<5?"I survived!":1/0
</code>```

Approx each 6 time, there is a ZeroDivisionError

There is even a shorter version with 24 characters (Thanks to ugoren and histocrat):

```<code>6/rand(6);p"I survived!"
</code>```

If you don't accept the " in the output, then I need 3 more characters. The first option (puts) adds a newline, the second ($><<) makes no newline:

```<code>6/rand(6);puts"I survived!"
6/rand(6);$><<"I survived!"
</code>```

There is a question about random number in ruby at SO.
The seed with srand is automatically called with the seed being from the current time if it wasn't already called. (see Julians comment)

Primo had the idea for an extra bonus to those solutions which don't rely on division by zero.

My first solution can be shortened (28 characters) with a undefined local variable or method ``a' for main:Object (NameError)

```<code>p rand(6)<5?"I survived!":a
</code>```

Title: Russian Roulette

Body:
Ruby, 24-28

p rand(6)<5?"I survived!":1/0

Approx each 6 time, there is a ZeroDivisionError

There is even a shorter version with 24 characters (Thanks to ugoren and histocrat):

6/rand(6);p"I survived!"

If you don't accept the " in the output, then I need 3 more characters. The first option (puts) adds a newline, the second ($><<) makes no newline:

6/rand(6);puts"I survived!"
6/rand(6);$><<"I survived!"

There is a question about random number in ruby at SO.
The seed with srand is automatically called with the seed being from the current time if it wasn't already called. (see Julians comment)

Primo had the idea for an extra bonus to those solutions which don't rely on division by zero.

My first solution can be shortened (28 characters) with a undefined local variable or method ``a' for main:Object (NameError)

p rand(6)<5?"I survived!":a


答:
Pyth, 11 bytes

```<code>{MC{I#.nM*F
</code>```

Try it online!

```<code>{MC{I#.nM*F
         *F  reduce by Cartesian product
             produces nested arrays
      .nM    flatten each
   {I#       filter for invariant under deduplication
  C          transpose
{M           deduplicate each
</code>```

Title: The Permutation Pigeon-hole Principle

Body:
In the game of sudoku, many players like to "pencil in" possible numbers that can go in each square:

The above row can be represented as an array:

```<code>[[1,2,9], [6], [5], [7], [1,2,9], [1,2,9], [3], [1,2,4], [8]]
</code>```

Now, notice that there is only 1 place where a 4 can go.  This effectively lets us simplify the above list to:

```<code>[[1,2,9], [6], [5], [7], [1,2,9], [1,2,9], [3], [4], [8]]
</code>```

The goal of this challenge is to take a list of possible numbers in a permutation, and deduce which possibilities can be eliminated.

As another example, lets say you have the following array of possibilities:

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

The last two places must be filled with 1 and 2.  Therefore, we can remove those possibilities from the first two elements in the array:

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

As another example:

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

Its impossible to construct a permutation from the above possibilities, as there's only 1 location for both 1 and 3, and you would want to return an empty array.

You need to input a list of possibilities and output the remaining possibilities after the maximum number of possibilities have been eliminated.

If a particular array is impossible, you either need to return an empty array, or an array where one of the subarrays is empty.

You may assume that the array will be well-formed, and have at least 1 element.

Given an array of size N, you can assume the numbers in the subarray will always be in the range [0:N), and that N <= 10

You may not assume that every number from 0 to N-1 will be present

You may assume that numbers within a single subarray are unique.

If a subarray contains only a single possibility, you can either represent the possibility in an array or by itself.  [[1],[2],[0]], [1,2,0], [[1,2],0,[1,2]] are all valid.

You may accept the array either in a reasonable string format or in list/array format.

Subarrays can be in any order.

Instead of dealing with ragged arrays, you can pad empty places with -1.

Test cases

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

This is a code-golf so make your answers as short as possible!

Body:
Pyth, 11 bytes

{MC{I#.nM*F

Try it online!

{MC{I#.nM*F
         *F  reduce by Cartesian product
             produces nested arrays
      .nM    flatten each
   {I#       filter for invariant under deduplication
  C          transpose
{M           deduplicate each


答:
Actually, 27 bytes

```<code>Rd╗R`╜∙"♂i"£M╗`MX╜`;╔=`░┬♂╔
</code>```

Try it online!

Title: The Permutation Pigeon-hole Principle

Body:
Actually, 27 bytes

Rd╗R`╜∙"♂i"£M╗`MX╜`;╔=`░┬♂╔

Try it online!


答:
Python 3, <s>101</s> 99 bytes

Thanks to @TLW for -2 bytes

```<code>from itertools import*
lambda x:list(map(set,zip(*[i for i in product(*x)if len(i)==len(set(i))])))
</code>```

An anonymous function that takes input via argument of a list of lists and returns a list of sets.

How it works

```<code>from itertools import*        Import Python's library for iterator generation
lambda x                      Anonymous function with input possibilities x as a
                              list of lists
...for i in product(*x)...    For i in the Cartesian product of x, ie all candidate
                              arrangements:
[...if len(i)==len(set(i))]    Filter into list by non-duplicity (set removes
                               duplicates, so there are no duplicates if the length
                               of i is the same as the length of the set of
                               the elements of i)
zip(*...)                     Unpack and take the transpose, leaving the modified
                              possibilities with duplicates
map(set,...)                  Remove duplicates
:list(...)                    Return the modified possibilities as a list of sets
</code>```

Try it on Ideone

Title: The Permutation Pigeon-hole Principle

Body:
Python 3, <s>101</s> 99 bytes

Thanks to @TLW for -2 bytes

from itertools import*
lambda x:list(map(set,zip(*[i for i in product(*x)if len(i)==len(set(i))])))

An anonymous function that takes input via argument of a list of lists and returns a list of sets.

How it works

from itertools import*        Import Python's library for iterator generation
lambda x                      Anonymous function with input possibilities x as a
                              list of lists
...for i in product(*x)...    For i in the Cartesian product of x, ie all candidate
                              arrangements:
[...if len(i)==len(set(i))]    Filter into list by non-duplicity (set removes
                               duplicates, so there are no duplicates if the length
                               of i is the same as the length of the set of
                               the elements of i)
zip(*...)                     Unpack and take the transpose, leaving the modified
                              possibilities with duplicates
map(set,...)                  Remove duplicates
:list(...)                    Return the modified possibilities as a list of sets

Try it on Ideone


答:
Python 2, 230 bytes

```<code>s='';m=['AaBbCc','BbCcDd','EeFfGg','HhIiJj','KkLlMm','NnOoPp','QqRrSs','TtUuVv','   WwXx',' '*7+'Yy',' '*9+'Z'];
p=lambda l:l.ljust(10)+l[::-1].rjust(10)+'\n';
for l in m:s+=p(l);
s+=' '*9+'zz\n';
for l in m[::-1]:s+=p(l)
print s
</code>```

Title: The Alphabet Chromosome

Body:
Python 2, 230 bytes

s='';m=['AaBbCc','BbCcDd','EeFfGg','HhIiJj','KkLlMm','NnOoPp','QqRrSs','TtUuVv','   WwXx',' '*7+'Yy',' '*9+'Z'];
p=lambda l:l.ljust(10)+l[::-1].rjust(10)+'\n';
for l in m:s+=p(l);
s+=' '*9+'zz\n';
for l in m[::-1]:s+=p(l)
print s


问:
Find the minimum and maximum integers in an array, without using builtins

Challenge

Given an array of integers, received from stdin, function arguments, program arguments, or some other method:

Output only the minimum and maximum numbers in the array, through a return value, stdout, or other fitting methods.

Example session

```<code>> minmax( {0, 15, 2, 3, 7, 18, -2, 9, 6, -5, 3, 8, 9, -14} )
-14 18
</code>```

Reference implementation

```<code>// C++14

void minmax(std::vector<int> v) {
    int min = v[0]; int max = v[0];
    for(auto it : v) {
        if (*it < min)
            min = *it;
        if (*it > max)
            max = *it;
    }
    std::cout << min << ' ' << max << std::endl;
}
</code>```

Rules

You may not use a built-in function to calculate the values.

Standard loopholes disallowed.

Creative implementations encouraged.

This is code-golf, shortest answer wins but will not be selected.

Clarifications

If the array contains 1 element you need to output it twice.

If the minimum and maximum values are the same, you need to output them both.

答:
Mathematica, 18 bytes

```<code>Sort[#][[{1,-1}]]&
</code>```

Sorts the array and extracts the first and last values.

Body:
Mathematica, 18 bytes

Sort[#][[{1,-1}]]&

Sorts the array and extracts the first and last values.


答:
Brachylog, 24 bytes

```<code>+:1f
yg:2j:eaL+?/g:Lz:*a
</code>```

Try it online!

Title: My triangle needs more nodes

Body:
Brachylog, 24 bytes

+:1f
yg:2j:eaL+?/g:Lz:*a

Try it online!


问:
Alphabet triangle strikes again

Task

Your task is to print this exact text:

```<code>A
BCD
EFGHI
JKLMNOP
QRSTUVWXY
ZABCDEFGHIJ
KLMNOPQRSTUVW
XYZABCDEFGHIJKL
MNOPQRSTUVWXYZABC
DEFGHIJKLMNOPQRSTUV
WXYZABCDEFGHIJKLMNOPQ
RSTUVWXYZABCDEFGHIJKLMN
OPQRSTUVWXYZABCDEFGHIJKLM
NOPQRSTUVWXYZABCDEFGHIJKLMN
OPQRSTUVWXYZABCDEFGHIJKLMNOPQ
RSTUVWXYZABCDEFGHIJKLMNOPQRSTUV
WXYZABCDEFGHIJKLMNOPQRSTUVWXYZABC
DEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKL
MNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVW
XYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJ
KLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXY
ZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOP
QRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHI
JKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCD
EFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZA
BCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ
</code>```

Specs

You may do it in all-lowercase instead of all-uppercase.

Trailing newlines at the end of the triangle is allowed.

Trailing spaces after each line is allowed.

You must print to STDOUT instead of outputting an array of strings.

Scoring

This is code-golf. Program with lowest byte-count wins.

答:
C#, 153 Bytes

```<code>using b=System.Console;class a{static void Main(){int i=0,j=0,k=0;while(i<26){b.Write((char)(65+j));j++;j%=26;k++;if(2*i+1==k){b.WriteLine();i++;k=0;}}}}
</code>```

Compile using Microsoft .NET Framework 2.0 or later. (Written using Visual Studio 2015 Update 3.)

Title: Alphabet triangle strikes again

Body:
C#, 153 Bytes

using b=System.Console;class a{static void Main(){int i=0,j=0,k=0;while(i<26){b.Write((char)(65+j));j++;j%=26;k++;if(2*i+1==k){b.WriteLine();i++;k=0;}}}}

Compile using Microsoft .NET Framework 2.0 or later. (Written using Visual Studio 2015 Update 3.)


答:
Python 3, 112 bytes

c is a function that returns the encrypted text and the key

```<code>from random import*
c=lambda t:map(''.join,zip(*[(chr(a+b),str(b))for a,b in((ord(i),randint(0,9))for i in t)]))
</code>```

Here is a code that does the same thing and is a bit more readable

```<code>def encrypt(text):
    # keep the codes of the letters in the input and a random key
    # that will be used later to encrypt this letter
    letter_and_key = ((ord(letter),randint(0,9)) for letter in text)

    # encrypt the letter and keep the key used as a string
    output_and_key = [(chr(letter_code+key), str(key))
                      for letter_code, key in letter_and_key]

    # At this point the values are kept in the format:
    # [(firstletter, firstkey), (secondletter, secondkey), ...]

    # to reorder the list to be able to output in the format "text key"
    text, key = map(''.join, zip(*output_and_key))

    # same as print(*output_and_key)
    return text, key
</code>```

Output:

```<code>>>> text, key = c('Hello World')
>>> print(text, key, sep='\n')
Liuot#`oylk
44935390707
</code>```

Title: Implement this key cipher

Body:
Implement this key cipher

Goal

Use the algorithm (explained in the Algorithm section) to implement a certain cipher.

The program must read input from STDIN or the closest available equivalent, use the algorithm to generate the ciphertext and a key.

The ciphertext and the key will be written to STDOUT or the closest available equivalent. Any format is allowed, as long as it outputs the ciphertext and the key.

Algorithm

Convert the characters in the string into the respective ASCII values. For example:

Hello -> 72 101 108 108 111

Next, you will need to generate a key as long as the string with random numbers in the range of 0-9.

Hello -> 62841

Add the integers in the random number sequence to the ASCII values of the string. In the above examples, 72 would become 78, and 101 would become 104.

72 + 6 = 78, 101 + 2 = 103, 108 + 8 = 116, etc

Next, convert the new values back to characters. In the above examples, the text Hello has become Ngtpp.

Examples

(These are simply examples of what the output might look like. The output can and will vary.)

```<code>Hello World

Lfrlu)_supg
41606984343
</code>```

```<code>This will be encoded

Zhjs$~koo gj$iuhofgj
60104723305544750226
</code>```

Rules

You can assume that the input will only contain characters in the range a-z, A-Z, and spaces.

Submissions must be full programs or functions.

Submissions will be scored in bytes.

Standard loopholes are forbidden.

This is code-golf, so the shortest code wins.

(This is one of my first challenges, if there's something wrong with it, feel free to tell me how I could improve it.)

Body:
Python 3, 112 bytes

c is a function that returns the encrypted text and the key

from random import*
c=lambda t:map(''.join,zip(*[(chr(a+b),str(b))for a,b in((ord(i),randint(0,9))for i in t)]))

Here is a code that does the same thing and is a bit more readable

def encrypt(text):
    # keep the codes of the letters in the input and a random key
    # that will be used later to encrypt this letter
    letter_and_key = ((ord(letter),randint(0,9)) for letter in text)

    # encrypt the letter and keep the key used as a string
    output_and_key = [(chr(letter_code+key), str(key))
                      for letter_code, key in letter_and_key]

    # At this point the values are kept in the format:
    # [(firstletter, firstkey), (secondletter, secondkey), ...]

    # to reorder the list to be able to output in the format "text key"
    text, key = map(''.join, zip(*output_and_key))

    # same as print(*output_and_key)
    return text, key

Output:

>>> text, key = c('Hello World')
>>> print(text, key, sep='\n')
Liuot#`oylk
44935390707


答:
Jelly, 3 bytes

```<code>Ṣ.ị
</code>```

Try it online!

Sort the array, and then takes the 0.5-th element.

Jelly uses 1-indexing, and floating points indexing means take its floor and its ceil.

So the 0.5-th element would give you the 0th element and the 1st element.

The 0th element is the last element.

Title: Find the minimum and maximum integers in an array, without using builtins

Body:
Challenge

Given an array of integers, received from stdin, function arguments, program arguments, or some other method:

Output only the minimum and maximum numbers in the array, through a return value, stdout, or other fitting methods.

Example session

```<code>> minmax( {0, 15, 2, 3, 7, 18, -2, 9, 6, -5, 3, 8, 9, -14} )
-14 18
</code>```

Reference implementation

```<code>// C++14

void minmax(std::vector<int> v) {
    int min = v[0]; int max = v[0];
    for(auto it : v) {
        if (*it < min)
            min = *it;
        if (*it > max)
            max = *it;
    }
    std::cout << min << ' ' << max << std::endl;
}
</code>```

Rules

You may not use a built-in function to calculate the values.

Standard loopholes disallowed.

Creative implementations encouraged.

This is code-golf, shortest answer wins but will not be selected.

Clarifications

If the array contains 1 element you need to output it twice.

If the minimum and maximum values are the same, you need to output them both.

Body:
Jelly, 3 bytes

Ṣ.ị

Try it online!

Sort the array, and then takes the 0.5-th element.

Jelly uses 1-indexing, and floating points indexing means take its floor and its ceil.

So the 0.5-th element would give you the 0th element and the 1st element.

The 0th element is the last element.


答:
Octave, 20 bytes

```<code>@(n)sort(n)([1,end])
</code>```

This sorts the input vector and outputs the first and last value.

Body:
Octave, 20 bytes

@(n)sort(n)([1,end])

This sorts the input vector and outputs the first and last value.


答:
Actually, 5 bytes

```<code>S;F@N
</code>```

Try it online!

Explanation:

```<code>S;F@N
S      sort
 ;     dupe
  F    first element
   @N  and last element
</code>```

Body:
Actually, 5 bytes

S;F@N

Try it online!

Explanation:

S;F@N
S      sort
 ;     dupe
  F    first element
   @N  and last element


答:
Python, <s>61</s> <s>49</s> <s>37</s> <s>36</s> <s>34</s> 31 bytes

lambda s:s.sort()or[s[0],s[-1]]
```

-12 bytes thanks to RootTwo

Another -12 bytes thanks to chepner

-2 bytes thanks to johnLate

-3 bytes thanks to johnLate

Body:
Python, <s>61</s> <s>49</s> <s>37</s> <s>36</s> <s>34</s> 31 bytes

lambda s:s.sort()or[s[0],s[-1]]

-12 bytes thanks to RootTwo

Another -12 bytes thanks to chepner

-2 bytes thanks to johnLate

-3 bytes thanks to johnLate


答:
R, 31 bytes

```<code>l=sort(scan());l[c(1,sum(l|1))]
</code>```

Not that original, but hey !

Body:
R, 31 bytes

l=sort(scan());l[c(1,sum(l|1))]

Not that original, but hey !


答:
Haskell, 36 bytes

```<code>(\l->(head l,last l)).Data.List.sort
</code>```

Would love to use &&& here but imports are so costly...

Body:
Haskell, 36 bytes

(\l->(head l,last l)).Data.List.sort

Would love to use &&& here but imports are so costly...


Body:
Ruby, <s>38</s> 23 bytes

<s>def m(v) puts v.sort![0];$><<v[-1];end</s>

->v{[v.sort![0],v[-1]]}

Thanks @Jordan!


答:
Retina, 17 bytes

```<code>O#`
$
¶$`
Ss`¶.+¶
</code>```

Input and output are linefeed-separated.

Try it online!

Explanation

```<code>O#`
</code>```

Sort lines by numerical value.

```<code>$
¶$`
</code>```

Duplicate the entire input to make sure that the first and last element are distinct.

```<code>Ss`¶.+¶
</code>```

Remove all intermediate lines, leaving only the minimum and maximum.

Body:
Retina, 17 bytes

O#`
$
¶$`
Ss`¶.+¶

Input and output are linefeed-separated.

Try it online!

Explanation

O#`

Sort lines by numerical value.

$
¶$`

Duplicate the entire input to make sure that the first and last element are distinct.

Ss`¶.+¶

Remove all intermediate lines, leaving only the minimum and maximum.


答:
Brachylog, 9 bytes

```<code>oOtT,Oh:T
</code>```

Try it online!

Body:
Brachylog, 9 bytes

oOtT,Oh:T

Try it online!


问:
Enterprise Quality Code Prime Sieve

Enterprise Quality Code!

TL;DR

Answers will consist of a full program (of length < 30k) prints the the first N Prime numbers (as a base 10 representation without leading zeros unless the chosen language only supports unary or other based output) separated by newlines (optional trailing linefeed).

You may post cracks at any time, but you must wait one hour after posting each initial bowled submission

Leading or trailing whitespace is not acceptable (except for the trailing newline)

An answer's score is the number of bytes in the answer. A user's score is the total number of bytes of all uncracked answers.

An answer gets cracked when another user posts an answer (in the same language) which is a permutation of any subset of the characters used in the original answer.

The user with the highest score will receive an accepted tick mark on his /her highest scoring post (although it doesnt really matter which specific post gets the tick)

The Inspiration for this challenge

At Pretty Good consultants there is a focus on writing "quality" verbose code that is sufficiently engineered. Your boss has decided to test you on your skills.

Consider the set of all programming languages in existence before the posting of this challenge. For this challenge there will technically be one individual "winner" in each language, however the boss will give a <s>promotion</s> accepted tick mark to only one answer based on your score.

Detailed Spec

The goal of this challenge is to receive an integer N strictly smaller than 2^8-1 and print the first N prime numbers (in less than 24 hours) separated by your platforms choice of new line (a trailing newline is optional). OEIS sequence A000040 in as many bytes as possible in as many languages as possible. However, note that others vying for the promotion will try to "help" you by golfing down your score. (Please note that your prime generation function should theoretically work for integer N inputs strictly smaller than 2^16-1 given enough time, the bounds for N have been reduced after realizing how slow some interpreters are (namely mine) hardcoding the list of primes is strictly forbidden)

Sample output for an input 11

```
2
3
5
7
11
13
17
19
23
29
31
```

How to participate

Pick any language X, but please avoid selecting a language which is just another version or derivative of another answer.
If there is no existing answer in language X than you will write a program (which must fit into a single post I.E it must be less than 30k characters) that solves this challenge.
The length in bytes of the source (in any reasonable preexisting textual encoding) will be added to your score. You must avoid using any unnecessary characters for reasons that will soon become apparent.

If language X already has been used to answer this question, then you must answer using any permutation of any proper subset of the characters used in the shortest answer (I.E take the shortest X answer and remove some (>=1) characters and optionally rearrange the resulting code). The previous holder of the shortest X answer will lose all of the bytes provided by his answer from his score, and the number of bytes of your submission will now be added to your score. The number of bytes golfed off gets "lost" forever.

Rules for Languages

You may only crack a submission by posting an answer in the same language (and version), but you are barred from posting an answer in language X if there exists a submission in a sufficiently similar language Y. Please do not abuse this rule posting an answer in a sufficiently similar language will receive disqualification.

Below is a leader board which removes answers with "cracked" (with any case) in their header.

var QUESTION_ID=90593,OVERRIDE_USER=46918;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="
"+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 a-r});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<>]+>)^(?:(?!cracked)\i.)*[^\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;width:290px;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

```

答:
Prolog (SWI), 109 bytes

```<code>p(N):-q(N,2).
q(N,X):-N=0;Y is X+1,(A is X-1,\+ (between(2,A,B),0is X mod B),writeln(X),M is N-1;M=N),q(M,Y).
</code>```

Online interpreter

Title: Enterprise Quality Code Prime Sieve

Body:
Prolog (SWI), 109 bytes

p(N):-q(N,2).
q(N,X):-N=0;Y is X+1,(A is X-1,\+ (between(2,A,B),0is X mod B),writeln(X),M is N-1;M=N),q(M,Y).

Online interpreter


答:
05AB1E, <s>6</s> 4 bytes

```<code>{Âø¬
</code>```

Explanation

```<code>{     # sort list
 Â    # bifurcate
  ø   # zip
   ¬  # head
</code>```

Try it online

Body:
05AB1E, <s>6</s> 4 bytes

{Âø¬

Explanation

{     # sort list
 Â    # bifurcate
  ø   # zip
   ¬  # head

Try it online


Body:
BASH 38

grep -o '[^ ]*'|sort -g|sed -n '1p;$p'


答:
Processing, <s>59</s> 52 bytes

```<code>void m(int[]x){x=sort(x);print(x[0],x[x.length-1]);}
</code>```

Processing doesn't actually let me read from stdin that I've been able to find, and I don't know if its internal Java compiler supports lambdas (and its been so long since I've had to write serious Java that I don't remember how).

Body:
Processing, <s>59</s> 52 bytes

void m(int[]x){x=sort(x);print(x[0],x[x.length-1]);}

Processing doesn't actually let me read from stdin that I've been able to find, and I don't know if its internal Java compiler supports lambdas (and its been so long since I've had to write serious Java that I don't remember how).


Body:
Brain-Flak <s>220</s> 218 bytes

(({}))([]){({}[()]<(([])<{({}[()]<([([({}<(({})<>)<>>)<><({}<>)>]{}<(())>)](<>)){({}())<>}{}({}<><{}{}>){{}<>(<({}<({}<>)<>>)<>({}<>)>)}{}({}<>)<>>)}{}<>{}>[()]){({}[()]<({}<>)<>>)}{}<>>)}{}({}<((())){{}{}([][()])}{}>)

Try It Online!

Explanation

First it doubles the top value (in cast the list is only one long)

(({}))

Then it uses my bubble sort algorithm:

([]){({}[()]<(([])<{({}[()]<([([({}<(({})<>)<>>)<><({}<>)>]{}<(())>)](<>)){({}())<>}{}({}<><{}{}>){{}<>(<({}<({}<>)<>>)<>({}<>)>)}{}({}<>)<>>)}{}<>{}>[()]){({}[()]<({}<>)<>>)}{}<>>)}{}

Then it picks up the top value of the stack (i.e. the min)

({}<...>)

Then it pops until the height of the stack is one:

((())){{}{}([][()])}{}


答:
V, 12 bytes

```<code>:sor
ò2Gjkd
</code>```

Try it online!

Credit to DJMcMayhem for this.

Body:
V, 12 bytes

:sor
ò2Gjkd

Try it online!

Credit to DJMcMayhem for this.