问:
Output the Current Time

Challenge

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

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

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

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

It may be pulled from the internet.

It may be the system time.

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

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

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

Since this is a catalog, languages created after this challenge are allowed to compete. Note that there must be an interpreter so the submission can be tested. It is allowed (and even encouraged) to write this interpreter yourself for a previously unimplemented language. Other than that, all the standard rules of code-golf must be obeyed. Submissions in most languages will be scored in bytes in an appropriate preexisting encoding (usually UTF-8).

Catalog

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

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

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

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

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

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

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

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

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

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

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

Leaderboard

	Author	Language	Size

Winners by Language

Language	User	Score

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

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

```

答:
K, 25 24 Bytes

Removed semicolon from the end of the func!

```<code>      .z.ts:{-1@$18h$x}
      \t 1000
  13:11:44
  13:11:45
  13:11:46
  13:11:47
  13:11:48
  ...

.z.ts is called every 1000 milliseconds.
x is the time.
18$x casts the time to the appropriate format.
$ - strings the result.
-1@(stringed result) - prints the string to the console.
</code>```

*Edit Below is less but I wasn't sure whether the time format was allowed;

```<code>    .z.ts:{-1($x)}
    \t 1000
2016.08.01D00:35:37.392683000
</code>```

Title: Output the Current Time

Body:
K, 25 24 Bytes

Removed semicolon from the end of the func!

      .z.ts:{-1@$18h$x}
      \t 1000
  13:11:44
  13:11:45
  13:11:46
  13:11:47
  13:11:48
  ...

.z.ts is called every 1000 milliseconds.
x is the time.
18$x casts the time to the appropriate format.
$ - strings the result.
-1@(stringed result) - prints the string to the console.

*Edit Below is less but I wasn't sure whether the time format was allowed;

    .z.ts:{-1($x)}
    \t 1000
2016.08.01D00:35:37.392683000


问:
Decipher a Vigenère ciphertext
The Vigenère cipher was a simple polyalphabetic cipher that basically applied one of several Caesar ciphers, according to a key. Bascially the letters in the key indicate which shifted alphabet to use. To that end there was a simple tool, called the Vigenère square:

Here each row is a separate alphabet, starting with the corresponding letter of the key. The columns then are used to determine the ciphered letter. Decryption works in very much the same fashion, only vice-versa.

Suppose we want to encrypt the string CODEGOLF. We also need a key. In this case the key shall be FOOBAR. When the key is shorter than the plaintext we extend it by repetition, therefore the actual key we use is FOOBARFO. We now look up the first letter of the key, which is F to find the alphabet. It starts, perhaps unsurprisingly, with F. Now we find the column with the first letter of the plaintext and the resulting letter is H. For the second letter we have O as the key letter and the plain text letter, resulting in C. Continuing that way we finally get HCRFGFQT.

Task

Your task now is to decipher messages, given a key. However, since we have outgrown the 16th century and have computers we should at least support a slightly larger alphabet:

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

The construction of the Vigenère square is still very much the same and the cipher still works in the same way. It's just a bit ... unwieldy to give here in full.

Input

Input is given on standard input as two separate lines of text, each terminated by a line break. The first line contains the key while the second contains the ciphertext.

Output

A single line, containing the deciphered message.

Winning condition

Since encryption is sometimes regarded as a weapon, the code should be short to facilitate easy smuggling. The shorter the better, as it reduces the likelihood of discovery.

Sample input 1

```<code>Key
miQ2eEO
</code>```

Sample output 1

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

Sample input 2

```<code>ThisIsAKey
CoqKuGRUw29BiDTQmOpJFpBzlMMLiPb8alGruFbu
</code>```

Sample output 2

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

A week has passed. The currently shortest solution has been accepted. For those interested, in our contest we had the following submissions and lengths:

130 – Python

  146 – Haskell

  195 – C

  197 – C

  267 – VB.NET

And our own solutions that weren't ranked with the others:

108 – Ruby

  139 – PowerShell

答:
Haskell (169)

```<code>import List
main=do c<-y;t<-y;putStrLn$map((k!!).(`mod`62))$zipWith(-)(g t)(cycle$g c)
k=['a'..'z']++['A'..'Z']++['0'..'9']
y=getLine
f(Just x)=x
g=map$f.(`elemIndex`k)
</code>```

ContentLicense: CC BY-SA 2.5

Title: Decipher a Vigenère ciphertext

Body:
Haskell (169)

import List
main=do c<-y;t<-y;putStrLn$map((k!!).(`mod`62))$zipWith(-)(g t)(cycle$g c)
k=['a'..'z']++['A'..'Z']++['0'..'9']
y=getLine
f(Just x)=x
g=map$f.(`elemIndex`k)


问:
Print this diamond
This question has been spreading like a virus in my office. There are quite a variety of approaches:

Print the following:

```<code>        1
       121
      12321
     1234321
    123454321
   12345654321
  1234567654321
 123456787654321
12345678987654321
 123456787654321
  1234567654321
   12345654321
    123454321
     1234321
      12321
       121
        1
</code>```

Answers are scored in characters with fewer characters being better.

ContentLicense: CC BY-SA 4.0

Title: Print this diamond

Body:
C, 98 chars

l=9,n;p(i){for(i=18;i;putchar(i?n>l?48+n-l:32:10))n=9<--i?18-i:i;}
main(){p(l--);l&&p(main());l++;}

ContentLicense: CC BY-SA 3.0


问:
Print/Output the L-phabet
Inspired by George Gibson's Print a Tabula Recta.

You are to print/output this exact text:

```<code>ABCDEFGHIJKLMNOPQRSTUVWXYZ
BBCDEFGHIJKLMNOPQRSTUVWXYZ
CCCDEFGHIJKLMNOPQRSTUVWXYZ
DDDDEFGHIJKLMNOPQRSTUVWXYZ
EEEEEFGHIJKLMNOPQRSTUVWXYZ
FFFFFFGHIJKLMNOPQRSTUVWXYZ
GGGGGGGHIJKLMNOPQRSTUVWXYZ
HHHHHHHHIJKLMNOPQRSTUVWXYZ
IIIIIIIIIJKLMNOPQRSTUVWXYZ
JJJJJJJJJJKLMNOPQRSTUVWXYZ
KKKKKKKKKKKLMNOPQRSTUVWXYZ
LLLLLLLLLLLLMNOPQRSTUVWXYZ
MMMMMMMMMMMMMNOPQRSTUVWXYZ
NNNNNNNNNNNNNNOPQRSTUVWXYZ
OOOOOOOOOOOOOOOPQRSTUVWXYZ
PPPPPPPPPPPPPPPPQRSTUVWXYZ
QQQQQQQQQQQQQQQQQRSTUVWXYZ
RRRRRRRRRRRRRRRRRRSTUVWXYZ
SSSSSSSSSSSSSSSSSSSTUVWXYZ
TTTTTTTTTTTTTTTTTTTTUVWXYZ
UUUUUUUUUUUUUUUUUUUUUVWXYZ
VVVVVVVVVVVVVVVVVVVVVVWXYZ
WWWWWWWWWWWWWWWWWWWWWWWXYZ
XXXXXXXXXXXXXXXXXXXXXXXXYZ
YYYYYYYYYYYYYYYYYYYYYYYYYZ
ZZZZZZZZZZZZZZZZZZZZZZZZZZ
</code>```

(Yes, I typed that by hand)

You are allowed to use all lowercase instead of all uppercase.

However, your choice of case must be consistent throughout the whole text.

Rules/Requirements

Each submission should be either a full program or function. If it is a function, it must be runnable by only needing to add the function call to the bottom of the program. Anything else (e.g. headers in C), must be included.

If it is possible, provide a link to a site where your program can be tested.

Your program must not write anything to STDERR.

Standard Loopholes are forbidden.

Your program can output in any case, but it must be printed (not an array or similar).

Scoring

Programs are scored according to bytes, in UTF-8 by default or a different character set of your choice.

Eventually, the answer with the least bytes will win.

Submissions

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

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

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

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

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

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

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

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

Leaderboard

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

/* Configuration */

var QUESTION_ID = 87064; // Obtain this from the url
// It will be like https://XYZ.stackexchange.com/questions/QUESTION_ID/... on any question page
var ANSWER_FILTER = "!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe";
var COMMENT_FILTER = "!)Q2B_A2kjfAiU78X(md6BoYk";
var OVERRIDE_USER = 48934; // This should be the user ID of the challenge author.

/* App */

var answers = [], answers_hash, answer_ids, answer_page = 1, more_answers = true, comment_page;

function answersUrl(index) {
  return "https://api.stackexchange.com/2.2/questions/" +  QUESTION_ID + "/answers?page=" + index + "&pagesize=100&order=desc&sort=creation&site=codegolf&filter=" + ANSWER_FILTER;
}

function commentUrl(index, answers) {
  return "https://api.stackexchange.com/2.2/answers/" + answers.join(';') + "/comments?page=" + index + "&pagesize=100&order=desc&sort=creation&site=codegolf&filter=" + COMMENT_FILTER;
}

function getAnswers() {
  jQuery.ajax({
    url: answersUrl(answer_page++),
    method: "get",
    dataType: "jsonp",
    crossDomain: true,
    success: function (data) {
      answers.push.apply(answers, data.items);
      answers_hash = [];
      answer_ids = [];
      data.items.forEach(function(a) {
        a.comments = [];
        var id = +a.share_link.match(/\d+/);
        answer_ids.push(id);
        answers_hash[id] = a;
      });
      if (!data.has_more) more_answers = false;
      comment_page = 1;
      getComments();
    }
  });
}

function getComments() {
  jQuery.ajax({
    url: commentUrl(comment_page++, answer_ids),
    method: "get",
    dataType: "jsonp",
    crossDomain: true,
    success: function (data) {
      data.items.forEach(function(c) {
        if (c.owner.user_id === OVERRIDE_USER)
          answers_hash[c.post_id].comments.push(c);
      });
      if (data.has_more) getComments();
      else if (more_answers) getAnswers();
      else process();
    }
  });
}

getAnswers();

var SCORE_REG = /<h\d>\s*([^\n,]*[^\s,]),.*?(\d+)(?=[^\n\d<>]*(?:<(?:s>[^\n<>]*<\/s>|[^\n<>]+>)[^\n\d<>]*)*<\/h\d>)/;

var OVERRIDE_REG = /^Override\s*header:\s*/i;

function getAuthorName(a) {
  return a.owner.display_name;
}

function process() {
  var valid = [];

  answers.forEach(function(a) {
    var body = a.body;
    a.comments.forEach(function(c) {
      if(OVERRIDE_REG.test(c.body))
        body = '
' + c.body.replace(OVERRIDE_REG, '') + '
';
    });

    var match = body.match(SCORE_REG);
    if (match)
      valid.push({
        user: getAuthorName(a),
        size: +match[2],
        language: match[1],
        link: a.share_link,
      });

  });

  valid.sort(function (a, b) {
    var aB = a.size,
        bB = b.size;
    return aB - bB
  });

  var languages = {};
  var place = 1;
  var lastSize = null;
  var lastPlace = 1;
  valid.forEach(function (a) {
    if (a.size != lastSize)
      lastPlace = place;
    lastSize = a.size;
    ++place;

    var answer = jQuery("#answer-template").html();
    answer = answer.replace("{{PLACE}}", lastPlace + ".")
                   .replace("{{NAME}}", a.user)
                   .replace("{{LANGUAGE}}", a.language)
                   .replace("{{SIZE}}", a.size)
                   .replace("{{LINK}}", a.link);
    answer = jQuery(answer);
    jQuery("#answers").append(answer);

    var lang = a.language;
    if (/ b.lang) return 1;
    if (a.lang < b.lang) return -1;
    return 0;
  });

  for (var i = 0; i < langs.length; ++i)
  {
    var language = jQuery("#language-template").html();
    var lang = langs[i];
    language = language.replace("{{LANGUAGE}}", lang.lang)
                       .replace("{{NAME}}", lang.user)
                       .replace("{{SIZE}}", lang.size)
                       .replace("{{LINK}}", lang.link);
    language = jQuery(language);
    jQuery("#languages").append(language);
  }

}```
<pre class="snippet-code-css lang-css prettyprint-override"><code>body { text-align: left !important}

#answer-list {
  padding: 10px;
  width: 290px;
  float: left;
}

#language-list {
  padding: 10px;
  width: 290px;
  float: left;
}

table thead {
  font-weight: bold;
}

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

```

答:
VBA, 88 bytes

```<code>Function L:For i=0To 701:m=i Mod 27:d=m-i\27:L=L &IIf(26=m,vbLf,Chr(65+m+d*(d<0))):Next
</code>```

An extension of my Tabula Recta answer. Again the last byte counted is the enter which generates the End Function statement. Invoke in the VBA editor Immediate window with ?L.

Title: Print/Output the L-phabet

Body:
VBA, 88 bytes

Function L:For i=0To 701:m=i Mod 27:d=m-i\27:L=L &IIf(26=m,vbLf,Chr(65+m+d*(d<0))):Next

An extension of my Tabula Recta answer. Again the last byte counted is the enter which generates the End Function statement. Invoke in the VBA editor Immediate window with ?L.


问:
Print a Tabula Recta!
The Tabula Recta (sometimes called a 'Vigenere Table'), was created by Johannes Trithemius, and has been used in several ciphers, including all variants of Bellaso's Vigenere cipher and the Trithemius cipher. It looks like this:

```<code>ABCDEFGHIJKLMNOPQRSTUVWXYZ
BCDEFGHIJKLMNOPQRSTUVWXYZA
CDEFGHIJKLMNOPQRSTUVWXYZAB
DEFGHIJKLMNOPQRSTUVWXYZABC
EFGHIJKLMNOPQRSTUVWXYZABCD
FGHIJKLMNOPQRSTUVWXYZABCDE
GHIJKLMNOPQRSTUVWXYZABCDEF
HIJKLMNOPQRSTUVWXYZABCDEFG
IJKLMNOPQRSTUVWXYZABCDEFGH
JKLMNOPQRSTUVWXYZABCDEFGHI
KLMNOPQRSTUVWXYZABCDEFGHIJ
LMNOPQRSTUVWXYZABCDEFGHIJK
MNOPQRSTUVWXYZABCDEFGHIJKL
NOPQRSTUVWXYZABCDEFGHIJKLM
OPQRSTUVWXYZABCDEFGHIJKLMN
PQRSTUVWXYZABCDEFGHIJKLMNO
QRSTUVWXYZABCDEFGHIJKLMNOP
RSTUVWXYZABCDEFGHIJKLMNOPQ
STUVWXYZABCDEFGHIJKLMNOPQR
TUVWXYZABCDEFGHIJKLMNOPQRS
UVWXYZABCDEFGHIJKLMNOPQRST
VWXYZABCDEFGHIJKLMNOPQRSTU
WXYZABCDEFGHIJKLMNOPQRSTUV
XYZABCDEFGHIJKLMNOPQRSTUVW
YZABCDEFGHIJKLMNOPQRSTUVWX
ZABCDEFGHIJKLMNOPQRSTUVWXY
</code>```

I frequently need this, but can't find it anywhere on the internet to copy and paste from. Because the square table is so long, and takes frigging ages to type, your code must be as short as possible.

Rules/Requirements

Each submission should be either a full program or function. If it is a function, it must be runnable by only needing to add the function call to the bottom of the program. Anything else (e.g. headers in C), must be included.

If it is possible, provide a link to a site where your program can be tested.

Your program must not write anything to STDERR.

Standard Loopholes are forbidden.

Your program can output in any case, but it must be printed (not an array or similar).

Scoring

Programs are scored according to bytes, in UTF-8 by default or a different character set of your choice.

Eventually, the answer with the least bytes will win.

Submissions

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

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

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

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

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

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

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

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

Leaderboard

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

/* Configuration */

var QUESTION_ID = 86986; // Obtain this from the url
// It will be like https://XYZ.stackexchange.com/questions/QUESTION_ID/... on any question page
var ANSWER_FILTER = "!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe";
var COMMENT_FILTER = "!)Q2B_A2kjfAiU78X(md6BoYk";
var OVERRIDE_USER = 53406; // This should be the user ID of the challenge author.

/* App */

var answers = [], answers_hash, answer_ids, answer_page = 1, more_answers = true, comment_page;

function answersUrl(index) {
  return "https://api.stackexchange.com/2.2/questions/" +  QUESTION_ID + "/answers?page=" + index + "&pagesize=100&order=desc&sort=creation&site=codegolf&filter=" + ANSWER_FILTER;
}

function commentUrl(index, answers) {
  return "https://api.stackexchange.com/2.2/answers/" + answers.join(';') + "/comments?page=" + index + "&pagesize=100&order=desc&sort=creation&site=codegolf&filter=" + COMMENT_FILTER;
}

function getAnswers() {
  jQuery.ajax({
    url: answersUrl(answer_page++),
    method: "get",
    dataType: "jsonp",
    crossDomain: true,
    success: function (data) {
      answers.push.apply(answers, data.items);
      answers_hash = [];
      answer_ids = [];
      data.items.forEach(function(a) {
        a.comments = [];
        var id = +a.share_link.match(/\d+/);
        answer_ids.push(id);
        answers_hash[id] = a;
      });
      if (!data.has_more) more_answers = false;
      comment_page = 1;
      getComments();
    }
  });
}

function getComments() {
  jQuery.ajax({
    url: commentUrl(comment_page++, answer_ids),
    method: "get",
    dataType: "jsonp",
    crossDomain: true,
    success: function (data) {
      data.items.forEach(function(c) {
        if (c.owner.user_id === OVERRIDE_USER)
          answers_hash[c.post_id].comments.push(c);
      });
      if (data.has_more) getComments();
      else if (more_answers) getAnswers();
      else process();
    }
  });
}

getAnswers();

var SCORE_REG = /<h\d>\s*([^\n,]*[^\s,]),.*?(\d+)(?=[^\n\d<>]*(?:<(?:s>[^\n<>]*<\/s>|[^\n<>]+>)[^\n\d<>]*)*<\/h\d>)/;

var OVERRIDE_REG = /^Override\s*header:\s*/i;

function getAuthorName(a) {
  return a.owner.display_name;
}

function process() {
  var valid = [];

  answers.forEach(function(a) {
    var body = a.body;
    a.comments.forEach(function(c) {
      if(OVERRIDE_REG.test(c.body))
        body = '
' + c.body.replace(OVERRIDE_REG, '') + '
';
    });

    var match = body.match(SCORE_REG);
    if (match)
      valid.push({
        user: getAuthorName(a),
        size: +match[2],
        language: match[1],
        link: a.share_link,
      });

  });

  valid.sort(function (a, b) {
    var aB = a.size,
        bB = b.size;
    return aB - bB
  });

  var languages = {};
  var place = 1;
  var lastSize = null;
  var lastPlace = 1;
  valid.forEach(function (a) {
    if (a.size != lastSize)
      lastPlace = place;
    lastSize = a.size;
    ++place;

    var answer = jQuery("#answer-template").html();
    answer = answer.replace("{{PLACE}}", lastPlace + ".")
                   .replace("{{NAME}}", a.user)
                   .replace("{{LANGUAGE}}", a.language)
                   .replace("{{SIZE}}", a.size)
                   .replace("{{LINK}}", a.link);
    answer = jQuery(answer);
    jQuery("#answers").append(answer);

    var lang = a.language;
    if (/ b.lang) return 1;
    if (a.lang < b.lang) return -1;
    return 0;
  });

  for (var i = 0; i < langs.length; ++i)
  {
    var language = jQuery("#language-template").html();
    var lang = langs[i];
    language = language.replace("{{LANGUAGE}}", lang.lang)
                       .replace("{{NAME}}", lang.user)
                       .replace("{{SIZE}}", lang.size)
                       .replace("{{LINK}}", lang.link);
    language = jQuery(language);
    jQuery("#languages").append(language);
  }

}```
<pre class="snippet-code-css lang-css prettyprint-override"><code>body { text-align: left !important}

#answer-list {
  padding: 10px;
  width: 290px;
  float: left;
}

#language-list {
  padding: 10px;
  width: 290px;
  float: left;
}

table thead {
  font-weight: bold;
}

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

```

Title: Print a Tabula Recta!

Body:
Brainfuck, 203 bytes

Code:

>++[<+++++++++++++>-]<[>[>+>+>+<<<-]>>>[<<<+>>>-]<<<<[>>>>+>+<<<<<-]>>>>>[<<<<<+
>>>>>-]>+++++[<+++++++++++++>-]<<<<[>>>+<<<-]>>[>.+<-]>[-]>+++++[<+++++++++++++>
-]<<<[>>.+<<-]>>[-]++++++++++.[-]<<<<+<-]

Explanation:

At #0
>++[<+++++++++++++>-]< Put 26 in #0
[ 26 times do

  === Get #1 and #2 and #3 to hold count

  > At #1
  [>+>+>+<<<-] Clone #1 into #2 and #3 and #4
  >>>[<<<+>>>-]<<< Move #4 into #1

  === Get #4 to hold 26 minus count which is stored in #0
  < At #0
  [>>>>+>+<<<<<-] Clone #0 into #4 and #5
  >>>>>[<<<<<+>>>>>-]<<<<< Move #5 into #0

  === Now put (count plus 65) into number #5 thereby emptying #2
  === This is the starting number

  >>>>> At #5
  >+++++[<+++++++++++++>-]< Put 65 in #5
  <<<[>>>+<<<-]>>> Add value from #2 to #5

  === Output first '#4' chars starting at #5

  < At #4
  [

    >.+< Output and increase #5

  -]

  === Put 65 in #5

  > At #5
  [-] Empty #5
  >+++++[<+++++++++++++>-]< Put 65 in #5

  === Output first count (#3) chars starting at 65

  << At #3

  [

    >>.+<<

  -]

  === Empty #5 and output newline

  >> At #5
  [-]
  ++++++++++.
  [-]

  === Increase count and prepare end of loop

  <<<<+ At #1 increase
  < At #0

-] end

<a href="https://copy.sh/brainfuck/?c=QXQgIzAKPisrWzwrKysrKysrKysrKysrPi1dPCBQdXQgMjYgaW4gIzAKWyAyNiB0aW1lcyBkbwoKICA9PT0gR2V0ICMxIGFuZCAjMiBhbmQgIzMgdG8gaG9sZCBjb3VudAoKICA-IEF0ICMxCiAgWz4rPis-Kzw8PC1dIENsb25lICMxIGludG8gIzIgYW5kICMzIGFuZCAjNAogID4-Pls8PDwrPj4-LV08PDwgTW92ZSAjNCBpbnRvICMxCgogID09PSBHZXQgIzQgdG8gaG9sZCAyNiBtaW51cyBjb3VudCB3aGljaCBpcyBzdG9yZWQgaW4gIzAKICA8IEF0ICMwCiAgWz4-Pj4rPis8PDw8PC1dIENsb25lICMwIGludG8gIzQgYW5kICM1CiAgPj4-Pj5bPDw8PDwrPj4-Pj4tXTw8PDw8IE1vdmUgIzUgaW50byAjMAoKICA9PT0gTm93IHB1dCAoY291bnQgcGx1cyA2NSkgaW50byBudW1iZXIgIzUgdGhlcmVieSBlbXB0eWluZyAjMgogID09PSBUaGlzIGlzIHRoZSBzdGFydGluZyBudW1iZXIKCiAgPj4-Pj4gQXQgIzUKICA-KysrKytbPCsrKysrKysrKysrKys-LV08IFB1dCA2NSBpbiAjNQogIDw8PFs-Pj4rPDw8LV0-Pj4gQWRkIHZhbHVlIGZyb20gIzIgdG8gIzUKCiAgPT09IE91dHB1dCBmaXJzdCAnIzQnIGNoYXJzIHN0YXJ0aW5nIGF0ICM1CgogIDwgQXQgIzQKICBbCgogICAgPi4rPCBPdXRwdXQgYW5kIGluY3JlYXNlICM1CgogIC1dCgogID09PSBQdXQgNjUgaW4gIzUKCiAgPiBBdCAjNQogIFstXSBFbXB0eSAjNQogID4rKysrK1s8KysrKysrKysrKysrKz4tXTwgUHV0IDY1IGluICM1CgogID09PSBPdXRwdXQgZmlyc3QgY291bnQgKCMzKSBjaGFycyBzdGFydGluZyBhdCA2NQoKICA8PCBBdCAjMwoKICBbCgogICAgPj4uKzw8CgogIC1dCgogID09PSBFbXB0eSAjNSBhbmQgb3V0cHV0IG5ld2xpbmUKCiAgPj4gQXQgIzUKICBbLV0KICArKysrKysrKysrLgogIFstXQoKICA9PT0gSW5jcmVhc2UgY291bnQgYW5kIHByZXBhcmUgZW5kIG9mIGxvb3AKCiAgPDw8PCsgQXQgIzEgaW5jcmVhc2UKICA8IEF0ICMwCgotXSBlbmQ$" rel="nofollow noreferrer">Try it online!


答:
Python 2, 59 bytes

n=0;exec'print bytearray([n+65]*n+range(n+65,91));n+=1;'*26
```

Test it on Ideone.

Title: Print/Output the L-phabet

Body:
Inspired by George Gibson's Print a Tabula Recta.

You are to print/output this exact text:

```<code>ABCDEFGHIJKLMNOPQRSTUVWXYZ
BBCDEFGHIJKLMNOPQRSTUVWXYZ
CCCDEFGHIJKLMNOPQRSTUVWXYZ
DDDDEFGHIJKLMNOPQRSTUVWXYZ
EEEEEFGHIJKLMNOPQRSTUVWXYZ
FFFFFFGHIJKLMNOPQRSTUVWXYZ
GGGGGGGHIJKLMNOPQRSTUVWXYZ
HHHHHHHHIJKLMNOPQRSTUVWXYZ
IIIIIIIIIJKLMNOPQRSTUVWXYZ
JJJJJJJJJJKLMNOPQRSTUVWXYZ
KKKKKKKKKKKLMNOPQRSTUVWXYZ
LLLLLLLLLLLLMNOPQRSTUVWXYZ
MMMMMMMMMMMMMNOPQRSTUVWXYZ
NNNNNNNNNNNNNNOPQRSTUVWXYZ
OOOOOOOOOOOOOOOPQRSTUVWXYZ
PPPPPPPPPPPPPPPPQRSTUVWXYZ
QQQQQQQQQQQQQQQQQRSTUVWXYZ
RRRRRRRRRRRRRRRRRRSTUVWXYZ
SSSSSSSSSSSSSSSSSSSTUVWXYZ
TTTTTTTTTTTTTTTTTTTTUVWXYZ
UUUUUUUUUUUUUUUUUUUUUVWXYZ
VVVVVVVVVVVVVVVVVVVVVVWXYZ
WWWWWWWWWWWWWWWWWWWWWWWXYZ
XXXXXXXXXXXXXXXXXXXXXXXXYZ
YYYYYYYYYYYYYYYYYYYYYYYYYZ
ZZZZZZZZZZZZZZZZZZZZZZZZZZ
</code>```

(Yes, I typed that by hand)

You are allowed to use all lowercase instead of all uppercase.

However, your choice of case must be consistent throughout the whole text.

Rules/Requirements

Each submission should be either a full program or function. If it is a function, it must be runnable by only needing to add the function call to the bottom of the program. Anything else (e.g. headers in C), must be included.

If it is possible, provide a link to a site where your program can be tested.

Your program must not write anything to STDERR.

Standard Loopholes are forbidden.

Your program can output in any case, but it must be printed (not an array or similar).

Scoring

Programs are scored according to bytes, in UTF-8 by default or a different character set of your choice.

Eventually, the answer with the least bytes will win.

Submissions

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

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

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

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

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

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

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

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

Leaderboard

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

/* Configuration */

var QUESTION_ID = 87064; // Obtain this from the url
// It will be like https://XYZ.stackexchange.com/questions/QUESTION_ID/... on any question page
var ANSWER_FILTER = "!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe";
var COMMENT_FILTER = "!)Q2B_A2kjfAiU78X(md6BoYk";
var OVERRIDE_USER = 48934; // This should be the user ID of the challenge author.

/* App */

var answers = [], answers_hash, answer_ids, answer_page = 1, more_answers = true, comment_page;

function answersUrl(index) {
  return "https://api.stackexchange.com/2.2/questions/" +  QUESTION_ID + "/answers?page=" + index + "&pagesize=100&order=desc&sort=creation&site=codegolf&filter=" + ANSWER_FILTER;
}

function commentUrl(index, answers) {
  return "https://api.stackexchange.com/2.2/answers/" + answers.join(';') + "/comments?page=" + index + "&pagesize=100&order=desc&sort=creation&site=codegolf&filter=" + COMMENT_FILTER;
}

function getAnswers() {
  jQuery.ajax({
    url: answersUrl(answer_page++),
    method: "get",
    dataType: "jsonp",
    crossDomain: true,
    success: function (data) {
      answers.push.apply(answers, data.items);
      answers_hash = [];
      answer_ids = [];
      data.items.forEach(function(a) {
        a.comments = [];
        var id = +a.share_link.match(/\d+/);
        answer_ids.push(id);
        answers_hash[id] = a;
      });
      if (!data.has_more) more_answers = false;
      comment_page = 1;
      getComments();
    }
  });
}

function getComments() {
  jQuery.ajax({
    url: commentUrl(comment_page++, answer_ids),
    method: "get",
    dataType: "jsonp",
    crossDomain: true,
    success: function (data) {
      data.items.forEach(function(c) {
        if (c.owner.user_id === OVERRIDE_USER)
          answers_hash[c.post_id].comments.push(c);
      });
      if (data.has_more) getComments();
      else if (more_answers) getAnswers();
      else process();
    }
  });
}

getAnswers();

var SCORE_REG = /<h\d>\s*([^\n,]*[^\s,]),.*?(\d+)(?=[^\n\d<>]*(?:<(?:s>[^\n<>]*<\/s>|[^\n<>]+>)[^\n\d<>]*)*<\/h\d>)/;

var OVERRIDE_REG = /^Override\s*header:\s*/i;

function getAuthorName(a) {
  return a.owner.display_name;
}

function process() {
  var valid = [];

  answers.forEach(function(a) {
    var body = a.body;
    a.comments.forEach(function(c) {
      if(OVERRIDE_REG.test(c.body))
        body = '
' + c.body.replace(OVERRIDE_REG, '') + '
';
    });

    var match = body.match(SCORE_REG);
    if (match)
      valid.push({
        user: getAuthorName(a),
        size: +match[2],
        language: match[1],
        link: a.share_link,
      });

  });

  valid.sort(function (a, b) {
    var aB = a.size,
        bB = b.size;
    return aB - bB
  });

  var languages = {};
  var place = 1;
  var lastSize = null;
  var lastPlace = 1;
  valid.forEach(function (a) {
    if (a.size != lastSize)
      lastPlace = place;
    lastSize = a.size;
    ++place;

    var answer = jQuery("#answer-template").html();
    answer = answer.replace("{{PLACE}}", lastPlace + ".")
                   .replace("{{NAME}}", a.user)
                   .replace("{{LANGUAGE}}", a.language)
                   .replace("{{SIZE}}", a.size)
                   .replace("{{LINK}}", a.link);
    answer = jQuery(answer);
    jQuery("#answers").append(answer);

    var lang = a.language;
    if (/ b.lang) return 1;
    if (a.lang < b.lang) return -1;
    return 0;
  });

  for (var i = 0; i < langs.length; ++i)
  {
    var language = jQuery("#language-template").html();
    var lang = langs[i];
    language = language.replace("{{LANGUAGE}}", lang.lang)
                       .replace("{{NAME}}", lang.user)
                       .replace("{{SIZE}}", lang.size)
                       .replace("{{LINK}}", lang.link);
    language = jQuery(language);
    jQuery("#languages").append(language);
  }

}```
<pre class="snippet-code-css lang-css prettyprint-override"><code>body { text-align: left !important}

#answer-list {
  padding: 10px;
  width: 290px;
  float: left;
}

#language-list {
  padding: 10px;
  width: 290px;
  float: left;
}

table thead {
  font-weight: bold;
}

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

```

Body:
Python 2, 59 bytes

n=0;exec'print bytearray([n+65]*n+range(n+65,91));n+=1;'*26

Test it on Ideone.


答:
ListSharp, 233 bytes

```<code>ROWS s=ROWSPLIT "A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z" BY [","]
[FOREACH NUMB IN 1 TO 26 AS k]
{
STRG t=GETLINE s [k]
[FOREACH NUMB IN 1 TO k AS o]
STRG p=p+t
ROWS x=GETLINES s [k+1 TO 27]
STRG p=p+x+<newline>
}
SHOW=p
</code>```

There are actually some tricks to get this shorter like directly accessing indexes or using c# queries since you can embed c# code in listsharp with some tricks.

But i kept it as in vanilla as possible

Title: Print/Output the L-phabet

Body:
ListSharp, 233 bytes

ROWS s=ROWSPLIT "A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z" BY [","]
[FOREACH NUMB IN 1 TO 26 AS k]
{
STRG t=GETLINE s [k]
[FOREACH NUMB IN 1 TO k AS o]
STRG p=p+t
ROWS x=GETLINES s [k+1 TO 27]
STRG p=p+x+<newline>
}
SHOW=p

There are actually some tricks to get this shorter like directly accessing indexes or using c# queries since you can embed c# code in listsharp with some tricks.

But i kept it as in vanilla as possible


答:
Haskell, <s>43</s> 41 bytes

```<code>l=['A'..'Z']
m=mapM(putStrLn.(<$>l).max)l
</code>```

This defines a function that needs no imports and can just be run in a complete program by adding

```<code>main=m
</code>```

Of course, we could also just name it main itself, but that is three more bytes.

Saved 2 bytes thanks to @wchargin. Depending on the interpretation of the task, we can save 2 more by deleting m= and saying that the remaining part is the function that you can put into main=...

Title: Print/Output the L-phabet

Body:
Haskell, <s>43</s> 41 bytes

l=['A'..'Z']
m=mapM(putStrLn.(<$>l).max)l

This defines a function that needs no imports and can just be run in a complete program by adding

main=m

Of course, we could also just name it main itself, but that is three more bytes.

Saved 2 bytes thanks to @wchargin. Depending on the interpretation of the task, we can save 2 more by deleting m= and saying that the remaining part is the function that you can put into main=...


问:
Cooke and Wheatstone telegraph, five-needle

Definition

According to Wikipedia:

The Cooke and Wheatstone telegraph was an early electrical telegraph system dating from the 1830s invented by English inventor William Fothergill Cooke and English scientist Charles Wheatstone. It was the first telegraph system to be put into commercial service. The receiver consisted of a number of needles which could be moved by electromagnetic coils to point to letters on a board. This feature was liked by early users who were unwilling to learn codes, and employers who did not want to invest in staff training.

It works like this:

In the middle are five needles, which can be deflected clockwise (as is the case of the middle needle) or anti-clockwise (as is the case of the last needle).

In the picture above, the two deflected needles point to the letter G, which means that the letter being transmitted/received is the letter G.

Note that the letters C, J, Q, V, X, Z are missing and thus have to be substituted with other letters.

Task

You will receive a character in ABDEFGHIKLMNOPRSTUWY as input, and you will output the corresponding configuration of the five needles, with undeflected as |, deflected clockwise as /, and deflected anti-clockwise as \.

Testcases

This covers all the possible inputs

```<code>input output
A     /|||\
B     /||\|
D     |/||\
E     /|\||
F     |/|\|
G     ||/|\  (explanation: see above)
H     /\|||
I     |/\||
K     ||/\|
L     |||/\
M     \/|||
N     |\/||
O     ||\/|
P     |||\/
R     \|/||
S     |\|/|
T     ||\|/
U     \||/|
W     |\||/
Y     \|||/
</code>```

Rules/Requirements

Each submission should be either a full program or function. If it is a function, it must be runnable by only needing to add the function call to the bottom of the program. Anything else (e.g. headers in C), must be included.

If it is possible, provide a link to a site where your program can be tested.

Your program must not write anything to STDERR.

Standard Loopholes are forbidden.

Your program can output in any case, but it must be printed (not an array or similar).

Scoring

Programs are scored according to bytes, in UTF-8 by default or a different character set of your choice.

Eventually, the answer with the least bytes will win.

Submissions

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

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

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

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

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

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

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

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

Leaderboard

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

/* Configuration */

var QUESTION_ID = 87104; // Obtain this from the url
// It will be like https://XYZ.stackexchange.com/questions/QUESTION_ID/... on any question page
var ANSWER_FILTER = "!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe";
var COMMENT_FILTER = "!)Q2B_A2kjfAiU78X(md6BoYk";
var OVERRIDE_USER = 48934; // This should be the user ID of the challenge author.

/* App */

var answers = [], answers_hash, answer_ids, answer_page = 1, more_answers = true, comment_page;

function answersUrl(index) {
  return "https://api.stackexchange.com/2.2/questions/" +  QUESTION_ID + "/answers?page=" + index + "&pagesize=100&order=desc&sort=creation&site=codegolf&filter=" + ANSWER_FILTER;
}

function commentUrl(index, answers) {
  return "https://api.stackexchange.com/2.2/answers/" + answers.join(';') + "/comments?page=" + index + "&pagesize=100&order=desc&sort=creation&site=codegolf&filter=" + COMMENT_FILTER;
}

function getAnswers() {
  jQuery.ajax({
    url: answersUrl(answer_page++),
    method: "get",
    dataType: "jsonp",
    crossDomain: true,
    success: function (data) {
      answers.push.apply(answers, data.items);
      answers_hash = [];
      answer_ids = [];
      data.items.forEach(function(a) {
        a.comments = [];
        var id = +a.share_link.match(/\d+/);
        answer_ids.push(id);
        answers_hash[id] = a;
      });
      if (!data.has_more) more_answers = false;
      comment_page = 1;
      getComments();
    }
  });
}

function getComments() {
  jQuery.ajax({
    url: commentUrl(comment_page++, answer_ids),
    method: "get",
    dataType: "jsonp",
    crossDomain: true,
    success: function (data) {
      data.items.forEach(function(c) {
        if (c.owner.user_id === OVERRIDE_USER)
          answers_hash[c.post_id].comments.push(c);
      });
      if (data.has_more) getComments();
      else if (more_answers) getAnswers();
      else process();
    }
  });
}

getAnswers();

var SCORE_REG = /<h\d>\s*([^\n,]*[^\s,]),.*?(\d+)(?=[^\n\d<>]*(?:<(?:s>[^\n<>]*<\/s>|[^\n<>]+>)[^\n\d<>]*)*<\/h\d>)/;

var OVERRIDE_REG = /^Override\s*header:\s*/i;

function getAuthorName(a) {
  return a.owner.display_name;
}

function process() {
  var valid = [];

  answers.forEach(function(a) {
    var body = a.body;
    a.comments.forEach(function(c) {
      if(OVERRIDE_REG.test(c.body))
        body = '
' + c.body.replace(OVERRIDE_REG, '') + '
';
    });

    var match = body.match(SCORE_REG);
    if (match)
      valid.push({
        user: getAuthorName(a),
        size: +match[2],
        language: match[1],
        link: a.share_link,
      });

  });

  valid.sort(function (a, b) {
    var aB = a.size,
        bB = b.size;
    return aB - bB
  });

  var languages = {};
  var place = 1;
  var lastSize = null;
  var lastPlace = 1;
  valid.forEach(function (a) {
    if (a.size != lastSize)
      lastPlace = place;
    lastSize = a.size;
    ++place;

    var answer = jQuery("#answer-template").html();
    answer = answer.replace("{{PLACE}}", lastPlace + ".")
                   .replace("{{NAME}}", a.user)
                   .replace("{{LANGUAGE}}", a.language)
                   .replace("{{SIZE}}", a.size)
                   .replace("{{LINK}}", a.link);
    answer = jQuery(answer);
    jQuery("#answers").append(answer);

    var lang = a.language;
    if (/ b.lang) return 1;
    if (a.lang < b.lang) return -1;
    return 0;
  });

  for (var i = 0; i < langs.length; ++i)
  {
    var language = jQuery("#language-template").html();
    var lang = langs[i];
    language = language.replace("{{LANGUAGE}}", lang.lang)
                       .replace("{{NAME}}", lang.user)
                       .replace("{{SIZE}}", lang.size)
                       .replace("{{LINK}}", lang.link);
    language = jQuery(language);
    jQuery("#languages").append(language);
  }

}```
<pre class="snippet-code-css lang-css prettyprint-override"><code>body { text-align: left !important}

#answer-list {
  padding: 10px;
  width: 290px;
  float: left;
}

#language-list {
  padding: 10px;
  width: 290px;
  float: left;
}

table thead {
  font-weight: bold;
}

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

```

答:
Python 2, <s>172</s> <s>152</s> <s>151</s> 79 bytes

lambda x:r'/|||\/|||/\|||/|\||/||\|/||'['APONM LKIHY GFEWU DBTSR'.find(x):][:5]
```

No algorithm, just a lookup table.

Saved 20 bytes thanks to @LeakyNun!

Saved a byte thanks to @TheBikingViking!

Saved a whopping 72 bytes thanks to @Keeta!

Body:
Python 2, <s>172</s> <s>152</s> <s>151</s> 79 bytes

lambda x:r'/|||\/|||/\|||/|\||/||\|/||'['APONM LKIHY GFEWU DBTSR'.find(x):][:5]

No algorithm, just a lookup table.

Saved 20 bytes thanks to @LeakyNun!

Saved a byte thanks to @TheBikingViking!

Saved a whopping 72 bytes thanks to @Keeta!


问:
Fibonacci function or sequence
The Fibonacci sequence is a sequence of numbers, where every number in the sequence is the sum of the two numbers preceding it.  The first two numbers in the sequence are both 1. Here are the first few terms:

```<code>1 1 2 3 5 8 13 21 34 55 89 ...
</code>```

Write the shortest code that either:

Generates the Fibonacci sequence without end.

Given n calculates the nth term of the sequence. (Either 1 or zero indexed)

You may use standard forms of input and output.

(I gave both options in case one is easier to do in your chosen language than the other.)

For the function that takes an n, a reasonably large return value (the largest Fibonacci number that fits your computer's normal word size, at a minimum) has to be supported.

Leaderboard

/* Configuration */

var QUESTION_ID = 85; // Obtain this from the url
// It will be like https://XYZ.stackexchange.com/questions/QUESTION_ID/... on any question page
var ANSWER_FILTER = "!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe";
var COMMENT_FILTER = "!)Q2B_A2kjfAiU78X(md6BoYk";
var OVERRIDE_USER = 3; // This should be the user ID of the challenge author.

/* App */

var answers = [], answers_hash, answer_ids, answer_page = 1, more_answers = true, comment_page;

function answersUrl(index) {
  return "https://api.stackexchange.com/2.2/questions/" +  QUESTION_ID + "/answers?page=" + index + "&pagesize=100&order=desc&sort=creation&site=codegolf&filter=" + ANSWER_FILTER;
}

function commentUrl(index, answers) {
  return "https://api.stackexchange.com/2.2/answers/" + answers.join(';') + "/comments?page=" + index + "&pagesize=100&order=desc&sort=creation&site=codegolf&filter=" + COMMENT_FILTER;
}

function getAnswers() {
  jQuery.ajax({
    url: answersUrl(answer_page++),
    method: "get",
    dataType: "jsonp",
    crossDomain: true,
    success: function (data) {
      answers.push.apply(answers, data.items);
      answers_hash = [];
      answer_ids = [];
      data.items.forEach(function(a) {
        a.comments = [];
        var id = +a.share_link.match(/\d+/);
        answer_ids.push(id);
        answers_hash[id] = a;
      });
      if (!data.has_more) more_answers = false;
      comment_page = 1;
      getComments();
    }
  });
}

function getComments() {
  jQuery.ajax({
    url: commentUrl(comment_page++, answer_ids),
    method: "get",
    dataType: "jsonp",
    crossDomain: true,
    success: function (data) {
      data.items.forEach(function(c) {
        if (c.owner.user_id === OVERRIDE_USER)
          answers_hash[c.post_id].comments.push(c);
      });
      if (data.has_more) getComments();
      else if (more_answers) getAnswers();
      else process();
    }
  });
}

getAnswers();

var SCORE_REG = /<h\d>\s*([^\n,<]*(?:<(?:[^\n>]*>[^\n<]*<\/[^\n>]*>)[^\n,<]*)*),.*?(\d+)(?=[^\n\d<>]*(?:<(?:s>[^\n<>]*<\/s>|[^\n<>]+>)[^\n\d<>]*)*<\/h\d>)/;

var OVERRIDE_REG = /^Override\s*header:\s*/i;

function getAuthorName(a) {
  return a.owner.display_name;
}

function process() {
  var valid = [];

  answers.forEach(function(a) {
    var body = a.body;
    a.comments.forEach(function(c) {
      if(OVERRIDE_REG.test(c.body))
        body = '
' + c.body.replace(OVERRIDE_REG, '') + '
';
    });

    var match = body.match(SCORE_REG);
    if (match)
      valid.push({
        user: getAuthorName(a),
        size: +match[2],
        language: match[1],
        link: a.share_link,
      });
    else console.log(body);
  });

  valid.sort(function (a, b) {
    var aB = a.size,
        bB = b.size;
    return aB - bB
  });

  var languages = {};
  var place = 1;
  var lastSize = null;
  var lastPlace = 1;
  valid.forEach(function (a) {
    if (a.size != lastSize)
      lastPlace = place;
    lastSize = a.size;
    ++place;

    var answer = jQuery("#answer-template").html();
    answer = answer.replace("{{PLACE}}", lastPlace + ".")
                   .replace("{{NAME}}", a.user)
                   .replace("{{LANGUAGE}}", a.language)
                   .replace("{{SIZE}}", a.size)
                   .replace("{{LINK}}", a.link);
    answer = jQuery(answer);
    jQuery("#answers").append(answer);

    var lang = a.language;
    lang = jQuery(''+lang+'').text();

    languages[lang] = languages[lang] || {lang: a.language, lang_raw: lang, user: a.user, size: a.size, link: a.link};
  });

  var langs = [];
  for (var lang in languages)
    if (languages.hasOwnProperty(lang))
      langs.push(languages[lang]);

  langs.sort(function (a, b) {
    if (a.lang_raw.toLowerCase() > b.lang_raw.toLowerCase()) return 1;
    if (a.lang_raw.toLowerCase() < b.lang_raw.toLowerCase()) return -1;
    return 0;
  });

  for (var i = 0; i < langs.length; ++i)
  {
    var language = jQuery("#language-template").html();
    var lang = langs[i];
    language = language.replace("{{LANGUAGE}}", lang.lang)
                       .replace("{{NAME}}", lang.user)
                       .replace("{{SIZE}}", lang.size)
                       .replace("{{LINK}}", lang.link);
    language = jQuery(language);
    jQuery("#languages").append(language);
  }

}```
<pre class="snippet-code-css lang-css prettyprint-override"><code>body {
  text-align: left !important;
  display: block !important;
}

#answer-list {
  padding: 10px;
  width: 290px;
  float: left;
}

#language-list {
  padding: 10px;
  width: 290px;
  float: left;
}

table thead {
  font-weight: bold;
}

table td {
  padding: 5px;
}</code>```

<link rel="stylesheet" type="text/css" href="https://cdn.sstatic.net/Sites/codegolf/all.css?v=ffb5d0584c5f">

Shortest Solution by Language

Language	User	Score

Leaderboard

	Author	Language	Size

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

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

```

答:
J, 9 bytes

```<code>+/@:!&i.-
</code>```

Gets the nth Fibonacci number by finding the sums of the binomial coefficients C(n-i-1, i) for i from 0 to n-1.

Also, a short way using 12 bytes to generate the first n Fibonacci numbers is

```<code>+/@(!|.)\@i.
</code>```

It uses the same method as above but works by operating on prefixes of the range [0, 1, ..., n-1].

Usage

```<code>   f =: +/@:!&i.-
   f 10
55
   f 17
1597
</code>```

Explanation

```<code>+/@:!&i.- Input: n
        - Negate n
     &i.  Form the ranges [n-1, n-2, ..., 0] and [0, 1, ..., n-1]
    !     Find the binomial coefficient between each pair of values
+/@:      Sum those binomial coefficients and return
</code>```

Title: Fibonacci function or sequence

Body:
J, 9 bytes

+/@:!&i.-

Gets the nth Fibonacci number by finding the sums of the binomial coefficients C(n-i-1, i) for i from 0 to n-1.

Also, a short way using 12 bytes to generate the first n Fibonacci numbers is

+/@(!|.)\@i.

It uses the same method as above but works by operating on prefixes of the range [0, 1, ..., n-1].

Usage

   f =: +/@:!&i.-
   f 10
55
   f 17
1597

Explanation

+/@:!&i.- Input: n
        - Negate n
     &i.  Form the ranges [n-1, n-2, ..., 0] and [0, 1, ..., n-1]
    !     Find the binomial coefficient between each pair of values
+/@:      Sum those binomial coefficients and return


答:
C, <s>124</s> <s>107</s> 98 bytes

As a function:

x,i;W(char*v){for(i=strcspn(" MRUYH NSWEI OTBFK PADGL",v);x<5;++x)putchar(x^i%5?x^i/5?124:92:47);}

// main(int c,char**v){W(v[1]);}
```

<p>This works by using rotating the grid 45 degrees and looking up the row/column from the resulting block.</p>

<hr>

<p>As a full executable (107 bytes):</p>

<pre class="lang-c prettyprint-override"><code>x;main(i,v)char**v;{for(i=strcspn(" MRUYH NSWEI OTBFK PADGL",v[1]);x<5;++x)putchar(x^i%5?x^i/5?124:92:47);}
</code>```

An alternative full executable: (same bytecount but takes input from stdin and includes newline after output)

main(i){char*r=" MRUYH NSWEI OTBFK PADGL",b[]="|||||";i=strchr(r,getchar())-r;b[i%5]=47;b[i/5]=92;puts(b);}
```

<p>Breakdown:</p>

<pre class="lang-c prettyprint-override"><code>x;                                      // Implicit int declaration
main(i,v)char**v;{                      // K&R function declaration to save a byte
    for(i=strcspn("<...>",v[1]);        // Find index of input in lookup table
        x<5;++x)                        // Loop 0 to 4
        putchar(x^i%5?x^i/5?124:92:47); //  Print /, \ or | depending on value of i
}
</code>```

Alternate breakdown:

main(i){
    char*r="<...>",                     // Store lookup table
    b[]="|||||";                        // Malleable base string for return
    i=strchr(r,getchar())-r;            // Find input in lookup table
    b[i%5]=47;                          // Set correct char in output to /
    b[i/5]=92;                          // Set correct char in output to \
    puts(b);                            // Print result
}
```

<hr>

<p>Bonus: 0-9 extension from the wikipedia page:</p>

<pre class="lang-c prettyprint-override"><code>x;main(i,v)char**v;{for(i=strcspn(" MRUY6H NSW7EI OT8BFK P9ADGL 012345",v[1]);x<5;++x)putchar(x^i%6?x^i/6?124:92:47);}
</code>```

Bonus bonus: a complete (if messy) program for both encoding and decoding messages:

#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <stdbool.h>

static const char *REF = " MRUY6H NSW7EI OT8BFK P9ADGL 012345 ";

char sub(char c) {
    c = toupper(c);
    if(c == 'C') { c = 'K'; }
    if(c == 'J') { c = 'G'; }
    if(c == 'Q') { c = 'K'; }
    if(c == 'V') { c = 'W'; }
    if(c == 'X') { c = 'S'; }
    if(c == 'Z') { c = 'S'; }
    return c;
}

void print_encoded(char c) {
    char b[] = "|||||";
    const char *p = strchr(REF, sub(c));
    if(!p) { return; }
    int i = p - REF;
    if(i) {
        if(i%6 < 5) { b[i%6] = '/'; }
        if(i/6 < 5) { b[i/6] = '\\';}
    }
    puts(b);
}

char decode(const char *m) {
    int pf = 5;
    int pb = 5;
    for(int x=0;x<5;++x) {
        if(m[x] == '/') {
            pf=x;
        } else if(m[x] == '\\') {
            pb=x;
        } else if(m[x] == '\0') {
            return '!';
        }
    }
    return REF[pb*6+pf];
}

int main(int c, const char **v) {
    int inArg;
    bool isDecode;
    if(c > 1 && (strcmp(v[1], "-h") == 0 || strcmp(v[1], "--help") == 0)) {
        printf("Usage:\n  %s [-d] [<input>]\n\n", v[0]);
        printf("Converts input to/from Cooke and Wheatstone 5-needle encoding.\n\n");
        printf("If no input arguments are given, takes input from stdin.\n\n");
        printf("Parameters:\n");
        printf("  -h --help   Displays help.\n");
        printf("  -d --decode Switches to decode mode.\n");
        printf("\n");
        return 0;
    } else if(c > 1 && (strcmp(v[1], "-d") == 0 || strcmp(v[1], "--decode") == 0)) {
        inArg = (c > 2 ? 2 : 0);
        isDecode = true;
    } else if(c > 1) {
        inArg = 1;
        isDecode = false;
    } else {
        inArg = 0;
        isDecode = false;
    }
    if(isDecode) {
        if(inArg == 0) {
            char ln[6];
            while(scanf("%5s", ln) == 1) {
                putchar(decode(ln));
            }
        } else {
            for(int p = inArg; p < c; ++p) {
                for(const char *q = v[p], *e = strchr(v[p], '\0'); q < e; q += 5) {
                    while(*q == ' ') { ++q; }
                    putchar(decode(q));
                }
            }
        }
        putchar('\n');
    } else {
        if(inArg == 0) {
            int c;
            while((c = getchar()) != EOF) {
                print_encoded(c);
            }
        } else {
            for(const char *p = v[inArg]; *p; ++p) {
                print_encoded(*p);
            }
        }
    }
    return 0;
}
```

Title: Cooke and Wheatstone telegraph, five-needle

Body:
Definition

According to Wikipedia:

The Cooke and Wheatstone telegraph was an early electrical telegraph system dating from the 1830s invented by English inventor William Fothergill Cooke and English scientist Charles Wheatstone. It was the first telegraph system to be put into commercial service. The receiver consisted of a number of needles which could be moved by electromagnetic coils to point to letters on a board. This feature was liked by early users who were unwilling to learn codes, and employers who did not want to invest in staff training.

It works like this:

In the middle are five needles, which can be deflected clockwise (as is the case of the middle needle) or anti-clockwise (as is the case of the last needle).

In the picture above, the two deflected needles point to the letter G, which means that the letter being transmitted/received is the letter G.

Note that the letters C, J, Q, V, X, Z are missing and thus have to be substituted with other letters.

Task

You will receive a character in ABDEFGHIKLMNOPRSTUWY as input, and you will output the corresponding configuration of the five needles, with undeflected as |, deflected clockwise as /, and deflected anti-clockwise as \.

Testcases

This covers all the possible inputs

```<code>input output
A     /|||\
B     /||\|
D     |/||\
E     /|\||
F     |/|\|
G     ||/|\  (explanation: see above)
H     /\|||
I     |/\||
K     ||/\|
L     |||/\
M     \/|||
N     |\/||
O     ||\/|
P     |||\/
R     \|/||
S     |\|/|
T     ||\|/
U     \||/|
W     |\||/
Y     \|||/
</code>```

Rules/Requirements

Each submission should be either a full program or function. If it is a function, it must be runnable by only needing to add the function call to the bottom of the program. Anything else (e.g. headers in C), must be included.

If it is possible, provide a link to a site where your program can be tested.

Your program must not write anything to STDERR.

Standard Loopholes are forbidden.

Your program can output in any case, but it must be printed (not an array or similar).

Scoring

Programs are scored according to bytes, in UTF-8 by default or a different character set of your choice.

Eventually, the answer with the least bytes will win.

Submissions

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

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

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

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

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

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

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

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

Leaderboard

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

/* Configuration */

var QUESTION_ID = 87104; // Obtain this from the url
// It will be like https://XYZ.stackexchange.com/questions/QUESTION_ID/... on any question page
var ANSWER_FILTER = "!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe";
var COMMENT_FILTER = "!)Q2B_A2kjfAiU78X(md6BoYk";
var OVERRIDE_USER = 48934; // This should be the user ID of the challenge author.

/* App */

var answers = [], answers_hash, answer_ids, answer_page = 1, more_answers = true, comment_page;

function answersUrl(index) {
  return "https://api.stackexchange.com/2.2/questions/" +  QUESTION_ID + "/answers?page=" + index + "&pagesize=100&order=desc&sort=creation&site=codegolf&filter=" + ANSWER_FILTER;
}

function commentUrl(index, answers) {
  return "https://api.stackexchange.com/2.2/answers/" + answers.join(';') + "/comments?page=" + index + "&pagesize=100&order=desc&sort=creation&site=codegolf&filter=" + COMMENT_FILTER;
}

function getAnswers() {
  jQuery.ajax({
    url: answersUrl(answer_page++),
    method: "get",
    dataType: "jsonp",
    crossDomain: true,
    success: function (data) {
      answers.push.apply(answers, data.items);
      answers_hash = [];
      answer_ids = [];
      data.items.forEach(function(a) {
        a.comments = [];
        var id = +a.share_link.match(/\d+/);
        answer_ids.push(id);
        answers_hash[id] = a;
      });
      if (!data.has_more) more_answers = false;
      comment_page = 1;
      getComments();
    }
  });
}

function getComments() {
  jQuery.ajax({
    url: commentUrl(comment_page++, answer_ids),
    method: "get",
    dataType: "jsonp",
    crossDomain: true,
    success: function (data) {
      data.items.forEach(function(c) {
        if (c.owner.user_id === OVERRIDE_USER)
          answers_hash[c.post_id].comments.push(c);
      });
      if (data.has_more) getComments();
      else if (more_answers) getAnswers();
      else process();
    }
  });
}

getAnswers();

var SCORE_REG = /<h\d>\s*([^\n,]*[^\s,]),.*?(\d+)(?=[^\n\d<>]*(?:<(?:s>[^\n<>]*<\/s>|[^\n<>]+>)[^\n\d<>]*)*<\/h\d>)/;

var OVERRIDE_REG = /^Override\s*header:\s*/i;

function getAuthorName(a) {
  return a.owner.display_name;
}

function process() {
  var valid = [];

  answers.forEach(function(a) {
    var body = a.body;
    a.comments.forEach(function(c) {
      if(OVERRIDE_REG.test(c.body))
        body = '
' + c.body.replace(OVERRIDE_REG, '') + '
';
    });

    var match = body.match(SCORE_REG);
    if (match)
      valid.push({
        user: getAuthorName(a),
        size: +match[2],
        language: match[1],
        link: a.share_link,
      });

  });

  valid.sort(function (a, b) {
    var aB = a.size,
        bB = b.size;
    return aB - bB
  });

  var languages = {};
  var place = 1;
  var lastSize = null;
  var lastPlace = 1;
  valid.forEach(function (a) {
    if (a.size != lastSize)
      lastPlace = place;
    lastSize = a.size;
    ++place;

    var answer = jQuery("#answer-template").html();
    answer = answer.replace("{{PLACE}}", lastPlace + ".")
                   .replace("{{NAME}}", a.user)
                   .replace("{{LANGUAGE}}", a.language)
                   .replace("{{SIZE}}", a.size)
                   .replace("{{LINK}}", a.link);
    answer = jQuery(answer);
    jQuery("#answers").append(answer);

    var lang = a.language;
    if (/ b.lang) return 1;
    if (a.lang < b.lang) return -1;
    return 0;
  });

  for (var i = 0; i < langs.length; ++i)
  {
    var language = jQuery("#language-template").html();
    var lang = langs[i];
    language = language.replace("{{LANGUAGE}}", lang.lang)
                       .replace("{{NAME}}", lang.user)
                       .replace("{{SIZE}}", lang.size)
                       .replace("{{LINK}}", lang.link);
    language = jQuery(language);
    jQuery("#languages").append(language);
  }

}```
<pre class="snippet-code-css lang-css prettyprint-override"><code>body { text-align: left !important}

#answer-list {
  padding: 10px;
  width: 290px;
  float: left;
}

#language-list {
  padding: 10px;
  width: 290px;
  float: left;
}

table thead {
  font-weight: bold;
}

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

```

Body:
C, <s>124</s> <s>107</s> 98 bytes

As a function:

x,i;W(char*v){for(i=strcspn(" MRUYH NSWEI OTBFK PADGL",v);x<5;++x)putchar(x^i%5?x^i/5?124:92:47);}

// main(int c,char**v){W(v[1]);}

This works by using rotating the grid 45 degrees and looking up the row/column from the resulting block.

As a full executable (107 bytes):

x;main(i,v)char**v;{for(i=strcspn(" MRUYH NSWEI OTBFK PADGL",v[1]);x<5;++x)putchar(x^i%5?x^i/5?124:92:47);}

An alternative full executable: (same bytecount but takes input from stdin and includes newline after output)

main(i){char*r=" MRUYH NSWEI OTBFK PADGL",b[]="|||||";i=strchr(r,getchar())-r;b[i%5]=47;b[i/5]=92;puts(b);}

Breakdown:

x;                                      // Implicit int declaration
main(i,v)char**v;{                      // K&R function declaration to save a byte
    for(i=strcspn("<...>",v[1]);        // Find index of input in lookup table
        x<5;++x)                        // Loop 0 to 4
        putchar(x^i%5?x^i/5?124:92:47); //  Print /, \ or | depending on value of i
}

Alternate breakdown:

main(i){
    char*r="<...>",                     // Store lookup table
    b[]="|||||";                        // Malleable base string for return
    i=strchr(r,getchar())-r;            // Find input in lookup table
    b[i%5]=47;                          // Set correct char in output to /
    b[i/5]=92;                          // Set correct char in output to \
    puts(b);                            // Print result
}

Bonus: 0-9 extension from the wikipedia page:

x;main(i,v)char**v;{for(i=strcspn(" MRUY6H NSW7EI OT8BFK P9ADGL 012345",v[1]);x<5;++x)putchar(x^i%6?x^i/6?124:92:47);}

Bonus bonus: a complete (if messy) program for both encoding and decoding messages:

#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <stdbool.h>

static const char *REF = " MRUY6H NSW7EI OT8BFK P9ADGL 012345 ";

char sub(char c) {
    c = toupper(c);
    if(c == 'C') { c = 'K'; }
    if(c == 'J') { c = 'G'; }
    if(c == 'Q') { c = 'K'; }
    if(c == 'V') { c = 'W'; }
    if(c == 'X') { c = 'S'; }
    if(c == 'Z') { c = 'S'; }
    return c;
}

void print_encoded(char c) {
    char b[] = "|||||";
    const char *p = strchr(REF, sub(c));
    if(!p) { return; }
    int i = p - REF;
    if(i) {
        if(i%6 < 5) { b[i%6] = '/'; }
        if(i/6 < 5) { b[i/6] = '\\';}
    }
    puts(b);
}

char decode(const char *m) {
    int pf = 5;
    int pb = 5;
    for(int x=0;x<5;++x) {
        if(m[x] == '/') {
            pf=x;
        } else if(m[x] == '\\') {
            pb=x;
        } else if(m[x] == '\0') {
            return '!';
        }
    }
    return REF[pb*6+pf];
}

int main(int c, const char **v) {
    int inArg;
    bool isDecode;
    if(c > 1 && (strcmp(v[1], "-h") == 0 || strcmp(v[1], "--help") == 0)) {
        printf("Usage:\n  %s [-d] [<input>]\n\n", v[0]);
        printf("Converts input to/from Cooke and Wheatstone 5-needle encoding.\n\n");
        printf("If no input arguments are given, takes input from stdin.\n\n");
        printf("Parameters:\n");
        printf("  -h --help   Displays help.\n");
        printf("  -d --decode Switches to decode mode.\n");
        printf("\n");
        return 0;
    } else if(c > 1 && (strcmp(v[1], "-d") == 0 || strcmp(v[1], "--decode") == 0)) {
        inArg = (c > 2 ? 2 : 0);
        isDecode = true;
    } else if(c > 1) {
        inArg = 1;
        isDecode = false;
    } else {
        inArg = 0;
        isDecode = false;
    }
    if(isDecode) {
        if(inArg == 0) {
            char ln[6];
            while(scanf("%5s", ln) == 1) {
                putchar(decode(ln));
            }
        } else {
            for(int p = inArg; p < c; ++p) {
                for(const char *q = v[p], *e = strchr(v[p], '\0'); q < e; q += 5) {
                    while(*q == ' ') { ++q; }
                    putchar(decode(q));
                }
            }
        }
        putchar('\n');
    } else {
        if(inArg == 0) {
            int c;
            while((c = getchar()) != EOF) {
                print_encoded(c);
            }
        } else {
            for(const char *p = v[inArg]; *p; ++p) {
                print_encoded(*p);
            }
        }
    }
    return 0;
}


答:
CJam, 42 bytes

```<code>r"HEBAMRUYIFDNSWKGOTLP"5e!{_$"/\|"er}%_&er
</code>```

Test it here

Although there's a lot of structure to the outputs I'm not entirely sure yet I can compute the results efficiently (in terms of bytes). So this is still a lookup table, but I'm generating the list of possible needle configurations via permutations of the list [0 1 2 3 4].

Body:
CJam, 42 bytes

r"HEBAMRUYIFDNSWKGOTLP"5e!{_$"/\|"er}%_&er

Test it here

Although there's a lot of structure to the outputs I'm not entirely sure yet I can compute the results efficiently (in terms of bytes). So this is still a lookup table, but I'm generating the list of possible needle configurations via permutations of the list [0 1 2 3 4].


Title: Print this diamond

Body:
This question has been spreading like a virus in my office. There are quite a variety of approaches:

Print the following:

```<code>        1
       121
      12321
     1234321
    123454321
   12345654321
  1234567654321
 123456787654321
12345678987654321
 123456787654321
  1234567654321
   12345654321
    123454321
     1234321
      12321
       121
        1
</code>```

Answers are scored in characters with fewer characters being better.

Body:
R, 71 characters

For the records:

s=c(1:9,8:1);for(i in s)cat(rep(" ",9-i),s[0:i],s[(i-1):0],"\n",sep="")


答:
Perl 6, <s> 67 </s> 64 bytes

<s>my @a;@a[.[0]][.[1]]=('A'..'Z')[.max]for ^26 X ^26;.join.put for @a</s>
my @a;@a[.[0];.[1]]=('A'..*)[.max]for ^26 X ^26;.join.put for @a```

<h3>Explanation:</h3>

<pre class="lang-perl6 prettyprint-override"><code>my @a;

# @a[ $_.[0] ][ $_.[1] ]
@a[ $_.[0] ; $_.[1] ] = (

    # infinite Range that produces:
    #   'A',  'B',  'C' ...  'Y',  'Z',
    #  'AA', 'AB', 'AC' ... 'AY', 'AZ',
    #  'BA', 'BB', 'BC' ... 'BY', 'ZZ',
    # 'AAA','AAB','AAC' ... *｣
    'A' .. *

)[
    # index the Range with the max value in the "Tuple" ( 2 element List )
    $_.max
]

    for # do the above with each of the following "Tuples"

        # ｢(0,0),(0,1),(0,2)...(0,25),(1,0)...(25,25)｣
        ^26 X ^26;

$_.join.put for @a
</code>```

.method where a term is expected is an implicit method call on $_ the "default" scalar.

^26 is short for 0 ..^ 26 which in this case is effectively the same as 0 .. 25

The meta infix operator X creates the cross product of two lists

( accepts an optional infix operator which it applies between the elements )

Title: Print/Output the L-phabet

Body:
Perl 6, <s> 67 </s> 64 bytes

<s>my @a;@a[.[0]][.[1]]=('A'..'Z')[.max]for ^26 X ^26;.join.put for @a</s>
my @a;@a[.[0];.[1]]=('A'..*)[.max]for ^26 X ^26;.join.put for @a

Explanation:

my @a;

# @a[ $_.[0] ][ $_.[1] ]
@a[ $_.[0] ; $_.[1] ] = (

    # infinite Range that produces:
    #   'A',  'B',  'C' ...  'Y',  'Z',
    #  'AA', 'AB', 'AC' ... 'AY', 'AZ',
    #  'BA', 'BB', 'BC' ... 'BY', 'ZZ',
    # 'AAA','AAB','AAC' ... *｣
    'A' .. *

)[
    # index the Range with the max value in the "Tuple" ( 2 element List )
    $_.max
]

    for # do the above with each of the following "Tuples"

        # ｢(0,0),(0,1),(0,2)...(0,25),(1,0)...(25,25)｣
        ^26 X ^26;

$_.join.put for @a

.method where a term is expected is an implicit method call on $_ the "default" scalar.

^26 is short for 0 ..^ 26 which in this case is effectively the same as 0 .. 25

The meta infix operator X creates the cross product of two lists

( accepts an optional infix operator which it applies between the elements )


答:
K,  32 35 Bytes

3 more bytes to print the result without double quotes!

```<code>{-1,/[y#x@y-1;y _x]}[b]'1+!#b:.Q.A;
ABCDEFGHIJKLMNOPQRSTUVWXYZ
BBCDEFGHIJKLMNOPQRSTUVWXYZ
CCCDEFGHIJKLMNOPQRSTUVWXYZ
DDDDEFGHIJKLMNOPQRSTUVWXYZ
EEEEEFGHIJKLMNOPQRSTUVWXYZ
FFFFFFGHIJKLMNOPQRSTUVWXYZ
GGGGGGGHIJKLMNOPQRSTUVWXYZ
HHHHHHHHIJKLMNOPQRSTUVWXYZ
IIIIIIIIIJKLMNOPQRSTUVWXYZ
JJJJJJJJJJKLMNOPQRSTUVWXYZ
KKKKKKKKKKKLMNOPQRSTUVWXYZ
LLLLLLLLLLLLMNOPQRSTUVWXYZ
MMMMMMMMMMMMMNOPQRSTUVWXYZ
NNNNNNNNNNNNNNOPQRSTUVWXYZ
OOOOOOOOOOOOOOOPQRSTUVWXYZ
PPPPPPPPPPPPPPPPQRSTUVWXYZ
QQQQQQQQQQQQQQQQQRSTUVWXYZ
RRRRRRRRRRRRRRRRRRSTUVWXYZ
SSSSSSSSSSSSSSSSSSSTUVWXYZ
TTTTTTTTTTTTTTTTTTTTUVWXYZ
UUUUUUUUUUUUUUUUUUUUUVWXYZ
VVVVVVVVVVVVVVVVVVVVVVWXYZ
WWWWWWWWWWWWWWWWWWWWWWWXYZ
XXXXXXXXXXXXXXXXXXXXXXXXYZ
YYYYYYYYYYYYYYYYYYYYYYYYYZ
ZZZZZZZZZZZZZZZZZZZZZZZZZZ
</code>```

Explanation;

```<code>.Q.A                 --> uppercase alphabet
1+!#b:.Q.A           --> Indexes from 0 til (!) count (#) .Q.A (alphabet), and add 1 to them all. Also assign .Q.A to the variable b, so we don't have to type .Q.A again!
{}[b]'1 2 3 4 5....  --> we apply the function to b (alphabet) to each (') number i.e. 1 then 2 then 3 then 4
{,/[y#x@y-1;y _x]}   --> First time, y is 1;
    y#x@y-1              --> Use y-1 (0) to index (@) into x (alphabet), then take (#) y (1) of them i.e 1#"A" returns "A", 2#"A" returns "AA" etc.
    y _x                 --> drop (_) y many elements from x
,/[y#x@y-1;y _x]     --> flatten the result
-1 res;              --> Print the result
</code>```

Title: Print/Output the L-phabet

Body:
K,  32 35 Bytes

3 more bytes to print the result without double quotes!

{-1,/[y#x@y-1;y _x]}[b]'1+!#b:.Q.A;
ABCDEFGHIJKLMNOPQRSTUVWXYZ
BBCDEFGHIJKLMNOPQRSTUVWXYZ
CCCDEFGHIJKLMNOPQRSTUVWXYZ
DDDDEFGHIJKLMNOPQRSTUVWXYZ
EEEEEFGHIJKLMNOPQRSTUVWXYZ
FFFFFFGHIJKLMNOPQRSTUVWXYZ
GGGGGGGHIJKLMNOPQRSTUVWXYZ
HHHHHHHHIJKLMNOPQRSTUVWXYZ
IIIIIIIIIJKLMNOPQRSTUVWXYZ
JJJJJJJJJJKLMNOPQRSTUVWXYZ
KKKKKKKKKKKLMNOPQRSTUVWXYZ
LLLLLLLLLLLLMNOPQRSTUVWXYZ
MMMMMMMMMMMMMNOPQRSTUVWXYZ
NNNNNNNNNNNNNNOPQRSTUVWXYZ
OOOOOOOOOOOOOOOPQRSTUVWXYZ
PPPPPPPPPPPPPPPPQRSTUVWXYZ
QQQQQQQQQQQQQQQQQRSTUVWXYZ
RRRRRRRRRRRRRRRRRRSTUVWXYZ
SSSSSSSSSSSSSSSSSSSTUVWXYZ
TTTTTTTTTTTTTTTTTTTTUVWXYZ
UUUUUUUUUUUUUUUUUUUUUVWXYZ
VVVVVVVVVVVVVVVVVVVVVVWXYZ
WWWWWWWWWWWWWWWWWWWWWWWXYZ
XXXXXXXXXXXXXXXXXXXXXXXXYZ
YYYYYYYYYYYYYYYYYYYYYYYYYZ
ZZZZZZZZZZZZZZZZZZZZZZZZZZ

Explanation;

.Q.A                 --> uppercase alphabet
1+!#b:.Q.A           --> Indexes from 0 til (!) count (#) .Q.A (alphabet), and add 1 to them all. Also assign .Q.A to the variable b, so we don't have to type .Q.A again!
{}[b]'1 2 3 4 5....  --> we apply the function to b (alphabet) to each (') number i.e. 1 then 2 then 3 then 4
{,/[y#x@y-1;y _x]}   --> First time, y is 1;
    y#x@y-1              --> Use y-1 (0) to index (@) into x (alphabet), then take (#) y (1) of them i.e 1#"A" returns "A", 2#"A" returns "AA" etc.
    y _x                 --> drop (_) y many elements from x
,/[y#x@y-1;y _x]     --> flatten the result
-1 res;              --> Print the result


答:
MATL, 50 bytes

```<code>'!#$kYAqof^EZC}40iA*9n4JK?45/J~v'6Y2'\|/'Za5eioZ)!
</code>```

Try it online!

Short explanation

The code decompresses the shown string ('!#$...J~v') into a string containing \, | and /; reshapes it into an array where each column corresponds to a letter; and indexes that array with the input character.

Long explanation

The compressesed string has been obtained (offline) using base-3 to base-95 encoding. The data from the challenge has been arranged into a long string of \, | and /, where each group of 5 characters corresponds to a letter. This string is interpreted as the base-3 representation of some big number, which is converted to base-95, using all printable ASCII chars as digits. The result is the compressed string that appears in the code ('!#$...J~v').

The program starts decompressing this string, that is, converting from base-95 to base-3 with alphabet \, |, /. The decompressed string is reshaped into a 5-row 2D char array, in which each column representing a letter. Let us call this array Λ. This array will be indexed using the ASCII code point of the input letter.

The array Λ includes two tricks:

It has been filled with dummy values for the five letters missing between A and Y;

It starts with L (not  A) and then proceeds circularly.

The reasons for these two tricks are as follows:

Letter A has code point 65. The last letter that needs to be handled is Y, with code point 89. So we need to handle a range of 25 values, even if some intermediate ones (such as letter C) don't exist. To facilitate indexing, the five missing letters between A and Y have been filled with a dummy representation, so they do have a column in Λ. Thus, Λ has size 5×25.

Modular indexing is used. So letter A, or number 65, is the same as 65 mod 25, that is  15. Therefore A needs to be in column 15 of Λ, B in column 16, ..., and Y in column 14.

Commented code

```<code>'!#$kYAqof^EZC}40iA*9n4JK?45/J~v'     % Compressed string (in base-95)
6Y2                                   % Predefined literal 'AB...Z': source alphabet
                                      % for decompression
'\|/'                                 % Target alphabet for decompression
Za                                    % Change of base representation (decompress)
5e                                    % Reshape into 5-row array `Λ`
i                                     % Input letter
o                                     % Convert to number (ASCII code point)
Z)                                    % Use as column index into `Λ`
!                                     % Transpose into a row. Implicitly display
</code>```

Body:
MATL, 50 bytes

'!#$kYAqof^EZC}40iA*9n4JK?45/J~v'6Y2'\|/'Za5eioZ)!

Try it online!

Short explanation

The code decompresses the shown string ('!#$...J~v') into a string containing \, | and /; reshapes it into an array where each column corresponds to a letter; and indexes that array with the input character.

Long explanation

The compressesed string has been obtained (offline) using base-3 to base-95 encoding. The data from the challenge has been arranged into a long string of \, | and /, where each group of 5 characters corresponds to a letter. This string is interpreted as the base-3 representation of some big number, which is converted to base-95, using all printable ASCII chars as digits. The result is the compressed string that appears in the code ('!#$...J~v').

The program starts decompressing this string, that is, converting from base-95 to base-3 with alphabet \, |, /. The decompressed string is reshaped into a 5-row 2D char array, in which each column representing a letter. Let us call this array Λ. This array will be indexed using the ASCII code point of the input letter.

The array Λ includes two tricks:

It has been filled with dummy values for the five letters missing between A and Y;

It starts with L (not  A) and then proceeds circularly.

The reasons for these two tricks are as follows:

Letter A has code point 65. The last letter that needs to be handled is Y, with code point 89. So we need to handle a range of 25 values, even if some intermediate ones (such as letter C) don't exist. To facilitate indexing, the five missing letters between A and Y have been filled with a dummy representation, so they do have a column in Λ. Thus, Λ has size 5×25.

Modular indexing is used. So letter A, or number 65, is the same as 65 mod 25, that is  15. Therefore A needs to be in column 15 of Λ, B in column 16, ..., and Y in column 14.

Commented code

'!#$kYAqof^EZC}40iA*9n4JK?45/J~v'     % Compressed string (in base-95)
6Y2                                   % Predefined literal 'AB...Z': source alphabet
                                      % for decompression
'\|/'                                 % Target alphabet for decompression
Za                                    % Change of base representation (decompress)
5e                                    % Reshape into 5-row array `Λ`
i                                     % Input letter
o                                     % Convert to number (ASCII code point)
Z)                                    % Use as column index into `Λ`
!                                     % Transpose into a row. Implicitly display


答:
Cheddar, 90 bytes

```<code>(|>26).map(i->String.letters.chars.map((j,k,l)->k<i?l[i]:j).fuse).vfuse.slice(1)
</code>```

That String.letters is too long :/

Had to add a .slice(1) because leading newline is disallowed

Explanation

```<code>(|>26)       // Range from [0, 26)
.map(i->     // Loop through that range
 String.letters.chars // Alphabet array
  .map(               // Loop through alphabet
  (j,k,l) ->          // j = letter, j = index, l = alphabet
    k<i?l[i]:j        // Basically `l[max(k,i)]`
  ).fuse     // Collapse the array
).vfuse      // Join on newlines
</code>```

Cheddar, 65 bytes (non-competing)

```<code>(|>26).map(i->String.letters.map((j,k,l)->k<i?l[i]:j).fuse).vfuse
</code>```

Works with the nightly branch. Non-competing... sad part is that I already had the changes... just never commited ;_;

Title: Print/Output the L-phabet

Body:
Cheddar, 90 bytes

(|>26).map(i->String.letters.chars.map((j,k,l)->k<i?l[i]:j).fuse).vfuse.slice(1)

That String.letters is too long :/

Had to add a .slice(1) because leading newline is disallowed

Explanation

(|>26)       // Range from [0, 26)
.map(i->     // Loop through that range
 String.letters.chars // Alphabet array
  .map(               // Loop through alphabet
  (j,k,l) ->          // j = letter, j = index, l = alphabet
    k<i?l[i]:j        // Basically `l[max(k,i)]`
  ).fuse     // Collapse the array
).vfuse      // Join on newlines

Cheddar, 65 bytes (non-competing)

(|>26).map(i->String.letters.map((j,k,l)->k<i?l[i]:j).fuse).vfuse

Works with the nightly branch. Non-competing... sad part is that I already had the changes... just never commited ;_;


答:
ListSharp, 200 bytes

```<code>ROWS s=ROWSPLIT "A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z" BY [","]
[FOREACH NUMB IN 1 TO 26 AS k]
{
ROWS a=GETLINES s [k TO 26]
ROWS b=GETLINES s [0 TO k-1]
STRG p=p+a+b+<newline>
}
SHOW=p
</code>```

Even if you dont know this language, you can probably see how straight forward it is.

Thats the point of it, feel free to ask any questions

Title: Print a Tabula Recta!

Body:
The Tabula Recta (sometimes called a 'Vigenere Table'), was created by Johannes Trithemius, and has been used in several ciphers, including all variants of Bellaso's Vigenere cipher and the Trithemius cipher. It looks like this:

```<code>ABCDEFGHIJKLMNOPQRSTUVWXYZ
BCDEFGHIJKLMNOPQRSTUVWXYZA
CDEFGHIJKLMNOPQRSTUVWXYZAB
DEFGHIJKLMNOPQRSTUVWXYZABC
EFGHIJKLMNOPQRSTUVWXYZABCD
FGHIJKLMNOPQRSTUVWXYZABCDE
GHIJKLMNOPQRSTUVWXYZABCDEF
HIJKLMNOPQRSTUVWXYZABCDEFG
IJKLMNOPQRSTUVWXYZABCDEFGH
JKLMNOPQRSTUVWXYZABCDEFGHI
KLMNOPQRSTUVWXYZABCDEFGHIJ
LMNOPQRSTUVWXYZABCDEFGHIJK
MNOPQRSTUVWXYZABCDEFGHIJKL
NOPQRSTUVWXYZABCDEFGHIJKLM
OPQRSTUVWXYZABCDEFGHIJKLMN
PQRSTUVWXYZABCDEFGHIJKLMNO
QRSTUVWXYZABCDEFGHIJKLMNOP
RSTUVWXYZABCDEFGHIJKLMNOPQ
STUVWXYZABCDEFGHIJKLMNOPQR
TUVWXYZABCDEFGHIJKLMNOPQRS
UVWXYZABCDEFGHIJKLMNOPQRST
VWXYZABCDEFGHIJKLMNOPQRSTU
WXYZABCDEFGHIJKLMNOPQRSTUV
XYZABCDEFGHIJKLMNOPQRSTUVW
YZABCDEFGHIJKLMNOPQRSTUVWX
ZABCDEFGHIJKLMNOPQRSTUVWXY
</code>```

I frequently need this, but can't find it anywhere on the internet to copy and paste from. Because the square table is so long, and takes frigging ages to type, your code must be as short as possible.

Rules/Requirements

Each submission should be either a full program or function. If it is a function, it must be runnable by only needing to add the function call to the bottom of the program. Anything else (e.g. headers in C), must be included.

If it is possible, provide a link to a site where your program can be tested.

Your program must not write anything to STDERR.

Standard Loopholes are forbidden.

Your program can output in any case, but it must be printed (not an array or similar).

Scoring

Programs are scored according to bytes, in UTF-8 by default or a different character set of your choice.

Eventually, the answer with the least bytes will win.

Submissions

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

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

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

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

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

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

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

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

Leaderboard

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

/* Configuration */

var QUESTION_ID = 86986; // Obtain this from the url
// It will be like https://XYZ.stackexchange.com/questions/QUESTION_ID/... on any question page
var ANSWER_FILTER = "!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe";
var COMMENT_FILTER = "!)Q2B_A2kjfAiU78X(md6BoYk";
var OVERRIDE_USER = 53406; // This should be the user ID of the challenge author.

/* App */

var answers = [], answers_hash, answer_ids, answer_page = 1, more_answers = true, comment_page;

function answersUrl(index) {
  return "https://api.stackexchange.com/2.2/questions/" +  QUESTION_ID + "/answers?page=" + index + "&pagesize=100&order=desc&sort=creation&site=codegolf&filter=" + ANSWER_FILTER;
}

function commentUrl(index, answers) {
  return "https://api.stackexchange.com/2.2/answers/" + answers.join(';') + "/comments?page=" + index + "&pagesize=100&order=desc&sort=creation&site=codegolf&filter=" + COMMENT_FILTER;
}

function getAnswers() {
  jQuery.ajax({
    url: answersUrl(answer_page++),
    method: "get",
    dataType: "jsonp",
    crossDomain: true,
    success: function (data) {
      answers.push.apply(answers, data.items);
      answers_hash = [];
      answer_ids = [];
      data.items.forEach(function(a) {
        a.comments = [];
        var id = +a.share_link.match(/\d+/);
        answer_ids.push(id);
        answers_hash[id] = a;
      });
      if (!data.has_more) more_answers = false;
      comment_page = 1;
      getComments();
    }
  });
}

function getComments() {
  jQuery.ajax({
    url: commentUrl(comment_page++, answer_ids),
    method: "get",
    dataType: "jsonp",
    crossDomain: true,
    success: function (data) {
      data.items.forEach(function(c) {
        if (c.owner.user_id === OVERRIDE_USER)
          answers_hash[c.post_id].comments.push(c);
      });
      if (data.has_more) getComments();
      else if (more_answers) getAnswers();
      else process();
    }
  });
}

getAnswers();

var SCORE_REG = /<h\d>\s*([^\n,]*[^\s,]),.*?(\d+)(?=[^\n\d<>]*(?:<(?:s>[^\n<>]*<\/s>|[^\n<>]+>)[^\n\d<>]*)*<\/h\d>)/;

var OVERRIDE_REG = /^Override\s*header:\s*/i;

function getAuthorName(a) {
  return a.owner.display_name;
}

function process() {
  var valid = [];

  answers.forEach(function(a) {
    var body = a.body;
    a.comments.forEach(function(c) {
      if(OVERRIDE_REG.test(c.body))
        body = '
' + c.body.replace(OVERRIDE_REG, '') + '
';
    });

    var match = body.match(SCORE_REG);
    if (match)
      valid.push({
        user: getAuthorName(a),
        size: +match[2],
        language: match[1],
        link: a.share_link,
      });

  });

  valid.sort(function (a, b) {
    var aB = a.size,
        bB = b.size;
    return aB - bB
  });

  var languages = {};
  var place = 1;
  var lastSize = null;
  var lastPlace = 1;
  valid.forEach(function (a) {
    if (a.size != lastSize)
      lastPlace = place;
    lastSize = a.size;
    ++place;

    var answer = jQuery("#answer-template").html();
    answer = answer.replace("{{PLACE}}", lastPlace + ".")
                   .replace("{{NAME}}", a.user)
                   .replace("{{LANGUAGE}}", a.language)
                   .replace("{{SIZE}}", a.size)
                   .replace("{{LINK}}", a.link);
    answer = jQuery(answer);
    jQuery("#answers").append(answer);

    var lang = a.language;
    if (/ b.lang) return 1;
    if (a.lang < b.lang) return -1;
    return 0;
  });

  for (var i = 0; i < langs.length; ++i)
  {
    var language = jQuery("#language-template").html();
    var lang = langs[i];
    language = language.replace("{{LANGUAGE}}", lang.lang)
                       .replace("{{NAME}}", lang.user)
                       .replace("{{SIZE}}", lang.size)
                       .replace("{{LINK}}", lang.link);
    language = jQuery(language);
    jQuery("#languages").append(language);
  }

}```
<pre class="snippet-code-css lang-css prettyprint-override"><code>body { text-align: left !important}

#answer-list {
  padding: 10px;
  width: 290px;
  float: left;
}

#language-list {
  padding: 10px;
  width: 290px;
  float: left;
}

table thead {
  font-weight: bold;
}

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

```

Body:
ListSharp, 200 bytes

ROWS s=ROWSPLIT "A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z" BY [","]
[FOREACH NUMB IN 1 TO 26 AS k]
{
ROWS a=GETLINES s [k TO 26]
ROWS b=GETLINES s [0 TO k-1]
STRG p=p+a+b+<newline>
}
SHOW=p

Even if you dont know this language, you can probably see how straight forward it is.

Thats the point of it, feel free to ask any questions


答:
Python 2, 68 bytes

A simple exec loop that prints ''.joined lines one at a time. Golfing suggestions are welcome.

i=0;exec"print ''.join(chr(65+(i+j)%26)for j in range(26));i+=1;"*26
```

Title: Print a Tabula Recta!


答:
Mathematica, 129 bytes

```<code>""<>(IntegerDigits[IntegerDigits[36^^3ucgb2abu46m2rewohw225q4lc6hczypueyb3,190][[LetterNumber@#]],3,5]/.{0->"|",1->"/",2->"\\"})&
</code>```

Anonymous function. Takes a string as input and returns a string representing its code as output. Uses a relatively simple encoding scheme.

Body:
Mathematica, 129 bytes

""<>(IntegerDigits[IntegerDigits[36^^3ucgb2abu46m2rewohw225q4lc6hczypueyb3,190][[LetterNumber@#]],3,5]/.{0->"|",1->"/",2->"\\"})&

Anonymous function. Takes a string as input and returns a string representing its code as output. Uses a relatively simple encoding scheme.


问:
Implement division
Implement a division algorithm in your favourite language which handles integer division. It need only handle positive numbers - but bonus points if it handles negative and mixed-sign division, too. Results are rounded down for fractional results.

The program may not contain the /, \, div or similar operators. It must be a routine which does not use native division capabilities of the language.

You only need to handle up to 32-bit division. Using repeated subtraction is not allowed.

Input

Take two inputs on stdin separated by new lines or spaces (your choice)

```<code>740
2
</code>```

Output

In this case, the output would be 370.

The solution which is the shortest wins.

答:
APL (6)

```<code>⌊*-/⍟⎕
</code>```

/ is not division here, but foldr. i.e, F/a b c is a F (b F c).
If I can't use foldr because it's called /, it can be done in 9 characters:

```<code>⌊*(⍟⎕)-⍟⎕
</code>```

Explanation:

⎕: input()

⍟⎕: map(log, input())

-/⍟⎕: foldr1(sub, map(log, input()))

*-/⍟⎕: exp(foldr1(sub, map(log, input())))

⌊*-/⍟⎕: floor(exp(foldr1(sub, map(log, input()))))

Title: Implement division

Body:
APL (6)

⌊*-/⍟⎕

/ is not division here, but foldr. i.e, F/a b c is a F (b F c).
If I can't use foldr because it's called /, it can be done in 9 characters:

⌊*(⍟⎕)-⍟⎕

Explanation:

⎕: input()

⍟⎕: map(log, input())

-/⍟⎕: foldr1(sub, map(log, input()))

*-/⍟⎕: exp(foldr1(sub, map(log, input())))

⌊*-/⍟⎕: floor(exp(foldr1(sub, map(log, input()))))


问:
Snakes all around

Challenge

The challenge is simple: print a snake.

You will get the length of the snake as input.

A snake of length 2 looks like this:

```<code>==(:)-
</code>```

A snake of length 7 looks like this:

```<code>=======(:)-
</code>```

In other words, the length of a snake is how many equal signs are before the head.

Usage

Let's say I made a C++ implementation and compiled it to ./getsnake.

I could run it like so:

```<code>$ ./getsnake 10
==========(:)-
</code>```

Clarifications

Standard loopholes are disallowed.

You can get input and output in any acceptable way.

You can assume all inputs given are positive integers.

You may write a function instead of a regular program.

答:
Pyth, 10 bytes

```<code>+*\=Q"(:)-
</code>```

Test suite.

```<code>+*\=Q"(:)-
    Q        get input
 *\=         repeat "=" that many times
+    "(:)-   append "(:)-"
</code>```

Title: Snakes all around

Body:
Pyth, 10 bytes

+*\=Q"(:)-

Test suite.

+*\=Q"(:)-
    Q        get input
 *\=         repeat "=" that many times
+    "(:)-   append "(:)-"


答:
C++, 106 103 bytes

```<code>#include <iostream>
void s(int n){for(int i=0;i<n;i++){std::cout<<"=";}std::cout<<"(:)-"<<std::endl;}
</code>```

Usage

```<code>#include <string>
int main(int argc, char *argv[]) {
    int length = std::stoi(argv[1]);
    s(length);
    return 0;
}
</code>```

Ungolfed

```<code>#include <iostream> // for printing
void outputSnake(int length) {
    for (int i = 0; i < length; i++) { // iterates over length of snake
        std::cout << "="; // prints an equals sign
    }
    std::cout << "(:)-" << std::endl; // prints rest of snake
}

</code>```

Thanks @LeakyNun for shaving off 3 bytes.

Title: Snakes all around

Body:
Challenge

The challenge is simple: print a snake.

You will get the length of the snake as input.

A snake of length 2 looks like this:

```<code>==(:)-
</code>```

A snake of length 7 looks like this:

```<code>=======(:)-
</code>```

In other words, the length of a snake is how many equal signs are before the head.

Usage

Let's say I made a C++ implementation and compiled it to ./getsnake.

I could run it like so:

```<code>$ ./getsnake 10
==========(:)-
</code>```

Clarifications

Standard loopholes are disallowed.

You can get input and output in any acceptable way.

You can assume all inputs given are positive integers.

You may write a function instead of a regular program.

Body:
C++, 106 103 bytes

#include <iostream>
void s(int n){for(int i=0;i<n;i++){std::cout<<"=";}std::cout<<"(:)-"<<std::endl;}

Usage

#include <string>
int main(int argc, char *argv[]) {
    int length = std::stoi(argv[1]);
    s(length);
    return 0;
}

Ungolfed

#include <iostream> // for printing
void outputSnake(int length) {
    for (int i = 0; i < length; i++) { // iterates over length of snake
        std::cout << "="; // prints an equals sign
    }
    std::cout << "(:)-" << std::endl; // prints rest of snake
}

Thanks @LeakyNun for shaving off 3 bytes.


答:
Sesos, 11 bytes

Hexdump:

```<code>0000000: aaaa5e a0f7b4 ed4cee 5d3b                         ..^....L.];
</code>```

Try it online!

Assembler:

set numin
add 61
fwd 1
get
jmp,sub 1,rwd 1,put,fwd 1,jnz
add 40,put
rwd 1,sub 3,put
fwd 1,add 1,put
add 4,put
```

Title: Snakes all around

Body:
Sesos, 11 bytes

Hexdump:

0000000: aaaa5e a0f7b4 ed4cee 5d3b                         ..^....L.];

Try it online!

Assembler:

set numin
add 61
fwd 1
get
jmp,sub 1,rwd 1,put,fwd 1,jnz
add 40,put
rwd 1,sub 3,put
fwd 1,add 1,put
add 4,put


答:
Jelly, 9 bytes

```<code>”=x;“(:)-
</code>```

Try it online!

```<code>”=x;“(:)-
”=          '='
  x         repeat (argument) that many times
   ;        append
    “(:)-   "(:)-"
</code>```

Title: Snakes all around

Body:
Jelly, 9 bytes

”=x;“(:)-

Try it online!

”=x;“(:)-
”=          '='
  x         repeat (argument) that many times
   ;        append
    “(:)-   "(:)-"


答:
Emacs Lisp, 117 bytes

```<code>(let((s(mapcar'string(number-sequence ?A ?Z))))(dotimes(i 26)(message(apply'concat s))(setcdr(last s)(list(pop s)))))
</code>```

Uses a list storing the alphabet and always appends the head to the tail. A more general approach would be the following function

```<code>(defun tabula-recta (glyphs)
  (dotimes (i (length glyphs))
    (message (apply 'concat glyphs))
    (setcdr (last glyphs) (list (pop glyphs)))))
</code>```

which could be called in a similar fashion.

```<code>(tabula-recta (mapcar'string(number-sequence ?A ?Z)))
</code>```

Title: Print a Tabula Recta!

Body:
Emacs Lisp, 117 bytes

(let((s(mapcar'string(number-sequence ?A ?Z))))(dotimes(i 26)(message(apply'concat s))(setcdr(last s)(list(pop s)))))

Uses a list storing the alphabet and always appends the head to the tail. A more general approach would be the following function

(defun tabula-recta (glyphs)
  (dotimes (i (length glyphs))
    (message (apply 'concat glyphs))
    (setcdr (last glyphs) (list (pop glyphs)))))

which could be called in a similar fashion.

(tabula-recta (mapcar'string(number-sequence ?A ?Z)))


答:
Python, 21 bytes

lambda n:"="*n+"(:)-"
```

Ideone it!

Title: Snakes all around

Body:
Python, 21 bytes

lambda n:"="*n+"(:)-"

Ideone it!


答:
Cinnamon Gum, 7 bytes

```<code>0000000: 7043 dc95 6d4f ce                        pC..mO.
</code>```

Try it online.

Would have been 6 bytes with the old p syntax :/

Explanation

Decompresses to p~=~(:)-, the p stage then simply reads input and repeats the = n times.

Title: Snakes all around

Body:
Cinnamon Gum, 7 bytes

0000000: 7043 dc95 6d4f ce                        pC..mO.

Try it online.

Would have been 6 bytes with the old p syntax :/

Explanation

Decompresses to p~=~(:)-, the p stage then simply reads input and repeats the = n times.


答:
C, 46 45 43 bytes

saved 2 bytes thanks to owacoder!
saved 3 bytes thanks to rici!

f(n){while(4-printf("=\0(:)-"+2*!n--));}
```

Try it on Ideone!

Title: Snakes all around

Body:
C, 46 45 43 bytes

saved 2 bytes thanks to owacoder!
saved 3 bytes thanks to rici!

f(n){while(4-printf("=\0(:)-"+2*!n--));}

Try it on Ideone!


答:
05AB1E, <s>10</s> 9 bytes

```<code>'=×"ÿ(:)-
</code>```

Explanation

```<code>'=         # push equal-sign
  ×        # repeat input nr of times
   "ÿ(:)-  # interpolate snake body with head as a string
           # implicitly display
</code>```

Try it online

1 byte saved thanks to Adnan.

Title: Snakes all around

Body:
05AB1E, <s>10</s> 9 bytes

'=×"ÿ(:)-

Explanation

'=         # push equal-sign
  ×        # repeat input nr of times
   "ÿ(:)-  # interpolate snake body with head as a string
           # implicitly display

Try it online

1 byte saved thanks to Adnan.


答:
V, 8 bytes

```<code>Àé=A(:)-
</code>```

Try it online!

V uses the "Latin1" encoding.

Explanation:

```<code>À        "Arg1 times:
 é=      "Insert an '='
   A(:)- "Append the head
</code>```

Title: Snakes all around

Body:
V, 8 bytes

Àé=A(:)-

Try it online!

V uses the "Latin1" encoding.

Explanation:

À        "Arg1 times:
 é=      "Insert an '='
   A(:)- "Append the head


答:
GolfScript, <s>11</s> 10 bytes

~"="*"(:)-"
```

Multiplies "=" by input, and adds head.

-1 thanks to Leaky Nun

Title: Snakes all around

Body:
GolfScript, <s>11</s> 10 bytes

~"="*"(:)-"

Multiplies "=" by input, and adds head.

-1 thanks to Leaky Nun


Title: Snakes all around

Body:
C, 38

f(n){for(;n--;printf(n?"=":"=(:)-"));}

Try it on ideone.