答:
Pip, 10 bytes

```<code>W$+o%g++oo
</code>```

Uses the "try every number until one works" strategy. Try it online!

```<code>            o is preinitialized to 1, g is list of cmdline args
   o%g      Mod o by each arg
 $+         Sum (truthy if any nonzero, falsy if all zero)
W           Loop while that expression is truthy:
      ++o     Increment o
         o  Autoprint o
</code>```

Title: Least Common Multiple

Body:
The least common multiple of a set of positive integers A is the smallest postive integer B such that, for each k in A, there exists a positive integer n such that k*n = B.

Given at least two positive integers as input, output their least common multiple.

Rules

Builtins are allowed, but if your solution uses one, you are encouraged to include an alternate solution that does not use GCD/LCM builtins. However, the alternate solution will not count towards your score at all, so it is entirely optional.

All inputs and outputs will be within the natively-representable range for your language. If your language is natively capable of arbitrarily-large integers, then your solution must work with arbitrarily large inputs and outputs.

Test cases

```<code>[7, 2] -> 14
[8, 1] -> 8
[6, 4, 8] -> 24
[8, 2, 1, 10] -> 40
[9, 6, 2, 1, 5] -> 90
[5, 5, 7, 1, 1] -> 35
[4, 13, 8, 8, 11, 1] -> 1144
[7, 2, 2, 11, 11, 8, 5] -> 3080
[1, 6, 10, 3, 4, 10, 7] -> 420
[5, 2, 9, 10, 3, 4, 4, 4, 7] -> 1260
[9, 7, 10, 9, 7, 8, 5, 10, 1] -> 2520
</code>```

Body:
Pip, 10 bytes

W$+o%g++oo

Uses the "try every number until one works" strategy. Try it online!

            o is preinitialized to 1, g is list of cmdline args
   o%g      Mod o by each arg
 $+         Sum (truthy if any nonzero, falsy if all zero)
W           Loop while that expression is truthy:
      ++o     Increment o
         o  Autoprint o


问:
So sayeth the Shepherd
I'm tired, but I can't seem to fall asleep. Help me count sheep.

Given an input N (positive integer), make N sheep jump over an ascii fence, like the sample below. Only one frame should be displayed at once:

```<code>o |-|
──|-|──  0
</code>```

```<code> o|-|
──|-|──  0
</code>```

```<code>   o
  |-|
──|-|──  0
</code>```

```<code>  |-|o
──|-|──  0
</code>```

```<code>  |-| o
──|-|──  0
</code>```

```<code>o |-|
──|-|──  1
</code>```

```<code> o|-|
──|-|──  1
</code>```

```<code>   o
  |-|
──|-|──  1
</code>```

Count should be kept at the lower right side of the 'ground'. Trailing and leading whitespace and newlines are allowed. If your language of choice has difficulty clearing the screen for each frame you can add sufficient newlines to clear the screen - please state how many lines you add for this in your answer. The program should terminate when the N'th sheep is on the fifth floortile.

I need to get up early tomorrow, so shortest code in bytes wins. Please submit a function or complete program. Standard loopholes apply.

答:
QBasic, 110 bytes

```<code>INPUT n
FOR i=0TO 5*n-1
CLS
?
?"  |-|"
?"--|-|-- ";i\5
x=i MOD 5
LOCATE(x=2)+2,1+x-(x>1)+x\3
?"o"
SLEEP 1
NEXT
</code>```

Loops over 5*n ticks. At each tick, clears the screen, prints the stile and sheep count, and then uses LOCATE to print the o at the appropriate spot. With x being the position code between 0 and 4:

Row: (x=2)+2

If x=2 is true, -1+2 = 1

If x=2 is false, 0+2 = 2

Column: 1+x-(x>1)+x\3

If x is 0 or 1, x>1 is false and x\3 is 0: 1+x-0+0 = 1 or 2

If x is 2, x>1 is true and x\3 is 0: 1+x-(-1)+0 = 4

If x is 3 or 4, x>1 is true and x\3 is 1: 1+x-(-1)+1 = 6 or 7

Finally, SLEEP for 1 second and loop. If you don't mind hitting enter at every frame, I can shave two bytes by removing the argument to SLEEP.

ContentLicense: CC BY-SA 3.0

Title: So sayeth the Shepherd

Body:
QBasic, 110 bytes

INPUT n
FOR i=0TO 5*n-1
CLS
?
?"  |-|"
?"--|-|-- ";i\5
x=i MOD 5
LOCATE(x=2)+2,1+x-(x>1)+x\3
?"o"
SLEEP 1
NEXT

Loops over 5*n ticks. At each tick, clears the screen, prints the stile and sheep count, and then uses LOCATE to print the o at the appropriate spot. With x being the position code between 0 and 4:

Row: (x=2)+2

If x=2 is true, -1+2 = 1

If x=2 is false, 0+2 = 2

Column: 1+x-(x>1)+x\3

If x is 0 or 1, x>1 is false and x\3 is 0: 1+x-0+0 = 1 or 2

If x is 2, x>1 is true and x\3 is 0: 1+x-(-1)+0 = 4

If x is 3 or 4, x>1 is true and x\3 is 1: 1+x-(-1)+1 = 6 or 7

Finally, SLEEP for 1 second and loop. If you don't mind hitting enter at every frame, I can shave two bytes by removing the argument to SLEEP.


答:
node.js + sleep, 169 bytes

```<code>c='   2\n01|-|34\n──|-|──  '
for(i=0;i<process.argv[2]*5;require('sleep').sleep(1))console.log('\033[2J'+c.replace(i%5,'o').replace(/\d/g,' ')+Math.floor(i++/5))
</code>```

Original solution

node.js, <s>146</s> <s>142</s> 185 bytes

Tested with ubuntu terminal only (and now with n sheeps):

```<code>i=0
c='   2\n01|-|34\n──|-|──  '
setInterval(function(){console.log('\033[2J'+c.replace(i%5,'o').replace(/\d/g,' ')+Math.floor(i++/5))
if(process.argv[2]*5==i)process.exit()},9)
</code>```

Well, that's a frame every 9 ms. A more sleep-soothing version (frame every 1s):

```<code>i=0;setInterval(function(){console.log('\033[2J'+'   2\n01|-|34\n──|-|──  '.replace(i%5,'o').replace(/\d/g,' ')+Math.floor(i++/5))},1000)
</code>```

And ungolfed:

```<code>var i = 0;
setInterval(function(){
  console.log('\033[2J' + '   2\n01|-|34\n──|-|──  '.replace(i%5, 'o').replace(/\d/g, ' ') + Math.floor(i++/5));
}, 1000)
</code>```

Title: So sayeth the Shepherd

Body:
I'm tired, but I can't seem to fall asleep. Help me count sheep.

Given an input N (positive integer), make N sheep jump over an ascii fence, like the sample below. Only one frame should be displayed at once:

```<code>o |-|
──|-|──  0
</code>```

```<code> o|-|
──|-|──  0
</code>```

```<code>   o
  |-|
──|-|──  0
</code>```

```<code>  |-|o
──|-|──  0
</code>```

```<code>  |-| o
──|-|──  0
</code>```

```<code>o |-|
──|-|──  1
</code>```

```<code> o|-|
──|-|──  1
</code>```

```<code>   o
  |-|
──|-|──  1
</code>```

Count should be kept at the lower right side of the 'ground'. Trailing and leading whitespace and newlines are allowed. If your language of choice has difficulty clearing the screen for each frame you can add sufficient newlines to clear the screen - please state how many lines you add for this in your answer. The program should terminate when the N'th sheep is on the fifth floortile.

I need to get up early tomorrow, so shortest code in bytes wins. Please submit a function or complete program. Standard loopholes apply.

Body:
node.js + sleep, 169 bytes

c='   2\n01|-|34\n──|-|──  '
for(i=0;i<process.argv[2]*5;require('sleep').sleep(1))console.log('\033[2J'+c.replace(i%5,'o').replace(/\d/g,' ')+Math.floor(i++/5))

Original solution

node.js, <s>146</s> <s>142</s> 185 bytes

Tested with ubuntu terminal only (and now with n sheeps):

i=0
c='   2\n01|-|34\n──|-|──  '
setInterval(function(){console.log('\033[2J'+c.replace(i%5,'o').replace(/\d/g,' ')+Math.floor(i++/5))
if(process.argv[2]*5==i)process.exit()},9)

Well, that's a frame every 9 ms. A more sleep-soothing version (frame every 1s):

i=0;setInterval(function(){console.log('\033[2J'+'   2\n01|-|34\n──|-|──  '.replace(i%5,'o').replace(/\d/g,' ')+Math.floor(i++/5))},1000)

And ungolfed:

var i = 0;
setInterval(function(){
  console.log('\033[2J' + '   2\n01|-|34\n──|-|──  '.replace(i%5, 'o').replace(/\d/g, ' ') + Math.floor(i++/5));
}, 1000)


问:
Now I know my ABCs, won't you come and golf with me?
Write a program or function that outputs this exact text, case-insensitive:

```<code>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.
</code>```

(Based on the alphabet song that many American kids learn to help memorize the alphabet, though edited for more compressibility.)

The output must look exactly the same as the above (again, case-insensitive), but may contain trailing spaces on each line and/or trailing newlines. Notice the period at the end.

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

Body:
Brainfuck, 117 bytes

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

The first four lines each have a trailing space, and the program assumes 8-bit cells. Try it online!

(Handling the last line is tricky...)


答:
PHP, <s>132</s> 131 bytes

Edits after comments (thanks!):

```<code><?php for(;$i<$argv[1]*5;sleep(1),system(clear),$c="
  |-|
──|-|──  ".floor($i/5),$c[[5,6,3,10,11][$i++%5]]=o)echo$c;
</code>```

Which is ungolfed:

```<code><?php

ini_set('error_reporting', '0');        # golfing precondition

for(; $i<$argv[1]*5;                    # repeat N times
  sleep(1),                             # sleep after iteration
  system(clear),                        # clear screen (linux only)
  $c = "
  |-|
──|-|──  " . floor($i / 5),             # define template
  $c[[5, 6, 3, 10, 11][$i++ % 5]] = o)  # replace with sheep (and finish "for" statement)
  echo $c;                              # output result
</code>```

Original post

```<code><?php $i=0;for(;;){system("clear");$c="  \n  |-|  \n──|-|──  ";$c[[3,4,1,8,9][$i%5]]='o';echo"  $c".floor($i++/5);sleep(1);}
</code>```

Tested on ubuntu (don't know, if system("clear") works on windows)

Ungolfed:

```<code><?php
$i = 0;
for(;;) {
  system("clear");
  $content = "  \n  |-|  \n──|-|──  ";
  $content[[3,4,1,8,9][$i%5]] = 'o';
  echo "  $content " . floor($i++/5);
  sleep(1);
}
</code>```

Title: So sayeth the Shepherd

Body:
PHP, <s>132</s> 131 bytes

Edits after comments (thanks!):

<?php for(;$i<$argv[1]*5;sleep(1),system(clear),$c="
  |-|
──|-|──  ".floor($i/5),$c[[5,6,3,10,11][$i++%5]]=o)echo$c;

Which is ungolfed:

<?php

ini_set('error_reporting', '0');        # golfing precondition

for(; $i<$argv[1]*5;                    # repeat N times
  sleep(1),                             # sleep after iteration
  system(clear),                        # clear screen (linux only)
  $c = "
  |-|
──|-|──  " . floor($i / 5),             # define template
  $c[[5, 6, 3, 10, 11][$i++ % 5]] = o)  # replace with sheep (and finish "for" statement)
  echo $c;                              # output result

Original post

<?php $i=0;for(;;){system("clear");$c="  \n  |-|  \n──|-|──  ";$c[[3,4,1,8,9][$i%5]]='o';echo"  $c".floor($i++/5);sleep(1);}

Tested on ubuntu (don't know, if system("clear") works on windows)

Ungolfed:

<?php
$i = 0;
for(;;) {
  system("clear");
  $content = "  \n  |-|  \n──|-|──  ";
  $content[[3,4,1,8,9][$i%5]] = 'o';
  echo "  $content " . floor($i++/5);
  sleep(1);
}


问:
Yes, of course I'm an adult!
I think we've all done this as a kid: some websites require a minimum age of 18, so we just subtract a few years from the year of birth and voilà, we 'are' 18+.

In addition, for most rides at amusement parks the minimum height to enter is 1.40 meters (here in The Netherlands it as at least). Of course this can be cheated less easily than age, but you could wear shoes with thick heels, put your hair up, wear a hat, stand on your toes, etc.

Input:

Your program/function accepts a positive integer or decimal.

Output:

Is the input an integer >= 18? Simply print the input.

Is the input an integer 0-17? Print 18.

Is the input a decimal >= 1.4? Simply print the input.

Is the input a decimal 0.0-1.4? Print 1.4.

Challenge rules:

Assume the input will always be in the range of 0-122 (oldest woman ever was 122) or 0.0-2.72 (tallest man ever was 2.72).

You are allowed to take the input as a String, object, or anything else you prefer.

The decimal inputs will never have more than three decimal places after the decimal point.

2 or 2. both aren't valid outputs for 2.0. You are free to output 2.00 or 2.000 instead of 2.0 however.

Just like the input the output will never have more than three decimal places after the point.

General rules:

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

Don't let code-golf languages discourage you from posting answers with non-codegolfing languages. Try to come up with an as short as possible answer for 'any' programming language.

Standard rules apply for your answer, so you are allowed to use STDIN/STDOUT, functions/method with the proper parameters, full programs. Your call.

Default Loopholes are forbidden.

If possible, please add a link with a test for your code.

Also, please add an explanation if necessary.

Test cases:

```<code>0      ->  18
1      ->  18
2      ->  18
12     ->  18
18     ->  18
43     ->  43
115    ->  115
122    ->  122

0.0    ->  1.4
1.04   ->  1.4
1.225  ->  1.4
1.399  ->  1.4
1.4    ->  1.4
1.74   ->  1.74
2.0    ->  2.0
2.72   ->  2.72
</code>```

答:
Julia, 35 bytes

```<code>f(x)=max(x,1.4)
f(x::Int)=max(x,18)
</code>```

Using multiple dispatch.

Title: Yes, of course I'm an adult!

Body:
Julia, 35 bytes

f(x)=max(x,1.4)
f(x::Int)=max(x,18)

Using multiple dispatch.


答:
Fourier, 56 bytes

```<code>|~S44a32aS^|f|(iaf~i)10a|L65~i72L81L84L87L90(iaf~i)ia46a
</code>```

Again, uses functions to take out repeated parts of the code.

Try it FourIDE!

Title: Now I know my ABCs, won't you come and golf with me?

Body:
Write a program or function that outputs this exact text, case-insensitive:

```<code>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.
</code>```

(Based on the alphabet song that many American kids learn to help memorize the alphabet, though edited for more compressibility.)

The output must look exactly the same as the above (again, case-insensitive), but may contain trailing spaces on each line and/or trailing newlines. Notice the period at the end.

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

Body:
Fourier, 56 bytes

|~S44a32aS^|f|(iaf~i)10a|L65~i72L81L84L87L90(iaf~i)ia46a

Again, uses functions to take out repeated parts of the code.

Try it FourIDE!


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

```

答:
Julia, 49 bytes

```<code>println.(join.((n->circshift('A':'Z',n)).(0:25)))
</code>```

Requires julia v0.5 or better for the .() broadcasting function calls.

ContentLicense: CC BY-SA 4.0

Title: Print a Tabula Recta!

Body:
Julia, 49 bytes

println.(join.((n->circshift('A':'Z',n)).(0:25)))

Requires julia v0.5 or better for the .() broadcasting function calls.


问:
Find the Factorial!
Create the shortest program or function that finds the factorial of a non-negative integer.

The factorial, represented with ! is defined as such

$$n!:=\begin{cases}1 & n=0\\n\cdot(n-1)!&n>0\end{cases}$$

In plain English the factorial of 0 is 1 and the factorial of n, where n is larger than 0 is n times the factorial of one less than n.

Your code should perform input and output using a standard methods.

Requirements:

Does not use any built-in libraries that can calculate the factorial (this includes any form of eval)

Can calculate factorials for numbers up to 125

Can calculate the factorial for the number 0 (equal to 1)

Completes in under a minute for numbers up to 125

The shortest submission wins, in the case of a tie the answer with the most votes at the time wins.

答:
Fourier, 18 bytes

```<code>1~NI(i^~iN*i~Ni)No
</code>```

Try it online!

Title: Find the Factorial!

Body:
Fourier, 18 bytes

1~NI(i^~iN*i~Ni)No

Try it online!


答:
Julia, 71 bytes

```<code>f()=join(join.(['A':'G','H':'P',"QRS","TUV","WXYZ"],[", "]),",\n")*"."
</code>```

Requires 0.5 or better for broadcasting .()

Body:
Julia, 71 bytes

f()=join(join.(['A':'G','H':'P',"QRS","TUV","WXYZ"],[", "]),",\n")*"."

Requires 0.5 or better for broadcasting .()


答:
Python 2, <s>171</s> <s>159</s> 144 bytes, <s>163</s> <s>151</s> 136 characters

Solution using a recursive function. Call as f(int)

EDIT

-12 after rereading the comments and seeing that the count does not have to increment when the sheep reaches the end of the field

-15 by iterating through the index list directly and losing a variable

```<code>def f(a,x=0):
 if a>0:
  for c in 5,6,3,10,11:
   b=list('    \n  |-|  \n──|-|──  ');b[c]='o';print"\n"*50+"".join(b)+(`x`)
  f(a-1,x+1)
</code>```

Notes

Assumes UTF-8 encoding

Using - instead of ─ (as in @Luis MATL answer) would bring the byte count down by 8 to match the character count and would lose the UTF-8 dependency

50 newlines added - output is at the bottom on the console (cheaper than importing and using os.system("clear") and works on Windows and Linux)

Version with 1 second time delay between outputs (170 bytes, 162 characters)

```<code>import time
def f(a,x=0):
 if a>0:
  for c in 5,6,3,10,11:
   b=list('    \n  |-|  \n──|-|──  ');b[c]='o';print"\n"*50+"".join(b)+(`x`);time.sleep(1)
  f(a-1,x+1)
</code>```

Title: So sayeth the Shepherd

Body:
Python 2, <s>171</s> <s>159</s> 144 bytes, <s>163</s> <s>151</s> 136 characters

Solution using a recursive function. Call as f(int)

EDIT

-12 after rereading the comments and seeing that the count does not have to increment when the sheep reaches the end of the field

-15 by iterating through the index list directly and losing a variable

def f(a,x=0):
 if a>0:
  for c in 5,6,3,10,11:
   b=list('    \n  |-|  \n──|-|──  ');b[c]='o';print"\n"*50+"".join(b)+(`x`)
  f(a-1,x+1)

Notes

Assumes UTF-8 encoding

Using - instead of ─ (as in @Luis MATL answer) would bring the byte count down by 8 to match the character count and would lose the UTF-8 dependency

50 newlines added - output is at the bottom on the console (cheaper than importing and using os.system("clear") and works on Windows and Linux)

Version with 1 second time delay between outputs (170 bytes, 162 characters)

import time
def f(a,x=0):
 if a>0:
  for c in 5,6,3,10,11:
   b=list('    \n  |-|  \n──|-|──  ');b[c]='o';print"\n"*50+"".join(b)+(`x`);time.sleep(1)
  f(a-1,x+1)


问:
Tips for golfing in Julia
What general tips do you have for golfing in Julia? I'm looking for ideas that can be applied to code golf problems in general that are at least somewhat specific to Julia (e.g. "remove comments" is not an answer).</p>

答:
Use Broadcasting function calls.

Introduced in Julia 0.5.
It is like map, but uses less characters,
and does broadcasting behavour over it's args -- which means you can write less lambda's to deal with things.

Rather than:

map(f,x) -- 8 characters.

f.(x) -- 5 characters

Better still:

map(a->g(a,y),x) -- 16 characters

g.(x,[y]) -- 9 characters

Title: Tips for golfing in Julia


问:
How much will this cost?
Given N items (0 < N <= 50) with prices (which are always integers) P0 ... PN-1 and given amounts of each item A0 ... AN-1, determine how much the total cost will be.

Examples

N: 2

P0: 2

P1: 3

A0: 1

A1: 4

Result: 14

N: 5

P0: 2

P1: 7

P2: 5

P3: 1

P4: 9

A0: 1

A1: 2

A2: 3

A3: 2

A4: 3

Result: 60

Remember, this is code-golf, so the code with the smallest number of bytes wins.

Leaderboards

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

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

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

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

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

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

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

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

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

var QUESTION_ID=95128,OVERRIDE_USER=12537;function answersUrl(e){return"https://api.stackexchange.com/2.2/questions/"+QUESTION_ID+"/answers?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+ANSWER_FILTER}function commentUrl(e,s){return"https://api.stackexchange.com/2.2/answers/"+s.join(";")+"/comments?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+COMMENT_FILTER}function getAnswers(){jQuery.ajax({url:answersUrl(answer_page++),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){answers.push.apply(answers,e.items),answers_hash=[],answer_ids=[],e.items.forEach(function(e){e.comments=[];var s=+e.share_link.match(/\d+/);answer_ids.push(s),answers_hash[s]=e}),e.has_more||(more_answers=!1),comment_page=1,getComments()}})}function getComments(){jQuery.ajax({url:commentUrl(comment_page++,answer_ids),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){e.items.forEach(function(e){e.owner.user_id===OVERRIDE_USER&&answers_hash[e.post_id].comments.push(e)}),e.has_more?getComments():more_answers?getAnswers():process()}})}function getAuthorName(e){return e.owner.display_name}function process(){var e=[];answers.forEach(function(s){var r=s.body;s.comments.forEach(function(e){OVERRIDE_REG.test(e.body)&&(r="
"+e.body.replace(OVERRIDE_REG,"")+"
")});var a=r.match(SCORE_REG);a&&e.push({user:getAuthorName(s),size:+a[2],language:a[1],link:s.share_link})}),e.sort(function(e,s){var r=e.size,a=s.size;return 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;width:290px;float:left}table thead{font-weight:700}table td{padding:5px}</code>```

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

Leaderboard

	Author	Language	Size

Winners by Language

Language	User	Score

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

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

```

答:
R, <s>8</s> 18 bytes

```<code>sum(scan()*scan())
</code>```

Now takes input from stdin.

Title: How much will this cost?

Body:
R, <s>8</s> 18 bytes

sum(scan()*scan())

Now takes input from stdin.


答:
Clojure, 154 bytes

#(print(loop[a(map char(range 65 91))[c & d][7 9 3 3 4]s""](if c(let[[l r](split-at c a)e(if d\,\.)](recur r d(str s(clojure.string/join", "l)e"\n")))s)))
```

<p>That call to <code>clojure.string/join</code> is killer, although this wasn't competitive to begin with. Basically, it cuts the generated alphabet string <code>a</code> at the predefined line lengths, then adds each line to the <code>acc</code>. </p>

<p>It would have been significantly shorter for me to just "cheat" and print the string (91 bytes):</p>

<pre class="lang-clj prettyprint-override"><code>(print "A, B, C, D, E, F, G,\nH, I, J, K, L, M, N, O, P,\nQ, R, S,\nT, U, V,\nW, X, Y, Z.")
</code>```

But where's the fun in that?

Ungolfed:

(defn abcs []
  (print
    (loop [alpha (map char (range 65 91))
           [c & cuts] [7 9 3 3 4]
           acc ""]
      (if c
        (let [[a-line a-rest] (split-at c alpha)
              e (if cuts \, \.)]
          (recur a-rest cuts (str acc (clojure.string/join ", " a-line) e "\n")))
        acc))))
```

Body:
Clojure, 154 bytes

#(print(loop[a(map char(range 65 91))[c & d][7 9 3 3 4]s""](if c(let[[l r](split-at c a)e(if d\,\.)](recur r d(str s(clojure.string/join", "l)e"\n")))s)))

That call to clojure.string/join is killer, although this wasn't competitive to begin with. Basically, it cuts the generated alphabet string a at the predefined line lengths, then adds each line to the acc.

It would have been significantly shorter for me to just "cheat" and print the string (91 bytes):

(print "A, B, C, D, E, F, G,\nH, I, J, K, L, M, N, O, P,\nQ, R, S,\nT, U, V,\nW, X, Y, Z.")

But where's the fun in that?

Ungolfed:

(defn abcs []
  (print
    (loop [alpha (map char (range 65 91))
           [c & cuts] [7 9 3 3 4]
           acc ""]
      (if c
        (let [[a-line a-rest] (split-at c alpha)
              e (if cuts \, \.)]
          (recur a-rest cuts (str acc (clojure.string/join ", " a-line) e "\n")))
        acc))))


答:
ListSharp, 88 bytes

```<code>SHOW="A, B, C, D, E, F, G,\nH, I, J, K, L, M, N, O, P,\nQ, R, S,\nT, U, V,\nW, X, Y, Z."
</code>```

Body:
ListSharp, 88 bytes

SHOW="A, B, C, D, E, F, G,\nH, I, J, K, L, M, N, O, P,\nQ, R, S,\nT, U, V,\nW, X, Y, Z."


问:
Ain't there nothing up my sleeves

Note: reference to Nothing up my sleeve number.

Your task is to take no input and generate this exact output:

d76aa478 e8c7b756 242070db c1bdceee f57c0faf 4787c62a a8304613 fd469501
698098d8 8b44f7af ffff5bb1 895cd7be 6b901122 fd987193 a679438e 49b40821
f61e2562 c040b340 265e5a51 e9b6c7aa d62f105d 02441453 d8a1e681 e7d3fbc8
21e1cde6 c33707d6 f4d50d87 455a14ed a9e3e905 fcefa3f8 676f02d9 8d2a4c8a
fffa3942 8771f681 6d9d6122 fde5380c a4beea44 4bdecfa9 f6bb4b60 bebfbc70
289b7ec6 eaa127fa d4ef3085 04881d05 d9d4d039 e6db99e5 1fa27cf8 c4ac5665
f4292244 432aff97 ab9423a7 fc93a039 655b59c3 8f0ccc92 ffeff47d 85845dd1
6fa87e4f fe2ce6e0 a3014314 4e0811a1 f7537e82 bd3af235 2ad7d2bb eb86d391
```
<p>A trailing newline is optional.</p>
<p>The MD5 hash for the version <strong>with</strong> trailing newline is:</p>
<ul>
<li><code>FC1D37B5295177E7F28509EC9197688F</code></li>
</ul>
<p>The MD5 hash for the version <strong>without</strong> trailing newline is:</p>
<ul>
<li><code>FAC194EC5EFD2E5A5AC07C2A4925699B</code></li>
</ul>
<h3>How the string is generated</h3>
<p>Those 64 strings are actually the 64 hexadecimal numbers used in the MD5 hash.</p>
<p>The pseudocode for them:</p>
<pre class="lang-python prettyprint-override"><code>numbers = floor(2^32 × abs(sin(i))) for i in [1,2,...,64]
</code>```

The reference Python code:

from math import*
for i in range(8):print" ".join("{:08x}".format(int(abs(2**32*sin(-~j))))for j in range(8*i,8*i+8))
```
<p>Ungolfed:</p>
<pre class="lang-python prettyprint-override"><code>from math import*
for i in range(8):
    temp = []
    for j in range(8*i,8*i+8):
        temp += ["{:08x}".format(int(abs(2**32*sin(j+1))))]
    print " ".join(temp)
</code>```

答:
///, <s>568</s> 567 bytes

```<code>/!/ f//@/fa/d76aa478 e8c7b756 242070db c1bdceee!57c0@f 4787c62a a8304613!d469501
698098d8 8b44f7af!fff5bb1 895cd7be 6b901122!d987193 a679438e 49b40821
f61e2562 c040b340 265e5a51 e9b6c7aa d62f105d 02441453 d8a1e681 e7d3fbc8
21e1cde6 c33707d6!4d50d87 455a14ed a9e3e905!ce@3f8 676f02d9 8d2a4c8a
ff@3942 8771f681 6d9d6122!de5380c a4beea44 4bdec@9!6bb4b60 bebfbc70
289b7ec6 eaa127@ d4ef3085 04881d05 d9d4d039 e6db99e5 1@27cf8 c4ac5665
f4292244 432aff97 ab9423a7!c93a039 655b59c3 8f0ccc92!feff47d 85845dd1
6@87e4f!e2ce6e0 a3014314 4e0811a1!7537e82 bd3af235 2ad7d2bb eb86d391
</code>```

Try it online!

Too bad I can only golf <s>6</s> 7 bytes :-(

To convince you that I can't golf it further, I challenge you to do better in just ///, should you accept it. If you do, you're a magician, since Martin Ender's code says otherwise (checked)!

People that won the challenge and are worth of crediting (format: name (id), bytes_golfed):

daHugLenny (56258), 1

Title: Ain't there nothing up my sleeves

Body:
///, <s>568</s> 567 bytes

/!/ f//@/fa/d76aa478 e8c7b756 242070db c1bdceee!57c0@f 4787c62a a8304613!d469501
698098d8 8b44f7af!fff5bb1 895cd7be 6b901122!d987193 a679438e 49b40821
f61e2562 c040b340 265e5a51 e9b6c7aa d62f105d 02441453 d8a1e681 e7d3fbc8
21e1cde6 c33707d6!4d50d87 455a14ed a9e3e905!ce@3f8 676f02d9 8d2a4c8a
ff@3942 8771f681 6d9d6122!de5380c a4beea44 4bdec@9!6bb4b60 bebfbc70
289b7ec6 eaa127@ d4ef3085 04881d05 d9d4d039 e6db99e5 1@27cf8 c4ac5665
f4292244 432aff97 ab9423a7!c93a039 655b59c3 8f0ccc92!feff47d 85845dd1
6@87e4f!e2ce6e0 a3014314 4e0811a1!7537e82 bd3af235 2ad7d2bb eb86d391

<a href="http://slashes.tryitonline.net#code=LyEvIGYvL0AvZmEvZDc2YWE0NzggZThjN2I3NTYgMjQyMDcwZGIgYzFiZGNlZWUhNTdjMEBmIDQ3ODdjNjJhIGE4MzA0NjEzIWQ0Njk1MDEKNjk4MDk4ZDggOGI0NGY3YWYhZmZmNWJiMSA4OTVjZDdiZSA2YjkwMTEyMiFkOTg3MTkzIGE2Nzk0MzhlIDQ5YjQwODIxCmY2MWUyNTYyIGMwNDBiMzQwIDI2NWU1YTUxIGU5YjZjN2FhIGQ2MmYxMDVkIDAyNDQxNDUzIGQ4YTFlNjgxIGU3ZDNmYmM4CjIxZTFjZGU2IGMzMzcwN2Q2ITRkNTBkODcgNDU1YTE0ZWQgYTllM2U5MDUhY2VAM2Y4IDY3NmYwMmQ5IDhkMmE0YzhhCmZmQDM5NDIgODc3MWY2ODEgNmQ5ZDYxMjIhZGU1MzgwYyBhNGJlZWE0NCA0YmRlY0A5ITZiYjRiNjAgYmViZmJjNzAKMjg5YjdlYzYgZWFhMTI3QCBkNGVmMzA4NSAwNDg4MWQwNSBkOWQ0ZDAzOSBlNmRiOTllNSAxQDI3Y2Y4IGM0YWM1NjY1CmY0MjkyMjQ0IDQzMmFmZjk3IGFiOTQyM2E3IWM5M2EwMzkgNjU1YjU5YzMgOGYwY2NjOTIhZmVmZjQ3ZCA4NTg0NWRkMQo2QDg3ZTRmIWUyY2U2ZTAgYTMwMTQzMTQgNGUwODExYTEhNzUzN2U4MiBiZDNhZjIzNSAyYWQ3ZDJiYiBlYjg2ZDM5MQ" rel="nofollow noreferrer">Try it online!

Too bad I can only golf <s>6</s> 7 bytes :-(

To convince you that I can't golf it further, I challenge you to do better in just ///, should you accept it. If you do, <a href="http://cjam.aditsu.net#code=q6%2C2%3E%5Cfew%3A%7E%24e%60%7B0%3D1%3E%7D%2C%7B%7E%2C(*%7E%7D%24Sf*N*&input=d76aa478%20e8c7b756%20242070db%20c1bdceeeF57c0faf%204787c62a%20a8304613Fd469501%0A698098d8%208b44f7afFfff5bb1%20895cd7be%206b901122Fd987193%20a679438e%2049b40821%0Af61e2562%20c040b340%20265e5a51%20e9b6c7aa%20d62f105d%2002441453%20d8a1e681%20e7d3fbc8%0A21e1cde6%20c33707d6F4d50d87%20455a14ed%20a9e3e905Fcefa3f8%20676f02d9%208d2a4c8a%0Afffa3942%208771f681%206d9d6122Fde5380c%20a4beea44%204bdecfa9F6bb4b60%20bebfbc70%0A289b7ec6%20eaa127fa%20d4ef3085%2004881d05%20d9d4d039%20e6db99e5%201fa27cf8%20c4ac5665%0Af4292244%20432aff97%20ab9423a7Fc93a039%20655b59c3%208f0ccc92Ffeff47d%2085845dd1%0A6fa87e4fFe2ce6e0%20a3014314%204e0811a1F7537e82%20bd3af235%202ad7d2bb%20eb86d391" rel="nofollow noreferrer">you're a magician, since Martin Ender's code says otherwise (checked)!

People that won the challenge and are worth of crediting (format: name (id), bytes_golfed):

daHugLenny (56258), 1


答:
Cheddar, 57 bytes

```<code>->(65@"90).sub(/[GPSV]/g,"$0
").sub(/[^Z\n]/g,"$0, ")+"."
</code>```

Try it online! Isn't that beautiful? It's a nice rectangle.

Two regex substitutions. (65@"90) is the uppercase alphabet, .sub(/[GPSV]/g,"$0\n") replaces GPSV with itself and "\n", .sub(/[^Z\n]/g,"$0, ") replaces all non newline and Z characters with itself and ", ", and "." adds a final ..

Body:
Cheddar, 57 bytes

->(65@"90).sub(/[GPSV]/g,"$0
").sub(/[^Z\n]/g,"$0, ")+"."

Try it online! Isn't that beautiful? It's a nice rectangle.

Two regex substitutions. (65@"90) is the uppercase alphabet, .sub(/[GPSV]/g,"$0\n") replaces GPSV with itself and "\n", .sub(/[^Z\n]/g,"$0, ") replaces all non newline and Z characters with itself and ", ", and "." adds a final ..


答:
Brachylog, 14 bytes

```<code>yk:{,[]:?:gi}a
</code>```

Try it online!

Explanation

```<code>yk                The range [0, ..., Input - 1]
  :{        }a    Apply on each element of the range
    ,[]:?:gi      Group the empty list [] in a list Input times
</code>```

Title: Natural construction

Body:
The natural numbers including 0 are formally defined as sets, in the following way:

Number 0 is defined as the empty set, {}

For n ≥ 0, number n+1 is defined as n ∪ {n}.

As a consequence, n = {0, 1, ..., n-1}.

The first numbers, defined by this procedure, are:

0 = {}

1 = {{}}

2 = {{}, {{}}}

3 = {{}, {{}}, {{}, {{}}}}

Challenge

Given n, output its representation as a set.

Rules

The output can consistently use any bracket character such as {}, [], () or <>. Arbitrary characters (such as 01) are not allowed.

Instead of a comma as above, the separator can be any punctuation sign; or it may be inexistent.

Spaces (not newlines) may be included arbitrarily and inconsistently.

For example, number 2 with square brackets and semicolon as separator is [[]; [[]]], or equivalently [ [ ]; [ [ ] ] ], or even [  [ ] ;[  []]]

The order in which elements of a set are specified doesn't matter. So you can use any order in the representation. For example, these are some valid outputs for 3:

```<code>{{},{{}},{{},{{}}}}
{{{}},{{},{{}}},{}}
{{{}},{{{}},{}},{}}
</code>```

You can write a program or function. Output may be a string or, if using a function, you may return a nested list or array whose string representation conforms to the above.

Test cases

```<code>0  ->  {}
1  ->  {{}}
2  ->  {{},{{}}}
3  ->  {{},{{}},{{},{{}}}}
4  ->  {{},{{}},{{},{{}}},{{},{{}},{{},{{}}}}}
5  ->  {{},{{}},{{},{{}}},{{},{{}},{{},{{}}}},{{},{{}},{{},{{}}},{{},{{}},{{},{{}}}}}}
6  ->  {{},{{}},{{},{{}}},{{},{{}},{{},{{}}}},{{},{{}},{{},{{}}},{{},{{}},{{},{{}}}}},{{},{{}},{{},{{}}},{{},{{}},{{},{{}}}},{{},{{}},{{},{{}}},{{},{{}},{{},{{}}}}}}}
7  ->  {{},{{}},{{},{{}}},{{},{{}},{{},{{}}}},{{},{{}},{{},{{}}},{{},{{}},{{},{{}}}}},{{},{{}},{{},{{}}},{{},{{}},{{},{{}}}},{{},{{}},{{},{{}}},{{},{{}},{{},{{}}}}}},{{},{{}},{{},{{}}},{{},{{}},{{},{{}}}},{{},{{}},{{},{{}}},{{},{{}},{{},{{}}}}},{{},{{}},{{},{{}}},{{},{{}},{{},{{}}}},{{},{{}},{{},{{}}},{{},{{}},{{},{{}}}}}}}}
</code>```

Body:
Brachylog, 14 bytes

yk:{,[]:?:gi}a

Try it online!

Explanation

yk                The range [0, ..., Input - 1]
  :{        }a    Apply on each element of the range
    ,[]:?:gi      Group the empty list [] in a list Input times


答:
TI-Basic, 86 bytes

Cheers to anyone who can compress it further :3

```<code>Disp "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.
</code>```

Body:
TI-Basic, 86 bytes

Cheers to anyone who can compress it further :3

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


问:
Least Common Multiple
The least common multiple of a set of positive integers A is the smallest postive integer B such that, for each k in A, there exists a positive integer n such that k*n = B.

Given at least two positive integers as input, output their least common multiple.

Rules

Builtins are allowed, but if your solution uses one, you are encouraged to include an alternate solution that does not use GCD/LCM builtins. However, the alternate solution will not count towards your score at all, so it is entirely optional.

All inputs and outputs will be within the natively-representable range for your language. If your language is natively capable of arbitrarily-large integers, then your solution must work with arbitrarily large inputs and outputs.

Test cases

```<code>[7, 2] -> 14
[8, 1] -> 8
[6, 4, 8] -> 24
[8, 2, 1, 10] -> 40
[9, 6, 2, 1, 5] -> 90
[5, 5, 7, 1, 1] -> 35
[4, 13, 8, 8, 11, 1] -> 1144
[7, 2, 2, 11, 11, 8, 5] -> 3080
[1, 6, 10, 3, 4, 10, 7] -> 420
[5, 2, 9, 10, 3, 4, 4, 4, 7] -> 1260
[9, 7, 10, 9, 7, 8, 5, 10, 1] -> 2520
</code>```

答:
CJam, <s>18</s> <s>17</s> 16 bytes

1 byte saved thanks to Martin Ender.

Incrementing until the LCM is found.

```<code>q~0{)_2$f%:+}g\;
</code>```

Try it online

Title: Least Common Multiple

Body:
CJam, <s>18</s> <s>17</s> 16 bytes

1 byte saved thanks to Martin Ender.

Incrementing until the LCM is found.

q~0{)_2$f%:+}g\;

Try it online


答:
TI-Basic, 12 bytes

```<code>Prompt L1,L2
sum(L1L2
</code>```

Title: How much will this cost?

Body:
Given N items (0 < N <= 50) with prices (which are always integers) P0 ... PN-1 and given amounts of each item A0 ... AN-1, determine how much the total cost will be.

Examples

N: 2

P0: 2

P1: 3

A0: 1

A1: 4

Result: 14

N: 5

P0: 2

P1: 7

P2: 5

P3: 1

P4: 9

A0: 1

A1: 2

A2: 3

A3: 2

A4: 3

Result: 60

Remember, this is code-golf, so the code with the smallest number of bytes wins.

Leaderboards

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

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

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

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

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

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

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

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

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

var QUESTION_ID=95128,OVERRIDE_USER=12537;function answersUrl(e){return"https://api.stackexchange.com/2.2/questions/"+QUESTION_ID+"/answers?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+ANSWER_FILTER}function commentUrl(e,s){return"https://api.stackexchange.com/2.2/answers/"+s.join(";")+"/comments?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+COMMENT_FILTER}function getAnswers(){jQuery.ajax({url:answersUrl(answer_page++),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){answers.push.apply(answers,e.items),answers_hash=[],answer_ids=[],e.items.forEach(function(e){e.comments=[];var s=+e.share_link.match(/\d+/);answer_ids.push(s),answers_hash[s]=e}),e.has_more||(more_answers=!1),comment_page=1,getComments()}})}function getComments(){jQuery.ajax({url:commentUrl(comment_page++,answer_ids),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){e.items.forEach(function(e){e.owner.user_id===OVERRIDE_USER&&answers_hash[e.post_id].comments.push(e)}),e.has_more?getComments():more_answers?getAnswers():process()}})}function getAuthorName(e){return e.owner.display_name}function process(){var e=[];answers.forEach(function(s){var r=s.body;s.comments.forEach(function(e){OVERRIDE_REG.test(e.body)&&(r="
"+e.body.replace(OVERRIDE_REG,"")+"
")});var a=r.match(SCORE_REG);a&&e.push({user:getAuthorName(s),size:+a[2],language:a[1],link:s.share_link})}),e.sort(function(e,s){var r=e.size,a=s.size;return 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;width:290px;float:left}table thead{font-weight:700}table td{padding:5px}</code>```

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

Leaderboard

	Author	Language	Size

Winners by Language

Language	User	Score

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

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

```

Body:
TI-Basic, 12 bytes

Prompt L1,L2
sum(L1L2


Title: Ain't there nothing up my sleeves

Body:
Note: reference to Nothing up my sleeve number.

Your task is to take no input and generate this exact output:

d76aa478 e8c7b756 242070db c1bdceee f57c0faf 4787c62a a8304613 fd469501
698098d8 8b44f7af ffff5bb1 895cd7be 6b901122 fd987193 a679438e 49b40821
f61e2562 c040b340 265e5a51 e9b6c7aa d62f105d 02441453 d8a1e681 e7d3fbc8
21e1cde6 c33707d6 f4d50d87 455a14ed a9e3e905 fcefa3f8 676f02d9 8d2a4c8a
fffa3942 8771f681 6d9d6122 fde5380c a4beea44 4bdecfa9 f6bb4b60 bebfbc70
289b7ec6 eaa127fa d4ef3085 04881d05 d9d4d039 e6db99e5 1fa27cf8 c4ac5665
f4292244 432aff97 ab9423a7 fc93a039 655b59c3 8f0ccc92 ffeff47d 85845dd1
6fa87e4f fe2ce6e0 a3014314 4e0811a1 f7537e82 bd3af235 2ad7d2bb eb86d391
```
<p>A trailing newline is optional.</p>
<p>The MD5 hash for the version <strong>with</strong> trailing newline is:</p>
<ul>
<li><code>FC1D37B5295177E7F28509EC9197688F</code></li>
</ul>
<p>The MD5 hash for the version <strong>without</strong> trailing newline is:</p>
<ul>
<li><code>FAC194EC5EFD2E5A5AC07C2A4925699B</code></li>
</ul>
<h3>How the string is generated</h3>
<p>Those 64 strings are actually the 64 hexadecimal numbers used in the MD5 hash.</p>
<p>The pseudocode for them:</p>
<pre class="lang-python prettyprint-override"><code>numbers = floor(2^32 × abs(sin(i))) for i in [1,2,...,64]
</code>```

The reference Python code:

from math import*
for i in range(8):print" ".join("{:08x}".format(int(abs(2**32*sin(-~j))))for j in range(8*i,8*i+8))
```
<p>Ungolfed:</p>
<pre class="lang-python prettyprint-override"><code>from math import*
for i in range(8):
    temp = []
    for j in range(8*i,8*i+8):
        temp += ["{:08x}".format(int(abs(2**32*sin(j+1))))]
    print " ".join(temp)
</code>```

Body:
Racket 125 bytes

(λ()(for((i(range 1 65)))(printf"~x "(inexact->exact(floor(*(expt 2 32)(abs(sin i))))))(when(= 0(modulo i 8))(printf"~n"))))

Ungolfed:

(define f
  (λ ()
    (for ((i (range 1 65)))
      (printf "~x " (inexact->exact(floor (*(expt 2 32) (abs (sin i)) ))))
      (when(= 0 (modulo i 8)) (printf "~n"))
      )))

Testing:

(f)

Output:

d76aa478 e8c7b756 242070db c1bdceee f57c0faf 4787c62a a8304613 fd469501
698098d8 8b44f7af ffff5bb1 895cd7be 6b901122 fd987193 a679438e 49b40821
f61e2562 c040b340 265e5a51 e9b6c7aa d62f105d 2441453 d8a1e681 e7d3fbc8
21e1cde6 c33707d6 f4d50d87 455a14ed a9e3e905 fcefa3f8 676f02d9 8d2a4c8a
fffa3942 8771f681 6d9d6122 fde5380c a4beea44 4bdecfa9 f6bb4b60 bebfbc70
289b7ec6 eaa127fa d4ef3085 4881d05 d9d4d039 e6db99e5 1fa27cf8 c4ac5665
f4292244 432aff97 ab9423a7 fc93a039 655b59c3 8f0ccc92 ffeff47d 85845dd1
6fa87e4f fe2ce6e0 a3014314 4e0811a1 f7537e82 bd3af235 2ad7d2bb eb86d391


答:
Retina, <s>24</s> 18 bytes

```<code>.+
$*1<>
+`1<
<<$'
</code>```

Try it online! (The first line enables a linefeed-separated test suite.)

Explanation

```<code>.+
$*1<>
</code>```

This converts the input to unary and appends <>, the representation of 0.

```<code>+`1<
<<$'
</code>```

Here, the + indicates that this substitution should be run in a loop until the string stops changing. It's easier to explain this by going through the individual steps I took golfing it down. Let's with this version of the substitution:

```<code>1<(.*)>
<<$1>$1>
</code>```

This matches the last 1 of the unary representation of the remaining input (to remove it and decrement the input), as well as the contents of the current set at the end. This is then replaced with a new set containing the previous one as well as its contents. However, we can notice that $1 is followed by > in both cases and hence we can include it in the capture itself and omit it from the substitution pattern. That leads to the form

```<code>1<(.*)
<<$1$1
</code>```

However, now we can observe that (.*) just captures the suffix of the string after 1< and we even reinsert this suffix at the end with $1. Since the substitution syntax gives us a way to refer to the part of a string after a match with $' we can simply omit both of those parts and end up with the version used in the answer:

```<code>1<
<<$'
</code>```

Title: Natural construction

Body:
Retina, <s>24</s> 18 bytes

.+
$*1<>
+`1<
<<$'

Try it online! (The first line enables a linefeed-separated test suite.)

Explanation

.+
$*1<>

This converts the input to unary and appends <>, the representation of 0.

+`1<
<<$'

Here, the + indicates that this substitution should be run in a loop until the string stops changing. It's easier to explain this by going through the individual steps I took golfing it down. Let's with this version of the substitution:

1<(.*)>
<<$1>$1>

This matches the last 1 of the unary representation of the remaining input (to remove it and decrement the input), as well as the contents of the current set at the end. This is then replaced with a new set containing the previous one as well as its contents. However, we can notice that $1 is followed by > in both cases and hence we can include it in the capture itself and omit it from the substitution pattern. That leads to the form

1<(.*)
<<$1$1

However, now we can observe that (.*) just captures the suffix of the string after 1< and we even reinsert this suffix at the end with $1. Since the substitution syntax gives us a way to refer to the part of a string after a match with $' we can simply omit both of those parts and end up with the version used in the answer:

1<
<<$'


答:
GameMaker Language, 85 bytes

```<code>b=""for(a=65;a<90;a++){d=chr(a)c=", "if string_pos(d,"GPSV")c=",#"b+=d+c}return b+"Z.
</code>```

Boring alternate (94 bytes)

```<code>return string_replace_all("AaBaCaDaEaFaG,#HaIaJaKaLaMaNaOaP,#QaRaS,#TaUaV,#WaXaYaZ.","a",", ")
</code>```

Pretty straightforward. Note that # is newline literal (think \n in most languages). Use \# for #.

Body:
Write a program or function that outputs this exact text, case-insensitive:

```<code>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.
</code>```

(Based on the alphabet song that many American kids learn to help memorize the alphabet, though edited for more compressibility.)

The output must look exactly the same as the above (again, case-insensitive), but may contain trailing spaces on each line and/or trailing newlines. Notice the period at the end.

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

Body:
GameMaker Language, 85 bytes

b=""for(a=65;a<90;a++){d=chr(a)c=", "if string_pos(d,"GPSV")c=",#"b+=d+c}return b+"Z.

Boring alternate (94 bytes)

return string_replace_all("AaBaCaDaEaFaG,#HaIaJaKaLaMaNaOaP,#QaRaS,#TaUaV,#WaXaYaZ.","a",", ")

Pretty straightforward. Note that # is newline literal (think \n in most languages). Use \# for #.


Body:
Java, <s>116</s> <s>109</s> <s>105</s> 104

String f(){String s="";for(char c=65;c<91;)s=s+c+(c>89?46:',')+("GPSV".indexOf(c++)<0?' ':10);return s;}

Ungolfed:

String f() {
  String s = "";
  for (char c = 65; c < 91;) {
    s = s + c
      + (c > 89 ? 46 : ',')
      + ("GPSV".indexOf(c++) < 0 ? ' ' : 10);
  }
  return s;
}


问:
When was this language released?
Your challenge is simple. You need to write a program that prints to either STDOUT or a file the year the language it is written in was released. Because this is such a simple task, the twist is that it must be written in as many different languages as possible.

Your score is the total number of different years that are correctly printed.

For each language you use, you must

Specify which version of the language you are using. (If there are multiple versions)

Specify what year that version was first released, and

Provide a link to a page proving the date of your version/language.

Any one of these counts as release date proof, as long as it specifies the version number (if applicable) and a release date.

A wikipedia page.

An esolangs page.

The language's official website. A github page or similar counts, as long as it has a release date. (Latest commit does not count, unless there is a version number somewhere in the code)

If there are not multiple versions or releases of a language, just use the initial release date of the language.

Minor versions of the same language do count as different languages, as long as they come from different years and still produce the correct output. You may not use any builtins that give you information (including release date) about the current version of the language you are using. For example, this is an invalid python submission:

```<code>import platform
i = platform.python_version()
if i == '3.5':
    print(2015)
if i == '3.4':
    print(2014)
if i == '3.3':
    print(2012)
...
</code>```

Whichever submission correctly prints the most distinct years wins!

Rules

Each program must print out the language year and nothing more. A trailing newline (windows style or *nix style) is allowed.

No programs may take any input.

In case of a tie, the shortest code scored in bytes wins. You may use whatever encoding you like for this, but all programs must use the same encoding.

Any of the programs may print to STDERR, or throw runtime/compile time errors and warnings as long as the correct output is still printed to STDOUT or a file.

Different languages may use different IO methods, but they most all be full programs, (functions not allowed for this challenge) and follow one of our default IO methods allowed.

Happy <s>golfing</s> polyglotting!

答:
3 languages, 3 years

An ad-hoc answer for fun.

```<code>2002!~+++++++[<+++++++>-]<[.++++++++..------.[-]] 2016 !.
</code>```

Mouse-2002: everything after ~ is a comment, and the first part, which could also be written C0U!!!, prints 2002.

this pre-challenge commit of Calc: which is a stack-based calculator interpreter I just designed in C11 for Programming II, the part of the program before the first space prints an error (allowed under the challenge spec), and 2016 !. prints 2016.

Brainfuck: prints 1993 as seen in other answers. The final extraneous . is ignored by beef.

Note that Calc's display of the current stack < stack with every non-empty input line is part of the prompt >, not part of the output.

Title: When was this language released?

Body:
3 languages, 3 years

An ad-hoc answer for fun.

2002!~+++++++[<+++++++>-]<[.++++++++..------.[-]] 2016 !.

Mouse-2002: everything after ~ is a comment, and the first part, which could also be written C0U!!!, prints 2002.

this pre-challenge commit of Calc: which is a stack-based calculator interpreter I just designed in C11 for Programming II, the part of the program before the first space prints an error (allowed under the challenge spec), and 2016 !. prints 2016.

Brainfuck: prints 1993 as seen in other answers. The final extraneous . is ignored by beef.

Note that Calc's display of the current stack < stack with every non-empty input line is part of the prompt >, not part of the output.


Title: So sayeth the Shepherd

Body:
I'm tired, but I can't seem to fall asleep. Help me count sheep.

Given an input N (positive integer), make N sheep jump over an ascii fence, like the sample below. Only one frame should be displayed at once:

```<code>o |-|
──|-|──  0
</code>```

```<code> o|-|
──|-|──  0
</code>```

```<code>   o
  |-|
──|-|──  0
</code>```

```<code>  |-|o
──|-|──  0
</code>```

```<code>  |-| o
──|-|──  0
</code>```

```<code>o |-|
──|-|──  1
</code>```

```<code> o|-|
──|-|──  1
</code>```

```<code>   o
  |-|
──|-|──  1
</code>```

Count should be kept at the lower right side of the 'ground'. Trailing and leading whitespace and newlines are allowed. If your language of choice has difficulty clearing the screen for each frame you can add sufficient newlines to clear the screen - please state how many lines you add for this in your answer. The program should terminate when the N'th sheep is on the fifth floortile.

I need to get up early tomorrow, so shortest code in bytes wins. Please submit a function or complete program. Standard loopholes apply.

Body:
Bash + standard Linux utilities (339 bytes)

e(){ echo "$@";}
n(){ e -n "$@";}
r(){ [ $? -eq 0 ]&&s=o||s=" ";[ $1 ]&&n " $s "||n "$s";}
f(){ k=$(($1%5));n "  ";[ $k -eq 2 ];r .;e "  ";for i in 0 1;do [ $k -eq $i ];r;done;n "|-|";for i in 3 4;do [ $k -eq $i ];r;done;e;n "──|-|──";}
for l in `seq 1 $1`;do for z in `seq 0 4`;do clear;f $z;e "  $((l-1))";sleep 1;done;done


答:
Java, 67 bytes

```<code>a->{int p=0;for(int i=-1;++i<a[0];)p+=a[i+1]*a[i+a[0]+1];return p;}
</code>```

Slightly ungolfed:

```<code>public static int pay(int...a){
  int p=0;
  for(int i=-1;++i<a[0];){
    p+=a[i+1]*a[i+a[0]+1];
  }
  return p;
}
</code>```

Title: How much will this cost?

Body:
Java, 67 bytes

a->{int p=0;for(int i=-1;++i<a[0];)p+=a[i+1]*a[i+a[0]+1];return p;}

Slightly ungolfed:

public static int pay(int...a){
  int p=0;
  for(int i=-1;++i<a[0];){
    p+=a[i+1]*a[i+a[0]+1];
  }
  return p;
}


答:
C#, 25 bytes

```<code>p.Zip(a,(x,y)=>x*y).Sum()
</code>```

Sample program:

```<code>using System.Linq;
using Xunit;
public class Tests {
    [Fact]
    public void Cost() {
        int[] p = new [] { 2, 7, 5, 1, 9 };
        int[] a = new [] { 1, 2, 3, 2, 3 };
        int r = p.Zip(a, (x, y) => x * y).Sum();
        Assert.Equal(60, r);
    }
}
</code>```

Title: How much will this cost?

Body:
C#, 25 bytes

p.Zip(a,(x,y)=>x*y).Sum()

Sample program:

using System.Linq;
using Xunit;
public class Tests {
    [Fact]
    public void Cost() {
        int[] p = new [] { 2, 7, 5, 1, 9 };
        int[] a = new [] { 1, 2, 3, 2, 3 };
        int r = p.Zip(a, (x, y) => x * y).Sum();
        Assert.Equal(60, r);
    }
}


答:
Perl 6, 13 bytes

{[+] [Z*] $_}
```

<p>Input is a list of two lists</p>

<h2>Example:</h2>

<pre class="lang-perl6 prettyprint-override"><code>say {[+] [Z*] $_}(  ((2,7,5,1,9),(1,2,3,2,3))  );
# 60
</code>```

Explanation:

{          # bare block lambda with implicit parameter ｢$_｣

  [+]      # reduce using addition operator

    [Z*]   # reduce using zip meta-operator combined with multiplication operator

      $_   # the argument ( list of lists )
}
```

Title: How much will this cost?

Body:
Perl 6, 13 bytes

{[+] [Z*] $_}

Input is a list of two lists

Example:

say {[+] [Z*] $_}(  ((2,7,5,1,9),(1,2,3,2,3))  );
# 60

Explanation:

{          # bare block lambda with implicit parameter ｢$_｣

  [+]      # reduce using addition operator

    [Z*]   # reduce using zip meta-operator combined with multiplication operator

      $_   # the argument ( list of lists )
}


问:
Is this number a prime?
Believe it or not, we do not yet have a code golf challenge for a simple primality test. While it may not be the most interesting challenge, particularly for "usual" languages, it can be nontrivial in many languages.

Rosetta code features lists by language of idiomatic approaches to primality testing, one using the Miller-Rabin test specifically and another using trial division. However, "most idiomatic" often does not coincide with "shortest." In an effort to make Programming Puzzles and Code Golf the go-to site for code golf, this challenge seeks to compile a catalog of the shortest approach in every language, similar to "Hello, World!" and Golf you a quine for great good!.

Furthermore, the capability of implementing a primality test is part of our definition of programming language, so this challenge will also serve as a directory of proven programming languages.

Task

Write a full program that, given a strictly positive integer n as input, determines whether n is prime and prints a truthy or falsy value accordingly.

For the purpose of this challenge, an integer is prime if it has exactly two strictly positive divisors. Note that this excludes 1, who is its only strictly positive divisor.

Your algorithm must be deterministic (i.e., produce the correct output with probability 1) and should, in theory, work for arbitrarily large integers. In practice, you may assume that the input can be stored in your data type, as long as the program works for integers from 1 to 255.

Input

If your language is able to read from STDIN, accept command-line arguments or any other alternative form of user input, you can read the integer as its decimal representation, unary representation (using a character of your choice), byte array (big or little endian) or single byte (if this is your languages largest data type).

If (and only if) your language is unable to accept any kind of user input, you may hardcode the input in your program.

In this case, the hardcoded integer must be easily exchangeable. In particular, it may appear only in a single place in the entire program.

For scoring purposes, submit the program that corresponds to the input 1.

Output

Output has to be written to STDOUT or closest alternative.

If possible, output should consist solely of a truthy or falsy value (or a string representation thereof), optionally followed by a single newline.

The only exception to this rule is constant output of your language's interpreter that cannot be suppressed, such as a greeting, ANSI color codes or indentation.

Additional rules

This is not about finding the language with the shortest approach for prime testing, this is about finding the shortest approach in every language. Therefore, no answer will be marked as accepted.

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

The language Piet, for example, will be scored in codels, which is the natural choice for this language.

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

Unlike our usual rules, feel free to use a language (or language version) even if it's newer than this challenge. If anyone wants to abuse this by creating a language where the empty program performs a primality test, then congrats for paving the way for a very boring answer.

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.

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

Built-in functions for testing primality are allowed. This challenge is meant to catalog the shortest possible solution in each language, so if it's shorter to use a built-in in your language, go for it.

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

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

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

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

Shortest Solution by Language

Language	User	Score

Leaderboard

	Author	Language	Size

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

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

```

答:
Logy, 82 bytes

```<code>f[X]->X<2&1|X*f[X-1];p[&1]->0<0;p[X]->f[X-1]%X==X-1;main[A]->print[p[atoi[A(1)]]];
</code>```

I have no idea what I am doing.

Use Wilson's theorem.

Ungolfed code:

```<code>factorial[X] -> X < 2 & 1 | X*factorial[X - 1];
prime[&1] -> FALSE;
prime[X] -> factorial[X - 1]%X == X - 1;
main[Args] -> print[prime[atoi[Args(1)]]];
</code>```

Title: Is this number a prime?

Body:
Logy, 82 bytes

f[X]->X<2&1|X*f[X-1];p[&1]->0<0;p[X]->f[X-1]%X==X-1;main[A]->print[p[atoi[A(1)]]];

I have no idea what I am doing.

Use Wilson's theorem.

Ungolfed code:

factorial[X] -> X < 2 & 1 | X*factorial[X - 1];
prime[&1] -> FALSE;
prime[X] -> factorial[X - 1]%X == X - 1;
main[Args] -> print[prime[atoi[Args(1)]]];


答:
Pip, 37 bytes

36 bytes of code, +1 for -S flag.

```<code>0X8-#_._MMLC(2**32*ABSI++,64)TB16<>8
</code>```

Pretty straightforward implementation. Unfortunately, 10 bytes are needed to left-pad some of the values with 0. Try it online!

```<code>                         ,64          Numbers 0 to 63
                       ++             Increment to get 1 to 64
                     SI               Sine
                   AB                 Absolute value
             2**32*                   Multiply by 2^32
            (               )TB16     Convert to hex (implicitly truncating to int)
          LC                          Lowercase--Pip's base conversion uses uppercase :(
                                 <>8  Group into sublists of size 8
        MM                            Map this function to each item of each sublist:
  8-#_                                  1 if item is length 7, 0 if length 8
0X                                      That many zeros
      ._                                Concatenate to beginning of item
                                      Print separated first by newline then by space (-S)
</code>```

Title: Ain't there nothing up my sleeves

Body:
Pip, 37 bytes

36 bytes of code, +1 for -S flag.

0X8-#_._MMLC(2**32*ABSI++,64)TB16<>8

Pretty straightforward implementation. Unfortunately, 10 bytes are needed to left-pad some of the values with 0. Try it online!

                         ,64          Numbers 0 to 63
                       ++             Increment to get 1 to 64
                     SI               Sine
                   AB                 Absolute value
             2**32*                   Multiply by 2^32
            (               )TB16     Convert to hex (implicitly truncating to int)
          LC                          Lowercase--Pip's base conversion uses uppercase :(
                                 <>8  Group into sublists of size 8
        MM                            Map this function to each item of each sublist:
  8-#_                                  1 if item is length 7, 0 if length 8
0X                                      That many zeros
      ._                                Concatenate to beginning of item
                                      Print separated first by newline then by space (-S)


问:
Print a bunch of uninteresting numbers!
An uninteresting number (which I totally didn't make up only for this challenge) is created like this:

Take a positive integer N

Create a new number O by adding the digits of N at the end of N

The final uninteresting number is O*N

For example for N=12:

O = 1212

O*N = 1212 * 12

Final number is 14544

Input

A positive integer N (N > 0) or your language's equivalent. You don't have to catch incorrect input.

Output

The corresponding uninteresting number.

Test cases

```<code>  1 -> 11
  2 -> 44
  3 -> 99
 10 -> 10100
174 -> 30306276
</code>```

Scoring

Shortest Code in Bytes wins.

答:
Logy, 40 bytes

```<code>main[A]->print[atoi[A(1)*2]*atoi[A(1)]];
</code>```

Ungolfed:

```<code>main[Args] -> print[atoi[Args(1)*2]*
                    atoi[Args(1)]];
</code>```

Title: Print a bunch of uninteresting numbers!

Body:
Logy, 40 bytes

main[A]->print[atoi[A(1)*2]*atoi[A(1)]];

Ungolfed:

main[Args] -> print[atoi[Args(1)*2]*
                    atoi[Args(1)]];


答:
Haskell, <s>118 115</s> 108 bytes

g 0=[""]
g n|a<-g$n-1=map('0':)a++map('1':)(reverse a)
d=dropWhile
f s=d(=='0')$(d(/='0':s)$g$1+length s)!!1
```

Try it on Ideone.

Naive approach: g generates the set of all gray codes with length n (with 0-padding), f calls g with length(input)+1, removes all elements until 0<inputstring> is found and returns the next element (truncating a possibly leading 0).

Title: Incrementing Gray Codes

Body:
Introduction

A Gray Code is an alternative to binary representation in which a number is incremented by toggling only one bit, rather than a variable amount of bits. Here are some gray codes along with their decimal and binary equivalents:

```<code> decimal | binary | gray
-------------------------
       0 |      0 |    0
-------------------------
       1 |      1 |    1
-------------------------
       2 |     10 |   11
-------------------------
       3 |     11 |   10
-------------------------
       4 |    100 |  110
-------------------------
       5 |    101 |  111
-------------------------
       6 |    110 |  101
-------------------------
       7 |    111 |  100
-------------------------
       8 |   1000 | 1100
-------------------------
       9 |   1001 | 1101
-------------------------
      10 |   1010 | 1111
-------------------------
      11 |   1011 | 1110
-------------------------
      12 |   1100 | 1010
-------------------------
      13 |   1101 | 1011
-------------------------
      14 |   1110 | 1001
-------------------------
      15 |   1111 | 1000
</code>```

Cyclic Bit Pattern of a Gray Code

Sometimes called "reflected binary", the property of changing only one bit at a time is easily achieved with cyclic bit patterns for each column starting from the least significant bit:

```<code>bit 0: 0110011001100110011001100110011001100110011001100110011001100110
bit 1: 0011110000111100001111000011110000111100001111000011110000111100
bit 2: 0000111111110000000011111111000000001111111100000000111111110000
bit 3: 0000000011111111111111110000000000000000111111111111111100000000
bit 4: 0000000000000000111111111111111111111111111111110000000000000000
bit 5: 0000000000000000000000000000000011111111111111111111111111111111
</code>```

...and so on.

Objective

Given a non-padded input string of a gray code, increment the gray code by alternating a single character in the sequence or prepending a 1 (when incrementing to the next power of 2), then output the result as a non-padded gray code.

Caveats

Do not worry about taking 0 or an empty string as input.

The lowest input will be 1, and there is no upper-bound to the string length other than memory limitations imposed by the environment.

By non-padded string, I mean there will be no leading or trailing whitespace (other than an optional trailing newline), and no leading 0s in the input or output.

I/O formats

The following formats are accepted form for input and output, but strings are encouraged over other formats:

most significant "bit" first

non-padded character array or string of ASCII '1's and '0's

non-padded integer array of 1s and 0s

non-padded boolean array

What's not allowed:

least significant "bit" first

decimal, binary or unary integer

fixed-length data-structure

character array or string of non-printable ASCII indices 1 and 0

Tests

```<code>input -> output
1 -> 11
11 -> 10
111 -> 101
1011 -> 1001
1111 -> 1110
10111 -> 10110
101100 -> 100100
100000 -> 1100000
</code>```

More tests can be added by request.

Criteria

This is code-golf, so shortest program in bytes wins! All ties will be broken by favoring earlier submissions; standard loopholes apply. The best submitted answer will be accepted October 9th, 2016, and updated whenever better answers are given.

Body:
Haskell, <s>118 115</s> 108 bytes

g 0=[""]
g n|a<-g$n-1=map('0':)a++map('1':)(reverse a)
d=dropWhile
f s=d(=='0')$(d(/='0':s)$g$1+length s)!!1

Try it on Ideone.

Naive approach: g generates the set of all gray codes with length n (with 0-padding), f calls g with length(input)+1, removes all elements until 0<inputstring> is found and returns the next element (truncating a possibly leading 0).


答:
MATL, 18 bytes

```<code>ZBtE:t2/kZ~tb=fQ)B
</code>```

Try it online! Or verify all test cases.

Explanation

Let a(n) denote the sequence of integers corresponding to Gray codes (OEIS A003188). The program uses the characterization a(n) = n XOR floor(n/2), where XOR is bit-wise.

Essentially, the code converts the input to an integer a0, finds that integer in the sequence, and then selects the next term. This requires generating a sufficiently large number of terms of the sequence a(n). It turns out that 2·a0 is sufficiently large. This stems from the fact that the Gray code a(n) never has more binary digits than n.

Let's take input '101' as an example.

```<code>ZB      % Input string implicitly. Convert from binary string to integer
        %   STACK: 5
t       % Duplicate
        %   STACK: 5, 5
E       % Multiply by 2. This is the number of terms we'll generate from the sequence
        %   STACK: 5, 10
:       % Range
        %   STACK: 5, [1 2 3 4 5 6 7 8 9 10]
t       % Duplicate
        %   STACK: 5, [1 2 3 4 5 6 7 8 9 10], [1 2 3 4 5 6 7 8 9 10]
2/k     % Divide by 2 and round down, element-wise
        %   STACK: 5, [1 2 3 4 5 6 7 8 9 10], [0 1 1 2 2 3 3 4 4 5]
Z~      % Bit-wise XOR, element-wise
        %   STACK: 5, [1 3 2 6 7 5 4 12 13 15]
t       % Duplicate
        %   STACK: 5, [1 3 2 6 7 5 4 12 13 15], [1 3 2 6 7 5 4 12 13 15]
b       % Bubble up
        %   STACK: [1 3 2 6 7 5 4 12 13 15], [1 3 2 6 7 5 4 12 13 15], 5
=       % Equality test, element-wise
        %   STACK: [1 3 2 6 7 5 4 12 13 15], [0 0 0 0 0 1 0 0 0 0]
f       % Find: yield (1-based) index of nonzero values (here there's only one)
        %   STACK: [1 3 2 6 7 5 4 12 13 15], 6
Q       % Increase by 1
        %   STACK: [1 3 2 6 7 5 4 12 13 15], 7
)       % Apply as index
        %   STACK: 4
B       % Convert to binary array
        %   STACK: [1 0 0]
        % Implicitly display
</code>```

Title: Incrementing Gray Codes

Body:
MATL, 18 bytes

ZBtE:t2/kZ~tb=fQ)B

Try it online! Or verify all test cases.

Explanation

Let a(n) denote the sequence of integers corresponding to Gray codes (OEIS A003188). The program uses the characterization a(n) = n XOR floor(n/2), where XOR is bit-wise.

Essentially, the code converts the input to an integer a0, finds that integer in the sequence, and then selects the next term. This requires generating a sufficiently large number of terms of the sequence a(n). It turns out that 2·a0 is sufficiently large. This stems from the fact that the Gray code a(n) never has more binary digits than n.

Let's take input '101' as an example.

ZB      % Input string implicitly. Convert from binary string to integer
        %   STACK: 5
t       % Duplicate
        %   STACK: 5, 5
E       % Multiply by 2. This is the number of terms we'll generate from the sequence
        %   STACK: 5, 10
:       % Range
        %   STACK: 5, [1 2 3 4 5 6 7 8 9 10]
t       % Duplicate
        %   STACK: 5, [1 2 3 4 5 6 7 8 9 10], [1 2 3 4 5 6 7 8 9 10]
2/k     % Divide by 2 and round down, element-wise
        %   STACK: 5, [1 2 3 4 5 6 7 8 9 10], [0 1 1 2 2 3 3 4 4 5]
Z~      % Bit-wise XOR, element-wise
        %   STACK: 5, [1 3 2 6 7 5 4 12 13 15]
t       % Duplicate
        %   STACK: 5, [1 3 2 6 7 5 4 12 13 15], [1 3 2 6 7 5 4 12 13 15]
b       % Bubble up
        %   STACK: [1 3 2 6 7 5 4 12 13 15], [1 3 2 6 7 5 4 12 13 15], 5
=       % Equality test, element-wise
        %   STACK: [1 3 2 6 7 5 4 12 13 15], [0 0 0 0 0 1 0 0 0 0]
f       % Find: yield (1-based) index of nonzero values (here there's only one)
        %   STACK: [1 3 2 6 7 5 4 12 13 15], 6
Q       % Increase by 1
        %   STACK: [1 3 2 6 7 5 4 12 13 15], 7
)       % Apply as index
        %   STACK: 4
B       % Convert to binary array
        %   STACK: [1 0 0]
        % Implicitly display


问:
Count even steps of 196 algorithm
In the 196-algorithm one starts from an integer and then adds its reverse to it until a palindrome is reached, like this:

```<code>start -> 5280
5280 + 0825 = 6105
6105 + 5016 = 11121
11121 + 12111 = 23232
-end-
</code>```

Write a function that counts how many even numbers are visited before the algorithm ends. Starting and ending numbers are also counted, so, in the example above, visited are consider the numbers: 5280, 6105, 11121, 23232 but not 825, 5016 and 12111.

Examples:

```<code>f(5280) = 2
f(56) = 1
f(59) = 1
f(89) = 13
</code>```

Extended code golf rules apply: shortest number of instructions and operations (like +,-,mod,print,while,if,...) wins.

答:
J, 36 characters, 7 instructions

```<code>+/@:-.@(2&|)@((+`1:@.=|.&.":)"0^:a:)
</code>```

I'm counting both monadic and dyadic verbs as instructions.  Here's a token breakdown to make sure everything is accounted for:

3 monadic verbs (6 chars): -., |., ":

4 dyadic verbs (4 chars): +, |, +, =

0 adverbs (0 chars)

10 conjunctions (14 chars): /, @:, @, &, @, `, @., &., ", ^:

4 constants (6 chars): 2 1: 0 a:

3 parenthesis groups (6 chars)

Demonstration:

```<code>   +/@:-.@(2&|)@((+`1:@.=|.&.":)"0^:a:) 5280 56 59 89
2 1 1 13
</code>```

The "0 isn't strictly needed to answer the question, it's just there to make the function more J-like (i.e., able to operate on a whole array at once, as above).  I kept it in as it doesn't go against my instruction count.

Title: Count even steps of 196 algorithm

Body:
J, 36 characters, 7 instructions

+/@:-.@(2&|)@((+`1:@.=|.&.":)"0^:a:)

I'm counting both monadic and dyadic verbs as instructions.  Here's a token breakdown to make sure everything is accounted for:

3 monadic verbs (6 chars): -., |., ":

4 dyadic verbs (4 chars): +, |, +, =

0 adverbs (0 chars)

10 conjunctions (14 chars): /, @:, @, &, @, `, @., &., ", ^:

4 constants (6 chars): 2 1: 0 a:

3 parenthesis groups (6 chars)

Demonstration:

   +/@:-.@(2&|)@((+`1:@.=|.&.":)"0^:a:) 5280 56 59 89
2 1 1 13

The "0 isn't strictly needed to answer the question, it's just there to make the function more J-like (i.e., able to operate on a whole array at once, as above).  I kept it in as it doesn't go against my instruction count.

ContentLicense: CC BY-SA 2.5


答:
RProgN, 9 Bytes

```<code>] ] . * _
</code>```

Explanation

```<code>] ]     # Push two copies of the top of the stack, which implicitly contains the input.
.       # Concatenate the top two values of the stack, and push it to the top of the stack.
*       # Multiply the top two values of the stack
_       # Floor the top of the stack, to make it pretty.
        # Implicitly print
</code>```

Yay for Stack Based Loosly typed languages.
The main downside of RProgN is that (Currently) whitespace is needed for a function to run (Aside from the last command). Which wastefully adds four whole bytes.

Title: Print a bunch of uninteresting numbers!

Body:
An uninteresting number (which I totally didn't make up only for this challenge) is created like this:

Take a positive integer N

Create a new number O by adding the digits of N at the end of N

The final uninteresting number is O*N

For example for N=12:

O = 1212

O*N = 1212 * 12

Final number is 14544

Input

A positive integer N (N > 0) or your language's equivalent. You don't have to catch incorrect input.

Output

The corresponding uninteresting number.

Test cases

```<code>  1 -> 11
  2 -> 44
  3 -> 99
 10 -> 10100
174 -> 30306276
</code>```

Scoring

Shortest Code in Bytes wins.

Body:
RProgN, 9 Bytes

] ] . * _

Explanation

] ]     # Push two copies of the top of the stack, which implicitly contains the input.
.       # Concatenate the top two values of the stack, and push it to the top of the stack.
*       # Multiply the top two values of the stack
_       # Floor the top of the stack, to make it pretty.
        # Implicitly print

Yay for Stack Based Loosly typed languages.
The main downside of RProgN is that (Currently) whitespace is needed for a function to run (Aside from the last command). Which wastefully adds four whole bytes.


答:
JavaScript (ES6), 58 bytes

```<code>s=>s.replace(s.split`1`.length%2?/.$/:/.?(?=10*$)/,c=>1-c)
</code>```

Directly toggles the appropriate bit. Explanation: As shown in MartinEnder♦'s answer, each bit in a decoded Gray code is the cumulative XOR, or parity, of itself and the bits to its left. We then need to increment the number which causes a carry ripple that toggles all the rightmost 1 bits to 0 and then the next 0 bit to 1. Re-encoding results in a code with just that one 0 bit position toggled. If the parity of all the 1 bits is even, then the rightmost bit is 0 and we therefore just toggle the last bit. If the parity of all the 1 bits is odd, then the rightmost bits are 1, and we need to find the last 1 bit. This is now the last of the carried bits, so the bit we need to toggle is the next bit from the right.

Title: Incrementing Gray Codes

Body:
JavaScript (ES6), 58 bytes

s=>s.replace(s.split`1`.length%2?/.$/:/.?(?=10*$)/,c=>1-c)

Directly toggles the appropriate bit. Explanation: As shown in MartinEnder♦'s answer, each bit in a decoded Gray code is the cumulative XOR, or parity, of itself and the bits to its left. We then need to increment the number which causes a carry ripple that toggles all the rightmost 1 bits to 0 and then the next 0 bit to 1. Re-encoding results in a code with just that one 0 bit position toggled. If the parity of all the 1 bits is even, then the rightmost bit is 0 and we therefore just toggle the last bit. If the parity of all the 1 bits is odd, then the rightmost bits are 1, and we need to find the last 1 bit. This is now the last of the carried bits, so the bit we need to toggle is the next bit from the right.


问:
Just repeat yourself
Write a program that outputs

```<code>Do not repeat yourself!
</code>```

Your program code must respect the following constraints :

its length must be an even number

each character that is in position 2n (where n is an integer > 0) must be equal to the character in position 2n-1. The second character of the program is equal to the first, the fourth is equal to the third, etc.

Newlines count as characters!

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

Examples

HHeellllooWWoorrlldd is a valid program

123 or AAABBB or HHeello are incorrect

Verification

You can use this CJam script to verify that your source code is valid. Simply paste your code into the "Input" box and run the script.

答:
DC, <s>348</s> <s>346</s> <s>342</s> <s>306</s> <s>290</s> 278 bytes

File dnr6.short.dc (without trailing newline):

```<code>AAzz--22222222vvPPAAAAAAAAvvPP88vvFFFFFFFFvv00++AAzz--PP11vvFFFFFFFFvv00++AAAAAAvvPP11vvEEEEEEEEvv00++OOOO//44999999vv++PP77II++OOOO//44999999vv++PPAAAAAAvv88vvFFFFFFFFvv00++PPAAzz--BBPP11vvFFFFFFFFvv00++77OOOO++++PPOOOO//44999999vv++66vvFFFFFFFFvv00++PP99zz++OO88++PPAAAAvv33PP
</code>```

Run:

```<code>$ dc < dnr6.short.dc
Do not repeat yourself!
</code>```

Title: Just repeat yourself

Body:
DC, <s>348</s> <s>346</s> <s>342</s> <s>306</s> <s>290</s> 278 bytes

File dnr6.short.dc (without trailing newline):

AAzz--22222222vvPPAAAAAAAAvvPP88vvFFFFFFFFvv00++AAzz--PP11vvFFFFFFFFvv00++AAAAAAvvPP11vvEEEEEEEEvv00++OOOO//44999999vv++PP77II++OOOO//44999999vv++PPAAAAAAvv88vvFFFFFFFFvv00++PPAAzz--BBPP11vvFFFFFFFFvv00++77OOOO++++PPOOOO//44999999vv++66vvFFFFFFFFvv00++PP99zz++OO88++PPAAAAvv33PP

Run:

$ dc < dnr6.short.dc
Do not repeat yourself!


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

Thanks to Dennis for saving 2 bytes.

```<code>^\Ḅ‘^H$B
</code>```

Input and output are lists of 0s and 1s.

Try it online!

Explanation

The inverse of the Gray code is given by A006068. Using this we don't need to generate a large number of Gray codes to look up the input. One classification of this sequence given on OEIS is this:

```<code>a(n) = n XOR [n/2] XOR [n/4] XOR [n/8] ...
</code>```

Where the [] are floor brackets. Consider the example of 44 whose binary representation is 101100. Dividing by 2 and flooring is just a right-shift, chopping off the least-significant bit. So we're trying to XOR the following numbers

```<code>1 0 1 1 0 0
  1 0 1 1 0
    1 0 1 1
      1 0 1
        1 0
          1
</code>```

Notice that the nth column contains the first n bits. Hence, this formula can be computed trivially on the binary input as the cumulative reduction of XOR over the list (which basically applies XOR to each prefix of the list and gives us a list of the results).

This gives us a simple way to invert the Gray code. Afterwards, we just increment the result and convert it back to the Gray code. For the latter step we use the following definition:

```<code>a(n) = n XOR floor(n/2)
</code>```

Thankfully, Jelly seems to floor the inputs automatically when trying to XOR them. Anyway, here is the code:

```<code>^\          Cumulative reduce of XOR over the input.
  Ḅ         Convert binary list to integer.
   ‘        Increment.
    ^H$     XOR with half of itself.
       B    Convert integer to binary list.
</code>```

Title: Incrementing Gray Codes

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

Thanks to Dennis for saving 2 bytes.

^\Ḅ‘^H$B

Input and output are lists of 0s and 1s.

Try it online!

Explanation

The inverse of the Gray code is given by A006068. Using this we don't need to generate a large number of Gray codes to look up the input. One classification of this sequence given on OEIS is this:

a(n) = n XOR [n/2] XOR [n/4] XOR [n/8] ...

Where the [] are floor brackets. Consider the example of 44 whose binary representation is 101100. Dividing by 2 and flooring is just a right-shift, chopping off the least-significant bit. So we're trying to XOR the following numbers

1 0 1 1 0 0
  1 0 1 1 0
    1 0 1 1
      1 0 1
        1 0
          1

Notice that the nth column contains the first n bits. Hence, this formula can be computed trivially on the binary input as the cumulative reduction of XOR over the list (which basically applies XOR to each prefix of the list and gives us a list of the results).

This gives us a simple way to invert the Gray code. Afterwards, we just increment the result and convert it back to the Gray code. For the latter step we use the following definition:

a(n) = n XOR floor(n/2)

Thankfully, Jelly seems to floor the inputs automatically when trying to XOR them. Anyway, here is the code:

^\          Cumulative reduce of XOR over the input.
  Ḅ         Convert binary list to integer.
   ‘        Increment.
    ^H$     XOR with half of itself.
       B    Convert integer to binary list.


答:
BotEngine, 6x49=294

```<code>vv  PP

  !!ee

  ffee

  llee

  eeee

  ssee

  rree

  uuee

  ooee

  yyee

    ee

  ttee

  aaee

  eeee

  ppee

  eeee

  rree

    ee

  ttee

  ooee

  nnee

    ee

  ooee

  DDee

>>  ^^
</code>```

Title: Just repeat yourself

Body:
Write a program that outputs

```<code>Do not repeat yourself!
</code>```

Your program code must respect the following constraints :

its length must be an even number

each character that is in position 2n (where n is an integer > 0) must be equal to the character in position 2n-1. The second character of the program is equal to the first, the fourth is equal to the third, etc.

Newlines count as characters!

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

Examples

HHeellllooWWoorrlldd is a valid program

123 or AAABBB or HHeello are incorrect

Verification

You can use this CJam script to verify that your source code is valid. Simply paste your code into the "Input" box and run the script.

Body:
BotEngine, 6x49=294

vv  PP

  !!ee

  ffee

  llee

  eeee

  ssee

  rree

  uuee

  ooee

  yyee

    ee

  ttee

  aaee

  eeee

  ppee

  eeee

  rree

    ee

  ttee

  ooee

  nnee

    ee

  ooee

  DDee

>>  ^^