答:
PHP, 34 bytes

```<code><?for($f=fgetc(STDIN);$f;?>1<?)?>0
</code>```

Wanted to try to get rid of the print but not sure it's worth it since you have to reintroduce the <? tags

Title: Implement a Truth-Machine

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

```

Body:
PHP, 34 bytes

<?for($f=fgetc(STDIN);$f;?>1<?)?>0

Wanted to try to get rid of the print but not sure it's worth it since you have to reintroduce the <? tags


问:
Substring Sum Set

Introduction

Let's observe this array: [3, 2, 4, 1, 1, 5, 1, 2].

Each element displays the length of the substring which must be summed up. Let's take a look at the first element of the above array:

```<code>[3, 2, 4, 1, 1, 5, 1, 2]
 ^
</code>```

The element at the first index is 3, so we now take a substring of length three with the same index as the starting position:

```<code>[3, 2, 4]
</code>```

When summed up, this results into 9, so the first element of the substring sum set is 9.

We do this for all the elements in the array:

```<code>3 -> [3, 2, 4]
2 -> [2, 4]
4 -> [4, 1, 1, 5]
1 -> [1]
1 -> [1]
5 -> [5, 1, 2]
1 -> [1]
2 -> [2]
</code>```

You can see that the number 5 is a bit of a weird case. That number exceeds the length of the array:

```<code>[3, 2, 4, 1, 1, 5, 1, 2]
                ^  ^  ^  ^  ^
</code>```

We'll ignore everything that exceeds the array, so we just use [5, 1, 2].

The last step is to sum everything up:

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

And that is the array that needs to be outputted:

```<code>[9, 6, 11, 1, 1, 8, 1, 2]
</code>```

The Task

Given an non-empty array with positive (non-zero) integers, output the substring sum set. This is code-golf, so the submission with the smallest number of bytes wins!

Test cases

```<code>[1, 2, 3, 4, 5] -> [1, 5, 12, 9, 5]
[3, 3, 3, 3, 3, 3, 3, 3] -> [9, 9, 9, 9, 9, 9, 6, 3]
[5, 1, 2, 4, 1] -> [13, 1, 6, 5, 1]
[1] -> [1]
</code>```

答:
JavaScript (ES6), 45

reduce beaten again!

a=>a.map((v,i)=>eval(a.slice(i,v+i).join`+`))
```
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>F=
a=>a.map((v,i)=>eval(a.slice(i,v+i).join`+`))

;[[3, 2, 4, 1, 1, 5, 1, 2],
  [1, 2, 3, 4, 5],
  [3, 3, 3, 3, 3, 3, 3, 3,],
  [5, 1, 2, 4, 1],
  [1]].forEach(t=>console.log(t+' -> '+F(t)))</code>```

ContentLicense: CC BY-SA 3.0

Title: Substring Sum Set

Body:
JavaScript (ES6), 45

reduce beaten again!

a=>a.map((v,i)=>eval(a.slice(i,v+i).join`+`))

F=
a=>a.map((v,i)=>eval(a.slice(i,v+i).join`+`))

;[[3, 2, 4, 1, 1, 5, 1, 2],
  [1, 2, 3, 4, 5],
  [3, 3, 3, 3, 3, 3, 3, 3,],
  [5, 1, 2, 4, 1],
  [1]].forEach(t=>console.log(t+' -> '+F(t)))


问:
Calculate Swatch Internet Time
Output the current time of day as Swatch Internet Time.

Specifically, output a three-digit (zero-padded) number of ".beats" (1000ths of a day) which represent the current time of day in the Swatch Internet Time time zone of UTC+01:00 ("Biel Meantime").

For example, if the current time in UTC is 23:47, then it is 00:47 in UTC+1 ("Biel Meantime"), and the output would be 032.

Examples:

```<code>UTC Current Time  ->  SIT Output
23:47             ->  032
23:00             ->  000
11:00             ->  500
14:37             ->  651
</code>```

The program should produce this output then immediately exit.

Output is to standard output (or equivalent). Must be a complete, runnable program, not a function. The program takes no input; it outputs the current time.

答:
Javascript, 83 bytes

```<code>a=(((36e5+(+new Date()))%864e5)/864e2).toFixed(),alert("00".slice(Math.log10(a))+a)
</code>```

Title: Calculate Swatch Internet Time

Body:
Javascript, 83 bytes

a=(((36e5+(+new Date()))%864e5)/864e2).toFixed(),alert("00".slice(Math.log10(a))+a)


问:
Print numbers from 1 to 10
This might be a very simple challenge, but I am surprised it hasn't been done on code-golf yet:

Print all Integers from 1 to 10 inclusive in ascending order to standard output.

Your output format can be whatever your language supports. This includes arbitrary separators (commas, semicolons, newlines, combinations of those, etc., but no digits), and prefixes and postfixes (like [...]). However, you may not output any other numbers than 1 through 10. Your program may not take any input. Standard loopholes are disallowed.

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

Leaderboard

var QUESTION_ID=86075,OVERRIDE_USER=42570;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

```

答:
golflua, 13 characters

(Rewrite of Katenkyo's Lua answer. Appreciations should be expressed by upvoting the original answer.)

```<code>~@i=1,10w(i)$
</code>```

Sample run:

```<code>bash-4.3$ golflua -e '~@i=1,10w(i)$'
1
2
3
4
5
6
7
8
9
10
</code>```

Title: Print numbers from 1 to 10

Body:
golflua, 13 characters

(Rewrite of Katenkyo's Lua answer. Appreciations should be expressed by upvoting the original answer.)

~@i=1,10w(i)$

Sample run:

bash-4.3$ golflua -e '~@i=1,10w(i)$'
1
2
3
4
5
6
7
8
9
10


问:
Print the ASCII table
The task is to display n characters of the ASCII table.

You may write a function (or a program that takes the argument as a parameter, STDIN is allowed as well) that takes a parameter n, which will be the index of the last character to print.

The task is quite simple, so as an example here's a possible implementation in Python 2.7:

```<code>(lambda n:map(chr, range(n)))(256)
</code>```

As I said it's a simple task. So this is code-golf and the shortest codes wins!

EDIT

As some of you pointed out this code doesn't print the result. It's just an example since I might struggle explaining the problem in english ;-).

EDIT2

Feel free to post the answer in any programming language, even if it's not the shortest code. Maybe there are some interesting implementations out there!

EDIT3

Fixed the example so it prints the result.

答:
Lua, 37 Bytes

```<code>a=...for i=1,a do print(a.char(i))end
</code>```

Title: Print the ASCII table

Body:
Lua, 37 Bytes

a=...for i=1,a do print(a.char(i))end


问:
Code Injection works in C# too!
Given the following C# program outputting False, inject a 'malicious' line of code such that the program outputs True.

```<code>class Program
{
    static void Main()
    {
        System.Console.Write("False");
        ;
    }
}
</code>```

Your answer should consist of a string that replaces the second semicolon, and causes the program to output True, the whole True and nothing but True (not even a newline). It must do this if stdout is printed to the console, and if stdout is redirected to a file.

The shortest answer wins.

答:
Not sure if this is accepted.

The question doesn't say anything about compiler options so I assume I can change the entry point of the app.

55 characters ,3 more than the accepted answer

```<code>}class P{static void Main(){System.Console.Write(1>0);}
</code>```

Full

```<code>class Program
{
    static void Main()
    {
        System.Console.Write("False");
    }
    class P
    {
        static void Main() { System.Console.Write(1 > 0); }
    }
}
</code>```

Title: Code Injection works in C# too!

Body:
Not sure if this is accepted.

The question doesn't say anything about compiler options so I assume I can change the entry point of the app.

55 characters ,3 more than the accepted answer

}class P{static void Main(){System.Console.Write(1>0);}

Full

class Program
{
    static void Main()
    {
        System.Console.Write("False");
    }
    class P
    {
        static void Main() { System.Console.Write(1 > 0); }
    }
}


Title: Substring Sum Set

Body:
Introduction

Let's observe this array: [3, 2, 4, 1, 1, 5, 1, 2].

Each element displays the length of the substring which must be summed up. Let's take a look at the first element of the above array:

```<code>[3, 2, 4, 1, 1, 5, 1, 2]
 ^
</code>```

The element at the first index is 3, so we now take a substring of length three with the same index as the starting position:

```<code>[3, 2, 4]
</code>```

When summed up, this results into 9, so the first element of the substring sum set is 9.

We do this for all the elements in the array:

```<code>3 -> [3, 2, 4]
2 -> [2, 4]
4 -> [4, 1, 1, 5]
1 -> [1]
1 -> [1]
5 -> [5, 1, 2]
1 -> [1]
2 -> [2]
</code>```

You can see that the number 5 is a bit of a weird case. That number exceeds the length of the array:

```<code>[3, 2, 4, 1, 1, 5, 1, 2]
                ^  ^  ^  ^  ^
</code>```

We'll ignore everything that exceeds the array, so we just use [5, 1, 2].

The last step is to sum everything up:

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

And that is the array that needs to be outputted:

```<code>[9, 6, 11, 1, 1, 8, 1, 2]
</code>```

The Task

Given an non-empty array with positive (non-zero) integers, output the substring sum set. This is code-golf, so the submission with the smallest number of bytes wins!

Test cases

```<code>[1, 2, 3, 4, 5] -> [1, 5, 12, 9, 5]
[3, 3, 3, 3, 3, 3, 3, 3] -> [9, 9, 9, 9, 9, 9, 6, 3]
[5, 1, 2, 4, 1] -> [13, 1, 6, 5, 1]
[1] -> [1]
</code>```

Body:
JavaScript (ES6) - 79 Bytes

A recursive solution that does not use any of the Array methods:

f=([a,...t],n)=>a&&n?a+f(t,n-1):0;g=([a,...t],r=[])=>a?g(t,[...r,a+f(t,a-1)]):r

Testing:

f=([a,...t],n)=>a&&n?a+f(t,n-1):0;
g=([a,...t],r=[])=>a?g(t,[...r,a+f(t,a-1)]):r;

[
  [3, 2, 4, 1, 1, 5, 1, 2],
  [1, 2, 3, 4, 5],
  [3, 3, 3, 3, 3, 3, 3, 3,],
  [5, 1, 2, 4, 1],
  [1]
].forEach(a=>console.log(''+g(a)));


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

```

答:
JQuery, <s>63</s> 57 Bytes

```<code>if($("input").val()==1){while(1){alert(1)}}else{alert(0)}
</code>```

Try it!

Title: Implement a Truth-Machine

Body:
JQuery, <s>63</s> 57 Bytes

if($("input").val()==1){while(1){alert(1)}}else{alert(0)}

Try it!


问:
Fibonacci reversed!

Introduction

We all know and love our Fibonacci sequence and have seen a myriad of challenge on it here already. However, we're still lacking a very simple case which this answer is going to provide: Reversed fibonacci! So given F_n your job is to find n.

Specification

Input

Your input will be a non-negative integer, which is guaranteed to be part of the fibonacci sequence.

Output

The output must be a non-negative integer as well.

What to do?

The introduction already said: Given a fibonacci number, output its index. Fiboancci number hereby is defined as F(0)=0, F(1)=1, F(n)=F(n-1)+F(n-2) and you're given F(n) and must return n.

Potential Corner Cases

0 is a valid in- and output.

If given "1" as input you may either output "1" or "2", as you prefer.

You may always assume that your input actually is a fibonacci number.

You may assume that the input is representable as a 32-bit signed integer.

Who wins?

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

Standard rules apply of course.

Test-cases

```<code>0 -> 0
2 -> 3
3 -> 4
5 -> 5
8 -> 6
13 -> 7
1836311903 -> 46
</code>```

答:
Sesos, 28 bytes

Hexdump:

```<code>0000000: 16f8be 766ef7 ae6d80 f90bde b563f0 7ded18 3ceffa  ...vn..m.....c.}..<..
0000015: b1c1bb af9f3f ff                                  .....?.
</code>```

Try it online!

(Exponential time because in Sesos copying a number needs exponential time.)

Assembly used to generate the binary file:

set numin
set numout
get
jmp
sub 1
fwd 1
add 1
fwd 1
add 1
rwd 2
jnz    ;input input
fwd 4
add 1  ;input input 0 1
fwd 2
add 1  ;input input 0 1 0 1
rwd 4
jmp
jmp    ;input input-curr curr next iterations
sub 1
jnz    ;input 0 curr next iterations
fwd 3
add 1
jmp
sub 1
fwd 2
add 1
rwd 2
jnz    ;input 0 curr next 0 0 iterations+1
rwd 1
jmp
sub 1
fwd 1
add 1
fwd 1
add 1
rwd 2
jnz    ;input 0 curr 0 next next iterations+1
rwd 1
jmp
sub 1
fwd 1
sub 1
fwd 2
add 1
rwd 3
jnz    ;input 0 0 -curr next curr+next iterations+1
rwd 2
jmp
sub 1
fwd 2
add 1
fwd 1
add 1
rwd 3
jnz    ;0 0 input input-curr next curr+next iterations+1
fwd 3
jnz
fwd 3
put
```

Title: Fibonacci reversed!

Body:
Sesos, 28 bytes

Hexdump:

0000000: 16f8be 766ef7 ae6d80 f90bde b563f0 7ded18 3ceffa  ...vn..m.....c.}..<..
0000015: b1c1bb af9f3f ff                                  .....?.

<a href="http://sesos.tryitonline.net/#code=c2V0IG51bWluCnNldCBudW1vdXQKZ2V0CmptcApzdWIgMQpmd2QgMQphZGQgMQpmd2QgMQphZGQgMQpyd2QgMgpqbnogICAgO2EgYQpmd2QgNAphZGQgMSAgO2EgYSAwIDEKZndkIDIKYWRkIDEgIDthIGEgMCAxIDAgMQpyd2QgNApqbXAKam1wICAgIDthIGEtYiBiIGMgbgpzdWIgMQpqbnogICAgO2EgMCBiIGMgbgpmd2QgMwphZGQgMQpqbXAKc3ViIDEKZndkIDIKYWRkIDEKcndkIDIKam56ICAgIDthIDAgYiBjIDAgMCBuKzEKcndkIDEKam1wCnN1YiAxCmZ3ZCAxCmFkZCAxCmZ3ZCAxCmFkZCAxCnJ3ZCAyCmpueiAgICA7YSAwIGIgMCBjIGMgbisxCnJ3ZCAxCmptcApzdWIgMQpmd2QgMQpzdWIgMQpmd2QgMgphZGQgMQpyd2QgMwpqbnogICAgO2EgMCAwIC1iIGMgYitjIG4rMQpyd2QgMgpqbXAKc3ViIDEKZndkIDIKYWRkIDEKZndkIDEKYWRkIDEKcndkIDMKam56ICAgIDswIDAgYSBhLWIgYyBiK2MgbisxCmZ3ZCAzCmpuegpmd2QgMwpwdXQ&input=NQ&debug=on" rel="nofollow">Try it online!

(Exponential time because in Sesos copying a number needs exponential time.)

Assembly used to generate the binary file:

set numin
set numout
get
jmp
sub 1
fwd 1
add 1
fwd 1
add 1
rwd 2
jnz    ;input input
fwd 4
add 1  ;input input 0 1
fwd 2
add 1  ;input input 0 1 0 1
rwd 4
jmp
jmp    ;input input-curr curr next iterations
sub 1
jnz    ;input 0 curr next iterations
fwd 3
add 1
jmp
sub 1
fwd 2
add 1
rwd 2
jnz    ;input 0 curr next 0 0 iterations+1
rwd 1
jmp
sub 1
fwd 1
add 1
fwd 1
add 1
rwd 2
jnz    ;input 0 curr 0 next next iterations+1
rwd 1
jmp
sub 1
fwd 1
sub 1
fwd 2
add 1
rwd 3
jnz    ;input 0 0 -curr next curr+next iterations+1
rwd 2
jmp
sub 1
fwd 2
add 1
fwd 1
add 1
rwd 3
jnz    ;0 0 input input-curr next curr+next iterations+1
fwd 3
jnz
fwd 3
put


答:
C#, 94 bytes

```<code>Console.Write(String.Join(",",a.Select((v,i)=>a.Skip(i).Take(v).Sum().ToString()).ToArray()));
</code>```

Where a is an int[] that represents the input to be solved.

Title: Substring Sum Set

Body:
C#, 94 bytes

Console.Write(String.Join(",",a.Select((v,i)=>a.Skip(i).Take(v).Sum().ToString()).ToArray()));

Where a is an int[] that represents the input to be solved.


答:
Pyke, <s>12</s> 7 bytes

```<code>FKo>i<s
</code>```

Try it here!

```<code>        - o = 0
F       - for i in input:
  o     -    o+=1
   >    -    input[o:]
    i<  -   ^[:i]
      s -  sum(^)
</code>```

Title: Substring Sum Set

Body:
Pyke, <s>12</s> 7 bytes

FKo>i<s

Try it here!

        - o = 0
F       - for i in input:
  o     -    o+=1
   >    -    input[o:]
    i<  -   ^[:i]
      s -  sum(^)


问:
Count up forever
Write a program that counts up forever, starting from one.

Rules:

Your program must log to STDOUT or an acceptable alternative, if STDOUT is not available.

Your program must be a full, runnable program, and not a function or snippet.

Your program must output each number with a separating character in between (a newline, space, tab or comma), but this must be consistent for all numbers.

You may print the numbers in decimal, in unary or in base 256 where each digit is represented by a byte value.

Your program must count at least as far as 2128 (inclusive) without problems and without running out of memory on a reasonable desktop PC. In particular, this means if you're using unary, you cannot store a unary representation of the current number in memory.

Unlike our usual rules, feel free to use a language (or language version) even if it's newer than this challenge. Languages specifically written to submit a 0-byte answer to this challenge are fair game but not particularly interesting.

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.

This is not about finding the language with the shortest solution for this (there are some where the empty program does the trick) - this is about finding the shortest solution in every language. Therefore, no answer will be marked as accepted.

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>## [><>](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

```

答:
Sesos, 2 bytes

Hexdump:

```<code>0000000: 0c3a                                              .:
</code>```

Try it online!

Assembly:

set numout ;output one number per line instead of character
nop        ;set entry marker (start of loop)
add 1
put
           ;(implicit jnz) set exit marker (end of loop, jump if not zero)
```

Title: Count up forever

Body:
Sesos, 2 bytes

Hexdump:

0000000: 0c3a                                              .:

Try it online!

Assembly:

set numout ;output one number per line instead of character
nop        ;set entry marker (start of loop)
add 1
put
           ;(implicit jnz) set exit marker (end of loop, jump if not zero)


问:
Divisibility test

Task

Given two strictly positive integers n and d as input, determine whether n is evenly divisible by d, i.e., if there exists an integer q such that n = qd.

You may write a program or a function and use any of the our standard methods of receiving input and providing output.

The output should be a truthy or a falsy value; truthy if n is divisible by d, and falsy otherwise.

Your code only has to handle integers it can represent natively, as long as it works for all signed 8-bit integers. However, your algorithm has to work for arbitrarily large integers.

You may use any programming language, but note that these loopholes are forbidden by default.

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

Test cases

```<code> n,  d    output

 1,  1    truthy
 2,  1    truthy
 6,  3    truthy
17, 17    truthy
22,  2    truthy
 1,  2    falsy
 2,  3    falsy
 2,  4    falsy
 3,  9    falsy
15, 16    falsy
</code>```

Leaderboard

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 + 3 (-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

```

答:
C++11, 31 bytes

```<code>[](int n,int d){return n%d<1;}
</code>```

Uses the fact that a%b is always non-negative for positive numbers, and therefore only n%d==0 fulfills n%d<1.

Usage:

```<code>int main(){
   const auto lambda = [](int n,int d){return n%d<1;};
   std::cout << lambda(100,2) << "\n";
             << lambda(100,3) << std::endl;
}
</code>```

Result:

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

Title: Divisibility test

Body:
C++11, 31 bytes

[](int n,int d){return n%d<1;}

Uses the fact that a%b is always non-negative for positive numbers, and therefore only n%d==0 fulfills n%d<1.

Usage:

int main(){
   const auto lambda = [](int n,int d){return n%d<1;};
   std::cout << lambda(100,2) << "\n";
             << lambda(100,3) << std::endl;
}

Result:

1
0


答:
C#, 89 bytes

```<code>int[]s(List<int>a)=>a.Select((n,i)=>a.GetRange(i,Math.Min(n,a.Count-i)).Sum()).ToArray();
</code>```

pretty straight forward

improvement ideas appreciated

Title: Substring Sum Set

Body:
C#, 89 bytes

int[]s(List<int>a)=>a.Select((n,i)=>a.GetRange(i,Math.Min(n,a.Count-i)).Sum()).ToArray();

pretty straight forward

improvement ideas appreciated


答:
Excel VBA, 62 bytes

```<code>Function q(b, c)
If b / c = Int(b / c) Then q = 1
End Function
</code>```

Title: Divisibility test

Body:
Task

Given two strictly positive integers n and d as input, determine whether n is evenly divisible by d, i.e., if there exists an integer q such that n = qd.

You may write a program or a function and use any of the our standard methods of receiving input and providing output.

The output should be a truthy or a falsy value; truthy if n is divisible by d, and falsy otherwise.

Your code only has to handle integers it can represent natively, as long as it works for all signed 8-bit integers. However, your algorithm has to work for arbitrarily large integers.

You may use any programming language, but note that these loopholes are forbidden by default.

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

Test cases

```<code> n,  d    output

 1,  1    truthy
 2,  1    truthy
 6,  3    truthy
17, 17    truthy
22,  2    truthy
 1,  2    falsy
 2,  3    falsy
 2,  4    falsy
 3,  9    falsy
15, 16    falsy
</code>```

Leaderboard

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 + 3 (-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

```

Body:
Excel VBA, 62 bytes

Function q(b, c)
If b / c = Int(b / c) Then q = 1
End Function


答:
05AB1E, <s>11</s> 8 bytes

```<code>[D¬£Oˆ¦Ž
</code>```

Explanation

```<code>[         # infinite loop
 D        # duplicate current list
  ¬       # get head of list
   £      # get that many elements from list
    O     # sum
     ˆ    # add to global array
      ¦   # remove first element of list
       Ž  # break if stack is empty
          # implicitly push and print global array
</code>```

Try it online

Title: Substring Sum Set

Body:
05AB1E, <s>11</s> 8 bytes

[D¬£Oˆ¦Ž

Explanation

[         # infinite loop
 D        # duplicate current list
  ¬       # get head of list
   £      # get that many elements from list
    O     # sum
     ˆ    # add to global array
      ¦   # remove first element of list
       Ž  # break if stack is empty
          # implicitly push and print global array

Try it online


问:
Is it a leap year?
This challenge is quite simple. You will take an input which will be a year from 1801 to 2400, and output if it is a leap year or not.

Your input will have no newlines or trailing spaces:

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

You will output in any way that you like that clearly tells the user if it is or isn't a leap year (I will accept y or n for yes/no)

You can get a list of leap years here: http://kalender-365.de/leap-years.php
I would note that leap years are not ever four years always. 1896 is a leap year, but 1900 is not. The years that follow this "skip" are:

```<code>1900
2100
2200
2300
</code>```

Test cases:

```<code>1936 ->  y
1805 ->  n
1900 ->  n
2272 ->  y
2400 ->  y
</code>```

EDIT: This is based on a standard Gregorian calendar: http://www.epochconverter.com/date-and-time/daynumbers-by-year.php

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

```

答:
Stackylogic, 226 bytes

Yes, that is right. I made a program in Stackylogic (non-TC), which was invented by Helka Homba, for the challenge found here.

Stackylogic has only binary input, so 10 (or more, any more digits will be ignored) bit binary must be used (least significant bit inputted first). Any dates outside the specified range might fail, as it simply checks what the inputted number is: it doesn't cover unnecessary dates

Not only is this my first challenge with stackylogic, but the first challenge with stackylogic at all.

Get ready for this mess:

```<code>1
0
1?
010
1?0
010
1?10
?1010
001010
?1010
?1010
?010
?10
?0
0
?
110
?10
11010
?010
11010
?1010
001010
?1010
?1010
?1010
?1010
?010
?0
110
?10
11010
?010
1010
01010
01010
?010
?0
110
?0
110
?0
110
1?0
?10
0?10
?10
?0
01
?
?<
0
</code>```

This took me so long to make, because Stackylogic is the most confusing language I have encountered, and extremely unreadable: you have to know how the rest of the program has executed before you can read the current section being edited. I even had to add spaces for readability while creating it.

Meagre explanation

This is a simple explanation of what it does.

Stackylogic does not have any mathematical functions, so that made this harder. I had to hardcode most of it, to check if it was a specific number.

First, this program will do a NOR of the least significant bits, discarding them in the process. this means that if it is divisible by 4, it will proceed to the main part of the program, otherwise output 0.

Second, the pointer is carried over to the labyrinth of stackylogic, from here, if the next two bits are zero, it will instantly output 1 (as then it is divisible by 16, and so a leap year despite any other conditions), other wise it will check if it is not any of the numbers that is divisible by 4 but not a leap year, between 1801 and 2400.

To explain in detail, would involve making this post many times longer than it already is

ContentLicense: CC BY-SA 4.0

Title: Is it a leap year?

Body:
Stackylogic, 226 bytes

Yes, that is right. I made a program in Stackylogic (non-TC), which was invented by Helka Homba, for the challenge found here.

Stackylogic has only binary input, so 10 (or more, any more digits will be ignored) bit binary must be used (least significant bit inputted first). Any dates outside the specified range might fail, as it simply checks what the inputted number is: it doesn't cover unnecessary dates

Not only is this my first challenge with stackylogic, but the first challenge with stackylogic at all.

Get ready for this mess:

1
0
1?
010
1?0
010
1?10
?1010
001010
?1010
?1010
?010
?10
?0
0
?
110
?10
11010
?010
11010
?1010
001010
?1010
?1010
?1010
?1010
?010
?0
110
?10
11010
?010
1010
01010
01010
?010
?0
110
?0
110
?0
110
1?0
?10
0?10
?10
?0
01
?
?<
0

This took me so long to make, because Stackylogic is the most confusing language I have encountered, and extremely unreadable: you have to know how the rest of the program has executed before you can read the current section being edited. I even had to add spaces for readability while creating it.

Meagre explanation

This is a simple explanation of what it does.

Stackylogic does not have any mathematical functions, so that made this harder. I had to hardcode most of it, to check if it was a specific number.

First, this program will do a NOR of the least significant bits, discarding them in the process. this means that if it is divisible by 4, it will proceed to the main part of the program, otherwise output 0.

Second, the pointer is carried over to the labyrinth of stackylogic, from here, if the next two bits are zero, it will instantly output 1 (as then it is divisible by 16, and so a leap year despite any other conditions), other wise it will check if it is not any of the numbers that is divisible by 4 but not a leap year, between 1801 and 2400.

To explain in detail, would involve making this post many times longer than it already is


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

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

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

Task

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

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

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

Input

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

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

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

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

Output

Output has to be written to STDOUT or closest alternative.

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

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

Additional rules

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

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

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

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

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

Note that there must be an interpreter so the submission can be tested. It is allowed (and even encouraged) to write this interpreter yourself for a previously unimplemented language.

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

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

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

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

Catalog

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

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

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

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

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

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

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

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

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

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

Shortest Solution by Language

Language	User	Score

Leaderboard

	Author	Language	Size

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

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

```

答:
Sesos, <s>50</s> 49 bytes

Algorithm #3...

```<code>0000000: 16def7 f5991b 7441bf 3f0ebb eecfd8 b86b33 b7eb33  ......tA.?......k3..3
0000015: 37ecda bccdd8 b86b33 3ffcfe 8c7de8 797cfc f599c3  7......k3?...}.y|....
000002a: f973f5 8479c5 03                                  .s..y..
</code>```

Try it online!

This is the very first working code I got, so I'm sure it's possible to shave off a few more bytes here. Here's the BF-code I wrote (with some rather sparse comments that are mostly meant for myself):

```<code>,
[>+>+>+<<<-]                ; triplicate input
>>[-                        ; i from n_1 down to 0
    <+[-<<<+>>>             ; j from n down to 0 copying n to the left
        [                   ; k from j down to 1
            >[<<+<+>>>-]    ; add i to the values on the left
            <<[>>+<<-]      ; move one copy of i back
            >>>>+<<<-       ; decrement k while copying j to the right
        ]
        >>[<<+<<->>>>-]     ; subtract n from i*j while copying it
        <<[>>+<<-]          ; move n back
        >>>[<<<+>>>-]       ; move j back
        <<<<<[              ; if not equal:
            ,               ; reset to zero
            >               ; move to zero left of j
        ]
        >
    ]
    <<<[>>>+<<<-]           ; move n back to j
    >[<]>>>                 ; if we didn't exit move back to i
                            ; otherwise remain on the zero left of j
]
>,+>-[<->,]<.
</code>```

I then used this Retina script to convert that to Sesos ASM:

```<code>set numin
set numout

get
jmp
   fwd 1
   add 1
   fwd 1
   add 1
   fwd 1
   add 1
   rwd 3
   sub 1
jnz
fwd 2
jmp
   sub 1
   rwd 1
   add 1
   jmp
      sub 1
      rwd 3
      add 1
      fwd 3
      jmp
         fwd 1
         jmp
            rwd 2
            add 1
            rwd 1
            add 1
            fwd 3
            sub 1
         jnz
         rwd 2
         jmp
            fwd 2
            add 1
            rwd 2
            sub 1
         jnz
         fwd 4
         add 1
         rwd 3
         sub 1
      jnz
      fwd 2
      jmp
         rwd 2
         add 1
         rwd 2
         sub 1
         fwd 4
         sub 1
      jnz
      rwd 2
      jmp
         fwd 2
         add 1
         rwd 2
         sub 1
      jnz
      fwd 3
      jmp
         rwd 3
         add 1
         fwd 3
         sub 1
      jnz
      rwd 5
      jmp
         get
         fwd 1
      jnz
      fwd 1
   jnz
   rwd 3
   jmp
      fwd 3
      add 1
      rwd 3
      sub 1
   jnz
   fwd 1
   jmp
      rwd 1
   jnz
   fwd 3
jnz
fwd 1
get
add 1
fwd 1
sub 1
jmp
   rwd 1
   sub 1
   fwd 1
   get
jnz
rwd 1
put
</code>```

And of course the final conversion to binary is done by Sesos itself.

I scrapped three earlier attempts for trial division, and ultimately really got tired of the modulo computation. So I started thinking about how I could avoid that altogether. I ended up coming up with a very simple primality test, that for some reason never occurred to me before and might be handy for a lot of other esolangs where doing a multiplication is fine but computing a modulo is a royal pain:

In essence, I just compute the full multiplication between [1, ..., n-1] and [1, ..., n] starting from the largest value. After each multiplication, I subtract n from the result. If that gives 0, I terminate. This is bound to terminate, because at the beginning of the final iteration of the outer loop, I'm computing 1 * n. If I get there, it's a prime. Otherwise, some earlier multiplication will have given n and the loop stops there instead. That means I can simply check after terminating whether the first iterator is equal to 1 or not in order to decide primality.

I'll probably post the Brainfuck-version of this as well, once I'm happy with the golfing.

Title: Is this number a prime?

Body:
Sesos, <s>50</s> 49 bytes

Algorithm #3...

0000000: 16def7 f5991b 7441bf 3f0ebb eecfd8 b86b33 b7eb33  ......tA.?......k3..3
0000015: 37ecda bccdd8 b86b33 3ffcfe 8c7de8 797cfc f599c3  7......k3?...}.y|....
000002a: f973f5 8479c5 03                                  .s..y..

<a href="http://sesos.tryitonline.net/#code=c2V0IG51bWluCnNldCBudW1vdXQKCmdldApqbXAKICAgZndkIDEKICAgYWRkIDEKICAgZndkIDEKICAgYWRkIDEKICAgZndkIDEKICAgYWRkIDEKICAgcndkIDMKICAgc3ViIDEKam56CmZ3ZCAyCmptcAogICBzdWIgMQogICByd2QgMQogICBhZGQgMQogICBqbXAKICAgICAgc3ViIDEKICAgICAgcndkIDMKICAgICAgYWRkIDEKICAgICAgZndkIDMKICAgICAgam1wCiAgICAgICAgIGZ3ZCAxCiAgICAgICAgIGptcAogICAgICAgICAgICByd2QgMgogICAgICAgICAgICBhZGQgMQogICAgICAgICAgICByd2QgMQogICAgICAgICAgICBhZGQgMQogICAgICAgICAgICBmd2QgMwogICAgICAgICAgICBzdWIgMQogICAgICAgICBqbnoKICAgICAgICAgcndkIDIKICAgICAgICAgam1wCiAgICAgICAgICAgIGZ3ZCAyCiAgICAgICAgICAgIGFkZCAxCiAgICAgICAgICAgIHJ3ZCAyCiAgICAgICAgICAgIHN1YiAxCiAgICAgICAgIGpuegogICAgICAgICBmd2QgNAogICAgICAgICBhZGQgMQogICAgICAgICByd2QgMwogICAgICAgICBzdWIgMQogICAgICBqbnoKICAgICAgZndkIDIKICAgICAgam1wCiAgICAgICAgIHJ3ZCAyCiAgICAgICAgIGFkZCAxCiAgICAgICAgIHJ3ZCAyCiAgICAgICAgIHN1YiAxCiAgICAgICAgIGZ3ZCA0CiAgICAgICAgIHN1YiAxCiAgICAgIGpuegogICAgICByd2QgMgogICAgICBqbXAKICAgICAgICAgZndkIDIKICAgICAgICAgYWRkIDEKICAgICAgICAgcndkIDIKICAgICAgICAgc3ViIDEKICAgICAgam56CiAgICAgIGZ3ZCAzCiAgICAgIGptcAogICAgICAgICByd2QgMwogICAgICAgICBhZGQgMQogICAgICAgICBmd2QgMwogICAgICAgICBzdWIgMQogICAgICBqbnoKICAgICAgcndkIDUKICAgICAgam1wCiAgICAgICAgIGdldAogICAgICAgICBmd2QgMQogICAgICBqbnoKICAgICAgZndkIDEKICAgam56CiAgIHJ3ZCAzCiAgIGptcAogICAgICBmd2QgMwogICAgICBhZGQgMQogICAgICByd2QgMwogICAgICBzdWIgMQogICBqbnoKICAgZndkIDEKICAgam1wCiAgICAgIHJ3ZCAxCiAgIGpuegogICBmd2QgMwpqbnoKZndkIDEKZ2V0CmFkZCAxCmZ3ZCAxCnN1YiAxCmptcAogICByd2QgMQogICBzdWIgMQogICBmd2QgMQogICBnZXQKam56CnJ3ZCAxCnB1dAo&input=MTE">Try it online!

This is the very first working code I got, so I'm sure it's possible to shave off a few more bytes here. Here's the BF-code I wrote (with some rather sparse comments that are mostly meant for myself):

,
[>+>+>+<<<-]                ; triplicate input
>>[-                        ; i from n_1 down to 0
    <+[-<<<+>>>             ; j from n down to 0 copying n to the left
        [                   ; k from j down to 1
            >[<<+<+>>>-]    ; add i to the values on the left
            <<[>>+<<-]      ; move one copy of i back
            >>>>+<<<-       ; decrement k while copying j to the right
        ]
        >>[<<+<<->>>>-]     ; subtract n from i*j while copying it
        <<[>>+<<-]          ; move n back
        >>>[<<<+>>>-]       ; move j back
        <<<<<[              ; if not equal:
            ,               ; reset to zero
            >               ; move to zero left of j
        ]
        >
    ]
    <<<[>>>+<<<-]           ; move n back to j
    >[<]>>>                 ; if we didn't exit move back to i
                            ; otherwise remain on the zero left of j
]
>,+>-[<->,]<.

I then used this Retina script to convert that to Sesos ASM:

set numin
set numout

get
jmp
   fwd 1
   add 1
   fwd 1
   add 1
   fwd 1
   add 1
   rwd 3
   sub 1
jnz
fwd 2
jmp
   sub 1
   rwd 1
   add 1
   jmp
      sub 1
      rwd 3
      add 1
      fwd 3
      jmp
         fwd 1
         jmp
            rwd 2
            add 1
            rwd 1
            add 1
            fwd 3
            sub 1
         jnz
         rwd 2
         jmp
            fwd 2
            add 1
            rwd 2
            sub 1
         jnz
         fwd 4
         add 1
         rwd 3
         sub 1
      jnz
      fwd 2
      jmp
         rwd 2
         add 1
         rwd 2
         sub 1
         fwd 4
         sub 1
      jnz
      rwd 2
      jmp
         fwd 2
         add 1
         rwd 2
         sub 1
      jnz
      fwd 3
      jmp
         rwd 3
         add 1
         fwd 3
         sub 1
      jnz
      rwd 5
      jmp
         get
         fwd 1
      jnz
      fwd 1
   jnz
   rwd 3
   jmp
      fwd 3
      add 1
      rwd 3
      sub 1
   jnz
   fwd 1
   jmp
      rwd 1
   jnz
   fwd 3
jnz
fwd 1
get
add 1
fwd 1
sub 1
jmp
   rwd 1
   sub 1
   fwd 1
   get
jnz
rwd 1
put

And of course the final conversion to binary is done by Sesos itself.

I scrapped three earlier attempts for trial division, and ultimately really got tired of the modulo computation. So I started thinking about how I could avoid that altogether. I ended up coming up with a very simple primality test, that for some reason never occurred to me before and might be handy for a lot of other esolangs where doing a multiplication is fine but computing a modulo is a royal pain:

In essence, I just compute the full multiplication between [1, ..., n-1] and [1, ..., n] starting from the largest value. After each multiplication, I subtract n from the result. If that gives 0, I terminate. This is bound to terminate, because at the beginning of the final iteration of the outer loop, I'm computing 1 * n. If I get there, it's a prime. Otherwise, some earlier multiplication will have given n and the loop stops there instead. That means I can simply check after terminating whether the first iterator is equal to 1 or not in order to decide primality.

I'll probably post the Brainfuck-version of this as well, once I'm happy with the golfing.


答:
Brachylog, 27 bytes

```<code>.v|h~l(A:Tc?;A?)b:0&~b.h~+A
</code>```

Try it online! or verify all test cases.

Explanation

```<code>  .v           Input = Output = []
|            Or
  h~l          A is a list, its length is the value of the first element of the Input
  (
    A:Tc?        The concatenation of A with another list T results in the Input
  ;            Or
    A?           A = Input
  )
  b:0&         Call recursively on Input minus the first element
  ~b.          Output is the output of that call with an extra element at the beginning
  h~+A         That extra element is the sum of the elements of A
</code>```

Title: Substring Sum Set

Body:
Brachylog, 27 bytes

.v|h~l(A:Tc?;A?)b:0&~b.h~+A

Try it online! or verify all test cases.

Explanation

  .v           Input = Output = []
|            Or
  h~l          A is a list, its length is the value of the first element of the Input
  (
    A:Tc?        The concatenation of A with another list T results in the Input
  ;            Or
    A?           A = Input
  )
  b:0&         Call recursively on Input minus the first element
  ~b.          Output is the output of that call with an extra element at the beginning
  h~+A         That extra element is the sum of the elements of A


答:
Dyalog APL, 15 bytes

```<code>{+/¨⍵↑∘⌽¨⌽,\⌽⍵}
</code>```

or

```<code>{⌽+/¨(-↑¨,\)⌽⍵}
</code>```

Title: Substring Sum Set

Body:
Dyalog APL, 15 bytes

{+/¨⍵↑∘⌽¨⌽,\⌽⍵}

or

{⌽+/¨(-↑¨,\)⌽⍵}


答:
VBA, 46 44 41 bytes

```<code>Function f(i,j)
f=i Mod j = 0
End Function
</code>```

Title: Divisibility test

Body:
VBA, 46 44 41 bytes

Function f(i,j)
f=i Mod j = 0
End Function


问:
Bring ASCII art to the 3rd dimension
In this challenge, You have to bring ASCII art (which are usually 2D) to 3D!

How?

like this,

```<code>X X DD
 X  D D
X X DD
</code>```

to...

```<code>  X X DD
 X X DD D
X X DDDD
 X XDDD
X X DD
</code>```

Then How do we do that?

Given the ascii art and N, repeat this N times.

for every character (we will call this A):

let B be the character which is exactly 1 right and 1 up from A

if B is a space or is undefined:

set B to A.

Specs

The first input can be a string with newline characters or a list of strings representing the 2D ASCII art.

You are allowed to use %END% to tag the end of input, but this is not required.

The second input will be N. It will be a positive integer.

all the lines of the strings will be the same length.

Examples

Input: ("###\n###",1)

Output:

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

Rules

Basic code-golf rules apply.

also, If you have questions, be sure to ask in the comments!

答:
Pyth, <s>54</s> 33 bytes

```<code>ju+++dhG.bsmh|-d;;.t,Y+dNdtGGeG.*
</code>```

Test suite.

Title: Bring ASCII art to the 3rd dimension

Body:
Pyth, <s>54</s> 33 bytes

ju+++dhG.bsmh|-d;;.t,Y+dNdtGGeG.*

<a href="http://pyth.herokuapp.com/?code=ju%2B%2B%2BdhG.bsmh%7C-d%3B%3B.t%2CY%2BdNdtGGeG.%2a&test_suite=1&test_suite_input=%5B2%2C%5B%22X+X+DD%22%2C%22+X++D+D%22%2C%22X+X+DD%22%5D%5D%0A%5B1%2C%5B%22%23%23%23%22%2C%22%23%23%23%22%5D%5D%0A%5B9%2C%5B%22+ROFL%3AROFL%3AROFL%3AROFL%22%2C%22+++++++++_%5E___%22%2C%22+L++++__%2F+++%5B%5D+%5C%5C++++%22%2C%22LOL%3D%3D%3D__++++++++%5C%5C+%22%2C%22+L++++++%5C%5C________%5D%22%2C%22+++++++++I+++I%22%2C%22++++++++--------%2F%22%5D%5D&debug=0" rel="nofollow">Test suite.


问:
Holiday Gift Exchange
Another problem from our internal golfing...this one around the holidays last year.

PROBLEM

Andy, Barb, Carl, Didi, Earl, and Fran are buying gifts for each other. Draw names for a gift exchange.

Each person buys one gift and receives one gift.

Nobody buys their own gift.

Running the solution multiple times should produce different results (giver-receiver pair should not be predictable or identical from run to run).

INPUT

None.

OUTPUT

Formatted as in this example:

Andy buys for Barb

  Barb buys for Carl

  Carl buys for Didi

  Didi buys for Earl

  Earl buys for Fran

  Fran buys for Andy

答:
Ruby - 89 chars

```<code>(a=%w(Andy Barb Carl Didi Earl Fran).shuffle).zip(a.reverse).each{|e|puts e*' buys for '}
</code>```

Output:

```<code>Andy buys for Didi
Barb buys for Earl
Fran buys for Carl
Carl buys for Fran
Earl buys for Barb
Didi buys for Andy
</code>```

ContentLicense: CC BY-SA 2.5

Title: Holiday Gift Exchange

Body:
Ruby - 89 chars

(a=%w(Andy Barb Carl Didi Earl Fran).shuffle).zip(a.reverse).each{|e|puts e*' buys for '}

Output:

Andy buys for Didi
Barb buys for Earl
Fran buys for Carl
Carl buys for Fran
Earl buys for Barb
Didi buys for Andy


问:
Square-free semiprime counting

Definition

A square-free semiprime is a natural number that is the product of two distinct prime numbers.

The task

Given a natural number n, count all square-free semiprimes less than or equal to n.

Details

Please write a function or procedure that accepts a single integer parameter and counts all square-free semiprimes less than or equal to its parameter. The count must either be a return value of a function call or be printed to STDOUT.

Scoring

The answer with the fewest number of characters wins.

In the event of a tie, the following criteria will be used in order:

Tallest person

Best time-complexity

Worst space-complexity

Examples

```<code>f(1)     = 0
f(62)    = 18
f(420)   = 124
f(10000) = 2600
</code>```

Title: Square-free semiprime counting

Body:
Shell, 40

#!/bin/sh

seq $1|factor|awk 'NF==3&&$2!=$3'|wc -l

#old, 61
#seq $1|factor|awk 'BEGIN{a=0}NF==3&&$2!=$3{a++}END{print a}'

Usage:

$ ./count 1
0
$ ./count 420
124
$ ./count 10000
2600
$ time ./cnt.sh 1000000
209867

real    0m23.956s
user    0m23.601s
sys     0m0.404s


问:
Count of "a"s and "b"s must be equal. Did you get it computer?
In the popular (and essential) computer science book, An Introduction to Formal Languages and Automata by Peter Linz, the following formal language is frequently stated:

$$\large{L=\{a^n b^n:n\in\mathbb{Z}^+\}}$$

mainly because this language can not be processed with finite-state automata.
This expression mean "Language L consists all strings of 'a's followed by 'b's, in which the number of 'a's and 'b's are equal and non-zero".

Challenge

Write a working program/function which gets a string, containing "a"s and "b"s only, as input and returns/outputs a truth value, saying if this string is valid the formal language L.

Your program cannot use any external computation tools, including network, external programs, etc. Shells are an exception to this rule; Bash, e.g., can use command line utilities.

Your program must return/output the result in a "logical" way, for example: returning 10 instead of 0, "beep" sound, outputting to stdout etc. More info here.

Standard code golf rules apply.

This is a code-golf. Shortest code in bytes wins. Good luck!

Truthy test cases

```<code>"ab"
"aabb"
"aaabbb"
"aaaabbbb"
"aaaaabbbbb"
"aaaaaabbbbbb"
</code>```

Falsy test cases

```<code>""
"a"
"b"
"aa"
"ba"
"bb"
"aaa"
"aab"
"aba"
"abb"
"baa"
"bab"
"bba"
"bbb"
"aaaa"
"aaab"
"aaba"
"abaa"
"abab"
"abba"
"abbb"
"baaa"
"baab"
"baba"
"babb"
"bbaa"
"bbab"
"bbba"
"bbbb"
</code>```

Leaderboard

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

/* Configuration */

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

/* App */

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

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

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

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

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

getAnswers();

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

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

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

function process() {
  var valid = [];

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

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

  });

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

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

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

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

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

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

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

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

table thead {
  font-weight: bold;
}

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

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

Leaderboard

	Author	Language	Size

Winners by Language

Language	User	Score

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

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

```

答:
C#, 78 67 bytes

```<code>bool f(string s)=>Regex.IsMatch(s,"^(?'o'a)+(?'-o'b)+(?(o)(?!))$");
</code>```

This implementation uses .NET Regex's "Balancing Group Definitions" to match the same number of 'a' and 'b' characters while ensuring that the input isn't an empty string by using the + quantifier.

Body:
C#, 78 67 bytes

bool f(string s)=>Regex.IsMatch(s,"^(?'o'a)+(?'-o'b)+(?(o)(?!))$");

This implementation uses .NET Regex's "Balancing Group Definitions" to match the same number of 'a' and 'b' characters while ensuring that the input isn't an empty string by using the + quantifier.


答:
PHP, <s>23</s> 22 bytes

```<code><?=$argv[1]%$argv[2]<1
</code>```

prints 1 for true, empty string (=nothing) for false

call from cli with n and d as arguments

10 bytes for ancient PHP: <?=$n%$d<1

Title: Divisibility test

Body:
PHP, <s>23</s> 22 bytes

<?=$argv[1]%$argv[2]<1

prints 1 for true, empty string (=nothing) for false

call from cli with n and d as arguments

10 bytes for ancient PHP: <?=$n%$d<1


答:
CJam, <s>25</s> 24 bytes

```<code>{{' 1$f+La@+..{sS@er}}*}
</code>```

An unnamed block that expects a list of strings and the number of repetitions on the stack and leaves a new list of strings instead.

Test it here. (Includes a test wrapper that reads the string from STDIN for convenience.)

Explanation

```<code>{       e# Repeat this block N times...
  '     e#   Push a space character.
  1$    e#   Copy the current grid.
  f+    e#   Prepend the space to each line of the grid.
  La    e#   Push [[]].
  @+    e#   Pull up the other copy of the grid and prepend the [].
        e#   We've now got two copies of the grid, one shifted right by
        e#   a cell and one shifted down by a cell. We now want to replace
        e#   spaces in the latter with the corresponding character in the
        e#   former.
  ..{   e#   For each pair of characters in corresponding positions...
    s   e#     Turn the character in the down-shifted grid into a string.
    S   e#     Push " ".
    @   e#     Pull up the character from the right-shifted grid.
    er  e#     Replace spaces with that character.
  }
}*
</code>```

Title: Bring ASCII art to the 3rd dimension

Body:
In this challenge, You have to bring ASCII art (which are usually 2D) to 3D!

How?

like this,

```<code>X X DD
 X  D D
X X DD
</code>```

to...

```<code>  X X DD
 X X DD D
X X DDDD
 X XDDD
X X DD
</code>```

Then How do we do that?

Given the ascii art and N, repeat this N times.

for every character (we will call this A):

let B be the character which is exactly 1 right and 1 up from A

if B is a space or is undefined:

set B to A.

Specs

The first input can be a string with newline characters or a list of strings representing the 2D ASCII art.

You are allowed to use %END% to tag the end of input, but this is not required.

The second input will be N. It will be a positive integer.

all the lines of the strings will be the same length.

Examples

Input: ("###\n###",1)

Output:

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

Rules

Basic code-golf rules apply.

also, If you have questions, be sure to ask in the comments!

Body:
CJam, <s>25</s> 24 bytes

{{' 1$f+La@+..{sS@er}}*}

An unnamed block that expects a list of strings and the number of repetitions on the stack and leaves a new list of strings instead.

Test it here. (Includes a test wrapper that reads the string from STDIN for convenience.)

Explanation

{       e# Repeat this block N times...
  '     e#   Push a space character.
  1$    e#   Copy the current grid.
  f+    e#   Prepend the space to each line of the grid.
  La    e#   Push [[]].
  @+    e#   Pull up the other copy of the grid and prepend the [].
        e#   We've now got two copies of the grid, one shifted right by
        e#   a cell and one shifted down by a cell. We now want to replace
        e#   spaces in the latter with the corresponding character in the
        e#   former.
  ..{   e#   For each pair of characters in corresponding positions...
    s   e#     Turn the character in the down-shifted grid into a string.
    S   e#     Push " ".
    @   e#     Pull up the character from the right-shifted grid.
    er  e#     Replace spaces with that character.
  }
}*


答:
APL, 49 bytes

```<code>{⎕UCS 32⌈{s+(s=0)×1⊖¯1⌽s←0⍪⍵,0}⍣⍺⊣(32∘≠×⊣)⎕UCS↑⍵}
</code>```

Input: vector of character vectors.
Example:

```<code>      2 {⎕UCS 32⌈{s+(s=0)×1⊖¯1⌽s←0⍪⍵,0}⍣⍺⊣(32∘≠×⊣)⎕UCS↑⍵} 'X X DD' ' X  D D' 'X X DD'
  X X DD
 X X DD D
X X DDDD
 X XDDD
X X DD
</code>```

How it works:

↑⍵ turns the argument into a matrix of chars

⎕UCS from char to integer

(32∘≠×⊣) substitute the spaces (32) with zeroes

...⍣⍺⊣ apply ⍺ (the left argument) times the function on the left

s←0⍪⍵,0 border with zeroes on top and on the right the argument

1⊖¯1⌽ rotate 1 up and 1 right

s+(s=0)× sum to the original the shifted version but only on top of the zeroes of the original

32⌈ turns back the zeroes into 32s

⎕UCS from integer to char

Title: Bring ASCII art to the 3rd dimension

Body:
APL, 49 bytes

{⎕UCS 32⌈{s+(s=0)×1⊖¯1⌽s←0⍪⍵,0}⍣⍺⊣(32∘≠×⊣)⎕UCS↑⍵}

Input: vector of character vectors.
Example:

      2 {⎕UCS 32⌈{s+(s=0)×1⊖¯1⌽s←0⍪⍵,0}⍣⍺⊣(32∘≠×⊣)⎕UCS↑⍵} 'X X DD' ' X  D D' 'X X DD'
  X X DD
 X X DD D
X X DDDD
 X XDDD
X X DD

How it works:

↑⍵ turns the argument into a matrix of chars

⎕UCS from char to integer

(32∘≠×⊣) substitute the spaces (32) with zeroes

...⍣⍺⊣ apply ⍺ (the left argument) times the function on the left

s←0⍪⍵,0 border with zeroes on top and on the right the argument

1⊖¯1⌽ rotate 1 up and 1 right

s+(s=0)× sum to the original the shifted version but only on top of the zeroes of the original

32⌈ turns back the zeroes into 32s

⎕UCS from integer to char


答:
VBA, 160 bytes

```<code>Function e(g())
Dim h()
k=LBound(g)
l=UBound(g)
ReDim h(k To l)
On Error Resume Next
For i=k To l
For j=i To i+g(i)-1
h(i)=h(i)+g(j)
Next
Next
e=h
End Function
</code>```

Title: Substring Sum Set

Body:
Introduction

Let's observe this array: [3, 2, 4, 1, 1, 5, 1, 2].

Each element displays the length of the substring which must be summed up. Let's take a look at the first element of the above array:

```<code>[3, 2, 4, 1, 1, 5, 1, 2]
 ^
</code>```

The element at the first index is 3, so we now take a substring of length three with the same index as the starting position:

```<code>[3, 2, 4]
</code>```

When summed up, this results into 9, so the first element of the substring sum set is 9.

We do this for all the elements in the array:

```<code>3 -> [3, 2, 4]
2 -> [2, 4]
4 -> [4, 1, 1, 5]
1 -> [1]
1 -> [1]
5 -> [5, 1, 2]
1 -> [1]
2 -> [2]
</code>```

You can see that the number 5 is a bit of a weird case. That number exceeds the length of the array:

```<code>[3, 2, 4, 1, 1, 5, 1, 2]
                ^  ^  ^  ^  ^
</code>```

We'll ignore everything that exceeds the array, so we just use [5, 1, 2].

The last step is to sum everything up:

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

And that is the array that needs to be outputted:

```<code>[9, 6, 11, 1, 1, 8, 1, 2]
</code>```

The Task

Given an non-empty array with positive (non-zero) integers, output the substring sum set. This is code-golf, so the submission with the smallest number of bytes wins!

Test cases

```<code>[1, 2, 3, 4, 5] -> [1, 5, 12, 9, 5]
[3, 3, 3, 3, 3, 3, 3, 3] -> [9, 9, 9, 9, 9, 9, 6, 3]
[5, 1, 2, 4, 1] -> [13, 1, 6, 5, 1]
[1] -> [1]
</code>```

Body:
VBA, 160 bytes

Function e(g())
Dim h()
k=LBound(g)
l=UBound(g)
ReDim h(k To l)
On Error Resume Next
For i=k To l
For j=i To i+g(i)-1
h(i)=h(i)+g(j)
Next
Next
e=h
End Function


问:
Theoretically output Graham's number
Graham's number G is defined in this way:

```<code>u(3,n,1) = 3^n
u(3,1,m) = 3
u(3,n,m) = u(3,u(3,n-1,m),m-1)
[Knuth's up-arrow notation]
[Conway chained arrow notation]

THEN

g1 = u(3,3,4)
g2 = u(3,3,g1)
g3 = u(3,3,g2)
...
G = u(3,3,g63)
</code>```

You are given that u(3,3,2)=7625597484987 to check your code.

Your task is to write a program/function that will output the value of G deterministically, given enough integer size and enough time.

References

Graham's number

Knuth's up-arrow notation

Conway chained arrow notation

Leaderboard

var QUESTION_ID=83873,OVERRIDE_USER=48934;function answersUrl(e){return"http://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"http://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+(?:\.\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

```

Title: Theoretically output Graham's number

Body:
Dyalog APL, 41 bytes

u←{1=⍺:3⋄1=⍵:3*⍺⋄(⍵∇⍨⍺-1)∇⍵-1}
3u 3u⍣64⊣4

Test case:

      3u 2
7625597484987


问:
Unique Sudoku Finder

Challenge:

Given a Sudoku board on standard input, find the minimum number of numbers added to make the board unique.

Specifics/Rules:

The input is formatted as follows (all whitespace is significant)

```<code>516|827|943
278|394|615
349|615|872
---+---+---
98 |4 2|156
465|189|237
12 |5 6|489
---+---+---
892|743|561
634|951|728
751|268|394
</code>```

The output is formatted with one number per line, formatted like (x,y):z - x and y start from one at the top left and increase down and right; z is the number to be added.

In this case these would all be valid outputs: (3,4):3, (3,4):7, (5,4):3, (5,4):7, (3,6):3, (3,6):7, (5,6):3, and (5,6):7, as any one of these would allow the board to be solved.

If a unique/solved Sudoku board is entered, the program should not print anything, even a newline.

The program should run in less than an hour for any board (I suggest testing using a fully blank board, or a board with one random number on it...).

Scoring:

Take your total (golfed) code size in characters, including all whitespace...

Bonuses:

1/2 code size:  If the program prints a single exclamation point and stops upon having a board with no solutions entered.

1/2 code size:  If the program prints two exclamation points and stops upon having a board with an internal contradiction entered (two numbers the same on the same row/column/square).

答:
Brachylog, 245 bytes /2 = 122.5

```<code>@n:1a:"-"x:7fF:3a$\:3a@3:4a,Fc~bCh[0:0:0]gO,Co~c[V:O:T]h:F:6f:10ao:ba(h:11a;!);"!!"w!
h"-".|:"|"x:2f.
e(~m["0123456789":.]`;0<.<=9)
:ha#d.
:@3az:ca:5a.
:3a.
hs.:=a,?t:9ac:=fl1
:Im:8f:[[I]]z:ca.
:Jm:J.
:ha.
lg:?c.
b:+a[X:Y],?h:Y:Xr:"(~d,~d):~d
"w
</code>```

(Note that you have to use the version of the language as of this commit. This code would need some slight changes for it to work properly in the following versions of Brachylog)

This prints "!!" if the given board has internal contradictions (This takes a few seconds in that case however on TIO, so be patient).

I'm not sure I understand the first bonus correctly so I'm not addressing it.

This is obviously non-competing since the language is much more recent than the challenge, however since there are no other answers I'm not sure this matters a whole lot…

Explanation

Main predicate:

```<code>@n                Split the input on line breaks
:1a:"-"x          Transform into a list of lists, each sublist contains a line's values
:7fF              Transform so that cells are [Value:X:Y]
:3a               All values on lines must be different
$\:3a             All values on columns must be different (by transposition)
@3:4a,            All 3*3 block values must be different
Fc~bCh[0:0:0]gO,  Append a fake cell [0:0:0]
Co~c[V:O:T]       Sort the board, the blank cells V will be those before O ([0:0:0])
h:F:6f            Find all subsets of blank cells with specific values for which
                      the board has only one solution
:10ao             Sort the subsets by lengths
:ba               Discard the lengths
(
  h:11a             Print the first subset = an answer
;                 Or (board is already fully determined)
  !                 Terminate
)
;                 Or (Some values don't respect the constraints)
"!!"w!            Print "!!" and terminate
</code>```

Predicate 1: Remove all "|" on lines, transform the ---+---+--- into - to remove them after

```<code>h"-".    If the first char is "-", then Output is "-"
|        Or
:"|"x    Remove all occurences of "|" from the input
:2f.     Output is the result of all outputs of predicate 2 on the filtered string
</code>```

Predicate 2: Convert one char to an integer, or if blank to a variable between 1 and 9.

```<code>e                      Take a char of the input string
(
  ~m["0123456789":.]     Output is the index of the char in "0123456789"
  `                      Discard the choice point caused by the ;
;                      Or
  0<.<=9                 Output is an integer between 1 and 9
)
</code>```

Predicate 3: Impose that all values of the input list of cells must be distinct

```<code>:ha    Retrieve the head of each cell (i.e. the value) in the input
#d.    Apply a constraint of distinctness to those values
</code>```

Predicate 4: Apply the distinctness constraint to values in 3*3 blocks

```<code>:@3a            Split 3 lines of the board in 3 parts
    z           Zip them together
     :ca:5a.    Concatenate each element of the zip, apply predicate 5 to that
</code>```

Predicate 5:

```<code>:3a.    Apply predicate 3 to each element of the input
</code>```

Predicate 6: Assign values satisfying the constraints to a subset of the blank cells, then with those values there is only one solution to the board.

```<code>hs.       Output is a subset of the blank cells
:=a,      Assign values to those cells
?t:9ac    Concatenate the values of all cells of the board
:=f       Find all solved boards
l1        There is only 1 such solved board
</code>```

Predicate 7: Transforms the board such that each cell is now [V:X:Y] instead of only V (the value).

```<code>:Im       Take the Ith line of the board
:8f       Transform all elements of the line using predicate 8
:[[I]]z   Zip the result with [I]
:ca.      Concatenate each element of the zip
</code>```

Predicate 8: Transforms a line such that each cell is now [V:X].

```<code>:Jm    Take the Jth element of the line
:J.    Output is [That element:J]
</code>```

Predicate 9: Retrieve the values of cells

```<code>@n                Split the input on line breaks
:1a:"-"x          Transform into a list of lists, each sublist contains a line's values
:7fF              Transform so that cells are [Value:X:Y]
:3a               All values on lines must be different
$\:3a             All values on columns must be different (by transposition)
@3:4a,            All 3*3 block values must be different
Fc~bCh[0:0:0]gO,  Append a fake cell [0:0:0]
Co~c[V:O:T]       Sort the board, the blank cells V will be those before O ([0:0:0])
h:F:6f            Find all subsets of blank cells with specific values for which
                      the board has only one solution
:10ao             Sort the subsets by lengths
:ba               Discard the lengths
(
  h:11a             Print the first subset = an answer
;                 Or (board is already fully determined)
  !                 Terminate
)
;                 Or (Some values don't respect the constraints)
"!!"w!            Print "!!" and terminate
</code>```0

Predicate 10: Append the length of a subset at the beginning of it

```<code>@n                Split the input on line breaks
:1a:"-"x          Transform into a list of lists, each sublist contains a line's values
:7fF              Transform so that cells are [Value:X:Y]
:3a               All values on lines must be different
$\:3a             All values on columns must be different (by transposition)
@3:4a,            All 3*3 block values must be different
Fc~bCh[0:0:0]gO,  Append a fake cell [0:0:0]
Co~c[V:O:T]       Sort the board, the blank cells V will be those before O ([0:0:0])
h:F:6f            Find all subsets of blank cells with specific values for which
                      the board has only one solution
:10ao             Sort the subsets by lengths
:ba               Discard the lengths
(
  h:11a             Print the first subset = an answer
;                 Or (board is already fully determined)
  !                 Terminate
)
;                 Or (Some values don't respect the constraints)
"!!"w!            Print "!!" and terminate
</code>```1

Predicate 11: Print one cell

```<code>@n                Split the input on line breaks
:1a:"-"x          Transform into a list of lists, each sublist contains a line's values
:7fF              Transform so that cells are [Value:X:Y]
:3a               All values on lines must be different
$\:3a             All values on columns must be different (by transposition)
@3:4a,            All 3*3 block values must be different
Fc~bCh[0:0:0]gO,  Append a fake cell [0:0:0]
Co~c[V:O:T]       Sort the board, the blank cells V will be those before O ([0:0:0])
h:F:6f            Find all subsets of blank cells with specific values for which
                      the board has only one solution
:10ao             Sort the subsets by lengths
:ba               Discard the lengths
(
  h:11a             Print the first subset = an answer
;                 Or (board is already fully determined)
  !                 Terminate
)
;                 Or (Some values don't respect the constraints)
"!!"w!            Print "!!" and terminate
</code>```2

Title: Unique Sudoku Finder

Body:
Brachylog, 245 bytes /2 = 122.5

@n:1a:"-"x:7fF:3a$\:3a@3:4a,Fc~bCh[0:0:0]gO,Co~c[V:O:T]h:F:6f:10ao:ba(h:11a;!);"!!"w!
h"-".|:"|"x:2f.
e(~m["0123456789":.]`;0<.<=9)
:ha#d.
:@3az:ca:5a.
:3a.
hs.:=a,?t:9ac:=fl1
:Im:8f:[[I]]z:ca.
:Jm:J.
:ha.
lg:?c.
b:+a[X:Y],?h:Y:Xr:"(~d,~d):~d
"w

(Note that you have to use the version of the language as of this commit. This code would need some slight changes for it to work properly in the following versions of Brachylog)

This prints "!!" if the given board has internal contradictions (This takes a few seconds in that case however on TIO, so be patient).

I'm not sure I understand the first bonus correctly so I'm not addressing it.

This is obviously non-competing since the language is much more recent than the challenge, however since there are no other answers I'm not sure this matters a whole lot…

Explanation

Main predicate:

@n                Split the input on line breaks
:1a:"-"x          Transform into a list of lists, each sublist contains a line's values
:7fF              Transform so that cells are [Value:X:Y]
:3a               All values on lines must be different
$\:3a             All values on columns must be different (by transposition)
@3:4a,            All 3*3 block values must be different
Fc~bCh[0:0:0]gO,  Append a fake cell [0:0:0]
Co~c[V:O:T]       Sort the board, the blank cells V will be those before O ([0:0:0])
h:F:6f            Find all subsets of blank cells with specific values for which
                      the board has only one solution
:10ao             Sort the subsets by lengths
:ba               Discard the lengths
(
  h:11a             Print the first subset = an answer
;                 Or (board is already fully determined)
  !                 Terminate
)
;                 Or (Some values don't respect the constraints)
"!!"w!            Print "!!" and terminate

Predicate 1: Remove all "|" on lines, transform the ---+---+--- into - to remove them after

h"-".    If the first char is "-", then Output is "-"
|        Or
:"|"x    Remove all occurences of "|" from the input
:2f.     Output is the result of all outputs of predicate 2 on the filtered string

Predicate 2: Convert one char to an integer, or if blank to a variable between 1 and 9.

e                      Take a char of the input string
(
  ~m["0123456789":.]     Output is the index of the char in "0123456789"
  `                      Discard the choice point caused by the ;
;                      Or
  0<.<=9                 Output is an integer between 1 and 9
)

Predicate 3: Impose that all values of the input list of cells must be distinct

:ha    Retrieve the head of each cell (i.e. the value) in the input
#d.    Apply a constraint of distinctness to those values

Predicate 4: Apply the distinctness constraint to values in 3*3 blocks

:@3a            Split 3 lines of the board in 3 parts
    z           Zip them together
     :ca:5a.    Concatenate each element of the zip, apply predicate 5 to that

Predicate 5:

:3a.    Apply predicate 3 to each element of the input

Predicate 6: Assign values satisfying the constraints to a subset of the blank cells, then with those values there is only one solution to the board.

hs.       Output is a subset of the blank cells
:=a,      Assign values to those cells
?t:9ac    Concatenate the values of all cells of the board
:=f       Find all solved boards
l1        There is only 1 such solved board

Predicate 7: Transforms the board such that each cell is now [V:X:Y] instead of only V (the value).

:Im       Take the Ith line of the board
:8f       Transform all elements of the line using predicate 8
:[[I]]z   Zip the result with [I]
:ca.      Concatenate each element of the zip

Predicate 8: Transforms a line such that each cell is now [V:X].

:Jm    Take the Jth element of the line
:J.    Output is [That element:J]

Predicate 9: Retrieve the values of cells

:ha.   Take the head of each element of the input

Predicate 10: Append the length of a subset at the beginning of it

lg     Put the length of the input in a list
:?c.   Concatenate it with the input

Predicate 11: Print one cell

b:+a[X:Y],        Increment coordinates by 1 to get X and Y
?h:Y:Xr:          Build the list [X:Y:Value]
"(~d,~d):~d\n"w   Format that list as "('X','Y'):'Value'\n" to STDOUT


答:
Verbosy 31 Bytes

```<code>~0 /0 ~10 /1 :a: ^0 o \0 -1 >-a
</code>```

Verbosy is a language that I wrote btw. The explanation can be found in README.md.

Title: Print numbers from 1 to 10

Body:
This might be a very simple challenge, but I am surprised it hasn't been done on code-golf yet:

Print all Integers from 1 to 10 inclusive in ascending order to standard output.

Your output format can be whatever your language supports. This includes arbitrary separators (commas, semicolons, newlines, combinations of those, etc., but no digits), and prefixes and postfixes (like [...]). However, you may not output any other numbers than 1 through 10. Your program may not take any input. Standard loopholes are disallowed.

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

Leaderboard

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

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

Leaderboard

	Author	Language	Size

Winners by Language

Language	User	Score

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

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

```

Body:
Verbosy 31 Bytes

~0 /0 ~10 /1 :a: ^0 o \0 -1 >-a

Verbosy is a language that I wrote btw. The explanation can be found in README.md.