答:
JavaScript, 95 bytes

95 bytes, but only 71 characters. Byte counter. Using @Neil s way to determine if arguments are passed.

```<code>(...a)=>'ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ'[`to${a.length?'Low':'Upp'}erCase`]()
</code>```

Title: Print the Greek alphabet!

Body:
Fairly obviously, you have to print the Greek alphabet. But I thought I'd make it slightly more interesting, so there's a twist: when your program is ran with an argument (anything), it should output the Greek alphabet in lowercase.

Information

Greek alphabet (Capitals):  ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ

Greek alphabet (Lowercase): αβγδεζηθικλμνξοπρστυφχψω

Rules/Requirements

Each submission must be a full program.

Builtins to print the Greek alphabet are not permitted

Standard loopholes apply

You must print exactly what is shown.

Scoring

Programs are scored according to bytes. If you are using a character set different to UTF-8 please specify. Try to get the least bytes out of everyone, this is code-golf!

Test cases

```<code>./program
==> ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ

./program 1
==> αβγδεζηθικλμνξοπρστυφχψω

./program 'lower'
==> αβγδεζηθικλμνξοπρστυφχψω

./program 123897883421
==> αβγδεζηθικλμνξοπρστυφχψω

./program ""
==> αβγδεζηθικλμνξοπρστυφχψω

greek();
==> ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ

greek("blah");
==> αβγδεζηθικλμνξοπρστυφχψω

greek(123);
==> αβγδεζηθικλμνξοπρστυφχψω
</code>```

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 = 97049; // 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:
JavaScript, 95 bytes

95 bytes, but only 71 characters. Byte counter. Using @Neil s way to determine if arguments are passed.

(...a)=>'ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ'[`to${a.length?'Low':'Upp'}erCase`]()


问:
Let's get ready for Halloween
I don't know about you all but I'm not preparing for Halloween––never did never will––but, my neighbor is, so we'll help her out.

She needs help figuring out which brand of candy she has, but she has so much candy she would not be able to finish before Halloween.

She has:

Snickers

KitKat

Starburst

GummyBears

Twix

Input

A multiline string (or any other reasonable form) containing only letters and spaces.

Output

A falsy value if it is not a valid candy, or which candy it is if it is a candy.

How to decide which candy it is

A candy is valid if it says one of the above brands on it. However, it's not that simple, because this is a valid candy:

```<code>K i t
       K a
           t
</code>```

A valid candy is one where:

the letters are in order from left to right

the letters are capitalized correctly

the letters, going from left to right, do not both ascend and descend

the letters with whitespace removed form one of the above brands

This is code-golf, so shortest code in byte wins!

Examples

Truthys:

```<code>1.
              kers
           c
        i
       n
    S

2.
  Kit K a t

3.
St a
    r b u
         r st

4.
         Bear s
G ummy

5.
T w i
                          x
</code>```

Falsys:

```<code>1.
SNICKERS

2.
 C   n

   a   d y

3.
xiwT

4.
S C I
       ss o
              r       s

5.
Kit
Kat
</code>```

ContentLicense: CC BY-SA 3.0

Title: Let's get ready for Halloween

Body:
JavaScript (ES6), <s>221</s> <s>218</s> <s>216</s> <s>212</s> <s>208</s> <s>205</s> 201 bytes

f=a=>(c=d=L=0,e=1,s=[],[...a].map(a=>a=='\n'?c=L=0:c++-(a!=' '&&(s[c]?e=0:(!L&&(d?d-1?e&=c>Q>d-3:d=c>Q>2:d=1),L=s[Q=c]=a)))),e&&'Snickers0KitKat0Starburst0GummyBears0Twix'.split(0).indexOf(s.join``)+1)

Try it here.


问:
Can you outgolf me? (Cops section)

Cops section

The robbers section can be found here.

Thanks to FryAmTheEggman, Peter Taylor, Nathan Merrill, xnor, Dennis, Laikoni and Mego for their contributions.

Challenge

Your task is to write 2 different programs (full programs/functions/etc.) in the same language and the same version (e.g. Python 3.5 ≠ Python 3.4, so that is not allowed), and when given n (using STDIN/function arguments/etc.), compute a(n) where a is an OEIS sequence of your choice. One of those programs is shorter than the other. You only need to submit the longer program of the two. The other one needs to be saved in case of not being cracked after 7 days. Your submission is cracked when your program has been outgolfed (whether it is by 1 byte or more).

For example, if the task you chose was to perform 2 × n, this could be a valid submission (in Python 2):

Python 2, 16 bytes, score = 15 / 16 = 0.9375

```<code>print(2*input())
</code>```

Computes A005843, (offset = 0).

If your submission has been cracked, then you need to state that in your header like so:

Python 2, 16 bytes, score = 15 / 16 = 0.9375, [cracked] + link

```<code>print(2*input())
</code>```

Computes A005843, (offset = 0).

Offset

This can be found on every OEIS page. For example, for A005843, the offset is 0,2. We only need to use the first one, which is 0. This means that the function is defined for all numbers ≥ 0.

In other words, the function OEIS(n) starts with n = 0. Your program needs to work for all cases given by OEIS.

More information can be found here.

Scoring

The score you get for your submission is equal to the following formula:

Score = Length (in bytes) of secret code ÷ Length (in bytes) of public code

The example above has the score 15 ÷ 16 = 0.9375.

The submission with the lowest score wins. Only submissions that have posted their solution will be eligible for winning.

Rules

The task you need to do is an OEIS sequence of your choice.

Given n, output OEIS(n). Deviation is not allowed, so you need to produce the exact same sequence (when given n, you need to output OEIS(n)).

Submissions that are not cracked within a period of 7 days are considered safe after the solution has been posted (submissions older than 7 days that do not have their solution posted are still vulnerable in being cracked).

In your submission, you need to post the following things: language name, byte count, full code, so no pastebin links etc. (to prevent answers like Unary), OEIS sequence, score with lengths of both programs and additionally, the encoding that is used.

Note: the same sequence cannot be posted twice in the same language. (For example, if the sequence A005843 has been done in Pyth, you cannot use Pyth again for that same sequence.)

Input and output are both in decimal (base 10)

Leaderboard

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

Uncracked submissions

 Language	 Score	 User

Sort by: score creation

Safe submissions

 Language	 Score	 User

```

Note

This challenge is finished. The final winner is feersum with his Seed answer. Congratulations! :).

You can still submit new cops, but be aware that they are no longer competing.

答:
Haskell, 28 bytes, score = 0.3571 (10/28), cracked

```<code>f n|odd n=1|1>0=2*f(div n 2)
</code>```

A006519, the highest power of 2 dividing n, starting at n=1.

```<code>1, 2, 1, 4, 1, 2, 1, 8, 1, 2, 1, 4, 1, 2, 1, 16, 1, ...
</code>```

While you get cracking credit for any shorter code, I consider the real puzzle to be getting down to 10 bytes.

Title: Can you outgolf me? (Cops section)

Body:
Haskell, 28 bytes, score = 0.3571 (10/28), cracked

f n|odd n=1|1>0=2*f(div n 2)

A006519, the highest power of 2 dividing n, starting at n=1.

1, 2, 1, 4, 1, 2, 1, 8, 1, 2, 1, 4, 1, 2, 1, 16, 1, ...

While you get cracking credit for any shorter code, I consider the real puzzle to be getting down to 10 bytes.


问:
Can you outgolf me? (Robbers section)

Robbers section

The cops section can be found here.

Challenge

Your task is to outgolf the submissions of the cops in the same language and the same version (for example, Python 3.5 ≠ Python 3.4, so that is not allowed). A submission is outgolfed when the length in bytes is shorter than the original submission. You only need to golf off at least 1 byte in order to crack a submission. E.g. if the task was to perform 2 × n, and the submission was the following:

```<code>print(2*input())
</code>```

You could outgolf the cop by doing the following:

```<code>print 2*input()
</code>```

Or even this (since lambda's are allowed):

```<code>lambda x:2*x
</code>```

Post this with the following header:

```<code>##{language name}, <s>{prev byte count}</s> {byte count}, {cop's submission + link}
</code>```

For example:

Python 2, <s>16</s> 12 bytes, Adnan (+ link to submission)

```<code>lambda x:2*x
</code>```

Computes A005843, (offset = 0).

In that case, you have cracked the submission.

Scoring

The person with who cracked the most submissions is the winner.

Rules

The crack submission must be in the same language as the cop submission.

The same input should result into the same output (so a(2) = 4 should remain 4).

For languages such as Python, you can import libraries that are standard included within the language. (So, no numpy/sympy etc.)

Input and output are both in decimal (base 10).

Note

This challenge is finished. The winner of the Robbers section is feersum. The final scores for the CnR are shown below:

feersum: 16 cracks

Dennis: 12 cracks

Leaky Nun: 6 cracks

Lynn: 4 cracks

miles: 3 cracks

Martin Ender: 2 cracks

Emigna: 2 cracks

jimmy23013: 1 crack

Sp3000: 1 crack

randomra: 1 crack

alephalpha: 1 crack

nimi: 1 crack

Destructible Watermelon: 1 crack

Dom Hastings: 1 crack

答:
Haskell, 10 bytes, xnor

```<code>gcd=<<(2^)
</code>```

Usage example: map ( gcd=<<(2^) ) [1..17] -> [1,2,1,4,1,2,1,8,1,2,1,4,1,2,1,16,1].

How it works: From the oeis page we see that a(n) = gcd(2^n, n) or written in Haskell syntax: a n = gcd (2^n) n. Functions with the pattern f x = g (h x) x can be turned to point-free via the function =<<: f = g =<< h, hence gcd=<<(2^) which translates back to gcd (2^x) x.

Title: Can you outgolf me? (Robbers section)

Body:
Haskell, 10 bytes, xnor

gcd=<<(2^)

Usage example: map ( gcd=<<(2^) ) [1..17] -> [1,2,1,4,1,2,1,8,1,2,1,4,1,2,1,16,1].

How it works: From the oeis page we see that a(n) = gcd(2^n, n) or written in Haskell syntax: a n = gcd (2^n) n. Functions with the pattern f x = g (h x) x can be turned to point-free via the function =<<: f = g =<< h, hence gcd=<<(2^) which translates back to gcd (2^x) x.


问:
Print the Greek alphabet!
Fairly obviously, you have to print the Greek alphabet. But I thought I'd make it slightly more interesting, so there's a twist: when your program is ran with an argument (anything), it should output the Greek alphabet in lowercase.

Information

Greek alphabet (Capitals):  ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ

Greek alphabet (Lowercase): αβγδεζηθικλμνξοπρστυφχψω

Rules/Requirements

Each submission must be a full program.

Builtins to print the Greek alphabet are not permitted

Standard loopholes apply

You must print exactly what is shown.

Scoring

Programs are scored according to bytes. If you are using a character set different to UTF-8 please specify. Try to get the least bytes out of everyone, this is code-golf!

Test cases

```<code>./program
==> ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ

./program 1
==> αβγδεζηθικλμνξοπρστυφχψω

./program 'lower'
==> αβγδεζηθικλμνξοπρστυφχψω

./program 123897883421
==> αβγδεζηθικλμνξοπρστυφχψω

./program ""
==> αβγδεζηθικλμνξοπρστυφχψω

greek();
==> ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ

greek("blah");
==> αβγδεζηθικλμνξοπρστυφχψω

greek(123);
==> αβγδεζηθικλμνξοπρστυφχψω
</code>```

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 = 97049; // 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

```

答:
Perl under Windows -- console has no Unicode support -- (42 bytes, including spaces)

This is not my solution, I am just merely adapting the Perl solution of Denis Ibaev above, to Windows console Perl.

```<code>perl -E"say map{chr$_+151-!@ARGV*24}1..24"
ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ
$ perl -E"say map{chr$_+151-!@ARGV*24}1..24" with one or many arguments
αβγδεζηθικλμνξοπρσςτυφχψ
</code>```

The console page code must be Greek of course:

```<code>chcp 737
</code>```

NOTE: Just a small idea. On this page I can see that some of the answers use CHARACTERS that seem to been Unicode above 255. Therefore those characters take at least 2 bytes to code (perhaps 4 if one is using a console using 32bits Unicode chars?). Would not it be better if the contest measure was the CHARACTER unit (being Unicode or ASCII or EBCDIC ou whatever) rather than just BYTES? Would not it be simpler and more unifying (wonder if this adjectif exists in English, "unificateur" in French)?

Previous code in error:
Does not print lowercase omega.

Corrected code (70 chars) :

```<code>perl -E"$i=!@ARGV+0;@a=73;pop@a if$i;say map{chr$_+151-$i*24}1..24,@a"
ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ
perl -E"$i=!@ARGV+0;@a=73;pop@a if$i;say map{chr$_+151-$i*24}1..24,@a" foo
αβγδεζηθικλμνξοπρσςτυφχψω
</code>```

I know we are not supposed to print the 'end-of-word' sigma form ('ς') but as it is a mispelling error in ancient Greek to use regular sigma ('σ') at the end of a lowercase word, I choose to print it, as the tittle of this puzzle is "Print the Greek alphabet" and that this character is part of it...

Title: Print the Greek alphabet!

Body:
Perl under Windows -- console has no Unicode support -- (42 bytes, including spaces)

This is not my solution, I am just merely adapting the Perl solution of Denis Ibaev above, to Windows console Perl.

perl -E"say map{chr$_+151-!@ARGV*24}1..24"
ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ
$ perl -E"say map{chr$_+151-!@ARGV*24}1..24" with one or many arguments
αβγδεζηθικλμνξοπρσςτυφχψ

The console page code must be Greek of course:

chcp 737

NOTE: Just a small idea. On this page I can see that some of the answers use CHARACTERS that seem to been Unicode above 255. Therefore those characters take at least 2 bytes to code (perhaps 4 if one is using a console using 32bits Unicode chars?). Would not it be better if the contest measure was the CHARACTER unit (being Unicode or ASCII or EBCDIC ou whatever) rather than just BYTES? Would not it be simpler and more unifying (wonder if this adjectif exists in English, "unificateur" in French)?

Previous code in error:
Does not print lowercase omega.

Corrected code (70 chars) :

perl -E"$i=!@ARGV+0;@a=73;pop@a if$i;say map{chr$_+151-$i*24}1..24,@a"
ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ
perl -E"$i=!@ARGV+0;@a=73;pop@a if$i;say map{chr$_+151-$i*24}1..24,@a" foo
αβγδεζηθικλμνξοπρσςτυφχψω

I know we are not supposed to print the 'end-of-word' sigma form ('ς') but as it is a mispelling error in ancient Greek to use regular sigma ('σ') at the end of a lowercase word, I choose to print it, as the tittle of this puzzle is "Print the Greek alphabet" and that this character is part of it...


答:
Mathematica, n ≈ 20

```<code>p[m_] := Last[Fold[Take[ListConvolve[##, {1, -1}, 0], 2^Length[m]]&,
  Table[If[IntegerQ[Log2[k]], m[[j, Log2[k] + 1]], 0], {j, n}, {k, 0, 2^Length[m] - 1}]]]
</code>```

Using the Timing command, a 20x20 matrix requires about 48 seconds on my system. This is not exactly as efficient as the other since it relies on the fact that the permanent can be found as the coefficient of the product of polymomials from each row of the matrix. Efficient polynomial multiplication is performed by creating the coefficient lists and performing convolution using ListConvolve. This requires about O(2n n2) time assuming convolution is performed using a Fast Fourier transform or similar which requires O(n log n) time.

Title: Calculate the permanent as quickly as possible

Body:
The challenge is to write the fastest code possible for computing the permanent of a matrix.

The permanent of an n-by-n matrix A = (ai,j) is defined as

Here S_n represents the set of all permutations of [1, n].

As an example (from the wiki):

In this question matrices are all square and will only have the values -1 and 1 in them.

Examples

Input:

```<code>[[ 1 -1 -1  1]
 [-1 -1 -1  1]
 [-1  1 -1  1]
 [ 1 -1 -1  1]]
</code>```

Permanent:

```<code>-4
</code>```

Input:

```<code>[[-1 -1 -1 -1]
 [-1  1 -1 -1]
 [ 1 -1 -1 -1]
 [ 1 -1  1 -1]]
</code>```

Permanent:

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

Input:

```<code>[[ 1 -1  1 -1 -1 -1 -1 -1]
 [-1 -1  1  1 -1  1  1 -1]
 [ 1 -1 -1 -1 -1  1  1  1]
 [-1 -1 -1  1 -1  1  1  1]
 [ 1 -1 -1  1  1  1  1 -1]
 [-1  1 -1  1 -1  1  1 -1]
 [ 1 -1  1 -1  1 -1  1 -1]
 [-1 -1  1 -1  1  1  1  1]]
</code>```

Permanent:

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

Input:

```<code>[[1, -1, 1, -1, -1, 1, 1, 1, -1, -1, -1, -1, 1, 1, 1, 1, -1, 1, 1, -1],
 [1, -1, 1, 1, 1, 1, 1, -1, 1, -1, -1, 1, 1, 1, -1, -1, 1, 1, 1, -1],
 [-1, -1, 1, 1, 1, -1, -1, -1, -1, 1, -1, 1, 1, 1, -1, -1, -1, 1, -1, -1],
 [-1, -1, -1, 1, 1, -1, 1, 1, 1, 1, 1, 1, -1, -1, -1, -1, -1, -1, 1, -1],
 [-1, 1, 1, 1, -1, 1, 1, 1, -1, -1, -1, 1, -1, 1, -1, 1, 1, 1, 1, 1],
 [1, -1, 1, 1, -1, -1, 1, -1, 1, 1, 1, 1, -1, 1, 1, -1, 1, -1, -1, -1],
 [1, -1, -1, 1, -1, -1, -1, 1, -1, 1, 1, 1, 1, -1, -1, -1, 1, 1, 1, -1],
 [1, -1, -1, 1, -1, 1, 1, -1, 1, 1, 1, -1, 1, -1, 1, 1, 1, -1, 1, 1],
 [1, -1, -1, -1, -1, -1, 1, 1, 1, -1, -1, -1, -1, -1, 1, 1, -1, 1, 1, -1],
 [-1, -1, 1, -1, 1, -1, 1, 1, -1, 1, -1, 1, 1, 1, 1, 1, 1, -1, 1, 1],
 [-1, -1, -1, -1, -1, -1, -1, 1, -1, -1, -1, -1, 1, 1, 1, 1, -1, -1, -1, -1],
 [1, 1, -1, -1, -1, 1, 1, -1, -1, 1, -1, 1, 1, -1, 1, 1, 1, 1, 1, 1],
 [-1, 1, 1, -1, -1, -1, -1, -1, 1, 1, 1, 1, -1, -1, -1, -1, -1, 1, -1, 1],
 [1, 1, -1, -1, -1, 1, -1, 1, -1, -1, -1, -1, 1, -1, 1, 1, -1, 1, -1, 1],
 [1, 1, 1, 1, 1, -1, -1, -1, 1, 1, 1, -1, 1, -1, 1, 1, 1, -1, 1, 1],
 [1, -1, -1, 1, -1, -1, -1, -1, 1, -1, -1, 1, 1, -1, 1, -1, -1, -1, -1, -1],
 [-1, 1, 1, 1, -1, 1, 1, -1, -1, 1, 1, 1, -1, -1, 1, 1, -1, -1, 1, 1],
 [1, 1, -1, -1, 1, 1, -1, 1, 1, -1, 1, 1, 1, -1, 1, 1, -1, 1, -1, 1],
 [1, 1, 1, -1, -1, -1, 1, -1, -1, 1, 1, -1, -1, -1, 1, -1, -1, -1, -1, 1],
 [-1, 1, 1, 1, -1, -1, -1, -1, -1, -1, -1, 1, 1, -1, 1, 1, -1, 1, -1, -1]]
</code>```

Permanent:

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

The task

You should write code that, given an n by n matrix, outputs its permanent.

As I will need to test your code it would be helpful if you could give a simple way for me to give a matrix as input to your code, for example by reading from standard in.

Be warned that the permanent can be large (the all 1s matrix is the extreme case).

Scores and ties

I will test your code on random +-1 matrices of increasing size and stop the first time your code takes more than 1 minute on my computer.  The scoring matrices will be consistent for all submissions in order to ensure fairness.

If two people get the same score then the winner is the one which is fastest for that value of n. If those are within 1 second of each other then it is the one posted first.

Languages and libraries

You can use any available language and libraries you like but no pre-existing function to compute the permanent. Where feasible, it would be good to be able to run your code so please include a full explanation for how to run/compile your code in Linux if at all possible.`

Reference implementations

There is already a codegolf question question with lots of code in different languages for computing the permanent for small matrices. Mathematica and Maple also both have permanent implementations if you can access those.

My Machine The timings will be run on my 64-bit machine. This is a standard ubuntu install with 8GB RAM, AMD FX-8350 Eight-Core Processor and Radeon HD 4250.  This also means I need to be able to run your code.

Low level information about my machine

cat /proc/cpuinfo/|grep flags gives

flags     : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov
  pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt
  pdpe1gb rdtscp lm constant_tsc rep_good nopl nonstop_tsc extd_apicid
  aperfmperf pni pclmulqdq monitor ssse3 fma cx16 sse4_1 sse4_2 popcnt
  aes xsave avx f16c lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a
  misalignsse 3dnowprefetch osvw ibs xop skinit wdt lwp fma4 tce
  nodeid_msr tbm topoext perfctr_core perfctr_nb cpb hw_pstate vmmcall
  bmi1 arat npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid
  decodeassists pausefilter pfthreshold

I will ask a closely related follow up multi-language question that doesn't suffer from the big Int problem so lovers of Scala, Nim, Julia, Rust, Bash can show off their languages too.

Leader board

n = 33 (45 seconds. 64 seconds for n = 34). Ton Hospel in C++ with g++ 5.4.0.

n = 32 (32 seconds). Dennis in C with gcc 5.4.0 using Ton Hospel's gcc flags.

n = 31 (54 seconds). Christian Sievers in Haskell

n = 31 (60 seconds). primo in rpython

n = 30 (26 seconds). ezrast in Rust

n = 28 (49 seconds). xnor with Python + pypy 5.4.1

n = 22 (25 seconds). Shebang with Python + pypy 5.4.1

Note. In practice the timings for Dennis and Ton Hospel's vary a lot for mysterious reasons. For example they seem to be faster after I have loaded a web browser! The timings quoted are the fastest in all the tests I have done.

Body:
Mathematica, n ≈ 20

p[m_] := Last[Fold[Take[ListConvolve[##, {1, -1}, 0], 2^Length[m]]&,
  Table[If[IntegerQ[Log2[k]], m[[j, Log2[k] + 1]], 0], {j, n}, {k, 0, 2^Length[m] - 1}]]]

Using the Timing command, a 20x20 matrix requires about 48 seconds on my system. This is not exactly as efficient as the other since it relies on the fact that the permanent can be found as the coefficient of the product of polymomials from each row of the matrix. Efficient polynomial multiplication is performed by creating the coefficient lists and performing convolution using ListConvolve. This requires about O(2n n2) time assuming convolution is performed using a Fast Fourier transform or similar which requires O(n log n) time.


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

```

答:
Dip, 1 byte

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

Pretty self-explanatory...

Title: Is this number a prime?

Body:
Dip, 1 byte

P

Pretty self-explanatory...


答:
Python 2.7, 254 bytes

I'm sure this can be golfed more. Input is an array of lines s.

```<code>x=len
p=lambda a:x(a)-x(a.lstrip())
g=sorted
a=map(p,l)
j=''.join
z=[i.replace(' ','')for i in l]
if g(a)==a:q=j(z)
elif g(a)==a[::-1]:q=j(z[::-1])
else:q=''
if x(set(a))<x(a):q=''
print 1if q in('Snickers','KitKat','Starburst','GummyBears','Twix')else 0
</code>```

Try it here!

Title: Let's get ready for Halloween

Body:
I don't know about you all but I'm not preparing for Halloween––never did never will––but, my neighbor is, so we'll help her out.

She needs help figuring out which brand of candy she has, but she has so much candy she would not be able to finish before Halloween.

She has:

Snickers

KitKat

Starburst

GummyBears

Twix

Input

A multiline string (or any other reasonable form) containing only letters and spaces.

Output

A falsy value if it is not a valid candy, or which candy it is if it is a candy.

How to decide which candy it is

A candy is valid if it says one of the above brands on it. However, it's not that simple, because this is a valid candy:

```<code>K i t
       K a
           t
</code>```

A valid candy is one where:

the letters are in order from left to right

the letters are capitalized correctly

the letters, going from left to right, do not both ascend and descend

the letters with whitespace removed form one of the above brands

This is code-golf, so shortest code in byte wins!

Examples

Truthys:

```<code>1.
              kers
           c
        i
       n
    S

2.
  Kit K a t

3.
St a
    r b u
         r st

4.
         Bear s
G ummy

5.
T w i
                          x
</code>```

Falsys:

```<code>1.
SNICKERS

2.
 C   n

   a   d y

3.
xiwT

4.
S C I
       ss o
              r       s

5.
Kit
Kat
</code>```

Body:
Python 2.7, 254 bytes

I'm sure this can be golfed more. Input is an array of lines s.

x=len
p=lambda a:x(a)-x(a.lstrip())
g=sorted
a=map(p,l)
j=''.join
z=[i.replace(' ','')for i in l]
if g(a)==a:q=j(z)
elif g(a)==a[::-1]:q=j(z[::-1])
else:q=''
if x(set(a))<x(a):q=''
print 1if q in('Snickers','KitKat','Starburst','GummyBears','Twix')else 0

Try it here!


答:
Haskell, n=31 (54s)

With a lot of invaluable contributions by @Angs: use Vector, use short circuit products, look at odd n.

```<code>import Control.Parallel.Strategies
import qualified Data.Vector.Unboxed as V
import Data.Int

type Row = V.Vector Int8

x :: Row -> [Row] -> Integer -> Int -> Integer
x p (v:vs) m c = let c' = c - 1
                     r = if c>0 then parTuple2 rseq rseq else r0
                     (a,b) = ( x p                  vs m    c' ,
                               x (V.zipWith(-) p v) vs (-m) c' )
                             `using` r
                 in a+b
x p _      m _ = prod m p

prod :: Integer -> Row -> Integer
prod m p = if 0 `V.elem` p then 0
                           else V.foldl' (\a b->a*fromIntegral b) m p

p, pt :: [Row] -> Integer
p (v:vs) = x (foldl (V.zipWith (+)) v vs) (map (V.map (2*)) vs) 1 11
           `div` 2^(length vs)
p [] = 1 -- handle 0x0 matrices too  :-)

pt (v:vs) | even (length vs) = p ((V.map (2*) v) : vs ) `div` 2
pt mat                       = p mat

main = getContents >>= print . pt . map V.fromList . read
</code>```

My first attempts at parallelism in Haskell. You can see a lot of optimization steps through the revision history. Amazingly, it were mostly very small changes. The code is based on the formula in the section "Balasubramanian-Bax/Franklin-Glynn formula" in the Wikipedia article on computing the permanent.

p computes the permanent. It is called via pt which transforms the matrix in a way that is always valid, but especially useful for the matrices that we get here.

Compile with ghc -O2 -threaded -fllvm -feager-blackholing -o <name> <name>.hs. To run with parallelisation, give it runtime parameters like this: ./<name> +RTS -N. Input is from stdin with nested comma separated lists in brackets like [[1,2],[3,4]] as in the last example (newlines allowed everywhere).

Body:
Haskell, n=31 (54s)

With a lot of invaluable contributions by @Angs: use Vector, use short circuit products, look at odd n.

import Control.Parallel.Strategies
import qualified Data.Vector.Unboxed as V
import Data.Int

type Row = V.Vector Int8

x :: Row -> [Row] -> Integer -> Int -> Integer
x p (v:vs) m c = let c' = c - 1
                     r = if c>0 then parTuple2 rseq rseq else r0
                     (a,b) = ( x p                  vs m    c' ,
                               x (V.zipWith(-) p v) vs (-m) c' )
                             `using` r
                 in a+b
x p _      m _ = prod m p

prod :: Integer -> Row -> Integer
prod m p = if 0 `V.elem` p then 0
                           else V.foldl' (\a b->a*fromIntegral b) m p

p, pt :: [Row] -> Integer
p (v:vs) = x (foldl (V.zipWith (+)) v vs) (map (V.map (2*)) vs) 1 11
           `div` 2^(length vs)
p [] = 1 -- handle 0x0 matrices too  :-)

pt (v:vs) | even (length vs) = p ((V.map (2*) v) : vs ) `div` 2
pt mat                       = p mat

main = getContents >>= print . pt . map V.fromList . read

My first attempts at parallelism in Haskell. You can see a lot of optimization steps through the revision history. Amazingly, it were mostly very small changes. The code is based on the formula in the section "Balasubramanian-Bax/Franklin-Glynn formula" in the Wikipedia article on computing the permanent.

p computes the permanent. It is called via pt which transforms the matrix in a way that is always valid, but especially useful for the matrices that we get here.

Compile with ghc -O2 -threaded -fllvm -feager-blackholing -o <name> <name>.hs. To run with parallelisation, give it runtime parameters like this: ./<name> +RTS -N. Input is from stdin with nested comma separated lists in brackets like [[1,2],[3,4]] as in the last example (newlines allowed everywhere).


问:
Compute the Eulerian number
The Eulerian number A(n, m) is the number of permutations of [1, 2, ..., n] in which exactly m elements are greater than the previous element. These are also called rises. For example, if n = 3, there are 3! = 6 permutations of [1, 2, 3]

```<code>1 2 3
 < <  2 elements are greater than the previous

1 3 2
 < >  1 ...

2 1 3
 > <  1 ...

2 3 1
 < >  1 ...

3 1 2
 > <  1 ...

3 2 1
 > >  0 ...
</code>```

So the outputs for A(3, m) for m in [0, 1, 2, 3] will be

```<code>A(3, 0) = 1
A(3, 1) = 4
A(3, 2) = 1
A(3, 3) = 0
</code>```

Also, this is the OEIS sequence A173018.

Rules

This is code-golf so the shortest code wins.

The input n will be a nonnegative integer and m will be a integer in the range [0, 1, ..., n].

Test Cases

```<code>n   m   A(n, m)
0   0   1
1   0   1
1   1   0
2   0   1
2   1   1
2   2   0
3   0   1
3   1   4
3   2   1
3   3   0
4   0   1
4   1   11
4   2   11
4   3   1
4   4   0
5   1   26
7   4   1191
9   5   88234
10  5   1310354
10  7   47840
10  10  0
12  2   478271
15  6   311387598411
17  1   131054
20  16  1026509354985
42  42  0
</code>```

答:
Racket 141 bytes

```<code>(count(λ(x)(= x m))(for/list((t(permutations(range 1(+ 1 n)))))(count
(λ(x)x)(for/list((i(sub1 n)))(>(list-ref t(+ 1 i))(list-ref t i))))))
</code>```

Ungolfed:

```<code>(define (f n m)
  (let* ((l (range 1 (add1 n)))                ; create a list till n
         (pl (permutations l))                 ; get all permutations
         (enl (for/list ((t pl))               ; check each permutation;
                (define rl
                  (for/list ((i (sub1 n)))     ; check if an element is a 'rise'
                    (> (list-ref t (add1 i))
                       (list-ref t i))))
                (count (lambda(x)x) rl))))     ; how many numbers are 'rises'
    (count (lambda(x) (= x m)) enl)))          ; how many permutations had m rises
                                               ; i.e. Eulerian number
</code>```

Testing:

```<code>(f 3 0)
(f 3 1)
(f 3 2)
(f 3 3)
(f 4 2)
(f 5 1)
(f 7 4)
</code>```

Output:

```<code>1
4
1
0
11
26
1191
</code>```

Title: Compute the Eulerian number

Body:
Racket 141 bytes

(count(λ(x)(= x m))(for/list((t(permutations(range 1(+ 1 n)))))(count
(λ(x)x)(for/list((i(sub1 n)))(>(list-ref t(+ 1 i))(list-ref t i))))))

Ungolfed:

(define (f n m)
  (let* ((l (range 1 (add1 n)))                ; create a list till n
         (pl (permutations l))                 ; get all permutations
         (enl (for/list ((t pl))               ; check each permutation;
                (define rl
                  (for/list ((i (sub1 n)))     ; check if an element is a 'rise'
                    (> (list-ref t (add1 i))
                       (list-ref t i))))
                (count (lambda(x)x) rl))))     ; how many numbers are 'rises'
    (count (lambda(x) (= x m)) enl)))          ; how many permutations had m rises
                                               ; i.e. Eulerian number

Testing:

(f 3 0)
(f 3 1)
(f 3 2)
(f 3 3)
(f 4 2)
(f 5 1)
(f 7 4)

Output:

1
4
1
0
11
26
1191


问:
Golf you a quine for great good!
Using your language of choice, golf a quine.

A quine is a non-empty computer program which takes no input and produces a copy of its own source code as its only output.

No cheating -- that means that you can't just read the source file and print it. Also, in many languages, an empty file is also a quine: that isn't considered a legit quine either.

No error quines -- there is already a separate challenge for error quines.

Points for:

Smallest code (in bytes)

Most obfuscated/obscure solution

Using esoteric/obscure languages

Successfully using languages that are difficult to golf in

The following Stack Snippet can be used to get a quick view of the current score in each language, and thus to know which languages have existing answers and what sort of target you have to beat:

var QUESTION_ID=69;
var OVERRIDE_USER=98;

var ANSWER_FILTER="!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe";var COMMENT_FILTER="!)Q2B_A2kjfAiU78X(md6BoYk";var answers=[],answers_hash,answer_ids,answer_page=1,more_answers=!0,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:!0,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=!1;comment_page=1;getComments()}})}
function getComments(){jQuery.ajax({url:commentUrl(comment_page++,answer_ids),method:"get",dataType:"jsonp",crossDomain:!0,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=(function(){var headerTag=String.raw `h\d`
var score=String.raw `\-?\d+\.?\d*`
var normalText=String.raw `[^\n<>]*`
var strikethrough=String.raw `<s>${normalText}</s>|<strike>${normalText}</strike>|<del>${normalText}</del>`
var noDigitText=String.raw `[^\n\d<>]*`
var htmlTag=String.raw `<[^\n<>]+>`
return new RegExp(String.raw `<${headerTag}>`+String.raw `\s*([^\n,]*[^\s,]),.*?`+String.raw `(${score})`+String.raw `(?=`+String.raw `${noDigitText}`+String.raw `(?:(?:${strikethrough}|${htmlTag})${noDigitText})*`+String.raw `</${headerTag}>`+String.raw `)`)})();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;lang=jQuery(''+a.language+'').text().toLowerCase();languages[lang]=languages[lang]||{lang:a.language,user:a.user,size:a.size,link:a.link,uniq:lang}});var langs=[];for(var lang in languages)
if(languages.hasOwnProperty(lang))
langs.push(languages[lang]);langs.sort(function(a,b){if(a.uniq>b.uniq)return 1;if(a.uniq<b.uniq)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;float:left}#language-list{padding:10px;float:left}table thead{font-weight:700}table td{padding:5px}</code>```

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

Winners by Language

Language	User	Score

Leaderboard

	Author	Language	Size

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

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

 ```

答:
MATL, 12 bytes

```<code>'&DtU'
&DtU

</code>```

(the code has a trailing newline).

Try it online!

Explanation

```<code>'&DtU'    % Push this string
&D        % String representation (adds quote marks)
t         % Duplicate
U         % Evaluate (removes quote marks)
          % Implicitly display each string followed by a newline
</code>```

ContentLicense: CC BY-SA 4.0

Title: Golf you a quine for great good!

Body:
MATL, 12 bytes

'&DtU'
&DtU

(the code has a trailing newline).

Try it online!

Explanation

'&DtU'    % Push this string
&D        % String representation (adds quote marks)
t         % Duplicate
U         % Evaluate (removes quote marks)
          % Implicitly display each string followed by a newline


答:
Racket 446 bytes

```<code>(let((lr list-ref)(ls list-set)(sl string-length)(ss substring)(l(string-split s "\n")))(let loop((changed #f))(for((i(sub1(length l))))
(let*((s(lr l i))(r(lr l(add1 i)))(n(sl s))(m(sl r)))(when(> n m)(set! l(ls l i(ss s 0 m)))(set! l(ls l(add1 i)
(string-append r(ss s m n))))(set! changed #t))))(if changed(loop #f)(begin(let*((l(for/list((i l))(string-trim i)))(l(string-join l))
(l(string-replace l " " "")))(ormap(λ(x)(equal? x l))cl))))))
</code>```

Ungolfed:

```<code>(define (f s cl)
  (let ((lr list-ref)
        (ls list-set)
        (sl string-length)
        (ss substring)
        (l (string-split s "\n")))
    (let loop ((changed #f))
      (for ((i (sub1 (length l))))
        (let* ((s (lr l i))
               (r (lr l (add1 i)))
               (n (sl s))
               (m (sl r)))
               (when (> n m)
                 (set! l (ls l i (ss s 0 m)))
                 (set! l (ls l (add1 i)(string-append r (ss s m n))))
                 (set! changed #t))))
        (if changed (loop #f)
            (begin
              (let* ((l (for/list ((i l))
                          (string-trim i)))
                     (l (string-join l))
                     (l (string-replace l " " "")))
                (ormap (λ(x) (equal? x l)) cl)))
            ))))
</code>```

Testing:

```<code>(f "
              kers
           c
        i
       n
    S"
   (list "Snickers""KitKat""Starburst""GummyBears""Twix"))

(f "  Kit K a t"
   (list "Snickers""KitKat""Starburst""GummyBears""Twix"))

(f "St a
    r b u
         r st "
   (list "Snickers""KitKat""Starburst""GummyBears""Twix"))

(f "         Bear s
G ummy"
   (list "Snickers""KitKat""Starburst""GummyBears""Twix"))

(f "T w i
                          x"
   (list "Snickers""KitKat""Starburst""GummyBears""Twix"))

(f "SNICKERS"
   (list "Snickers""KitKat""Starburst""GummyBears""Twix"))
(f " C   n
          y
   a   d"
   (list "Snickers""KitKat""Starburst""GummyBears""Twix"))

(f "xiwT"
   (list "Snickers""KitKat""Starburst""GummyBears""Twix"))

(f "S C I
       ss o
              r       s"
   (list "Snickers""KitKat""Starburst""GummyBears""Twix"))

(f "Kit
Kat"
   (list "Snickers""KitKat""Starburst""GummyBears""Twix"))
</code>```

Output:

```<code>#t
#t
#t
#t
#t
#f
#f
#f
#f
#t
</code>```

Title: Let's get ready for Halloween

Body:
Racket 446 bytes

(let((lr list-ref)(ls list-set)(sl string-length)(ss substring)(l(string-split s "\n")))(let loop((changed #f))(for((i(sub1(length l))))
(let*((s(lr l i))(r(lr l(add1 i)))(n(sl s))(m(sl r)))(when(> n m)(set! l(ls l i(ss s 0 m)))(set! l(ls l(add1 i)
(string-append r(ss s m n))))(set! changed #t))))(if changed(loop #f)(begin(let*((l(for/list((i l))(string-trim i)))(l(string-join l))
(l(string-replace l " " "")))(ormap(λ(x)(equal? x l))cl))))))

Ungolfed:

(define (f s cl)
  (let ((lr list-ref)
        (ls list-set)
        (sl string-length)
        (ss substring)
        (l (string-split s "\n")))
    (let loop ((changed #f))
      (for ((i (sub1 (length l))))
        (let* ((s (lr l i))
               (r (lr l (add1 i)))
               (n (sl s))
               (m (sl r)))
               (when (> n m)
                 (set! l (ls l i (ss s 0 m)))
                 (set! l (ls l (add1 i)(string-append r (ss s m n))))
                 (set! changed #t))))
        (if changed (loop #f)
            (begin
              (let* ((l (for/list ((i l))
                          (string-trim i)))
                     (l (string-join l))
                     (l (string-replace l " " "")))
                (ormap (λ(x) (equal? x l)) cl)))
            ))))

Testing:

(f "
              kers
           c
        i
       n
    S"
   (list "Snickers""KitKat""Starburst""GummyBears""Twix"))

(f "  Kit K a t"
   (list "Snickers""KitKat""Starburst""GummyBears""Twix"))

(f "St a
    r b u
         r st "
   (list "Snickers""KitKat""Starburst""GummyBears""Twix"))

(f "         Bear s
G ummy"
   (list "Snickers""KitKat""Starburst""GummyBears""Twix"))

(f "T w i
                          x"
   (list "Snickers""KitKat""Starburst""GummyBears""Twix"))

(f "SNICKERS"
   (list "Snickers""KitKat""Starburst""GummyBears""Twix"))
(f " C   n
          y
   a   d"
   (list "Snickers""KitKat""Starburst""GummyBears""Twix"))

(f "xiwT"
   (list "Snickers""KitKat""Starburst""GummyBears""Twix"))

(f "S C I
       ss o
              r       s"
   (list "Snickers""KitKat""Starburst""GummyBears""Twix"))

(f "Kit
Kat"
   (list "Snickers""KitKat""Starburst""GummyBears""Twix"))

Output:

#t
#t
#t
#t
#t
#f
#f
#f
#f
#t


问:
Generate alphabet with 4 copies of each letter
Note that this is not the same as Print the alphabet four times.

This task is to write a program to generate four copies of each letter of the English alphabet, one letter per line, on standard output:

```<code>A
A
A
A
B
B
B
B
</code>```

etc.

The output should include newlines after each letter.

Lowercase letters and/or extra whitespace are acceptable.

The solution must be a complete program.

This is code-golf so answers will be scored in bytes with a lower score being the goal.

答:
05AB1E, 6 bytes

```<code>A4×{S»
</code>```

Explanation:

```<code>A       # Push 'abcdefghijklmnopqrstuvwxyz'
 4×     # Repeat four times
   {    # Sort
    S   # Split into list
     »  # Join by newlines
        # Implicit print
</code>```

Without newlines, 4 bytes

```<code>A4×{
</code>```

Try it online!

Body:
05AB1E, 6 bytes

A4×{S»

Explanation:

A       # Push 'abcdefghijklmnopqrstuvwxyz'
 4×     # Repeat four times
   {    # Sort
    S   # Split into list
     »  # Join by newlines
        # Implicit print

Without newlines, 4 bytes

A4×{

Try it online!


问:
Print the Greek alphabet in words
This is different from Print the Greek alphabet! because it is in words.

This is different from "Hello, World!" because the output is different and much longer, leading to different techniques.

This is different from We're no strangers to code golf, you know the rules, and so do I because the output is different and much shorter, leading to different techniques.

Your task is to print this exact text: (the Greek alphabet in words)

```<code>alpha beta gamma delta epsilon zeta eta theta iota kappa lambda mu nu xi omicron pi rho sigma tau upsilon phi chi psi omega
</code>```

Capitalization does not matter.

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

答:
Pyth - <s>104</s> 83 bytes

Base conversion with separator f. Unfortunately, it starts with smallest code point a.

```<code>tX."azT¢ç§ªVôòé!þm<EÞ6ä¿û2_w}MªÍ]·¥ünBPæúòRÜÔYcWed¼(É?«/~{"\fd
</code>```

Try it online here.

Title: Print the Greek alphabet in words

Body:
Pyth - <s>104</s> 83 bytes

Base conversion with separator f. Unfortunately, it starts with smallest code point a.

tX."azT¢ç§ªVôòé!þm<EÞ6ä¿û2_w}MªÍ]·¥ünBPæúòRÜÔYcWed¼(É?«/~{"\fd

Try it online here.


答:
Pyth - 72 bytes

I hope I caught all the edge cases. Will base compress candy list.

```<code>&sSIM_Bmxdh-d;fnd{TK.tQd}-sKdc"Snickers KitKat Starburst GummyBears Twix
</code>```

Test Suite.

Title: Let's get ready for Halloween

Body:
Pyth - 72 bytes

I hope I caught all the edge cases. Will base compress candy list.

&sSIM_Bmxdh-d;fnd{TK.tQd}-sKdc"Snickers KitKat Starburst GummyBears Twix

<a href="http://pyth.herokuapp.com/?code=%26sSIM_Bmxdh-d%3Bfnd%7BTK.tQd%7D-sKdc%22Snickers+KitKat+Starburst+GummyBears+Twix&test_suite=1&test_suite_input=%5B%22K+i+t%22%2C+%22+++++++K+a%22+%2C%22+++++++++++t%22%5D%0A%5B%27++++++++++++++kers%27%2C+%27+++++++++++c%27%2C+%27++++++++i%27%2C+%27+++++++n%27%2C+%27++++S++++%27%5D%0A%5B%27++Kit+K+a+t%27%5D%0A%5B%27St+a%27%2C+%27++++r+b+u%27%2C+%27+++++++++r+st+%27%5D%0A%5B%27+++++++++Bear+s%27%2C+%27G+ummy%27%5D%0A%5B%27T+w+i%27%2C+%27++++++++++++++++++++++++++x%27%5D%0A%5B%27SNICKERS%27%5D%0A%5B%27+C+++n%27%2C+%27++++++++++y%27%2C+%27+++a+++d%27%5D%0A%5B%27xiwT%27%5D%0A%5B%27S+C+I%27%2C+%27+++++++ss+o%27%2C+%27++++++++++++++r+++++++s%27%5D%0A%5B%27Kit%27%2C+%27Kat%27%5D&debug=0" rel="nofollow noreferrer">Test Suite.


答:
Jelly, 58 bytes

```<code>“ßẓ⁸!ȧøḌçỊ¤¢Q=4QẠė⁷¤yż>S⁺ẓṬḄṂċK~⁼Ṛ7&⁼s<ụɦ³ḳMŻyVẉƑƭ6Ẋ⁵ỌQ⁸ẹ»
</code>```

Try it online!

Title: Print the Greek alphabet in words

Body:
This is different from Print the Greek alphabet! because it is in words.

This is different from "Hello, World!" because the output is different and much longer, leading to different techniques.

This is different from We're no strangers to code golf, you know the rules, and so do I because the output is different and much shorter, leading to different techniques.

Your task is to print this exact text: (the Greek alphabet in words)

```<code>alpha beta gamma delta epsilon zeta eta theta iota kappa lambda mu nu xi omicron pi rho sigma tau upsilon phi chi psi omega
</code>```

Capitalization does not matter.

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

Body:
Jelly, 58 bytes

“ßẓ⁸!ȧøḌçỊ¤¢Q=4QẠė⁷¤yż>S⁺ẓṬḄṂċK~⁼Ṛ7&⁼s<ụɦ³ḳMŻyVẉƑƭ6Ẋ⁵ỌQ⁸ẹ»

Try it online!


答:
Pip, <s>21</s> 20 bytes

```<code>C:913+32*#g+Y,24RM17
</code>```

This is a memorable day. Pip has <s>tied</s> beaten Jelly!1

1 And lost to two other golflangs, but whatever.

Try it online!

Explanation

```<code>             ,25      Numbers 0 through 24
                RM17  Remove 17 (ς)
            Y         Yank (to get correct order of operations)
  913                 Char code of capital alpha
      32*#g           32 times number of cmdline args (must be 0 or 1)
     +     +          Add everything up
C:                    Convert to characters (using the compute-and-assign metaoperator to
                        lower the precedence of C)
</code>```

Title: Print the Greek alphabet!

Body:
Fairly obviously, you have to print the Greek alphabet. But I thought I'd make it slightly more interesting, so there's a twist: when your program is ran with an argument (anything), it should output the Greek alphabet in lowercase.

Information

Greek alphabet (Capitals):  ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ

Greek alphabet (Lowercase): αβγδεζηθικλμνξοπρστυφχψω

Rules/Requirements

Each submission must be a full program.

Builtins to print the Greek alphabet are not permitted

Standard loopholes apply

You must print exactly what is shown.

Scoring

Programs are scored according to bytes. If you are using a character set different to UTF-8 please specify. Try to get the least bytes out of everyone, this is code-golf!

Test cases

```<code>./program
==> ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ

./program 1
==> αβγδεζηθικλμνξοπρστυφχψω

./program 'lower'
==> αβγδεζηθικλμνξοπρστυφχψω

./program 123897883421
==> αβγδεζηθικλμνξοπρστυφχψω

./program ""
==> αβγδεζηθικλμνξοπρστυφχψω

greek();
==> ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ

greek("blah");
==> αβγδεζηθικλμνξοπρστυφχψω

greek(123);
==> αβγδεζηθικλμνξοπρστυφχψω
</code>```

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 = 97049; // 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:
Pip, <s>21</s> 20 bytes

C:913+32*#g+Y,24RM17

This is a memorable day. Pip has <s>tied</s> beaten Jelly!1

1 And lost to two other golflangs, but whatever.

Try it online!

Explanation

             ,25      Numbers 0 through 24
                RM17  Remove 17 (ς)
            Y         Yank (to get correct order of operations)
  913                 Char code of capital alpha
      32*#g           32 times number of cmdline args (must be 0 or 1)
     +     +          Add everything up
C:                    Convert to characters (using the compute-and-assign metaoperator to
                        lower the precedence of C)


问:
Find the super palindromes!

Consider the number 99999999. That number is obviously a palindrome.  The largest prime factor of 99999999 is 137. If you divide 99999999 by 137, you get 729927. This number is also a palindrome.

The largest prime factor of 729927 is 101. 729927/101=7227 which again is a palindrome.

The largest prime factor of 7227 is 73. 7227/73=99 which again is a palindrome.

By further dividing by the largest prime factor, you get 9, 3 and finally 1, which, being one-digit numbers, are also palindromes. Since 1 has no prime factors, the procedure ends here.

Now generalizing this observation, I define a super-palindrome as a palindrome which is either 1, or which gives another super-palindrome if divided by its largest prime factor.

Credits: https://math.stackexchange.com/questions/200835/are-there-infinitely-many-super-palindromes

Given a number N, determine if it is a super palindrome or not, and print a truthy or falsey value accordingly.

Your program should print a truthy value for these inputs:

```<code>1
101
121
282
313
353
373
393
474
737
919
959
1331
1441
2882
6446
7887
8668
9559
9779
</code>```

Your program should print a falsey value for these inputs:

```<code>323
432
555
583
585
646
642
696
777
969
989
2112
3553
4554
5242
5225
5445
8080
8118
9988
</code>```

Remember, this is code-golf, so the code with the shortest amount of bytes wins.

答:
Jelly, <s>13</s> <s>12</s> <s>9</s> 8 bytes

```<code>Æf×\D⁼U$
</code>```

Try it online! or verify all test cases.

How it works

```<code>Æf×\D⁼U$  Main link. Argument: n

Æf        Yield all prime factors of n, with multiplicities and in ascending order.
  ×\      Take the cumulative product.
    D     Decimal; convert each product into the array of its base 10 digits.
       $  Combine the two links to the left into a monadic chain.
      U     Upend; reverse all arrays of decimal digits.
     ⁼      Test for equality.
</code>```

Title: Find the super palindromes!

Body:
Jelly, <s>13</s> <s>12</s> <s>9</s> 8 bytes

Æf×\D⁼U$

Try it online! or verify all test cases.

How it works

Æf×\D⁼U$  Main link. Argument: n

Æf        Yield all prime factors of n, with multiplicities and in ascending order.
  ×\      Take the cumulative product.
    D     Decimal; convert each product into the array of its base 10 digits.
       $  Combine the two links to the left into a monadic chain.
      U     Upend; reverse all arrays of decimal digits.
     ⁼      Test for equality.


问:
Fill in the Minesweeper clues
Minesweeper is a popular puzzle game where you must discover which tiles are "mines" without clicking on those tiles. Each tile is either a mine (represented by *) or a clue, i.e. a number from 0 to 8 representing how many of the 8 neighboring tiles are mines. Your task today is to take a board containing the mines and fill in all of the clues. For example, look at the following 5x4 board, with 5 mines:

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

After filling in the clues, the board will look like this:

```<code>2*211
*33*1
12*32
0112*
</code>```

Details

You must write either a full-program or a function that takes in a grid of characters containing only spaces and asterisks and outputs another grid where each space is replaced with the number of adjacent mines (asterisks). Any of these are acceptable formats for your grids:

A string with newlines in it

A 2D list of characters/single character strings

A list of strings

You can assume the grid will be at least 1x1, although it is possible for it to be all mines or all spaces.

The input grid will always be padded with the appropriate number of spaces. As usual, this is code-golf, so standard loopholes apply and the shortest answer in bytes wins!

Sample IO

So that you can see the whitespace, I will show all sample IO with brackets around it.

```<code>Input:
[    * ]
[*     ]
[      ]
[      ]
[  **  ]
[ *  * ]

Output:
[1101*1]
[*10111]
[110000]
[012210]
[12**21]
[1*33*1]

Input:
[****]
[****]

Output:
[****]
[****]

Input:
[   ]
[   ]
[   ]
[   ]

Output:
[000]
[000]
[000]
[000]

Input:
[*   ]
[**  ]
[    ]
[   *]

Ouput:
[*310]
[**10]
[2221]
[001*]

Input:
[**    ]
[*    *]
[  *   ]
[      ]
[*     ]
[****  ]

Output:
[**1011]
[*4211*]
[12*111]
[121100]
[*43210]
[****10]

Input:
[     *    ]
[        * ]
[     *    ]
[**   ***  ]
[      *** ]
[          ]
[       ** ]
[  * *     ]
[*      ** ]
[       ** ]

Output:
[00001*1111]
[00002221*1]
[22102*4321]
[**102***31]
[221013***1]
[0000013542]
[0112111**1]
[12*2*12442]
[*212112**2]
[1100002**2]
</code>```

Title: Fill in the Minesweeper clues

Body:
JavaScript (ES6) <s>186</s> <s>182</s> <s>177</s> <s>161</s> 152 bytes

f=a=>{for(s='',y=a[0].length;y--;)for(s=`
`+s,x=a.length;x--;)(k=>{for(t=0,i=9;i--;)t+=(a[x+i%3-1]||[])[y+i/3-1|0]==k;s=(a[x][y]<k?t:k)+s})`*`;return s}

Update

The above code for " *" returns "2*". This is fixed in the following script.

<s>168</s> 167 bytes

f=a=>{for(s='',y=a[0].length;y--;)for(s=`
`+s,x=a.length;x--;)a[x][y]=='*'?s='*'+s:(k=>{for(t=0,j=3;j--;)for(i=3;i--;)t+=(a[x+i-1]||1)[y+j-1]=='*';s=t+s})`*`;return s}

Try it here.


答:
Pyth - <s>15</s> 12 bytes

<s>Beat Jelly :P</s> :/

Unfortunately, all those implicit maps do not get shorter when combined into an explicit one since the last one is an auto-splat.

```<code>.A_IM`M*M._P
</code>```

Test Suite.

Gets all the prefixes of the prime factorization, the products of which will be the intermediate super palindromes, and checks if all of them are palindromes.

Title: Find the super palindromes!

Body:
Consider the number 99999999. That number is obviously a palindrome.  The largest prime factor of 99999999 is 137. If you divide 99999999 by 137, you get 729927. This number is also a palindrome.

The largest prime factor of 729927 is 101. 729927/101=7227 which again is a palindrome.

The largest prime factor of 7227 is 73. 7227/73=99 which again is a palindrome.

By further dividing by the largest prime factor, you get 9, 3 and finally 1, which, being one-digit numbers, are also palindromes. Since 1 has no prime factors, the procedure ends here.

Now generalizing this observation, I define a super-palindrome as a palindrome which is either 1, or which gives another super-palindrome if divided by its largest prime factor.

Credits: https://math.stackexchange.com/questions/200835/are-there-infinitely-many-super-palindromes

Given a number N, determine if it is a super palindrome or not, and print a truthy or falsey value accordingly.

Your program should print a truthy value for these inputs:

```<code>1
101
121
282
313
353
373
393
474
737
919
959
1331
1441
2882
6446
7887
8668
9559
9779
</code>```

Your program should print a falsey value for these inputs:

```<code>323
432
555
583
585
646
642
696
777
969
989
2112
3553
4554
5242
5225
5445
8080
8118
9988
</code>```

Remember, this is code-golf, so the code with the shortest amount of bytes wins.

Body:
Pyth - <s>15</s> 12 bytes

<s>Beat Jelly :P</s> :/

Unfortunately, all those implicit maps do not get shorter when combined into an explicit one since the last one is an auto-splat.

.A_IM`M*M._P

Test Suite.

Gets all the prefixes of the prime factorization, the products of which will be the intermediate super palindromes, and checks if all of them are palindromes.


答:
Mathematica, <s>71</s> 63 bytes

```<code>And@@PalindromeQ/@FoldList[1##&,Join@@Table@@@FactorInteger@#]&
</code>```

Explanation

```<code>FactorInteger@#
</code>```

Factor the input. (e.g. 8668 -> {{2, 2}, {11, 1}, {197, 1}}; for each list in the output, the first element is the prime factor, and the second one is the power.

```<code>Join@@Table@@ ...
</code>```

For each factor-power pair, duplicate the first element by the second element, and flatten the entire thing. ({{2, 2}, {11, 1}, {197, 1}} -> {{2, 2}, {11}, {197}} -> {2, 2, 11, 197})

```<code>FoldList[1##&, ... ]
</code>```

Iterate through the list, multiplying the elements. ({2, 2, 11, 197} -> {2, 2 * 2, 2 * 2 * 11, 2 * 2 * 11 * 197} -> {2, 4, 44, 8668})

```<code>And@@PalindromeQ/@ ...
</code>```

Check whether all of the resulting numbers are palindromes, and apply the And operator. ({2, 4, 44, 8668} -> {True, True, True, True} -> True)

Title: Find the super palindromes!

Body:
Mathematica, <s>71</s> 63 bytes

And@@PalindromeQ/@FoldList[1##&,Join@@Table@@@FactorInteger@#]&

Explanation

FactorInteger@#

Factor the input. (e.g. 8668 -> {{2, 2}, {11, 1}, {197, 1}}; for each list in the output, the first element is the prime factor, and the second one is the power.

Join@@Table@@ ...

For each factor-power pair, duplicate the first element by the second element, and flatten the entire thing. ({{2, 2}, {11, 1}, {197, 1}} -> {{2, 2}, {11}, {197}} -> {2, 2, 11, 197})

FoldList[1##&, ... ]

Iterate through the list, multiplying the elements. ({2, 2, 11, 197} -> {2, 2 * 2, 2 * 2 * 11, 2 * 2 * 11 * 197} -> {2, 4, 44, 8668})

And@@PalindromeQ/@ ...

Check whether all of the resulting numbers are palindromes, and apply the And operator. ({2, 4, 44, 8668} -> {True, True, True, True} -> True)


答:
Aubergine, 21 bytes

```<code>-a1+a1=oA=Bi-BA:bB=ia
</code>```

This program ends with a trailing tab character.

Title: Golf you a quine for great good!

Body:
Using your language of choice, golf a quine.

A quine is a non-empty computer program which takes no input and produces a copy of its own source code as its only output.

No cheating -- that means that you can't just read the source file and print it. Also, in many languages, an empty file is also a quine: that isn't considered a legit quine either.

No error quines -- there is already a separate challenge for error quines.

Points for:

Smallest code (in bytes)

Most obfuscated/obscure solution

Using esoteric/obscure languages

Successfully using languages that are difficult to golf in

The following Stack Snippet can be used to get a quick view of the current score in each language, and thus to know which languages have existing answers and what sort of target you have to beat:

var QUESTION_ID=69;
var OVERRIDE_USER=98;

var ANSWER_FILTER="!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe";var COMMENT_FILTER="!)Q2B_A2kjfAiU78X(md6BoYk";var answers=[],answers_hash,answer_ids,answer_page=1,more_answers=!0,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:!0,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=!1;comment_page=1;getComments()}})}
function getComments(){jQuery.ajax({url:commentUrl(comment_page++,answer_ids),method:"get",dataType:"jsonp",crossDomain:!0,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=(function(){var headerTag=String.raw `h\d`
var score=String.raw `\-?\d+\.?\d*`
var normalText=String.raw `[^\n<>]*`
var strikethrough=String.raw `<s>${normalText}</s>|<strike>${normalText}</strike>|<del>${normalText}</del>`
var noDigitText=String.raw `[^\n\d<>]*`
var htmlTag=String.raw `<[^\n<>]+>`
return new RegExp(String.raw `<${headerTag}>`+String.raw `\s*([^\n,]*[^\s,]),.*?`+String.raw `(${score})`+String.raw `(?=`+String.raw `${noDigitText}`+String.raw `(?:(?:${strikethrough}|${htmlTag})${noDigitText})*`+String.raw `</${headerTag}>`+String.raw `)`)})();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;lang=jQuery(''+a.language+'').text().toLowerCase();languages[lang]=languages[lang]||{lang:a.language,user:a.user,size:a.size,link:a.link,uniq:lang}});var langs=[];for(var lang in languages)
if(languages.hasOwnProperty(lang))
langs.push(languages[lang]);langs.sort(function(a,b){if(a.uniq>b.uniq)return 1;if(a.uniq<b.uniq)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;float:left}#language-list{padding:10px;float:left}table thead{font-weight:700}table td{padding:5px}</code>```

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

Winners by Language

Language	User	Score

Leaderboard

	Author	Language	Size

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

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

 ```

Body:
Aubergine, 21 bytes

-a1+a1=oA=Bi-BA:bB=ia

This program ends with a trailing tab character.


答:
Mathematica, 64 bytes

```<code>And@@PalindromeQ/@FixedPointList[#/FactorInteger[#][[-1,1]]&,#]&
</code>```

Unnamed function, returning True or False. Forms a list by starting at the input, then iterating the function "me divided by my largest prime factor" until the output doesn't change. (Fortunately, Mathematica now thinks the largest prime factor of 1 is 1.) Then tests whether the list entries are palindromes (yay built-ins! boo function name length!) and Ands them all together.

Title: Find the super palindromes!

Body:
Mathematica, 64 bytes

And@@PalindromeQ/@FixedPointList[#/FactorInteger[#][[-1,1]]&,#]&

Unnamed function, returning True or False. Forms a list by starting at the input, then iterating the function "me divided by my largest prime factor" until the output doesn't change. (Fortunately, Mathematica now thinks the largest prime factor of 1 is 1.) Then tests whether the list entries are palindromes (yay built-ins! boo function name length!) and Ands them all together.


答:
Racket 238 bytes

```<code>(define(p n)(=(string->number(list->string(reverse(string->list(number->string n)))))n))
(if(= n 1)#t(begin(let o((n n))(define pd(prime-divisors n))(if(null? pd)#f(begin(let((m(/ n(last pd))))
(cond[(= m 1)#t][(p m)(o m)][else #f])))))))
</code>```

Ungolfed:

```<code>(define (f n)
  (define (palin? n)                      ; define palindrome of number
    (=(string->number
       (list->string
        (reverse
         (string->list
          (number->string n)))))
      n))
  (if(= n 1)#t
     (begin
       (let loop ((n n))
         (define pd (prime-divisors n))   ; find prime divisors
         (if (null? pd) #f                ; end if none- not superpalindrome
             (begin
               (let ((m (/ n (last pd)))) ; divide by largest prime divisor
                 (cond                    ; test quotient
                   [(= m 1) #t]           ; end if 1: super-palindrome found
                   [(palin? m) (loop m)]  ; loop with quotient if palindrome
                   [else #f]              ; end if not palindrome
                   ))))))))
</code>```

Testing:

```<code>(f 1)
(f 101)
(f 121)
(f 282)
(f 313)
(f 353)
(f 373)
(f 393)
(f 474)
(f 737)
(f 919)
(f 959)
(f 1331)
(f 1441)
(f 2882)
(f 6446)
(f 7887)
(f 8668)
(f 9559)
(f 9779)
(f 99999999)
</code>```

Output:

```<code>#t
#t
#t
#t
#t
#t
#t
#t
#t
#t
#t
#t
#t
#t
#t
#t
#t
#t
#t
#t
#t
</code>```

Title: Find the super palindromes!

Body:
Racket 238 bytes

(define(p n)(=(string->number(list->string(reverse(string->list(number->string n)))))n))
(if(= n 1)#t(begin(let o((n n))(define pd(prime-divisors n))(if(null? pd)#f(begin(let((m(/ n(last pd))))
(cond[(= m 1)#t][(p m)(o m)][else #f])))))))

Ungolfed:

(define (f n)
  (define (palin? n)                      ; define palindrome of number
    (=(string->number
       (list->string
        (reverse
         (string->list
          (number->string n)))))
      n))
  (if(= n 1)#t
     (begin
       (let loop ((n n))
         (define pd (prime-divisors n))   ; find prime divisors
         (if (null? pd) #f                ; end if none- not superpalindrome
             (begin
               (let ((m (/ n (last pd)))) ; divide by largest prime divisor
                 (cond                    ; test quotient
                   [(= m 1) #t]           ; end if 1: super-palindrome found
                   [(palin? m) (loop m)]  ; loop with quotient if palindrome
                   [else #f]              ; end if not palindrome
                   ))))))))

Testing:

(f 1)
(f 101)
(f 121)
(f 282)
(f 313)
(f 353)
(f 373)
(f 393)
(f 474)
(f 737)
(f 919)
(f 959)
(f 1331)
(f 1441)
(f 2882)
(f 6446)
(f 7887)
(f 8668)
(f 9559)
(f 9779)
(f 99999999)

Output:

#t
#t
#t
#t
#t
#t
#t
#t
#t
#t
#t
#t
#t
#t
#t
#t
#t
#t
#t
#t
#t


问:
Balanced triplet brackets
A "triplet bracket" (that I made up for this challenge) is one of the following:

```<code>(...+...)
[...:...]
{...|...}
<...-...>
</code>```

A balanced triplet bracket string (BTBS for short) is either an empty string, two BTBSes concatenated, or one of the above triplet brackets with each ... replaced with a BTBS.

Your task is to write a program or function that checks whether a string that consists of only (+)[:]{|}<-> is balanced. Shortest code wins.

Examples

Your program should return truthy for the following strings:

```<code>(+)(+)(+)
[[[:]:]:(+(+))]{<->|<(+)->[:]}(+)
<<<<<<<<<<<<->->->->->->->->->->->->
{|(+[:<-{|(+[:<->])}>])}
[[[:]:[:]]:[[:]:[:]]]
{[:](+)|<->{|}}[(+)<->:{|}(+)]
</code>```

Your program should return falsy for the following strings:

```<code>:[
<|>
(+(+)
[:][:](+[[:]):]
{|{|{|(+{|{|{|}}}}}+)}[:]{|}
{{||}}
<<->-<->-<->>
[(+):((+)+)+(+(+))]
<<<<<->->->->->->
</code>```

答:
Pip, 26 bytes

```<code>L#aaR:"(+)[:]{|}<->"<>3x!a
</code>```

Try it online!

Loops len(a) times, replacing all occurrences of empty triplet brackets ("(+)[:]{|}<->"<>3, where <> is the "group" operator, => ["(+)"; "[:]"; "{|}"; "<->"]) with empty string (x). This many iterations is overkill, but it will always be more than enough to completely reduce all properly formed triplet brackets to nothing. After the loop completes, outputs !a: 0 if a is truthy (still has some characters), 1 if a is falsey (empty).

Title: Balanced triplet brackets

Body:
Pip, 26 bytes

L#aaR:"(+)[:]{|}<->"<>3x!a

Try it online!

Loops len(a) times, replacing all occurrences of empty triplet brackets ("(+)[:]{|}<->"<>3, where <> is the "group" operator, => ["(+)"; "[:]"; "{|}"; "<->"]) with empty string (x). This many iterations is overkill, but it will always be more than enough to completely reduce all properly formed triplet brackets to nothing. After the loop completes, outputs !a: 0 if a is truthy (still has some characters), 1 if a is falsey (empty).


答:
Java, 190 bytes

Edit:

-6 bytes off. Thanks to @Frozn

-1 byte off. Thanks to myself :)

-1 byte off. Also spotted some mistakes. Thanks to @Kevin Cruijssen

Snipet

```<code>c->{for(int x,y,j,i=-1;++i<c.length;)for(j=-1;++j<c[0].length;){if(c[i][j]<33){c[i][j]=48;for(x=i-2;++x<i+2;)for(y=j-2;++y<j+2;)try{if(c[x][y]==43)c[i][j]++;}catch(Exception e){}}}return c;}
</code>```

Ungolfed:

```<code>public class Main{
  public static char[][] minesweeper(char[][] woclues){
    for(int i = 0; i < woclues.length ; i++){
      for(int j = 0; j < woclues[0].length ; j++){
        if( woclues[i][j] == ' '){
          woclues[i][j] = '0';
          for(int x = i - 1; x < i + 2 ; x++){
            for(int y = j - 1; y < j + 2 ; y++){
              try{
                if(woclues[x][y] == '*'){
                  woclues[i][j]++;
                }
              }catch( ArrayIndexOutOfBoundsException e){}
            }
          }
        }
      }
    }
    return woclues;
  }
  public static void main(String[]args){
    char[][] in = new char[args.length][args[0].length()];
    for(int i = 0; i < args.length;i++){
      in[i]=args[i].toCharArray();
    }
    for(char[] c:minesweeper(in)){
      System.out.println(new String(c));
    }
  }
}
</code>```

Ideone it.

Title: Fill in the Minesweeper clues

Body:
Minesweeper is a popular puzzle game where you must discover which tiles are "mines" without clicking on those tiles. Each tile is either a mine (represented by *) or a clue, i.e. a number from 0 to 8 representing how many of the 8 neighboring tiles are mines. Your task today is to take a board containing the mines and fill in all of the clues. For example, look at the following 5x4 board, with 5 mines:

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

After filling in the clues, the board will look like this:

```<code>2*211
*33*1
12*32
0112*
</code>```

Details

You must write either a full-program or a function that takes in a grid of characters containing only spaces and asterisks and outputs another grid where each space is replaced with the number of adjacent mines (asterisks). Any of these are acceptable formats for your grids:

A string with newlines in it

A 2D list of characters/single character strings

A list of strings

You can assume the grid will be at least 1x1, although it is possible for it to be all mines or all spaces.

The input grid will always be padded with the appropriate number of spaces. As usual, this is code-golf, so standard loopholes apply and the shortest answer in bytes wins!

Sample IO

So that you can see the whitespace, I will show all sample IO with brackets around it.

```<code>Input:
[    * ]
[*     ]
[      ]
[      ]
[  **  ]
[ *  * ]

Output:
[1101*1]
[*10111]
[110000]
[012210]
[12**21]
[1*33*1]

Input:
[****]
[****]

Output:
[****]
[****]

Input:
[   ]
[   ]
[   ]
[   ]

Output:
[000]
[000]
[000]
[000]

Input:
[*   ]
[**  ]
[    ]
[   *]

Ouput:
[*310]
[**10]
[2221]
[001*]

Input:
[**    ]
[*    *]
[  *   ]
[      ]
[*     ]
[****  ]

Output:
[**1011]
[*4211*]
[12*111]
[121100]
[*43210]
[****10]

Input:
[     *    ]
[        * ]
[     *    ]
[**   ***  ]
[      *** ]
[          ]
[       ** ]
[  * *     ]
[*      ** ]
[       ** ]

Output:
[00001*1111]
[00002221*1]
[22102*4321]
[**102***31]
[221013***1]
[0000013542]
[0112111**1]
[12*2*12442]
[*212112**2]
[1100002**2]
</code>```

Body:
Java, 190 bytes

Edit:

-6 bytes off. Thanks to @Frozn

-1 byte off. Thanks to myself :)

-1 byte off. Also spotted some mistakes. Thanks to @Kevin Cruijssen

Snipet

c->{for(int x,y,j,i=-1;++i<c.length;)for(j=-1;++j<c[0].length;){if(c[i][j]<33){c[i][j]=48;for(x=i-2;++x<i+2;)for(y=j-2;++y<j+2;)try{if(c[x][y]==43)c[i][j]++;}catch(Exception e){}}}return c;}

Ungolfed:

public class Main{
  public static char[][] minesweeper(char[][] woclues){
    for(int i = 0; i < woclues.length ; i++){
      for(int j = 0; j < woclues[0].length ; j++){
        if( woclues[i][j] == ' '){
          woclues[i][j] = '0';
          for(int x = i - 1; x < i + 2 ; x++){
            for(int y = j - 1; y < j + 2 ; y++){
              try{
                if(woclues[x][y] == '*'){
                  woclues[i][j]++;
                }
              }catch( ArrayIndexOutOfBoundsException e){}
            }
          }
        }
      }
    }
    return woclues;
  }
  public static void main(String[]args){
    char[][] in = new char[args.length][args[0].length()];
    for(int i = 0; i < args.length;i++){
      in[i]=args[i].toCharArray();
    }
    for(char[] c:minesweeper(in)){
      System.out.println(new String(c));
    }
  }
}

Ideone it.


答:
Racket 415 bytes

```<code>(let*((l(string->list s))(g (λ(r c)(if(or(>= r n)(>= c n)(< r 0)(< c 0))#f(list-ref l(+ c(* n r))))))(ng (λ(r c)(let*((h'(-1 0 1))(k(filter(λ(x)x)
(for*/list((i h)(j h)#:unless(= 0 i j))(g(+ r i)(+ c j))))))(count(λ(x)(equal? x #\*))k))))(k(for*/list((i n)(j n))(ng i j)))
(ol(map(λ(x y)(if(equal? x #\*)"*"(number->string y)))l k)))(for((i(* n n))(j ol))(display j)(when(= 0(modulo(add1 i)n))(displayln ""))))
</code>```

Ungolfed:

```<code>(define (f s n)
  (let* ((l (string->list s))
         (get                            ; fn to get value at a (row, col)
          (lambda(r c)                   ; #f if invalid row or col
            (if (or (>= r n)
                    (>= c n)
                    (< r 0)
                    (< c 0))
                #f (list-ref l (+ c (* n r))))))

         (neighbors                      ; fn to count neighboring "*"
          (lambda(r c)
            (let* ((h '(-1 0 1))
                   (u (filter
                       (lambda(x) x)
                       (for*/list ((i h)(j h)
                                   #:unless (= 0 i j))
                         (get (+ r i) (+ c j))))))
              (count (lambda(x)(equal? x #\*)) u))))

         (k (for*/list ((i n) (j n))    ; for each row,col count neighboring "*"
              (neighbors i j)))
         (ol(map (lambda(x y)           ; get outlist- replace blanks with neighboring star count
                   (if(equal? x #\*)
                      "*"
                      (number->string y)))
                 l k)))

    (for ((i (* n n))(j ol))            ; display outlist
      (display j)
      (when (= 0 (modulo (add1 i) n))
        (displayln "")))))
</code>```

Testing (lists as a single string with column number specified; will also work with spaces):

```<code>(f "----*-*-------------------**---*--*-" 6)
</code>```

Output:

```<code>1101*1
*10111
110000
012210
12**21
1*33*1
</code>```

Title: Fill in the Minesweeper clues

Body:
Racket 415 bytes

(let*((l(string->list s))(g (λ(r c)(if(or(>= r n)(>= c n)(< r 0)(< c 0))#f(list-ref l(+ c(* n r))))))(ng (λ(r c)(let*((h'(-1 0 1))(k(filter(λ(x)x)
(for*/list((i h)(j h)#:unless(= 0 i j))(g(+ r i)(+ c j))))))(count(λ(x)(equal? x #\*))k))))(k(for*/list((i n)(j n))(ng i j)))
(ol(map(λ(x y)(if(equal? x #\*)"*"(number->string y)))l k)))(for((i(* n n))(j ol))(display j)(when(= 0(modulo(add1 i)n))(displayln ""))))

Ungolfed:

(define (f s n)
  (let* ((l (string->list s))
         (get                            ; fn to get value at a (row, col)
          (lambda(r c)                   ; #f if invalid row or col
            (if (or (>= r n)
                    (>= c n)
                    (< r 0)
                    (< c 0))
                #f (list-ref l (+ c (* n r))))))

         (neighbors                      ; fn to count neighboring "*"
          (lambda(r c)
            (let* ((h '(-1 0 1))
                   (u (filter
                       (lambda(x) x)
                       (for*/list ((i h)(j h)
                                   #:unless (= 0 i j))
                         (get (+ r i) (+ c j))))))
              (count (lambda(x)(equal? x #\*)) u))))

         (k (for*/list ((i n) (j n))    ; for each row,col count neighboring "*"
              (neighbors i j)))
         (ol(map (lambda(x y)           ; get outlist- replace blanks with neighboring star count
                   (if(equal? x #\*)
                      "*"
                      (number->string y)))
                 l k)))

    (for ((i (* n n))(j ol))            ; display outlist
      (display j)
      (when (= 0 (modulo (add1 i) n))
        (displayln "")))))

Testing (lists as a single string with column number specified; will also work with spaces):

(f "----*-*-------------------**---*--*-" 6)

Output:

1101*1
*10111
110000
012210
12**21
1*33*1


答:
Python 2, <s>99</s> 81 bytes

```<code>from unicodedata import*
i=913
exec"print name(unichr(i+(i>929)))[21:],;i+=1;"*24
</code>```

Thanks to @xnor for saving 15 bytes!

This uses the unicodedata.name() method
 to get the name of every character. Unfortunately, the code point 930 gives an error for some reason, so that cost a few extra bytes.

This also prints the output in uppercase, which is allowed.

Title: Print the Greek alphabet in words

Body:
This is different from Print the Greek alphabet! because it is in words.

This is different from "Hello, World!" because the output is different and much longer, leading to different techniques.

This is different from We're no strangers to code golf, you know the rules, and so do I because the output is different and much shorter, leading to different techniques.

Your task is to print this exact text: (the Greek alphabet in words)

```<code>alpha beta gamma delta epsilon zeta eta theta iota kappa lambda mu nu xi omicron pi rho sigma tau upsilon phi chi psi omega
</code>```

Capitalization does not matter.

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

Body:
Python 2, <s>99</s> 81 bytes

from unicodedata import*
i=913
exec"print name(unichr(i+(i>929)))[21:],;i+=1;"*24

Thanks to @xnor for saving 15 bytes!

This uses the unicodedata.name() method
 to get the name of every character. Unfortunately, the code point 930 gives an error for some reason, so that cost a few extra bytes.

This also prints the output in uppercase, which is allowed.