问:
"Hello, World!"
So... uh... this is a bit embarrassing. But we don't have a plain "Hello, World!" challenge yet (despite having 35 variants tagged with hello-world, and counting). While this is not the most interesting code golf in the common languages, finding the shortest solution in certain esolangs can be a serious challenge. For instance, to my knowledge it is not known whether the shortest possible Brainfuck solution has been found yet.

Furthermore, while all of <s>Wikipedia</s> (the Wikipedia entry has been deleted but there is a copy at archive.org
), esolangs and Rosetta Code have lists of "Hello, World!" programs, none of these are interested in having the shortest for each language (there is also this GitHub repository). If we want to be a significant site in the code golf community, I think we should try and create the ultimate catalogue of shortest "Hello, World!" programs (similar to how our basic quine challenge contains some of the shortest known quines in various languages). So let's do this!

The Rules

Each submission must be a full program.

The program must take no input, and print Hello, World! to STDOUT (this exact byte stream, including capitalization and punctuation) plus an optional trailing newline, and nothing else.

The program must not write anything to STDERR.

If anyone wants to abuse this by creating a language where the empty program prints Hello, World!, then congrats, they just paved 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.

Submissions are scored in bytes, in an appropriate (pre-existing) encoding, usually (but not necessarily) UTF-8. Some languages, like Folders, are a bit tricky to score - if in doubt, please ask on Meta.

This is not about finding the language with the shortest "Hello, World!" program. This is about finding the shortest "Hello, World!" program in every language. Therefore, I will not mark any answer as "accepted".

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 Alphuck), consider adding a note to the existing answer that the same or a very similar solution is also the shortest in the other language.

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 catalogue as complete as possible. However, do primarily upvote answers in languages where the authors actually had to put effort into golfing the code.

For inspiration, check the Hello World Collection.

The Catalogue

The Stack Snippet at the bottom of this post generates the catalogue 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>## [><>](https://esolangs.org/wiki/Fish), 121 bytes
</code>```

/* Configuration */

var QUESTION_ID = 55422; // 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 = 8478; // This should be the user ID of the challenge author.

/* App */

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

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

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

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

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

getAnswers();

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

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

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

function process() {
  var valid = [];

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

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

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

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

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

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

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

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

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

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

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

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

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

table thead {
  font-weight: bold;
}

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

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

Shortest Solution by Language

Language	User	Score

Leaderboard

	Author	Language	Size

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

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

```

答:
Pylongolf, 16 bytes

```<code>"Hello, World!"~
</code>```

Push Hello, World! into the stack then print it.

Title: "Hello, World!"

Body:
Pylongolf, 16 bytes

"Hello, World!"~

Push Hello, World! into the stack then print it.


答:
dc - 21 chars

```<code>[3z202>xO200^|]dsxxrp
</code>```

This takes about a minute on my computer, and would take lots longer for values larger than 200. It doesn't output leading zeroes.

Here's a slightly longer but faster version (26 chars):

```<code>[3rAz^|dz205>x]dsxxAz6-^%p
3[3rAz^|dz202>x]dsxxAz3-^%p # or an extra character for a few less iterations
</code>```

ContentLicense: CC BY-SA 2.5

Title: Calculate the last digits of Graham's Number

Body:
Graham's number ends in a 7. It is a massive number, in theory requiring more information to store than the size of the universe itself. However it is possible to calculate the last few digits of Graham's number.

The last few digits are:

```<code>02425950695064738395657479136519351798334535362521
43003540126026771622672160419810652263169355188780
38814483140652526168785095552646051071172000997092
91249544378887496062882911725063001303622934916080
25459461494578871427832350829242102091825896753560
43086993801689249889268099510169055919951195027887
17830837018340236474548882222161573228010132974509
27344594504343300901096928025352751833289884461508
94042482650181938515625357963996189939679054966380
03222348723967018485186439059104575627262464195387
</code>```

Your program may not contain these (or similar numbers), but must calculate them. It must calculate 200 digits or more.

Output to stdout. Running time of a maximum of 2 minutes on decent hardware. Shortest program wins.

Body:
dc - 21 chars

[3z202>xO200^|]dsxxrp

This takes about a minute on my computer, and would take lots longer for values larger than 200. It doesn't output leading zeroes.

Here's a slightly longer but faster version (26 chars):

[3rAz^|dz205>x]dsxxAz6-^%p
3[3rAz^|dz202>x]dsxxAz3-^%p # or an extra character for a few less iterations


问:
A simple TCP server
Write a program or function that listens for incoming TCP traffic on port N. It offers a simple service: it calculates sum of IP address fields of incoming connection and returns.

Program or function reads integer N from arguments or stdin. It listens to incoming TCP connections on port N. When someone connects to that port, the program calculates sum of its IP address fields and sends it back to the client with trailing newline and closes connection.

Port number N is a valid port, and 210 < N < 215

Trailing newline can be either \nor \r\n

You can use either IPv4 or IPv6. Since IPv6 addresses are written in hexadecimal form, you must also provide result in same format, for example 2001:0db8:0000:0042:0000:8a2e:0370:7334 => 12ecd.

This is code-golf. Standard rules and loopholes apply.

Example

You run your server with ./server 1234. The server is now running and waiting for connections on port 1234. Then a client from 127.0.0.1 connects to your server. Your server performs a simple calculation: 127+0+0+1 => 128 and sends the result to the client (with trailing newline): 128\n. Then server closes connection and waits for next client.

Leaderboard

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

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

Leaderboard

	Author	Language	Size

Winners by Language

Language	User	Score

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

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

```

答:
Go, 211 bytes

```<code>package main
import(."fmt"
."net"
"os")
func main(){s,_:=Listen("tcp4",":"+os.Args[1])
for{c,_:=s.Accept()
var a,b,d,e int
Sscanf(Sprint(c.RemoteAddr()),"%d.%d.%d.%d",&a,&b,&d,&e)
Fprintln(c,a+b+d+e)
c.Close()}}
</code>```

Can probably be golfed further, I'm not entirely satisfied with the way I have to parse the IP adress for instance, it looks like a horrible hack.

Listens on IPv4 on the port given as argument.

ContentLicense: CC BY-SA 3.0

Title: A simple TCP server

Body:
Go, 211 bytes

package main
import(."fmt"
."net"
"os")
func main(){s,_:=Listen("tcp4",":"+os.Args[1])
for{c,_:=s.Accept()
var a,b,d,e int
Sscanf(Sprint(c.RemoteAddr()),"%d.%d.%d.%d",&a,&b,&d,&e)
Fprintln(c,a+b+d+e)
c.Close()}}

Can probably be golfed further, I'm not entirely satisfied with the way I have to parse the IP adress for instance, it looks like a horrible hack.

Listens on IPv4 on the port given as argument.


问:
Identify arborally satisfied point sets
An arborally satisfied point set is a 2D set of points such that, for any axis-aligned rectangle that can be formed using two points in the set as opposite corners, that rectangle contains or touches at least one other point.  Here is an equivalent definition from Wikipedia:

A point set is said to be arborally satisfied if the following property holds: for any pair of points that do not both lie on the same horizontal or vertical line, there exists a third point which lies in the rectangle spanned by the first two points (either inside or on the boundary).

The following image illustrates how the rectangles are formed.  This point set is NOT arborally satisfied because this rectangle needs to contain at least one more point.

In ASCII art, this point set can be represented as:

```<code>......
....O.
......
.O....
......
</code>```

A slight modification can make this arborally satisfied:

```<code>......
....O.
......
.O..O.
......
</code>```

Above, you can see that all rectangles (of which there is only one) contain at least three points.

Here is another example of a more complex point set that is arborally satisfied:

For any rectangle that can be drawn spanning two points, that rectangle contains at least one other point.

The Challenge

Given a rectangular grid of points (which I represent with O) and empty space (which I represent with .), output a truthy value if it is arborally satisfied, or a falsey value if it is not.  This is code-golf.

Additional rules:

You can choose to have the characters O and . swapped out with any other pair of printable ASCII characters.  Simply specify which character mapping your program uses.

The grid will always be rectangular.  A trailing newline is allowable.

More Examples

Arborally satisfied:

```<code>.OOO.
OO...
.O.OO
.O..O
....O

..O..
OOOO.
...O.
.O.O.
...OO

O.O.
..O.
OOOO
.O.O
OO..

...
...
...

...
..O
...

O.....
O.O..O
.....O

OOO.OO
</code>```

Not Arborally Satisfied:

```<code>..O..
O....
...O.
.O...
....O

..O..
O.OO.
...O.
.O.O.
...OO

O.....
..O...
.....O
</code>```

答:
Snails, 29 <s>30 39</s> bytes

```<code>!{t\Oo\.+c\.,\O!{t\O{w!(.,~}2
</code>```

It works by tracing out 2 sides of the rectangle, and then checking whether there is some square containing an O such that traveling in a straight line from the square in 2 of the cardinal directions would result in hitting a side of the rectangle.

Prints the maximum of 1 and the grid's area if the input is "arborally satisfied"; otherwise 0.

Title: Identify arborally satisfied point sets

Body:
Snails, 29 <s>30 39</s> bytes

!{t\Oo\.+c\.,\O!{t\O{w!(.,~}2

It works by tracing out 2 sides of the rectangle, and then checking whether there is some square containing an O such that traveling in a straight line from the square in 2 of the cardinal directions would result in hitting a side of the rectangle.

Prints the maximum of 1 and the grid's area if the input is "arborally satisfied"; otherwise 0.


问:
Parse a Quaternion
If you don't know already, a quaternion is basically a 4-part number. For the purposes of this challenge, it has a real component and three imaginary components. The imaginary components are represented by the suffix i, j, k. For example, 1-2i+3j-4k is a quaternion with 1 being the real component and -2, 3, and -4 being the imaginary components.

In this challenge you have to parse the string form of a quaternion (ex. "1+2i-3j-4k") into a list/array of coefficients (ex. [1 2 -3 -4]). However, the quaternion string can be formatted in many different ways...

It may be normal: 1+2i-3j-4k

It may have missing terms: 1-3k, 2i-4k (If you have missing terms, output 0 for those terms)

It may have missing coefficients: i+j-k (In this case, this is equivalent to 1i+1j-1k. In other words, a i, j, or k without a number in front is assumed to have a 1 in front by default)

It may not be in the right order: 2i-1+3k-4j

The coefficients may be simply integers or decimals: 7-2.4i+3.75j-4.0k

There are some things to note while parsing:

There will always be a + or - between terms

You will always be passed valid input with at least 1 term, and without repeated letters (no j-js)

All numbers can be assumed to be valid

You can change numbers into another form after parsing if you want (ex. 3.0 => 3, 0.4 => .4, 7 => 7.0)

Parsing/quaternion builtins and standard loopholes are disallowed. This includes eval keywords and functions. Input will be a single string and output will be a list, an array, values separated by whitespace, etc.

As this is code-golf, shortest code in bytes wins.

Tons o' test cases

```<code>1+2i+3j+4k             => [1 2 3 4]
-1+3i-3j+7k            => [-1 3 -3 7]
-1-4i-9j-2k            => [-1 -4 -9 -2]
17-16i-15j-14k         => [17 -16 -15 -14]

7+2i                   => [7 2 0 0]
2i-6k                  => [0 2 0 -6]
1-5j+2k                => [1 0 -5 2]
3+4i-9k                => [3 4 0 -9]

42i+j-k                => [0 42 1 -1]
6-2i+j-3k              => [6 -2 1 -3]
1+i+j+k                => [1 1 1 1]
-1-i-j-k               => [-1 -1 -1 -1]

16k-20j+2i-7           => [-7 2 -20 16]
i+4k-3j+2              => [2 1 -3 4]
5k-2i+9+3j             => [9 -2 3 5]
5k-2j+3                => [3 0 -2 5]

1.75-1.75i-1.75j-1.75k => [1.75 -1.75 -1.75 -1.75]
2.0j-3k+0.47i-13       => [-13 0.47 2.0 -3] or [-13 .47 2 -3]
5.6-3i                 => [5.6 -3 0 0]
k-7.6i                 => [0 -7.6 0 1]

0                      => [0 0 0 0]
0j+0k                  => [0 0 0 0]
-0j                    => [0 0 0 0] or [0 0 -0 0]
1-0k                   => [1 0 0 0] or [1 0 0 -0]
</code>```

答:
PowerShell, 178 bytes

param($a);$p="(-?)([\d.]+)?";$g={param($s)if($a-match"$p$s"){if(($r=$matches)[2]){$r[1]+$r[2]}else{$r[1]+1}}else{0}};$a-match"$p(\+|-|$)">$null;+$matches[2];"i","j","k"|%{&$g $_}
```
<hr />
<p><strong>Ungolfed with Explanation</strong></p>
<pre class="lang-ps prettyprint-override"><code># Get the whole string into a variable
param($a)
# Pattern shared getting both imaginary and real numbers.
$p="(-?)([\d.]+)?"
# Anonymous function that will locate a imaginary number using a letter sent as a parameter.
# If no value is assigned a signed 1 is returned. If no value is matched 0 is returned
$g={param($s)if($a-match"$p$s"){if(($r=$matches)[2]){$r[1]+$r[2]}else{$r[1]+1}}else{0}}
# Locate the real component if any. Null is converted to 0
$a-match"$p(\+|-|$)">$null;+$matches[2]
# Call the anonymous function using each of the imaginary suffixes.
"i","j","k"|%{&$g $_}
</code>```

Not super impressed but it is a result nonetheless.

Title: Parse a Quaternion

Body:
PowerShell, 178 bytes

param($a);$p="(-?)([\d.]+)?";$g={param($s)if($a-match"$p$s"){if(($r=$matches)[2]){$r[1]+$r[2]}else{$r[1]+1}}else{0}};$a-match"$p(\+|-|$)">$null;+$matches[2];"i","j","k"|%{&$g $_}

Ungolfed with Explanation

# Get the whole string into a variable
param($a)
# Pattern shared getting both imaginary and real numbers.
$p="(-?)([\d.]+)?"
# Anonymous function that will locate a imaginary number using a letter sent as a parameter.
# If no value is assigned a signed 1 is returned. If no value is matched 0 is returned
$g={param($s)if($a-match"$p$s"){if(($r=$matches)[2]){$r[1]+$r[2]}else{$r[1]+1}}else{0}}
# Locate the real component if any. Null is converted to 0
$a-match"$p(\+|-|$)">$null;+$matches[2]
# Call the anonymous function using each of the imaginary suffixes.
"i","j","k"|%{&$g $_}

Not super impressed but it is a result nonetheless.


答:
PHP, 1123 bytes, 851 bytes, 657 bytes

(newbie php)

```<code><?php
$B=array_map("str_split",array_map("trim",file('F')));$a=[];$b=-1;foreach($B as $c=>$C){foreach($C as $d=>$Z){if($Z=='O'){$a[++$b][]=$c;$a[$b][]=$d;}}}$e=array();foreach($a as $f=>$l){foreach($a as $g=>$m){$h=$l[0];$i=$l[1];$j=$m[0];$k=$m[1];if($h!=$j&&$i!=$k&&!(in_array([$g,$f],$e,1)))$e[]=[$f,$g];}}$A=array();foreach($e as $E){$n=$E[0];$o=$E[1];$q=$a[$n][0];$s=$a[$n][1];$r=$a[$o][0];$t=$a[$o][1];$u=($q<$r)?$q:$r;$v=($s<$t)?$s:$t;$w=($q>$r)?$q:$r;$X=($s>$t)?$s:$t;$Y=0;foreach($a as $p){$x=$p[0];$y=$p[1];if($x>=$u&&$x<=$w&&$y>=$v&&$y<=$X){$Y=($x==$q&&$y==$s)||($x==$r&&$y==$t)?0:1;}if($Y==1)break;}if($Y==1)$A[]=1;}echo count($A)==count($e)?1:0;
</code>```

explaination (commented code) :

```<code><?php
//read the file
$lines=array_map("str_split",array_map("trim",file('F'))); // grid in file 'F'

//saving coords
$coords=[]; // new array
$iCoord=-1;
foreach($lines as $rowIndex=>$line) {
    foreach($line as $colIndex=>$value) {
        if ($value=='O'){
            $coords[++$iCoord][]=$rowIndex;//0 is x
            $coords[$iCoord][]=$colIndex;  //1 is y
        }
    }
}

/* for each point, draw as many rectangles as other points
 * without creating 'mirror' rectangles
 */
$rectangles=array();

foreach ($coords as $point1Index=>$point1) {
     //draw
     foreach ($coords as $point2Index=>$point2) {
            $point1X=$point1[0];
            $point1Y=$point1[1];
            $point2X=$point2[0];
            $point2Y=$point2[1];
            //if not on the same line or on the same column, ...
            if ($point1X!=$point2X &&   // same line
                $point1Y!=$point2Y &&   // same column
                !(in_array([$point2Index,$point1Index],$rectangles,true)) //... and if no 'mirror one' already
             ) $rectangles[]=[$point1Index,$point2Index]; //create a new rectangle
     }
 }

//now that we have rectangles and coords
//try and put a third point into each
$tests=array();
foreach ($rectangles as $rectangle) {
    $pointA=$rectangle[0];    // points of the rectangle
    $pointB=$rectangle[1];    // __________"____________
    $xA=$coords[$pointA][0];
    $yA=$coords[$pointA][1];
    $xB=$coords[$pointB][0];
    $yB=$coords[$pointB][1];
    $minX=($xA<$xB)?$xA:$xB;
    $minY=($yA<$yB)?$yA:$yB;
    $maxX=($xA>$xB)?$xA:$xB;
    $maxY=($yA>$yB)?$yA:$yB;

    $arborally=false;
    foreach ($coords as $point) {
        $x=$point[0];
        $y=$point[1];
        if ($x>=$minX &&
            $x<=$maxX &&
            $y>=$minY &&
            $y<=$maxY) {
                $arborally=($x==$xA&&$y==$yA) || ($x==$xB&&$y==$yB)?0:1; //same point (pointA or pointB)
        }
        if ($arborally==true) break;//1 found, check next rectangle
    }
    if ($arborally==true) $tests[]=1;//array of successes

}

echo count($tests)==count($rectangles)?1:0; //if as many successes than rectangles...

?>
</code>```

Title: Identify arborally satisfied point sets

Body:
An arborally satisfied point set is a 2D set of points such that, for any axis-aligned rectangle that can be formed using two points in the set as opposite corners, that rectangle contains or touches at least one other point.  Here is an equivalent definition from Wikipedia:

A point set is said to be arborally satisfied if the following property holds: for any pair of points that do not both lie on the same horizontal or vertical line, there exists a third point which lies in the rectangle spanned by the first two points (either inside or on the boundary).

The following image illustrates how the rectangles are formed.  This point set is NOT arborally satisfied because this rectangle needs to contain at least one more point.

In ASCII art, this point set can be represented as:

```<code>......
....O.
......
.O....
......
</code>```

A slight modification can make this arborally satisfied:

```<code>......
....O.
......
.O..O.
......
</code>```

Above, you can see that all rectangles (of which there is only one) contain at least three points.

Here is another example of a more complex point set that is arborally satisfied:

For any rectangle that can be drawn spanning two points, that rectangle contains at least one other point.

The Challenge

Given a rectangular grid of points (which I represent with O) and empty space (which I represent with .), output a truthy value if it is arborally satisfied, or a falsey value if it is not.  This is code-golf.

Additional rules:

You can choose to have the characters O and . swapped out with any other pair of printable ASCII characters.  Simply specify which character mapping your program uses.

The grid will always be rectangular.  A trailing newline is allowable.

More Examples

Arborally satisfied:

```<code>.OOO.
OO...
.O.OO
.O..O
....O

..O..
OOOO.
...O.
.O.O.
...OO

O.O.
..O.
OOOO
.O.O
OO..

...
...
...

...
..O
...

O.....
O.O..O
.....O

OOO.OO
</code>```

Not Arborally Satisfied:

```<code>..O..
O....
...O.
.O...
....O

..O..
O.OO.
...O.
.O.O.
...OO

O.....
..O...
.....O
</code>```

Body:
PHP, 1123 bytes, 851 bytes, 657 bytes

(newbie php)

<?php
$B=array_map("str_split",array_map("trim",file('F')));$a=[];$b=-1;foreach($B as $c=>$C){foreach($C as $d=>$Z){if($Z=='O'){$a[++$b][]=$c;$a[$b][]=$d;}}}$e=array();foreach($a as $f=>$l){foreach($a as $g=>$m){$h=$l[0];$i=$l[1];$j=$m[0];$k=$m[1];if($h!=$j&&$i!=$k&&!(in_array([$g,$f],$e,1)))$e[]=[$f,$g];}}$A=array();foreach($e as $E){$n=$E[0];$o=$E[1];$q=$a[$n][0];$s=$a[$n][1];$r=$a[$o][0];$t=$a[$o][1];$u=($q<$r)?$q:$r;$v=($s<$t)?$s:$t;$w=($q>$r)?$q:$r;$X=($s>$t)?$s:$t;$Y=0;foreach($a as $p){$x=$p[0];$y=$p[1];if($x>=$u&&$x<=$w&&$y>=$v&&$y<=$X){$Y=($x==$q&&$y==$s)||($x==$r&&$y==$t)?0:1;}if($Y==1)break;}if($Y==1)$A[]=1;}echo count($A)==count($e)?1:0;

explaination (commented code) :

<?php
//read the file
$lines=array_map("str_split",array_map("trim",file('F'))); // grid in file 'F'

//saving coords
$coords=[]; // new array
$iCoord=-1;
foreach($lines as $rowIndex=>$line) {
    foreach($line as $colIndex=>$value) {
        if ($value=='O'){
            $coords[++$iCoord][]=$rowIndex;//0 is x
            $coords[$iCoord][]=$colIndex;  //1 is y
        }
    }
}

/* for each point, draw as many rectangles as other points
 * without creating 'mirror' rectangles
 */
$rectangles=array();

foreach ($coords as $point1Index=>$point1) {
     //draw
     foreach ($coords as $point2Index=>$point2) {
            $point1X=$point1[0];
            $point1Y=$point1[1];
            $point2X=$point2[0];
            $point2Y=$point2[1];
            //if not on the same line or on the same column, ...
            if ($point1X!=$point2X &&   // same line
                $point1Y!=$point2Y &&   // same column
                !(in_array([$point2Index,$point1Index],$rectangles,true)) //... and if no 'mirror one' already
             ) $rectangles[]=[$point1Index,$point2Index]; //create a new rectangle
     }
 }

//now that we have rectangles and coords
//try and put a third point into each
$tests=array();
foreach ($rectangles as $rectangle) {
    $pointA=$rectangle[0];    // points of the rectangle
    $pointB=$rectangle[1];    // __________"____________
    $xA=$coords[$pointA][0];
    $yA=$coords[$pointA][1];
    $xB=$coords[$pointB][0];
    $yB=$coords[$pointB][1];
    $minX=($xA<$xB)?$xA:$xB;
    $minY=($yA<$yB)?$yA:$yB;
    $maxX=($xA>$xB)?$xA:$xB;
    $maxY=($yA>$yB)?$yA:$yB;

    $arborally=false;
    foreach ($coords as $point) {
        $x=$point[0];
        $y=$point[1];
        if ($x>=$minX &&
            $x<=$maxX &&
            $y>=$minY &&
            $y<=$maxY) {
                $arborally=($x==$xA&&$y==$yA) || ($x==$xB&&$y==$yB)?0:1; //same point (pointA or pointB)
        }
        if ($arborally==true) break;//1 found, check next rectangle
    }
    if ($arborally==true) $tests[]=1;//array of successes

}

echo count($tests)==count($rectangles)?1:0; //if as many successes than rectangles...

?>


问:
Generate the Abacaba sequence
This challenge is about printing the abacaba sequence of a specific depth.

Here is a diagram of the first 5 sequences (a(N) is the abacaba sequence of depth N, upper/lowercase is just to show the pattern, this is not needed in the output of your program):

```<code>a(0) = A
a(1) = aBa
a(2) = abaCaba
a(3) = abacabaDabacaba
a(4) = abacabadabacabaEabacabadabacaba
...
a(25) = abacabadabacabaeabacabadabacabafabacabadabacabaeabacabadabacabagabacabadabacabaeabacabadabacabafabacabadabacabaeabacabadabacabahabacabadabacabaeabacabadabacabafabacabadabacabaeabacabadabacabagabacabadabacabaeabacabadabacabafabacabadabacabaeabacabadabacabaiabacabadabacabaeabacabadabacabafabacabadabacabaeabacabadabacabagabacabadabacabaeabacabadabacabafabacabadabacabaeabacabadabacabahabacabadabacabaeabacabadabacabafabacabadabacabaeabacabadabacabagabacabadabacabaeabacabadabacabafabacabadabacabaeabacabadabacabajabacabadabacabaeabacabadabacabafabacabadabacabaeabacabadabacabagabacabadabacabaeabacabadabacabafabacabadabacabaeabacabadabacabahabacabadabacabaeabacabadabacabafabacabadabacabaeabacabadabacabagabacabadabacabaeabacabadabacabafabacabadabacabaeabacabadabacabaia...
</code>```

As you can probably tell, the n'th abacaba sequence is the last one with the n'th letter and itself again added to it. (a(n) = a(n - 1) + letter(n) + a(n - 1))

Your task is to make a program or function that takes an integer and prints the abacaba sequence of that depth. The output has to be correct at least for values up to and including 15.

答:
Powershell, <s>53</s>,<s>46</s>,<s>44</s>,41 Bytes

```<code>1..$args[0]|%{}{$d+=[char]($_+96)+$d}{$d}
</code>```

Pasting into console will generate erronous output on the second run since $d is not re-initialized.

Save 2 bytes by using +=
Save 3 bytes thanks to @TimmyD

ContentLicense: CC BY-SA 4.0

Title: Generate the Abacaba sequence

Body:
Powershell, <s>53</s>,<s>46</s>,<s>44</s>,41 Bytes

1..$args[0]|%{}{$d+=[char]($_+96)+$d}{$d}

Pasting into console will generate erronous output on the second run since $d is not re-initialized.

Save 2 bytes by using +=
Save 3 bytes thanks to @TimmyD


问:
Write a palindrome that prints "Hello, World!" without using comments
Your Task: Print "Hello, World!" using a palindrome.

Simple, right?

Nope.

You have one restriction: you may not use comments.

"Comments" include

Normal // or # comments

Adding extraneous characters to a string literal

Triple-quoted string comments

Creating a string literal to hide characters

You may not use a pre-defined procedure to print "Hello, World!". (like HQ9+'s H command)

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

答:
Gogh, 31 bytes

```<code>"Hello, World!"Ƥ"!dlroW ,olleH"
</code>```

Explanation

```<code>"Hello, World!"    “ Push the string literal ”
¡                  “ Output the TOS          ”
"!dlroW ,olleH"    “ Push the string literal ”
                   “ Non-implicit output     ”
</code>```

Body:
Gogh, 31 bytes

"Hello, World!"Ƥ"!dlroW ,olleH"

Explanation

"Hello, World!"    “ Push the string literal ”
¡                  “ Output the TOS          ”
"!dlroW ,olleH"    “ Push the string literal ”
                   “ Non-implicit output     ”


答:
Stuck, 0 bytes

I think this wins? An empty program in stuck prints Hello, World!

Shamelessly stolen from this answer

Title: Write a palindrome that prints "Hello, World!" without using comments

Body:
Your Task: Print "Hello, World!" using a palindrome.

Simple, right?

Nope.

You have one restriction: you may not use comments.

"Comments" include

Normal // or # comments

Adding extraneous characters to a string literal

Triple-quoted string comments

Creating a string literal to hide characters

You may not use a pre-defined procedure to print "Hello, World!". (like HQ9+'s H command)

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


问:
Palindrome Hello, World
Your task is to create a program that prints "Greetings, Planet!" exactly to the console. Seems simple enough, right? Well, here's the trick. The code must be a palindrome, meaning it reads from right to left the same as in left to right.
Standard loopholes are NOT allowed.

答:
Fission, <s>45</s> 43 bytes

Thanks to jimmy23013 for saving 2 bytes.

```<code>;"!tenalP ,sgniteerG"R"Greetings, Planet!";
</code>```

Try it online!

R initialises an atom which moves to the right. " toggles string mode which simply prints the desired string to STDOUT before hitting ;, which destroys the atom and terminates the program. The first half is simply never executed.

Title: Palindrome Hello, World

Body:
Fission, <s>45</s> 43 bytes

Thanks to jimmy23013 for saving 2 bytes.

;"!tenalP ,sgniteerG"R"Greetings, Planet!";

Try it online!

R initialises an atom which moves to the right. " toggles string mode which simply prints the desired string to STDOUT before hitting ;, which destroys the atom and terminates the program. The first half is simply never executed.


答:
Help, WarDoq!, 1 byte

```<code>H
</code>```

Print Hello, World!.

Body:
Help, WarDoq!, 1 byte

H

Print Hello, World!.


答:
Bash, 47 bytes

```<code>echo Hello, World!
exit
tixe
!dlroW, olleH ohce
</code>```

Body:
Bash, 47 bytes

echo Hello, World!
exit
tixe
!dlroW, olleH ohce


问:
Express a number with only 0-9 and the four operations

Explanation

Befunge is a two-dimensional program that uses stacks.

That means, to do 5 + 6, you write 56+, meaning:

```<code>56+
5    push 5 into stack
 6   push 6 into stack
  +  pop the first two items in the stack and add them up, and push the result into stack

(to those of you who do not know stacks, "push" just means add and "pop" just means take off)
</code>```

However, as the intelligent of you have observed, we cannot push the number 56 directly into the stack.

To do so, we must write 78* instead, which multiplies 7 and 8 and pushes the product into the stack.

Details

Input can be taken in any format, meaning it can be STDIN or not, at the programmer's discretion.

The input will be a positive integer (no bonus for including 0 or negative integers).

The output will be a string consisting of only these characters: 0123456789+-*/ (I would not use % modulo.)

The goal is to find the shortest string that can represent the input, using the format described above.

For example, if the input is 123, then the output would be 67*99*+. The output should be evaluated from left to right.

If there are more than one acceptable outputs (e.g. 99*67*+ is also acceptable), any one can be printed (no bonus for printing all of them).

Further Explanation

If you still do not understand how 67*99*+ evaluates to 123, here is a detailed explanation.

```<code>stack    |operation|explanation
          67*99*+
[6]       6         push 6 to stack
[6,7]      7        push 7 to stack
[42]        *       pop two from stack and multiply, then put result to stack
[42,9]       9      push 9 to stack
[42,9,9]      9     push 9 to stack
[42,81]        *    pop two from stack and multiply, then put result to stack
[123]           +   pop two from stack and add, then put result to stack
</code>```

TL;DR

The program needs to find the shortest string that can represent the input (number), using the format specified above.

Notes

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

Disambiguation

The - can either be x-y or y-x, at the programmer's discretion. However, the choice must be consistent within the solution. Likewise for the /.

Sample program

Lua, 1862 bytes (try it online)

Since I am the author, I will not golf it at all.

Explanation:

```<code>This uses the depth-first search method.
</code>```

More about depth-first search: here.

The program:

```<code>local input = (...) or 81

local function div(a,b)
    if b == 0 then
        return "error"
    end
    local result = a/b
    if result > 0 then
        return math.floor(result)
    else
        return math.ceil(result)
    end
end

local function eval(expr)
    local stack = {}
    for i=1,#expr do
        local c = expr:sub(i,i)
        if c:match('[0-9]') then
            table.insert(stack, tonumber(c))
        else
            local a = table.remove(stack)
            local b = table.remove(stack)
            if a and b then
                if c == '+' then
                    table.insert(stack, a+b)
                elseif c == '-' then
                    table.insert(stack, b-a)
                elseif c == '*' then
                    table.insert(stack, a*b)
                elseif c == '/' then
                    local test = div(b,a)
                    if test == "error" then
                        return -1
                    else
                        table.insert(stack, a+b)
                    end
                end
            else
                return -1
            end
        end
    end
    return table.remove(stack) or -1
end

local samples, temp = {""}, {}

while true do
    temp = {}
    for i=1,#samples do
        local s = samples[i]
        table.insert(temp, s..'0')
        table.insert(temp, s..'1')
        table.insert(temp, s..'2')
        table.insert(temp, s..'3')
        table.insert(temp, s..'4')
        table.insert(temp, s..'5')
        table.insert(temp, s..'6')
        table.insert(temp, s..'7')
        table.insert(temp, s..'8')
        table.insert(temp, s..'9')
        table.insert(temp, s..'+')
        table.insert(temp, s..'-')
        table.insert(temp, s..'*')
        table.insert(temp, s..'/')
    end
    for i=1,#temp do
        if input == eval(temp[i]) then
            print(temp[i])
            return
        end
    end
    samples = temp
end
</code>```

Bonus

A cake for you if you use Befunge (or any variant of it) to write the code.

答:
Perl, <s>134</s> <s>133</s> <s>132</s> 128 bytes

Includes +5 for -Xlp (2 extra because the code contains ')

Run with the target number on STDIN:

```<code>perl -Xlp befour.pl <<< 123
</code>```

befour.pl:

```<code>@1{1..9}=1..9;$.+=2,map{for$a(%1){"+-*/"=~s%.%"\$1{\$-=$a$&$_/'$1{$a}$1{$_}$&'=~/^.{$.}\$/}||=\$&"%eegr}}%1until$\=$1{$_}}{
</code>```

It has no artificial limits and is conceptually somewhat efficient but has terrible run times nevertheless even though I sacrificed a few bytes to speed it up. Generating a length 11 solution (e.g. target number 6551) takes about 5 hours on my system.

Sacrificing 7 more bytes makes the speed somewhat more bearable.

```<code>@1{1..9}=1..9;$.+=2,map{for$a(@a){"+-*/"=~s%.%"\$1{\$-=$a$&$_/'$1{$a}$1{$_}$&'=~/^.{$.}\$/}||=\$&"%eegr}}@a=keys%1until$\=$1{$_}}{
</code>```

17 minutes for a length 11 solution, about 5 hours for a length 13 solution. The first number that needs length 15 is 16622 which takes about 2 days. The first number that needs length 17 is 73319.

Notice that it assumes that division returns an integer by truncating towards 0 (per the befunge 93 specification)

Body:
Perl, <s>134</s> <s>133</s> <s>132</s> 128 bytes

Includes +5 for -Xlp (2 extra because the code contains ')

Run with the target number on STDIN:

perl -Xlp befour.pl <<< 123

befour.pl:

@1{1..9}=1..9;$.+=2,map{for$a(%1){"+-*/"=~s%.%"\$1{\$-=$a$&$_/'$1{$a}$1{$_}$&'=~/^.{$.}\$/}||=\$&"%eegr}}%1until$\=$1{$_}}{

It has no artificial limits and is conceptually somewhat efficient but has terrible run times nevertheless even though I sacrificed a few bytes to speed it up. Generating a length 11 solution (e.g. target number 6551) takes about 5 hours on my system.

Sacrificing 7 more bytes makes the speed somewhat more bearable.

@1{1..9}=1..9;$.+=2,map{for$a(@a){"+-*/"=~s%.%"\$1{\$-=$a$&$_/'$1{$a}$1{$_}$&'=~/^.{$.}\$/}||=\$&"%eegr}}@a=keys%1until$\=$1{$_}}{

17 minutes for a length 11 solution, about 5 hours for a length 13 solution. The first number that needs length 15 is 16622 which takes about 2 days. The first number that needs length 17 is 73319.

Notice that it assumes that division returns an integer by truncating towards 0 (per the befunge 93 specification)


答:
C, 72 bytes

```<code>main(){puts("Greetings, Planet!");}//};)"!tenalP ,sgniteerG"(stup{)(niam
</code>```

Title: Palindrome Hello, World

Body:
Your task is to create a program that prints "Greetings, Planet!" exactly to the console. Seems simple enough, right? Well, here's the trick. The code must be a palindrome, meaning it reads from right to left the same as in left to right.
Standard loopholes are NOT allowed.

Body:
C, 72 bytes

main(){puts("Greetings, Planet!");}//};)"!tenalP ,sgniteerG"(stup{)(niam


问:
A Tiny Explorer
You are an explorer, mapping an unknown world. Your ship is carried on the wind. Where it goes, who knows?

Each day, in your spyglass, you see features to the north, south, east and west. You always see four such features, corresponding to the cardinal directions. Your spyglass reports ASCII symbols like this:

~~.*, ~~~~, ~.^^, ~#~#

The symbols are in the order (north, south, east, west).

These are the symbols: ~ = sea, . = coast, ^ = mountain, * = tree, # = invalid (no observation, this occurs whenever you see the edge of the world, or the landscape is obscured by fog). Your spyglass sees exactly one unit in every direction.

Each night, you look up at the stars to see how far you've travelled. Looking at the stars reports an ascii symbol like this:

n, s, e, w

corresponding to North, South, East and West, respectively. You always move exactly one unit to the north, south, east or west every night. So you, as explorer will be receiving an endless stream of symbols:

~~.*n~~~~s~~.*s~.**

Your task is to output a 2D map of the world (where ? are unknown parts of the map, north is up, east is right):

```<code>?~~~??????
?~~~??????
?~~~.^^.??
?~~.***.~~
~~.*^^*.~~
~~~..~~~~~
~~~~~~~~~~
~~~~~~~~~~
</code>```

For the sake of simplicity let's assume you start in the bottom left corner of the map. Assume all maps are 8x8.

Here is a simple 3x3 example. Assume the map looks like this:

```<code>~.~
~^~
~.~
</code>```

With the following input: ~#.#n~~^#s

You will get this output:

```<code>~??
~^?
~.?
</code>```

More example inputs and outputs:

input
~#~#n~~~#n~~~#n~~~#n~~~#n~~.#n~~.#n#~~#e#.~~e#.~~e#.~~e#.~~e#~~~e#~~~e#~#~s~~#~s~~#~s~~#~s~~#.s~~#~s~~#~s~##~w~#~~w.#~~w^#~~w.#~~

output

```<code>~~~~~~~~
~....~~~
~.????~~
~~????~~
~~????.~
~~????~~
~~?.^.~~
~~~~~~~~
</code>```

Input:

~#~#e~#~~e~#~~e.#~~e^#~~n.~..n~^~.n~.~~n.~~.n.~~*n~.~.n#.~~w#.~~w#.~~s~*..s..*.s*~.~s.~~~s

Output:

```<code>?~~~~~??
?....~??
?.**.~??
?~..~~??
?~~~~~??
?~~..~??
~~~.^.??
~~~~~~??
</code>```

答:
C, <s>210</s> <s>208</s> 207 bytes

This one uses printf and scanf to read input, and a linearized array instead of x,y; so I feel it is sufficiently different from millibyte's.

Golfed:

 main(p){char*i,*j,m[80];for(p=73,i=m+p;p--;m[p]=63);for(p=8;scanf("%5s",i)>0;p+=*j=='n'?8:*j=='s'?-8:*j=='e'?1:-1)for(j=i;j-i<4;j++)if(*j^35)m[p+"qajh"[j-i]-'i']=*j;for(p=72;m[p]=0,p-=8;)printf("%s\n",m+p);}
```
<p>Somewhat-ungolfed:</p>
<pre class="lang-c prettyprint-override"><code>main(p){
    char*i,*j,m[80];
    for(p=73,i=m+p;p--;m[p]=63);                   // fill with ?
    for(p=8;scanf("%5s",i)>0;
            p+=*j=='n'?8:*j=='s'?-8:*j=='e'?1:-1)  // read 5-at-a-time
        for(j=i;j-i<4;j++)
            if(*j^35)m[p+"qajh"[j-i]-'i']=*j;      // update map positions
    for(p=72;m[p]=0,p-=8;)printf("%s\n",m+p);      // output line-by-line
}
</code>```

Representation:

  // board: (vertically reversed when printed)
    0  1  2  3  4  5  6  7
    8  9  10 ...
    16 18 19 ...
    ...
    56 57 58 59 60 61 62 63

  // offsets and offset order, or why "qajh":
    s2      -8       a
  w4  e3  -1 0+1   h i j
    n1      +8       q   <- offset by +'i'
```

Also, you start at position 8 because this shaves a char or so off the print-loop.

Title: A Tiny Explorer

Body:
C, <s>210</s> <s>208</s> 207 bytes

This one uses printf and scanf to read input, and a linearized array instead of x,y; so I feel it is sufficiently different from millibyte's.

Golfed:

 main(p){char*i,*j,m[80];for(p=73,i=m+p;p--;m[p]=63);for(p=8;scanf("%5s",i)>0;p+=*j=='n'?8:*j=='s'?-8:*j=='e'?1:-1)for(j=i;j-i<4;j++)if(*j^35)m[p+"qajh"[j-i]-'i']=*j;for(p=72;m[p]=0,p-=8;)printf("%s\n",m+p);}

Somewhat-ungolfed:

main(p){
    char*i,*j,m[80];
    for(p=73,i=m+p;p--;m[p]=63);                   // fill with ?
    for(p=8;scanf("%5s",i)>0;
            p+=*j=='n'?8:*j=='s'?-8:*j=='e'?1:-1)  // read 5-at-a-time
        for(j=i;j-i<4;j++)
            if(*j^35)m[p+"qajh"[j-i]-'i']=*j;      // update map positions
    for(p=72;m[p]=0,p-=8;)printf("%s\n",m+p);      // output line-by-line
}

Representation:

  // board: (vertically reversed when printed)
    0  1  2  3  4  5  6  7
    8  9  10 ...
    16 18 19 ...
    ...
    56 57 58 59 60 61 62 63

  // offsets and offset order, or why "qajh":
    s2      -8       a
  w4  e3  -1 0+1   h i j
    n1      +8       q   <- offset by +'i'

Also, you start at position 8 because this shaves a char or so off the print-loop.


问:
Create an ABACABA city
Here is the 3rd ABACABA city:

```<code>  _
A|_|
B|__|
A|_|_
C|___|
A|_|
B|__|
A|_|
</code>```

It is made out of the ABACABA sequence, which is basically:

A (1st iteration)

place B - AB

repeat A - ABA (2nd iteration)

Place C - ABAC

Repeat ABA - ABACABA (3rd iteration)

and you get the idea.

The buildings have a height (corresponded by no. of underscores) equal to the letters converted to numbers as A = 1, B = 2 e.t.c.

Input

An iteration number 1<=n<=26.

Output

The ABACABA city of order n, including the letters at the start of the lines.

Title: Create an ABACABA city

Body:
Powershell, 67 Bytes

1..(Read-Host)|%{'  _'}{$x+=@([char]($_+96)+'|'+'_'*$_+'|')+$x}{$x}


问:
Shortest code to determine if a string is a palindrome
A palindrome is some string that is spelled the same way both backwards and forwards.  For instance, 'Eva, can I stab bats in a cave?' is a palindrome (EVACANISTAB | BATSINACAVE)

For this code golf, using the language of your choice, determine if a given string is a palindrome or not.

Edge Cases:

Punctuation is not counted towards palindrominess.

Control characters are not counted towards palindrominess.

Whitespace is not counted towards palindrominess.

Numbers are counted towards palindrominess.

Case in this challenge is not counted towards palindrominess.

There is no limit to the length of strings to evaluate, except for what is imposed by your language of choice.

For this challenge, limit yourself to the ASCII character set.

Technical Requirements:

Only method bodies are needed; additional things like method signatures, data structure declarations, etc. do not count towards the victory requirement.

Code must compile or interpret without compile-time errors or exceptions.

Code must not throw any unhandled exceptions or crash.  (Almost needless to say.  Almost.)

Code must return some value indicating palindrominess.  The data type depends on the language you use (e.g. a C# user might use a bool, whereas a JavaScript user could use a var.)

You may not write your own interpreter that performs this task as a 'native' capability so you can 'golf' a near-winning score.  (Hopefully needless to say.)

Victory Condition:

The shortest code in characters wins.

Current Leader: tmartin (k, 25 characters)

...Want the magic green check mark by your answer?  Beat this guy's answer!

答:
Pylongolf2, 24 bytes

```<code>c╨2"[^a-zA-Z]"-_╨1=~
</code>```

c takes the input, ╨2 to convert to lower case.

I then push a regex onto the stack and use - to remove all non-alphabetical characters in the input.

_ duplicates the input.

╨1 reverses it and = then compares them.

~ prints the stack in the end which prints either true or false.

Body:
Pylongolf2, 24 bytes

c╨2"[^a-zA-Z]"-_╨1=~

c takes the input, ╨2 to convert to lower case.

I then push a regex onto the stack and use - to remove all non-alphabetical characters in the input.

_ duplicates the input.

╨1 reverses it and = then compares them.

~ prints the stack in the end which prints either true or false.


问:
Determine the type of an input
The challenge is simple: Determine the type of an input, and output an identifier telling what type it is.

"UI", Unsigned integer: 0, 1,34, 111111111111111111111111111111111111111111

"SI", Signed integer: +0, +1, +42, -1, -3, -111111111111111111111111111111111111111111

"UD", Unsigned decimal: 0.0, 1.23, 1234.1234

"SD", Signed decimal: -0.0, +0.0, -1.235

"LE", Letter: a-z and A-Z

"SY", Symbol: ASCII code points: [32-47, 58-64, 91-96, 123-126] (i.e. all characters except numbers and letters)

"ST", String: Two or more character that can't be parsed as any of the above number formats

Rules:

The input will be 1-99 characters long

The input will only contain printable ASCII characters, code points: 32-126.

The output should be the two identifier letters as defined above (UI, SI ...)

Standard I/O rules apply

Examples:

```<code>UI:
0
01
34
12938219383278319086135768712319838871631827319218923

SI:
-0
+01
+1
-123
+123

UD:
0.0
3.1415
2.718281828459045235360287471352662497757

SD:
+0.0
-3.1415
+2.718281828459045235360287471352662497757

LE:
a
k
L
Z

SY:
@
"
+
-

ST:
Hello, World!
f2!"
+23df
1234A
'"!
.012
1.
UI
+-1
5+3
</code>```

答:
Retina, <s>98</s> 97 bytes

A nice way to practise my regex skills indeed.

Try it online!

```<code>^(?![+-]?\d+(\.\d+)?$)..+
ST
^([+-]?)\d+$
$1UI
^([+-]?)\d+\.\d+$
$1UD
i`^[a-z]$
LE
^.$
SY
[+-]U
S
</code>```

Title: Determine the type of an input

Body:
Retina, <s>98</s> 97 bytes

A nice way to practise my regex skills indeed.

Try it online!

^(?![+-]?\d+(\.\d+)?$)..+
ST
^([+-]?)\d+$
$1UI
^([+-]?)\d+\.\d+$
$1UD
i`^[a-z]$
LE
^.$
SY
[+-]U
S


问:
Produce an XOR table

Introduction

XOR is a digital logic gate that implements an exclusive or. Most of the times, this is shown as ^. The four possible outcomes in binary:

```<code>0 ^ 0 = 0
0 ^ 1 = 1
1 ^ 0 = 1
1 ^ 1 = 0
</code>```

This can also be seen as addition modulo 2 in binary. In decimal, we need to convert the decimal to binary, 35 = 100011 and 25 = 11001.To compute the XOR value, we place them on top of each other:

```<code>100011
 11001 ^
--------
111010  = 58 in decimal
</code>```

The task: When given an integer value N greater than 1, output an XOR table with the size N + 1. For example, N = 5:

```<code> 0 1 2 3 4 5
 1 0 3 2 5 4
 2 3 0 1 6 7
 3 2 1 0 7 6
 4 5 6 7 0 1
 5 4 7 6 1 0
</code>```

You can see that there is one space in front of each number, because the highest amount in the table has length 1. However, if we take N = 9, we get the following grid:

```<code>  0  1  2  3  4  5  6  7  8  9
  1  0  3  2  5  4  7  6  9  8
  2  3  0  1  6  7  4  5 10 11
  3  2  1  0  7  6  5  4 11 10
  4  5  6  7  0  1  2  3 12 13
  5  4  7  6  1  0  3  2 13 12
  6  7  4  5  2  3  0  1 14 15
  7  6  5  4  3  2  1  0 15 14
  8  9 10 11 12 13 14 15  0  1
  9  8 11 10 13 12 15 14  1  0
</code>```

The highest value has length 2, so the value is right-aligned to length 3 (highest length + 1).

Rules:

Leading whitespace is not mandatory, only if used (or not) consistently

You must output a table in the form shown above.

The padding between columns should be as small as possible

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

答:
Pyke, 8 bytes

```<code>hD]UA.&P
</code>```

Explanation:

```<code>         - auto-add eval_or_not_input() to the stack
h        - increment the input
 D]      - Create a list containing [inp+1, inp+1]
   U     - Create a 2d range
    A.^  - Deeply apply the XOR function to the range
       P - print it out prettily
</code>```

Try it here

Title: Produce an XOR table

Body:
Pyke, 8 bytes

hD]UA.&P

Explanation:

         - auto-add eval_or_not_input() to the stack
h        - increment the input
 D]      - Create a list containing [inp+1, inp+1]
   U     - Create a 2d range
    A.^  - Deeply apply the XOR function to the range
       P - print it out prettily

Try it here


问:
Final Fantasy XV UNCOVERED!
Since I am INSANELY hyped for the Final Fantasy XV Uncovered event, I want you to write me a program to tell me when it is!!!

The input

Your take input in the form of HH:MM XDT, where HH is a number in the range 1-12, MM is a number between 0-60, and XDT is a time zone, with X being one of E (eastern, UTC-4), C (central, UTC-5), P (pacific, UTC-7), or M (mountain, UTC-6). This is a time assumed to be PM. Valid inputs include:

```<code>1:00 EDT (1 PM Eastern Daylight Time)
4:05 MDT (4:05 PM Mountain Daylight Time)
12:23 PDT (12:23 PM Pacific Daylight Time)
1:10 CDT (1:10 PM Central Daylight Time)
</code>```

The input may be assumed to be valid.

The output

Your program must do the following:

Convert the given time to PDT and output It is XX:XX PM PDT., where XX:XX is the converted time. Note that you do not need to handle any case where converting the time would cross the AM/PM boundary.

Print one of the following:

If the converted time is before 6:00 PM PDT, print X minutes until the pre-show!, replacing X with the number of minutes until 6:00 PM PDT.

If the converted time is after or equal to 6:00 PM PDT and before 7:00 PM PDT, print Pre-show started X minutes ago; UNCOVERED is starting in Y minutes!, where X is the number of minutes that have passed since 6:00 PM PDT, and Y is the number of minutes until 7:00 PM PDT.

If the converted time is after or equal to 7:00 PM PDT, print UNCOVERED started X minutes ago!, where X is the number of minutes that have passed since 7:00 PM PDT.

Each string printed must be followed by a newline.

Scoring

This is code golf, so the shortest program wins.

答:
PHP, <s>347</s> <s>328</s> <s>327</s> 322 bytes

```<code><?=$u="UNCOVERED";$m=" minutes";$s=" started ";$p="re-show";$z=['P'=>0,'M'=>1,'C'=>2,'E'=>3];$i=explode(":",$argv[1]);$h=$i[0]%12-$z[$argv[2][0]];$o=$i[1];$t=60-$o;$a="$s$o$m ago";echo"It is ".(($h+11)%12+1).":$o".($h<0?" A":" P")."M PDT.\n".($h<6?$t."$m until the p$p!":($h<7?"P$p$a; $u is starting in $t$m!":"$u$a!"));?>
</code>```

exploded view

```<code><?=
  $u = "UNCOVERED";
  $m = " minutes";
  $s = " started ";
  $p = "re-show";
  $z = [ 'P' => 0,
         'M' => 1,
         'C' => 2,
         'E' => 3 ];

  $i = explode(":", $argv[1]);
  $h = $i[0]%12 - $z[$argv[2][0]];
  $o = $i[1];
  $t = 60 - $o;
  $a = "$s$o$m ago";

  echo "It is " . (($h+11)%12+1) . ":$o" . ($h < 0 ? " A" : " P") . "M PDT.\n" .
       ($h < 6 ? $t . "$m until the p$p!"
               : ($h < 7 ? "P$p$a; $u is starting in $t$m!"
                         : "$u$a!"));
?>
</code>```

Runs as php script.php HH:MM XDT.  Takes in the time and time zone as $argv entries, regexes $argv[1] out into $i = [HH, MM], determines the time zone from the first character in $argv[2], maths out how many minutes past 6PM PDT that is, then ternaries the echo.

Could drop 2 bytes by using $u=UNCOVERED, but it'd be the only error here and I like that this works cleanly.

Title: Final Fantasy XV UNCOVERED!

Body:
PHP, <s>347</s> <s>328</s> <s>327</s> 322 bytes

<?=$u="UNCOVERED";$m=" minutes";$s=" started ";$p="re-show";$z=['P'=>0,'M'=>1,'C'=>2,'E'=>3];$i=explode(":",$argv[1]);$h=$i[0]%12-$z[$argv[2][0]];$o=$i[1];$t=60-$o;$a="$s$o$m ago";echo"It is ".(($h+11)%12+1).":$o".($h<0?" A":" P")."M PDT.\n".($h<6?$t."$m until the p$p!":($h<7?"P$p$a; $u is starting in $t$m!":"$u$a!"));?>

exploded view

<?=
  $u = "UNCOVERED";
  $m = " minutes";
  $s = " started ";
  $p = "re-show";
  $z = [ 'P' => 0,
         'M' => 1,
         'C' => 2,
         'E' => 3 ];

  $i = explode(":", $argv[1]);
  $h = $i[0]%12 - $z[$argv[2][0]];
  $o = $i[1];
  $t = 60 - $o;
  $a = "$s$o$m ago";

  echo "It is " . (($h+11)%12+1) . ":$o" . ($h < 0 ? " A" : " P") . "M PDT.\n" .
       ($h < 6 ? $t . "$m until the p$p!"
               : ($h < 7 ? "P$p$a; $u is starting in $t$m!"
                         : "$u$a!"));
?>

Runs as php script.php HH:MM XDT.  Takes in the time and time zone as $argv entries, regexes $argv[1] out into $i = [HH, MM], determines the time zone from the first character in $argv[2], maths out how many minutes past 6PM PDT that is, then ternaries the echo.

Could drop 2 bytes by using $u=UNCOVERED, but it'd be the only error here and I like that this works cleanly.


答:
Lua, 157 bytes

Try it online!

Golfed:

```<code>n=(...)m=string.match s=m(n,"^[+-]")and"S"or"U"print(m(n,"^[+-]?%d+%.%d+$")and s.."D"or m(n,"^[+-]?%d+")and s.."I"or m(n,"^%w$")and"LE"or#n==1 and"SY"or"ST")
</code>```

Ungolfed:

```<code>n = "2.718281828459045"

s = n:sub(1,1):match("[+-]") and "S" or "U"

if n:match("^[+-]?%d+%.%d+$") then
    print(s.."D")
elseif n:match("^[+-]?%d+") then
    print(s.."I")
elseif n:match("^%w$") then
    print("LE")
elseif #n==1 then
    print("SY")
else
    print("ST")
end
</code>```

Title: Determine the type of an input

Body:
The challenge is simple: Determine the type of an input, and output an identifier telling what type it is.

"UI", Unsigned integer: 0, 1,34, 111111111111111111111111111111111111111111

"SI", Signed integer: +0, +1, +42, -1, -3, -111111111111111111111111111111111111111111

"UD", Unsigned decimal: 0.0, 1.23, 1234.1234

"SD", Signed decimal: -0.0, +0.0, -1.235

"LE", Letter: a-z and A-Z

"SY", Symbol: ASCII code points: [32-47, 58-64, 91-96, 123-126] (i.e. all characters except numbers and letters)

"ST", String: Two or more character that can't be parsed as any of the above number formats

Rules:

The input will be 1-99 characters long

The input will only contain printable ASCII characters, code points: 32-126.

The output should be the two identifier letters as defined above (UI, SI ...)

Standard I/O rules apply

Examples:

```<code>UI:
0
01
34
12938219383278319086135768712319838871631827319218923

SI:
-0
+01
+1
-123
+123

UD:
0.0
3.1415
2.718281828459045235360287471352662497757

SD:
+0.0
-3.1415
+2.718281828459045235360287471352662497757

LE:
a
k
L
Z

SY:
@
"
+
-

ST:
Hello, World!
f2!"
+23df
1234A
'"!
.012
1.
UI
+-1
5+3
</code>```

Body:
Lua, 157 bytes

Try it online!

Golfed:

n=(...)m=string.match s=m(n,"^[+-]")and"S"or"U"print(m(n,"^[+-]?%d+%.%d+$")and s.."D"or m(n,"^[+-]?%d+")and s.."I"or m(n,"^%w$")and"LE"or#n==1 and"SY"or"ST")

Ungolfed:

n = "2.718281828459045"

s = n:sub(1,1):match("[+-]") and "S" or "U"

if n:match("^[+-]?%d+%.%d+$") then
    print(s.."D")
elseif n:match("^[+-]?%d+") then
    print(s.."I")
elseif n:match("^%w$") then
    print("LE")
elseif #n==1 then
    print("SY")
else
    print("ST")
end


答:
Python 2, 182 bytes

n=input()
L=[[[],""]]
while 1:
 s,c=L.pop(0);L+=[[s+[i],c+`i`]for i in range(10)]+(s[1:]and[[s[:-2]+[eval(`s[-2]`+o+`s[-1]`)],c+o]for o in"/+-*"[s[-1]==0:]])
 if[n]==s[-1:]:print c;E
```

So obscenely slow, I've left it running for an hour on input 221 and it still hasn't terminated. A great deal of the slowness is because I'm using a list as a queue for a breadth-first search, and .pop(0) is O(n) for lists.

L is just a queue containing (stack, code to reach stack) pairs. At each step, digits are always added, and operators are performed if the stack has at least two elements. Division is only performed if the last element is not 0, although I have a strong suspicion that division is never necessary (although I have no way of proving it, but I have checked this is the case up to 500).

The program terminates via a NameError after printing the result (eventually).

Title: Express a number with only 0-9 and the four operations

Body:
Explanation

Befunge is a two-dimensional program that uses stacks.

That means, to do 5 + 6, you write 56+, meaning:

```<code>56+
5    push 5 into stack
 6   push 6 into stack
  +  pop the first two items in the stack and add them up, and push the result into stack

(to those of you who do not know stacks, "push" just means add and "pop" just means take off)
</code>```

However, as the intelligent of you have observed, we cannot push the number 56 directly into the stack.

To do so, we must write 78* instead, which multiplies 7 and 8 and pushes the product into the stack.

Details

Input can be taken in any format, meaning it can be STDIN or not, at the programmer's discretion.

The input will be a positive integer (no bonus for including 0 or negative integers).

The output will be a string consisting of only these characters: 0123456789+-*/ (I would not use % modulo.)

The goal is to find the shortest string that can represent the input, using the format described above.

For example, if the input is 123, then the output would be 67*99*+. The output should be evaluated from left to right.

If there are more than one acceptable outputs (e.g. 99*67*+ is also acceptable), any one can be printed (no bonus for printing all of them).

Further Explanation

If you still do not understand how 67*99*+ evaluates to 123, here is a detailed explanation.

```<code>stack    |operation|explanation
          67*99*+
[6]       6         push 6 to stack
[6,7]      7        push 7 to stack
[42]        *       pop two from stack and multiply, then put result to stack
[42,9]       9      push 9 to stack
[42,9,9]      9     push 9 to stack
[42,81]        *    pop two from stack and multiply, then put result to stack
[123]           +   pop two from stack and add, then put result to stack
</code>```

TL;DR

The program needs to find the shortest string that can represent the input (number), using the format specified above.

Notes

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

Disambiguation

The - can either be x-y or y-x, at the programmer's discretion. However, the choice must be consistent within the solution. Likewise for the /.

Sample program

Lua, 1862 bytes (try it online)

Since I am the author, I will not golf it at all.

Explanation:

```<code>This uses the depth-first search method.
</code>```

More about depth-first search: here.

The program:

```<code>local input = (...) or 81

local function div(a,b)
    if b == 0 then
        return "error"
    end
    local result = a/b
    if result > 0 then
        return math.floor(result)
    else
        return math.ceil(result)
    end
end

local function eval(expr)
    local stack = {}
    for i=1,#expr do
        local c = expr:sub(i,i)
        if c:match('[0-9]') then
            table.insert(stack, tonumber(c))
        else
            local a = table.remove(stack)
            local b = table.remove(stack)
            if a and b then
                if c == '+' then
                    table.insert(stack, a+b)
                elseif c == '-' then
                    table.insert(stack, b-a)
                elseif c == '*' then
                    table.insert(stack, a*b)
                elseif c == '/' then
                    local test = div(b,a)
                    if test == "error" then
                        return -1
                    else
                        table.insert(stack, a+b)
                    end
                end
            else
                return -1
            end
        end
    end
    return table.remove(stack) or -1
end

local samples, temp = {""}, {}

while true do
    temp = {}
    for i=1,#samples do
        local s = samples[i]
        table.insert(temp, s..'0')
        table.insert(temp, s..'1')
        table.insert(temp, s..'2')
        table.insert(temp, s..'3')
        table.insert(temp, s..'4')
        table.insert(temp, s..'5')
        table.insert(temp, s..'6')
        table.insert(temp, s..'7')
        table.insert(temp, s..'8')
        table.insert(temp, s..'9')
        table.insert(temp, s..'+')
        table.insert(temp, s..'-')
        table.insert(temp, s..'*')
        table.insert(temp, s..'/')
    end
    for i=1,#temp do
        if input == eval(temp[i]) then
            print(temp[i])
            return
        end
    end
    samples = temp
end
</code>```

Bonus

A cake for you if you use Befunge (or any variant of it) to write the code.

Body:
Python 2, 182 bytes

n=input()
L=[[[],""]]
while 1:
 s,c=L.pop(0);L+=[[s+[i],c+`i`]for i in range(10)]+(s[1:]and[[s[:-2]+[eval(`s[-2]`+o+`s[-1]`)],c+o]for o in"/+-*"[s[-1]==0:]])
 if[n]==s[-1:]:print c;E

So obscenely slow, I've left it running for an hour on input 221 and it still hasn't terminated. A great deal of the slowness is because I'm using a list as a queue for a breadth-first search, and .pop(0) is O(n) for lists.

L is just a queue containing (stack, code to reach stack) pairs. At each step, digits are always added, and operators are performed if the stack has at least two elements. Division is only performed if the last element is not 0, although I have a strong suspicion that division is never necessary (although I have no way of proving it, but I have checked this is the case up to 500).

The program terminates via a NameError after printing the result (eventually).


问:
Showcase of Languages

Notes

This thread is open and unlocked only because the community decided to make an exception. Please do not use this question as evidence that you can ask similar questions here. Please do not create additional showcase questions.

This is no longer a popularity-contest, nor are snippet lengths limited by the vote tally. If you know this thread from before, please make sure you familiarize yourself with the changes.

This thread is dedicated to showing off interesting, useful, obscure, and/or unique features your favorite programming languages have to offer. This is neither a challenge nor a competition, but a collaboration effort to showcase as many programming languages as possible as well as possible.

How this works

All answers should include the name of the programming language at the top of the post, prefixed by a #.

Answers may contain one (and only one) factoid, i.e., a couple of sentences without code that describe the language.

Aside from the factoid, answers should consist of snippets of code, which can (but don't have to be) programs or functions.

The snippets do not need to be related. In fact, snippets that are too related may be redundant.

Since this is not a contest, all programming languages are welcome, whenever they were created.

Answers that contain more than a handful of code snippets should use a Stack Snippet to collapse everything except the factoid and one of the snippets.

Whenever possible, there should be only one answer per programming language. This is a community wiki, so feel free to add snippets to any answer, even if you haven't created it yourself. There is a Stack Snippet for compressing posts, which should mitigate the effect of the 30,000 character limit.

Answers that predate these guidelines should be edited. Please help updating them as needed.

Current answers, sorted alphabetically by language name

$.ajax({type:"GET",url:"https://api.stackexchange.com/2.2/questions/44680/answers?site=codegolf&filter=withbody",success:function(data){for(var i=0;i<data.items.length;i++){var temp=document.createElement('p');temp.innerHTML = data.items[i].body.split("\n")[0];$('#list').append('
' + temp.innerText || temp.textContent + '');}}})```
<pre class="snippet-code-html lang-html prettyprint-override"><code><script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script><base href="http://codegolf.stackexchange.com"><ul id="list"></ul></code>```

答:
Fuzzy Octo Guacamole

Factoid:

Do to the longness of the name, Fuzzy Octo Guacamole is also known as FOG, and rarely Fuzztoguac.

Length 1:

```<code>:
</code>```

Prints [], which is the empty stack.  As you may guess, : prints the stack.

Length 2:

```<code>_;
</code>```

Prints 0 because popping (_) from an empty stack gives 0.  ; prints.

Alternative:

```<code>^=
</code>```

This is the sign function. It returns 1 if x > 0, 0 if x = 0, and -1 if x < 0.  It prints due to implicit output.

Length 3:

```<code>^_;
</code>```

A simple cat program.  The ^ gets input.

Alternative:

```<code>^d*
</code>```

Prints n2 if n is a number, else n.

Alternative:

```<code>(^)
</code>```

A infinite cat program, shortened.  Loops have implicit output <s>due to a bug tagged wontfix</s>.

Length 4:

```<code>(_;)
</code>```

Prints 0 forever.  The ( and ) denote the start and end of a infinite loop, and the _; pops from the empty stack (giving 0) and prints.

Alternate:

```<code>_UNK
</code>```

Also happens to be a quine.  _ sets the temp var to 0, U pushes 0, and N pushes None.  The K prints _UNK.

Alternate #2:

```<code>(+X)
</code>```

Counts up forever, printing each number. Swapping the + and X makes it start at 0.

Alternate #3:

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

Prints a goat out of ASCII art. Thanks to @Downgoat for this suggestion.

```<code>_;
</code>```0

Length 5:

```<code>_;
</code>```1

Prints a list with the input if it is truthy, or another truthy value of the same type as the input.  e.g. 1 -> [1], 0 -> [1], asd -> [u'asd'].

Note: The u is due to unicode formatting.

Alternate:

```<code>_;
</code>```2

Outputs True if the 2 inputs are equal, else False.

Alternate #2:

```<code>^s^$:
</code>```

Prints inclusive range of the 2 inputs, so 2, 4 gives [2, 3, 4]

Outputs [] if input 2 > input 1.

Length 6:

```<code>^![_;]
</code>```

Prints your input as many times as itself. i.e. 3 -> 3\n3\n3\n, 1 -> 1\n, as -> ad\nas\n.  The last one is because the counter sets itself to the length of the ToS if it is a string.

Length 7

```<code>^X({@})
</code>```

This is a truth machine.  The ^ gets input, the X prints the ToS without popping (equivalent to o;), and the ({@}) ends the program if the ToS is 0.

Alternate:

```<code>#--repl
</code>```

This starts the REPL, which is like a infinite prompt for code.  But the stack is persistent, and implicit output always applies.

At this point in time, many changes were made to Fuzzy Octo Guacamole, including a REPL, implicit output and the X command.

The older snippets are staying the same, but I am adding a new alternative snippet for each length.

Length 8:

```<code>$--!++[*]
</code>```

This works either as a function (add a ^ before), or in the REPL. (type the number, hit enter, paste this, hit enter).

Length 9:

```<code>2pP*.2P**
</code>```

This calculates the area and circumference of a circle, assuming each stack has the input already. In the REPL, this can be done with ^C.  The results are left on the stacks.

Length 10:

```<code>22^p2^pSpX
</code>```

Output the product of the difference and the sum of two inputs, squared.  (From a CMC (chat-mini-challenge) by Conor O'Brien)

2 pushes 2 to the stack, then 2^ pushes 2 and gets input and p raises it to the 2nd power (because of that 2 we pushed).

The same is done again with the 2^p.

Then we subtract the squared numbers we got, and square them (using that first 2 we pushed at the beginning). Finally, X peeks and pops.

This uses the difference of squares formula, (x - y)(x + y) = x^2 - y^2.

Length 11:

```<code>^=
</code>```0

Prints Hello, <input>. Pretty simple.

Title: Showcase of Languages

Body:
Fuzzy Octo Guacamole

Factoid:

Do to the longness of the name, Fuzzy Octo Guacamole is also known as FOG, and rarely Fuzztoguac.

Length 1:

:

Prints [], which is the empty stack.  As you may guess, : prints the stack.

Length 2:

_;

Prints 0 because popping (_) from an empty stack gives 0.  ; prints.

Alternative:

^=

This is the sign function. It returns 1 if x > 0, 0 if x = 0, and -1 if x < 0.  It prints due to implicit output.

Length 3:

^_;

A simple cat program.  The ^ gets input.

Alternative:

^d*

Prints n2 if n is a number, else n.

Alternative:

(^)

A infinite cat program, shortened.  Loops have implicit output <s>due to a bug tagged wontfix</s>.

Length 4:

(_;)

Prints 0 forever.  The ( and ) denote the start and end of a infinite loop, and the _; pops from the empty stack (giving 0) and prints.

Alternate:

_UNK

Also happens to be a quine.  _ sets the temp var to 0, U pushes 0, and N pushes None.  The K prints _UNK.

Alternate #2:

(+X)

Counts up forever, printing each number. Swapping the + and X makes it start at 0.

Alternate #3:

Prints a goat out of ASCII art. Thanks to @Downgoat for this suggestion.

                      ___.
                     //  \\
                    ((   ''
                     \\__,
                    /6 (%)\,
                   (__/:";,;\--____----_
                    ;; :';,:';`;,';,;';`,`_
                      ;:,;;';';,;':,';';,-Y\
                       ;,;,;';';,;':;';'; Z/
                       / ;,';';,;';,;';;'
                      / / |';/~~~~~\';;'
                     ( K  | |      || |
                      \_\ | |      || |
                       \Z | |      || |
                          L_|      LL_|
                          LW/      LLW/

Length 5:

^{i}:

Prints a list with the input if it is truthy, or another truthy value of the same type as the input.  e.g. 1 -> [1], 0 -> [1], asd -> [u'asd'].

Note: The u is due to unicode formatting.

Alternate:

^^s=i

Outputs True if the 2 inputs are equal, else False.

Alternate #2:

^s^$:

Prints inclusive range of the 2 inputs, so 2, 4 gives [2, 3, 4]

Outputs [] if input 2 > input 1.

Length 6:

^![_;]

Prints your input as many times as itself. i.e. 3 -> 3\n3\n3\n, 1 -> 1\n, as -> ad\nas\n.  The last one is because the counter sets itself to the length of the ToS if it is a string.

Length 7

^X({@})

This is a truth machine.  The ^ gets input, the X prints the ToS without popping (equivalent to o;), and the ({@}) ends the program if the ToS is 0.

Alternate:

#--repl

This starts the REPL, which is like a infinite prompt for code.  But the stack is persistent, and implicit output always applies.

At this point in time, many changes were made to Fuzzy Octo Guacamole, including a REPL, implicit output and the X command.

The older snippets are staying the same, but I am adding a new alternative snippet for each length.

Length 8:

$--!++[*]

This works either as a function (add a ^ before), or in the REPL. (type the number, hit enter, paste this, hit enter).

Length 9:

2pP*.2P**

This calculates the area and circumference of a circle, assuming each stack has the input already. In the REPL, this can be done with ^C.  The results are left on the stacks.

Length 10:

22^p2^pSpX

Output the product of the difference and the sum of two inputs, squared.  (From a CMC (chat-mini-challenge) by Conor O'Brien)

2 pushes 2 to the stack, then 2^ pushes 2 and gets input and p raises it to the 2nd power (because of that 2 we pushed).

The same is done again with the 2^p.

Then we subtract the squared numbers we got, and square them (using that first 2 we pushed at the beginning). Finally, X peeks and pops.

This uses the difference of squares formula, (x - y)(x + y) = x^2 - y^2.

Length 11:

"Hello, "^j

Prints Hello, <input>. Pretty simple.


问:
Open the browser to http://codegolf.stackexchange.com
Your job is to open a browser window of the default browser to http://codegolf.stackexchange.com.

Your code must open the browser itself, and cannot rely on an open one.

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

Moderator note: A large number of answers to this challenge use the URLs http://ppcg.lol or http://ppcg.ga. These URLs did direct to https://codegolf.stackexchange.com at the time, but have since expired. By this meta discussion, they have been allowed to stay, with the note that they are currently invalid.

答:
VB.NET, <s>32</s> 30 bytes

```<code>Process.Start("http:ppcg.lol")
</code>```

Body:
VB.NET, <s>32</s> 30 bytes

Process.Start("http:ppcg.lol")


问:
Passwordify the string
Your challenge is to passwordify the string! What is passwordifying, you ask?

Take a string as input. This string will only contain uppercase letters, lowercase letters, digits, and spaces.

You must replace all spaces with underscores and move all numbers to the end of the string in the order that they appear from left to right. Then, for every letter in the string, randomly change it to uppercase or lowercase.

Examples (case of characters should vary every time):

```<code>Input
Hello world
Output
HElLo_wORld

Input
pa55 w0rd
Output
pA_Wrd550

Input
14 35
Output
_1435

Input
0971
Output
0971

Input
[space]
Output
_
</code>```

Shortest code in bytes wins!

Whoever asks on Information Security SE if this is a good hashing algorithm wins!--Don't worry SE overlords, I'm just kidding.

答:
IPOS - non competing, 14 bytes

```<code>S'_RE`N-`dE!k?
</code>```

Yes, I added builtins for this challenge, but those are not especially targeted at this problem.

This works with version 0.1 of the interpreter.

Example run

```
> python IPOS.py S'_RE`N-`dE!k? -i "pa55 w0rd"
Pa_WrD550
```

Explanation

```
     # Implicit: place input on the stack (C)
S    # Push a space to the stack (B)
'_   # Push an underscore to the stack (A)
R    # In C replace B with A -> replace underscores with spaces
     # the stack contains now only the replaced string (C)
E    # Push an empty string (B)
`    # Start a command literal,
     # the stack for this gets initialized with a single character (B) later
N    # Push the digits 0-9 as string to the stack (A)
-    # Remove every character from B that is in A
`    # End command literal (A)
d    # split C on B, sort the parts descending with the key A and join back on B.
     # The key function A transforms each character of the string to an empty string if it is a digit.
     # Since the resulting char does not contain a digit, it's key value is it's length.
     # This maps the key 0 to digits and the key 1 to non-digits. Sorting this in descending
     # order moves the digits to the right and leaves non-digits in the order they were before.
E    # Push an empty string
!k   # Push the command k (=swapcase)
?    # Apply ^ to every character randomly
     # Implicit: Output stack contents
```

Title: Passwordify the string

Body:
IPOS - non competing, 14 bytes

S'_RE`N-`dE!k?

Yes, I added builtins for this challenge, but those are not especially targeted at this problem.

This works with version 0.1 of the interpreter.

Example run

> python IPOS.py S'_RE`N-`dE!k? -i "pa55 w0rd"
Pa_WrD550

Explanation

     # Implicit: place input on the stack (C)
S    # Push a space to the stack (B)
'_   # Push an underscore to the stack (A)
R    # In C replace B with A -> replace underscores with spaces
     # the stack contains now only the replaced string (C)
E    # Push an empty string (B)
`    # Start a command literal,
     # the stack for this gets initialized with a single character (B) later
N    # Push the digits 0-9 as string to the stack (A)
-    # Remove every character from B that is in A
`    # End command literal (A)
d    # split C on B, sort the parts descending with the key A and join back on B.
     # The key function A transforms each character of the string to an empty string if it is a digit.
     # Since the resulting char does not contain a digit, it's key value is it's length.
     # This maps the key 0 to digits and the key 1 to non-digits. Sorting this in descending
     # order moves the digits to the right and leaves non-digits in the order they were before.
E    # Push an empty string
!k   # Push the command k (=swapcase)
?    # Apply ^ to every character randomly
     # Implicit: Output stack contents


问:
Implement a Truth-Machine
A truth-machine (credits goes to this guy for coming up with it) is a very simple program designed to demonstrate the I/O and control flow of a language. Here's what a truth-machine does:

Gets a number (either 0 or 1) from STDIN.

If that number is 0, print out 0 and terminate.

If that number is 1, print out 1 forever.

Challenge

Write a truth-machine as described above in your language of choice. The truth-machine must be a full program that follows these rules:

take input from STDIN or an acceptable alternative

If your language cannot take input from STDIN, it may take input from a hardcoded variable or suitable equivalent in the program

must output to STDOUT or an acceptable alternative

If your language is incapable of outputting the characters 0 or 1, byte or unary I/O is acceptable.

when the input is 1, it must continually print 1s and only stop if the program is killed or runs out of memory

the output must only be either a 0 followed by either one or no newline or space, or infinite 1s with each 1 followed by either one or no newline or space. No other output can be generated, except constant output of your language's interpreter that cannot be suppressed (such as a greeting, ANSI color codes or indentation). Your usage of newlines or spaces must be consistent: for example, if you choose to output 1 with a newline after it all 1s must have a newline after them.

if and only if your language cannot possibly terminate on an input of 0 it is acceptable for the code to enter an infinite loop in which nothing is outputted.

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

Catalog

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

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

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

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

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

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

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

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

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

 <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

```

答:
Fuzzy Octo Guacamole, 8 bytes

```<code>^X({@}X)
</code>```

^ pushes input, X prints the top item on the stack. ( starts an infinite loop.  {@} ends the program (@) only if the top item on the stack is falsy, like 0.  The X prints the top item on the stack (again), and the ) ends the loop.

So it repeats, printing and checking forever.

Title: Implement a Truth-Machine

Body:
Fuzzy Octo Guacamole, 8 bytes

^X({@}X)

^ pushes input, X prints the top item on the stack. ( starts an infinite loop.  {@} ends the program (@) only if the top item on the stack is falsy, like 0.  The X prints the top item on the stack (again), and the ) ends the loop.

So it repeats, printing and checking forever.


问:
A simple TCP server
Write a program or function that listens for incoming TCP traffic on port N. It offers a simple service: it calculates sum of IP address fields of incoming connection and returns.

Program or function reads integer N from arguments or stdin. It listens to incoming TCP connections on port N. When someone connects to that port, the program calculates sum of its IP address fields and sends it back to the client with trailing newline and closes connection.

Port number N is a valid port, and 210 < N < 215

Trailing newline can be either \nor \r\n

You can use either IPv4 or IPv6. Since IPv6 addresses are written in hexadecimal form, you must also provide result in same format, for example 2001:0db8:0000:0042:0000:8a2e:0370:7334 => 12ecd.

This is code-golf. Standard rules and loopholes apply.

Example

You run your server with ./server 1234. The server is now running and waiting for connections on port 1234. Then a client from 127.0.0.1 connects to your server. Your server performs a simple calculation: 127+0+0+1 => 128 and sends the result to the client (with trailing newline): 128\n. Then server closes connection and waits for next client.

Leaderboard

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

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

Leaderboard

	Author	Language	Size

Winners by Language

Language	User	Score

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

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

```

答:
Haskell, 216 bytes

Using the "network-simple" package (cabal install network-simple).  Needs a couple of language extensions (-XOverloadedStrings -XNoMonomorphismRestriction) to work.

```<code>import Network.Simple.TCP(serve)
import Network.Socket
import Data.Bits
main=getLine>>= \n->serve"*"n p
p(s,(SockAddrInet _ h))=()<$(send s$(show$sum$w h 24)++"\n")
m=255
w h 0=[h.&.m]
w h n=h`shiftR`n.&.m:(w h$n-8)
</code>```

There are a couple of possible simplifications, including changing the w function to return the sum directly rather than a list, and using a function rather than a program so that the port number can be specified as an argument. I don't imagine this would reduce the size very much, though.  20 bytes perhaps?

Title: A simple TCP server

Body:
Haskell, 216 bytes

Using the "network-simple" package (cabal install network-simple).  Needs a couple of language extensions (-XOverloadedStrings -XNoMonomorphismRestriction) to work.

import Network.Simple.TCP(serve)
import Network.Socket
import Data.Bits
main=getLine>>= \n->serve"*"n p
p(s,(SockAddrInet _ h))=()<$(send s$(show$sum$w h 24)++"\n")
m=255
w h 0=[h.&.m]
w h n=h`shiftR`n.&.m:(w h$n-8)

There are a couple of possible simplifications, including changing the w function to return the sum directly rather than a list, and using a function rather than a program so that the port number can be specified as an argument. I don't imagine this would reduce the size very much, though.  20 bytes perhaps?


答:
Retina

Factoid:

Retina is based on regular expressions, and supports various stages like match, replace, split, grep, antigrep, transliteration, and sort.

0 bytes:

Counts chars in input...+1!

1 byte:

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

Counts the number of 1s in the input. Pretty boring, but can make quick unary to decimal conversion.

2 bytes:

```<code>.+
</code>```

Outputs the number of nonempty lines in the input.

3 bytes:

```\d

```

Deletes numbers. (Tip: If you want empty lines to show in code, use ``` tags.)</p>
<h2>4 bytes:</h2>
```1
$_
```
<p>Computes squares. (Unary in, unary out)</p>
<h2>5 bytes:</h2>
```T`l`L
```
<p>UPPERCASES YOUR TEXT.</p>
<h2>6 bytes:</h2>
```G`cats
```
<p>Finds the [cats]</p>
<h2>7 bytes:</h2>
```\d
$*
1
```
<p>Sums digits in input.</p>
<h2>8 bytes:</h2>
```^
1
1
$'
```
<p>Computes triangular numbers. (Unary in, unary out)</p>
<h2>9 bytes:</h2>
```(.)\1+
$1
```
<p>Dereplicates chars.</p>

<h2>10 bytes:</h2>
```S`.
¶+
$.0
```
<p>Counts chars in a slightly weird way. (The shortest way is 3 characters.)</p>
<h2>11 bytes:</h2>
```.+
```0
<p>Matches squares.</p>
<h2>14 bytes:</h2>
```.+
```1
<p>The shortest Retina quine.</p>
<h2>15 bytes:</h2>
```.+
```2

Computes cubes. (Unary in, decimal out)

Title: Showcase of Languages

Body:
Notes

This thread is open and unlocked only because the community decided to make an exception. Please do not use this question as evidence that you can ask similar questions here. Please do not create additional showcase questions.

This is no longer a popularity-contest, nor are snippet lengths limited by the vote tally. If you know this thread from before, please make sure you familiarize yourself with the changes.

This thread is dedicated to showing off interesting, useful, obscure, and/or unique features your favorite programming languages have to offer. This is neither a challenge nor a competition, but a collaboration effort to showcase as many programming languages as possible as well as possible.

How this works

All answers should include the name of the programming language at the top of the post, prefixed by a #.

Answers may contain one (and only one) factoid, i.e., a couple of sentences without code that describe the language.

Aside from the factoid, answers should consist of snippets of code, which can (but don't have to be) programs or functions.

The snippets do not need to be related. In fact, snippets that are too related may be redundant.

Since this is not a contest, all programming languages are welcome, whenever they were created.

Answers that contain more than a handful of code snippets should use a Stack Snippet to collapse everything except the factoid and one of the snippets.

Whenever possible, there should be only one answer per programming language. This is a community wiki, so feel free to add snippets to any answer, even if you haven't created it yourself. There is a Stack Snippet for compressing posts, which should mitigate the effect of the 30,000 character limit.

Answers that predate these guidelines should be edited. Please help updating them as needed.

Current answers, sorted alphabetically by language name

$.ajax({type:"GET",url:"https://api.stackexchange.com/2.2/questions/44680/answers?site=codegolf&filter=withbody",success:function(data){for(var i=0;i<data.items.length;i++){var temp=document.createElement('p');temp.innerHTML = data.items[i].body.split("\n")[0];$('#list').append('
' + temp.innerText || temp.textContent + '');}}})```
<pre class="snippet-code-html lang-html prettyprint-override"><code><script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script><base href="http://codegolf.stackexchange.com"><ul id="list"></ul></code>```

Body:
Retina

Factoid:

Retina is based on regular expressions, and supports various stages like match, replace, split, grep, antigrep, transliteration, and sort.

0 bytes:

Counts chars in input...+1!

1 byte:

1

Counts the number of 1s in the input. Pretty boring, but can make quick unary to decimal conversion.

2 bytes:

.+

Outputs the number of nonempty lines in the input.

3 bytes:

\d

Deletes numbers. (Tip: If you want empty lines to show in code, use <pre> tags.)

4 bytes:

1
$_

Computes squares. (Unary in, unary out)

5 bytes:

T`l`L

UPPERCASES YOUR TEXT.

6 bytes:

G`cats

Finds the [cats]

7 bytes:

\d
$*
1

Sums digits in input.

8 bytes:

^
1
1
$'

Computes triangular numbers. (Unary in, unary out)

9 bytes:

(.)\1+
$1

Dereplicates chars.

10 bytes:

S`.
¶+
$.0

Counts chars in a slightly weird way. (The shortest way is 3 characters.)

11 bytes:

(^x|\1xx)+$

Matches squares.

14 bytes:

\(*S1`
\(*S1`

The shortest Retina quine.

15 bytes:

1
$`$'2
2
$_1
1

Computes cubes. (Unary in, decimal out)