问:
How many answers does this question have?
Write a program or a function that outputs the integer number of answers this question has. Your solution should still work as more answers are added.

Languages that run in a browser may be run from the js console while on this page. Otherwise, you'd probably have to download this page. Multi-language solutions, e.g. wgeting the page and parsing it using grep is ok. Just sum up the command line and all source used.

This is code golf; shortest answer in bytes wins.

EDIT:

Let's allow at most one occourance of the url of this page to not count, either as input or in the source. No url shorteners, no data stored as get parameters etc. Quotes around url, if needed, still count. Taking the url as input is also fine. If you want to remove some part of the url, e.g. /how-many-answers..., you can, but it probably doesn't help you.

答:
R, 80 bytes

Answer is based on searching the vector returned by readLines using regular expressions. I'm guessing that this could be broken by text in comments/answers (possibly even my own). Will delete if so. Also the pattern could also be gofled but not sure if that would increase the likelihood of getting a false value.

```<code>x=readLines(scan(,""));regmatches(x,regexpr("(?<=answerCount\">).*?(?=<)",x,,T))
</code>```

Body:
R, 80 bytes

Answer is based on searching the vector returned by readLines using regular expressions. I'm guessing that this could be broken by text in comments/answers (possibly even my own). Will delete if so. Also the pattern could also be gofled but not sure if that would increase the likelihood of getting a false value.

x=readLines(scan(,""));regmatches(x,regexpr("(?<=answerCount\">).*?(?=<)",x,,T))


问:
Permutation Numbering

The Challenge

For a given set of n integers, write a program which will output its lexicographic index.

The Rules

The input must only be a set of unique non-negative integers separated by spaces.

You should output the lexicographic index (range 0 to n!-1 inclusive) of the permutation.

No permutation libraries or permutation built-ins may be used.

You may not generate the set of permutations or any subset of permutations of the input to help you find the index.

You also can't increment or decrement the given permutation to the next/previous(lexicographically) permutation.

Bonus points (-10 bytes) if you find some way to complete this without using factorials.

Runtime should be less than 1 minute for n = 100

Shortest code by byte count wins

Winner chosen Tuesday (July 22, 2014)

More About Permutations

http://www.monkeyphysics.com/articles/read/26/numbering_permutations.html

Permutation group operation

http://lin-ear-th-inking.blogspot.com/2012/11/enumerating-permutations-using.html

Examples

```<code>0 1 2 --> 0
0 2 1 --> 1
1 0 2 --> 2
1 2 0 --> 3
2 0 1 --> 4
2 1 0 --> 5
0 1 2 3 4 5 6 7 --> 0
0 1 2 3 4 5 7 6 --> 1
0 1 2 3 4 6 5 7 --> 2
1 3 5 17        --> 0
781 780 779 13  --> 23
81 62 19 12 11 8 2 0 --> 40319
195 124 719 1 51 6 3 --> 4181
</code>```

答:
J, 5 bytes (15 - 10)

```<code>#\.#.+/@(<{.)\.
</code>```

This runs in O(n2) time and is able to handle n = 100 easily.

Usage

```<code>   f =: #\.#.+/@(<{.)\.
   f 0 1 2
0
   f 0 2 1
1
   f 1 0 2
2
   f 1 2 0
3
   f 2 0 1
4
   f 2 1 0
5
   f 0 1 2 3 4 5 6 7
0
   f 0 1 2 3 4 5 7 6
1
   f 0 1 2 3 4 6 5 7
2
   f 1 3 5 17
0
   f 781 780 779 13
23
   f 81 62 19 12 11 8 2 0
40319
   f 195 124 719 1 51 6 3
4181
   NB. A. is the builtin for permutation indexing
   timex 'r =: f 927 A. i. 100'
0.000161
   r
927
</code>```

Explanation

```<code>#\.#.+/@(<{.)\.  Input: array P
             \.  For each suffix of P
          {.       Take the head
         <         Test if it is greater than each of that suffix
     +/@           Sum, count the number of times it is greater
#\.              Get the length of each suffix of P
   #.            Convert to decimal using a mixed radix
</code>```

ContentLicense: CC BY-SA 3.0

Title: Permutation Numbering

Body:
J, 5 bytes (15 - 10)

#\.#.+/@(<{.)\.

This runs in O(n2) time and is able to handle n = 100 easily.

Usage

   f =: #\.#.+/@(<{.)\.
   f 0 1 2
0
   f 0 2 1
1
   f 1 0 2
2
   f 1 2 0
3
   f 2 0 1
4
   f 2 1 0
5
   f 0 1 2 3 4 5 6 7
0
   f 0 1 2 3 4 5 7 6
1
   f 0 1 2 3 4 6 5 7
2
   f 1 3 5 17
0
   f 781 780 779 13
23
   f 81 62 19 12 11 8 2 0
40319
   f 195 124 719 1 51 6 3
4181
   NB. A. is the builtin for permutation indexing
   timex 'r =: f 927 A. i. 100'
0.000161
   r
927

Explanation

#\.#.+/@(<{.)\.  Input: array P
             \.  For each suffix of P
          {.       Take the head
         <         Test if it is greater than each of that suffix
     +/@           Sum, count the number of times it is greater
#\.              Get the length of each suffix of P
   #.            Convert to decimal using a mixed radix


问:
Help me with my Halloween decoration
The Halloween is upon us, and I haven't decorated my house yet, so I gonna need your help to do this task

Input

The input will be a list of 4 digits numbers, where each digit represent a portion of decoration:

```<code>EMBU
||||
|||+-upper decoration
||+-bottom decoration
|+-mouth/nose
+-eyes
</code>```

Eyes:

0 - °

1 - ¯

2 - -

3 - ^

4 - '

Mouth/Nose

0 - v

1 - w

2 - o

3 - _

4 - -

Bottom decoration

0 - nothing

1 - skeleton

2 - pumpkin

Upper decoration

0 - nothing

1 - flying bat

2 - resting bat

3 - spider

Output

Skeleton:

(EME)

 _|_

/[|]\

  |

 / \

Pumpkin

  ,

(EME)

Flying bat

 ^"^

Resting bat

  ()

  ´`

Spider

  |

 .|.

 :":

Each decoration has a 5 character width

Upper decorations start from the top

Lower decorations start from the bottom

If the spider is over the pumpkin or there is no bottom decoration the web length will be 3, if it's over the skeleton, the web length will be 1

When the bottom decoration is 0 the first 2 digits are irrelevant

Between each decoration there will be an empty column

Example

Input

3123 ??02 1021 0310

Output

```<code>   |     ()
   |     ´`   ^"^
  .|.              (°_°)
  :":               _|_
                   /[|]\
   ,           ,     |
 (^w^)       (¯v¯)  / \
</code>```

Trailing spaces at the end of each line are optional

Trailing newline at the end of the entire output is allowed

Winning criteria

This is code-golf so the shortest answer wins

Title: Help me with my Halloween decoration

Body:
Python 2, 331 bytes""

B,I,l,s=' '*5,'  |  ',' .|. ',' :": '
r=[]
for x in inputtt:m,n,b,u=(int(y)for y in x);e="°¯-^'"[m];H='('+e+"vwo_-"[n]+e+')';r+=[[[B,B,'  () ',[I,l,I][b]][u],[B,' ^"^ ','  ´` ',[I,s,I][b]][u],[[B,l][u==3],H][b==1],[[B,s][u==3],' _|_ '][b==1]]+[[B]*3,['/[|]\\',I,' / \ ',],[B,'  ,  ',H]][b]]
print'\n'.join(map(' '.join,zip(*r)))

Takes input as list of strings

-

Example

Input:
["1212","4321","0123","1102","0020","1010","0101","2113"]

Output:

  ()          |     ()                     .|.
  ´`   ^"^    |     ´`               ^"^   :":
(¯o¯)        .|.              (¯v¯)       (-w-)
 _|_         :":               _|_         _|_
/[|]\                         /[|]\       /[|]\
  |     ,     ,           ,     |           |
 / \  ('_') (°w°)       (°v°)  / \         / \


问:
Compute the kangaroo sequence

Backstory

Disclaimer: May contain made up information about kangaroos.

Kangaroos traverse several stages of development. As they grow older and stronger, they can jump higher and longer, and they can jump more times before they get hungry.

In stage 1, the kangaroo is very little and cannot jump at all. Despite this, is constantly requires nourishment. We can represent a stage 1 kangaroo's activity pattern like this.

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

In stage 2, the kangaroo can make small jumps, but not more than 2 before it gets hungry. We can represent a stage 2 kangaroo's activity pattern like this.

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

After stage 2 the kangaroo improves quickly. In each subsequent stage, the kangaroo can jump a bit higher (1 unit in the graphical representation) and twice as many times. For example, a stage 3 kangaroo's activity pattern looks like this.

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

All that jumping requires energy, so the kangaroo requires nourishment after completing each activity pattern. The exact amount required can be calculated as follows.

Assign each o in the activity pattern of a stage n kangaroo its height, i.e., a number from 1 to n, where 1 corresponds to the ground and n to the highest position.

Compute the sum of all heights in the activity pattern.

For example, a stage 3 kangaroo's activity pattern includes the following heights.

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

We have five 1's, eight 2's, and four 3's; the sum is 5·1 + 8·2 + 4·3 = 33.

Task

Write a full program or a function that takes a positive integer n as input and prints or returns the nutritional requirements per activity of a stage n kangaroo.

This is code-golf; may the shortest answer in bytes win!

Examples

```<code> 1 ->     1
 2 ->     7
 3 ->    33
 4 ->   121
 5 ->   385
 6 ->  1121
 7 ->  3073
 8 ->  8065
 9 -> 20481
10 -> 50689
</code>```

答:
Groovy (22 Bytes)

```<code>{(it--**2-1)*2**it+1}
</code>```

Does not preserve n, but uses the same formula as all others in this competition. Saved 1 byte with decrements, due to needed parenthesis.

Test

```<code>(1..10).collect{(it--**2-1)*2**it+1}
</code>```

[1, 7, 33, 121, 385, 1121, 3073, 8065, 20481, 50689]

Title: Compute the kangaroo sequence

Body:
Groovy (22 Bytes)

{(it--**2-1)*2**it+1}

Does not preserve n, but uses the same formula as all others in this competition. Saved 1 byte with decrements, due to needed parenthesis.

Test

(1..10).collect{(it--**2-1)*2**it+1}

[1, 7, 33, 121, 385, 1121, 3073, 8065, 20481, 50689]


答:
JS-Forth, 32 bytes

Not super short, but it's shorter than Java. This function pushes the result onto the stack. This requires JS-Forth because I use <<.

```<code>: f dup dup * 1- over 1- << 1+ ;
</code>```

Try it online

Title: Compute the kangaroo sequence

Body:
Backstory

Disclaimer: May contain made up information about kangaroos.

Kangaroos traverse several stages of development. As they grow older and stronger, they can jump higher and longer, and they can jump more times before they get hungry.

In stage 1, the kangaroo is very little and cannot jump at all. Despite this, is constantly requires nourishment. We can represent a stage 1 kangaroo's activity pattern like this.

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

In stage 2, the kangaroo can make small jumps, but not more than 2 before it gets hungry. We can represent a stage 2 kangaroo's activity pattern like this.

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

After stage 2 the kangaroo improves quickly. In each subsequent stage, the kangaroo can jump a bit higher (1 unit in the graphical representation) and twice as many times. For example, a stage 3 kangaroo's activity pattern looks like this.

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

All that jumping requires energy, so the kangaroo requires nourishment after completing each activity pattern. The exact amount required can be calculated as follows.

Assign each o in the activity pattern of a stage n kangaroo its height, i.e., a number from 1 to n, where 1 corresponds to the ground and n to the highest position.

Compute the sum of all heights in the activity pattern.

For example, a stage 3 kangaroo's activity pattern includes the following heights.

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

We have five 1's, eight 2's, and four 3's; the sum is 5·1 + 8·2 + 4·3 = 33.

Task

Write a full program or a function that takes a positive integer n as input and prints or returns the nutritional requirements per activity of a stage n kangaroo.

This is code-golf; may the shortest answer in bytes win!

Examples

```<code> 1 ->     1
 2 ->     7
 3 ->    33
 4 ->   121
 5 ->   385
 6 ->  1121
 7 ->  3073
 8 ->  8065
 9 -> 20481
10 -> 50689
</code>```

Body:
JS-Forth, 32 bytes

Not super short, but it's shorter than Java. This function pushes the result onto the stack. This requires JS-Forth because I use <<.

: f dup dup * 1- over 1- << 1+ ;

Try it online


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

```

答:
Java 7, 50 bytes

```<code>void m{for(int i=1;i<11;System.out.println(i++));}
</code>```

Title: Print numbers from 1 to 10

Body:
Java 7, 50 bytes

void m{for(int i=1;i<11;System.out.println(i++));}


问:
Image Smoothie!
Input into your program a black and white image. (png, jpg, etc)

Convert the image to a 2D matrix of pixels, where each index is the grayscale value of the image.

Take each index of the matrix and average the 8 pixels around it. Then replace that index with the average.

For example if you had:

```<code>120 80  60
20  10  30
40  100 05
</code>```

If you were finding the average for 10, the result would be 56.875, which is (120,80,60,30,05,100,40,20)/8.

Round to up to the nearest integer (57) and replace the index. The result of this iteration would be

```<code>120 80  60
20  57  30
40  100 05
</code>```

If you are finding the average for a pixel on an edge then only take values that are valid. In the example above if you were finding the average for 20 You would only consider 120, 80, 57, 100, and 40 which is 79.4 rounded to 80.

You may start at any index of the graph but it must be in order. For example you could do

```<code>[0][0], [0][1], ... [0][n], then [1][0], [1][1],... [1][n]
</code>```

Once the averaging is complete, convert the matrix back into a new image.

Display the new image as the output of the program. (Or save it and add it in your solution). The result of your code should be a blurry looking image but much smoother than the original.

Example Input

Example Output

Example Input two

Example Output two

Please provide your code and start and end image results.

Q/A

1Q. If one of the 8 neighbors has already been changed, should the average be calculated based on this new value, or based on the original values? That is, does the order of calculation affect the end result?

1A Yes, You should change each index with new values from any potential indices done before. That is why you need to go left-right, top-bottom etc. In order.

2Q. Could you clarify what is meant by "must be in order"? Does this mean that only raster order/reading order is acceptable? Or does it mean that the order must be the same each time the code is run? Would a spiral be valid? Or a shuffled order that is always the same?

2A. You should go left to right, right to left, top to bottom, or bottom to top. I.E. Do all of the 0th row, do all of the 1st row,... do all of the nth row

答:
Racket 346 bytes

```<code>(let((s1 sub1)(a1 add1)(lr list-ref)(ln length))(define(g r c)(if(or(> r(s1(ln l)))(> c(s1(ln(lr l 0))))(< r 0)(< c 0))
#f(lr(lr l r)c)))(define(ng r c)(define h'(-1 0 1))(define k(filter(λ(x)x)(for*/list((i h)(j h)#:unless(= 0 i j))
(g (+ r i)(+ c j)))))(round(/(apply + k)(ln k))))(for/list((i(ln l)))(for/list((j(length (lr l 0))))(ng i j))))
</code>```

Ungolfed (comments follow ';'):

```<code>(define (f l)
  (define (get r c)                       ; to get value at a row,col
    (if (or (> r (sub1 (length l)))
            (> c (sub1 (length (list-ref l 0))))
            (< r 0)
            (< c 0))                      ; if row/col number is invalid
        #f (list-ref (list-ref l r) c)))  ; return false else return value
  (define (neighbors r c)                 ; finds average of neighboring values
    (define h '(-1 0 1))
    (define k (filter                     ; filter out false from list
               (lambda(x) x)
               (for*/list ((i h)(j h) #:unless (= 0 i j))
                 (get (+ r i) (+ c j)))))
    (round(/(apply + k)(length k))))      ; find average of values (sum/length of list)
  (for/list ((i (length l)))              ; create a list of lists of average values
    (for/list ((j (length (list-ref l 0))))
      (neighbors i j))
    ))
</code>```

Testing:

```<code>(f (list
    '(120 80 60)
    '(20 10 30)
    '(40 100 5)))
</code>```

Output:

```<code>'((37 48 40) (70 57 51) (43 21 47))
</code>```

Title: Image Smoothie!

Body:
Racket 346 bytes

(let((s1 sub1)(a1 add1)(lr list-ref)(ln length))(define(g r c)(if(or(> r(s1(ln l)))(> c(s1(ln(lr l 0))))(< r 0)(< c 0))
#f(lr(lr l r)c)))(define(ng r c)(define h'(-1 0 1))(define k(filter(λ(x)x)(for*/list((i h)(j h)#:unless(= 0 i j))
(g (+ r i)(+ c j)))))(round(/(apply + k)(ln k))))(for/list((i(ln l)))(for/list((j(length (lr l 0))))(ng i j))))

Ungolfed (comments follow ';'):

(define (f l)
  (define (get r c)                       ; to get value at a row,col
    (if (or (> r (sub1 (length l)))
            (> c (sub1 (length (list-ref l 0))))
            (< r 0)
            (< c 0))                      ; if row/col number is invalid
        #f (list-ref (list-ref l r) c)))  ; return false else return value
  (define (neighbors r c)                 ; finds average of neighboring values
    (define h '(-1 0 1))
    (define k (filter                     ; filter out false from list
               (lambda(x) x)
               (for*/list ((i h)(j h) #:unless (= 0 i j))
                 (get (+ r i) (+ c j)))))
    (round(/(apply + k)(length k))))      ; find average of values (sum/length of list)
  (for/list ((i (length l)))              ; create a list of lists of average values
    (for/list ((j (length (list-ref l 0))))
      (neighbors i j))
    ))

Testing:

(f (list
    '(120 80 60)
    '(20 10 30)
    '(40 100 5)))

Output:

'((37 48 40) (70 57 51) (43 21 47))


问:
Display a Connect Four game
Connect Four is a game where two players take turns to drop disks into columns of a vertically mounted grid, and attempt to connect four disks orthogonally or diagonally. When a column is chosen, the disk falls to the lowest empty position in that column, so any game may be completely specified by the size of the grid and the sequence of columns chosen. The task is to generate the configuration of the grid given this information.

Input

Width w and Height h of the grid, both positive integers.

Sequence of columns c1, c2, ..., cn chosen by the players, in any reasonable format (list, array etc.); either 0-based (0 to w-1) or 1-based (1 to w) indexing can be used.

It may be assumed that all of the column numbers lie within the grid (so the sequence won't contain -3 or w+50) and that any column number appears at most h times in the sequence (so a column can't be chosen once it is full).

Note that the sequence of columns may not constitute a complete game, nor a legal game. For instance, the players could opt to continue playing even after a player has connected four disks.

Output

Any reasonable representation of the resulting state of each position in the grid, either "occupied by Player 1", "occupied by Player 2", or "empty". Player 1 always moves first.

For example, a string, array, tuple etc. with each position containing one of three symbols (ASCII character, number etc.) representing the state of that position in the grid. The grid may be transposed.

For list/tuple/array outputs, the separator cannot be one of the three representative symbols. For string outputs, trailing spaces at the end of each line are permitted, provided a space is not one of the three representative symbols. Trailing newlines at the very end are permitted.

Test cases

Here, string output is used, with X, O, . denoting "occupied by Player 1", "occupied by Player 2", "empty".

```<code>IN: Width 1 Height 1 Sequence (empty sequence)
OUT:
.

IN: Width 7 Height 6 Sequence 4 4 5 5 6 7 3 [1-based]
                              3 3 4 4 5 6 2 [0-based]
OUT:
.......
.......
.......
.......
...OO..
..XXXXO

IN: Width 5 Height 5 Sequence 1 1 1 1 1 2 2 2 2 2 3 3 3 3 3 4 4 4 4 4 5 5 5 5 5 [1-based]
                              0 0 0 0 0 1 1 1 1 1 2 2 2 2 2 3 3 3 3 3 4 4 4 4 4 [0-based]
OUT:
XOXOX
OXOXO
XOXOX
OXOXO
xOXOX

IN: Width 4 Height 4 Sequence 3 3 2 4 3 2 4 2 2 3 4 4 1 1 1 1 [1-based]
                              2 2 1 3 2 1 3 1 1 2 3 3 0 0 0 0 [0-based]
OUT:
OXOO
XOXX
OOOX
XXXO

IN: Width 10 Height 10 Sequence 1 2 1 3 1 4 1 5 1 6 1 7 1 8 1 9 1 10 1 10  [1-based]
                                0 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0  9 0  9  [0-based]
OUT:
X.........
X.........
X.........
X.........
X.........
X.........
X.........
X.........
X........O
XOOOOOOOOO
</code>```

Shortest code in bytes wins.

答:
Java 7, 209 bytes

Not very inspiring.Simple and plain solution.

```<code>char[][]f(int w,int h,int[]a){char[][]b=new char[h][w];for(char[]r:b)Arrays.fill(r,'.');for(int l=a.length,i=l-1,j,c=0;i>-1;b[h-c-1][a[i]]=i--%2==0?'X':'O',c=0){for(j=i-1;j>-1 ;)if(a[j--]==a[i])c++;}return b;}
</code>```

Ungolfed

```<code> char[][] f( int w , int h , int[]a ) {
 char[][] b = new char [h][w];
for ( char[] r : b)
    Arrays.fill( r , '.') ;

for ( int l = a.length,i = l-1 , j , c = 0 ; i > -1 ;
                         b[h-c-1][a[i]] = i--%2 == 0 ? 'X' : 'O', c = 0 ) {
    for ( j = i-1 ; j > -1 ;)
        if ( a[j--] == a[i] )
              c++ ;
      }

return b;
}
</code>```

Title: Display a Connect Four game

Body:
Java 7, 209 bytes

Not very inspiring.Simple and plain solution.

char[][]f(int w,int h,int[]a){char[][]b=new char[h][w];for(char[]r:b)Arrays.fill(r,'.');for(int l=a.length,i=l-1,j,c=0;i>-1;b[h-c-1][a[i]]=i--%2==0?'X':'O',c=0){for(j=i-1;j>-1 ;)if(a[j--]==a[i])c++;}return b;}

Ungolfed

 char[][] f( int w , int h , int[]a ) {
 char[][] b = new char [h][w];
for ( char[] r : b)
    Arrays.fill( r , '.') ;

for ( int l = a.length,i = l-1 , j , c = 0 ; i > -1 ;
                         b[h-c-1][a[i]] = i--%2 == 0 ? 'X' : 'O', c = 0 ) {
    for ( j = i-1 ; j > -1 ;)
        if ( a[j--] == a[i] )
              c++ ;
      }

return b;
}


问:
Nest a string inside an array n times
You must produce a function which nests a string s inside an array, n times

```<code>>>> N("stackoverflow",2)
[['stackoverflow']]
</code>```

Parameters:

s - An ascii string

n - An integer >= 0

Rules

Shortest code wins.

The output will be a nested array, list or tuple (or similar type based off an array)

Test Cases

```<code>>>> N("stackoverflow",0)
'stackoverflow'
>>> N("stackoverflow",1)
['stackoverflow']
>>> N("stackoverflow",5)
[[[[['stackoverflow']]]]]
</code>```

Inspired by: Nesting a string inside a list n times ie list of a list of a list

答:
Convex, 4 bytes

```<code>'a*~
</code>```

Try it online!

Title: Nest a string inside an array n times

Body:
Convex, 4 bytes

'a*~

Try it online!


问:
Spaced-out numbers
Given a list of N non-negative integers, output those numbers with each left-padded by spaces to a length of N. (Alternatively, return a character/string list.) You may assume that N is greater than or equal to the number of digits of the largest number in the list. Trailing spaces are allowed in the output.

You may also take a string containing these numbers, but N is not the length of the string, but rather the number of elements in the list; also, you may take a list of strings e.g. ["1", "2", "3"].

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

Test cases

```<code>input => 'output'
0 => '0'
1 => '1'
2 3 => ' 2 3'
2 10 => ' 210'
4 5 6 => '  4  5  6'
17 19 20 => ' 17 19 20'
7 8 9 10 => '   7   8   9  10'
100 200 300 0 => ' 100 200 300   0'
1000 400 30 7 => '1000 400  30   7'
1 33 333 7777 => '   1  33 3337777'
0 0 0 0 0 0 => '     0     0     0     0     0     0'
</code>```

答:
PowerShell v2+, 36 bytes

```<code>param($a)$a|%{"{0,$($a.count)}"-f$_}
</code>```

Takes input $a as an array of integers. Loops through them with $a|%{...}. Each iteration, uses the -format operator with the optional Alignment Component (based on $a.count) to left-pad the appropriate number of spaces. That resultant string is left on the pipeline. At end of program execution, the resulting strings are all left on the pipeline as an array.

Examples

Output is newline-separated on each run, as that's the default Write-Output at program completion for an array.

```<code>PS C:\Tools\Scripts\golfing> @(0),@(1),@(2,3),@(2,10),@(4,5,6),@(17,19,20),@(7,8,9,10),@(100,200,300,0),@(1000,400,30,7),@(1,33,333,7777),@(0,0,0,0,0,0)|%{""+($_-join',')+" -> ";(.\spaced-out-numbers $_)}
0 ->
0
1 ->
1
2,3 ->
 2
 3
2,10 ->
 2
10
4,5,6 ->
  4
  5
  6
17,19,20 ->
 17
 19
 20
7,8,9,10 ->
   7
   8
   9
  10
100,200,300,0 ->
 100
 200
 300
   0
1000,400,30,7 ->
1000
 400
  30
   7
1,33,333,7777 ->
   1
  33
 333
7777
0,0,0,0,0,0 ->
     0
     0
     0
     0
     0
     0
</code>```

Title: Spaced-out numbers

Body:
PowerShell v2+, 36 bytes

param($a)$a|%{"{0,$($a.count)}"-f$_}

Takes input $a as an array of integers. Loops through them with $a|%{...}. Each iteration, uses the -format operator with the optional Alignment Component (based on $a.count) to left-pad the appropriate number of spaces. That resultant string is left on the pipeline. At end of program execution, the resulting strings are all left on the pipeline as an array.

Examples

Output is newline-separated on each run, as that's the default Write-Output at program completion for an array.

PS C:\Tools\Scripts\golfing> @(0),@(1),@(2,3),@(2,10),@(4,5,6),@(17,19,20),@(7,8,9,10),@(100,200,300,0),@(1000,400,30,7),@(1,33,333,7777),@(0,0,0,0,0,0)|%{""+($_-join',')+" -> ";(.\spaced-out-numbers $_)}
0 ->
0
1 ->
1
2,3 ->
 2
 3
2,10 ->
 2
10
4,5,6 ->
  4
  5
  6
17,19,20 ->
 17
 19
 20
7,8,9,10 ->
   7
   8
   9
  10
100,200,300,0 ->
 100
 200
 300
   0
1000,400,30,7 ->
1000
 400
  30
   7
1,33,333,7777 ->
   1
  33
 333
7777
0,0,0,0,0,0 ->
     0
     0
     0
     0
     0
     0


答:
Ruby, <s>40</s> <s>36</s> 34 bytes

```<code>->m{m.map{|i|$><<i.rjust(m.size)}}
</code>```

Can be worked on more.

Call as a lambda.

Explanation:

```<code>->m{m.map{|i|$><<i.rjust(m.size)}}
->m{                             } # lambda taking array m
    m.map{|i|                   }  # map over array using variable i
             $><<                  # output to $> (stdout)
                 i.rjust(m.size)   # right justify i to m's length
</code>```

Title: Spaced-out numbers

Body:
Given a list of N non-negative integers, output those numbers with each left-padded by spaces to a length of N. (Alternatively, return a character/string list.) You may assume that N is greater than or equal to the number of digits of the largest number in the list. Trailing spaces are allowed in the output.

You may also take a string containing these numbers, but N is not the length of the string, but rather the number of elements in the list; also, you may take a list of strings e.g. ["1", "2", "3"].

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

Test cases

```<code>input => 'output'
0 => '0'
1 => '1'
2 3 => ' 2 3'
2 10 => ' 210'
4 5 6 => '  4  5  6'
17 19 20 => ' 17 19 20'
7 8 9 10 => '   7   8   9  10'
100 200 300 0 => ' 100 200 300   0'
1000 400 30 7 => '1000 400  30   7'
1 33 333 7777 => '   1  33 3337777'
0 0 0 0 0 0 => '     0     0     0     0     0     0'
</code>```

Body:
Ruby, <s>40</s> <s>36</s> 34 bytes

->m{m.map{|i|$><<i.rjust(m.size)}}

Can be worked on more.

Call as a lambda.

Explanation:

->m{m.map{|i|$><<i.rjust(m.size)}}
->m{                             } # lambda taking array m
    m.map{|i|                   }  # map over array using variable i
             $><<                  # output to $> (stdout)
                 i.rjust(m.size)   # right justify i to m's length

ContentLicense: CC BY-SA 4.0


答:
Jelly, <s>7</s> 6 bytes

```<code>L⁶xaUU
</code>```

Input is an array of strings. Try it online! or verify all test cases.

How it works

```<code>L⁶xaUU  Main link. Argument: A (array of strings)

L       Yield the l, the length of A.
 ⁶x     Repeat ' ' l times.

    U   Upend; reverse all strings in A.
   a    Perform vectorizing logical AND, replacing spaces with their corresponding
        digits and leaving spaces without corresponding digits untouched.
     U  Upend; reverse the strings in the result to restore the original order of
        its digits, moving the spaces to the left.
</code>```

Title: Spaced-out numbers

Body:
Jelly, <s>7</s> 6 bytes

L⁶xaUU

Input is an array of strings. Try it online! or verify all test cases.

How it works

L⁶xaUU  Main link. Argument: A (array of strings)

L       Yield the l, the length of A.
 ⁶x     Repeat ' ' l times.

    U   Upend; reverse all strings in A.
   a    Perform vectorizing logical AND, replacing spaces with their corresponding
        digits and leaving spaces without corresponding digits untouched.
     U  Upend; reverse the strings in the result to restore the original order of
        its digits, moving the spaces to the left.


答:
Vim, 19 bytes

YPPG!{<C-F>|R%ri<CR>djVGgJ

Takes a list of numbers one-per-line. Relies on :set expandtab, which is popular, but not universal.

You clearly want to use :right for this. The question is how to get the number of lines onto the command line. The traditional way is :%ri<C-R>=line('$'), but all that text is long.

The shorter, more enterprising approach is to form the command line using the normal mode ! command. It involves some weird workarounds, expanding the file by 2 lines then removing them again, but it comes out 2 bytes shorter. And I'm kinda shocked the garbled command line I get (like :%ri+4!) actually works, but it does.

Title: Spaced-out numbers


答:
JavaScript, 49 bytes

```<code>a=>a.map(n=>" ".repeat(a.length-n.length)+n)
</code>```

Takes the arguments as a list of strings and also returns a list of strings.

Explanation:

```<code>a=>                                                   An unnamed function, which takes one argument, a
   a.map(n=>                               )          Do the following to each element n in a:
            " ".repeat(a.length-n.length)             Generate the spaces needed to justify the number
                                         +n           Append the number
</code>```

Title: Spaced-out numbers

Body:
JavaScript, 49 bytes

a=>a.map(n=>" ".repeat(a.length-n.length)+n)

Takes the arguments as a list of strings and also returns a list of strings.

Explanation:

a=>                                                   An unnamed function, which takes one argument, a
   a.map(n=>                               )          Do the following to each element n in a:
            " ".repeat(a.length-n.length)             Generate the spaces needed to justify the number
                                         +n           Append the number


答:
PHP, 55 Bytes

```<code><?foreach($a=$_GET[a]as$i)printf("%".count($a)."s",$i);
</code>```

Pevious Version 59 Bytes

```<code><?foreach($a=$_GET[a]as$i)echo str_pad($i,count($a)," ",0);
</code>```

Title: Spaced-out numbers

Body:
PHP, 55 Bytes

<?foreach($a=$_GET[a]as$i)printf("%".count($a)."s",$i);

Pevious Version 59 Bytes

<?foreach($a=$_GET[a]as$i)echo str_pad($i,count($a)," ",0);


答:
Bash, 14

```<code>printf %$#d $@
</code>```

Input list given at the command line.

Not much to explain here.  Simply uses built-in printf facilities to do the necessary padding, based off the number of passed args:

$# is the number of args passed

%<n>d is a printf format specifier that prints an integer with up to n leading spaces

$@ is the list of all args passed

The format specifier is reused for each member of $@.

Ideone.

Title: Spaced-out numbers

Body:
Bash, 14

printf %$#d $@

Input list given at the command line.

Not much to explain here.  Simply uses built-in printf facilities to do the necessary padding, based off the number of passed args:

$# is the number of args passed

%<n>d is a printf format specifier that prints an integer with up to n leading spaces

$@ is the list of all args passed

The format specifier is reused for each member of $@.

Ideone.


答:
Python, 32 bytes

lambda l:'%%%ds'%len(l)*len(l)%l
```

<p>An anonymous function that takes a tuple as input. Either numbers or strings work.</p>

<p>Example:</p>

<pre class="lang-python prettyprint-override"><code>l=(1,33,333,7777)

'%%%ds'
## A "second-order" format string

'%%%ds'%len(l)           -> '%4s'
## Inserts the length as a number in place of '%d'
## The escaped '%%' becomes '%', ready to take a new format argument
## The result is a format string to pad with that many spaces on the left

'%%%ds'%len(l)*len(l)    -> '%4s%4s%4s%4s'
## Concatenates a copy per element

'%%%ds'%len(l)*len(l)%l  -> '   1  33 3337777'
## Inserts all the tuple elements into the format string
## So, each one is padded with spaces
</code>```

Title: Spaced-out numbers

Body:
Python, 32 bytes

lambda l:'%%%ds'%len(l)*len(l)%l

An anonymous function that takes a tuple as input. Either numbers or strings work.

Example:

l=(1,33,333,7777)

'%%%ds'
## A "second-order" format string

'%%%ds'%len(l)           -> '%4s'
## Inserts the length as a number in place of '%d'
## The escaped '%%' becomes '%', ready to take a new format argument
## The result is a format string to pad with that many spaces on the left

'%%%ds'%len(l)*len(l)    -> '%4s%4s%4s%4s'
## Concatenates a copy per element

'%%%ds'%len(l)*len(l)%l  -> '   1  33 3337777'
## Inserts all the tuple elements into the format string
## So, each one is padded with spaces


答:
Hexagony, 31 bytes

```<code><8!~\\\..)\M\~={{'$;$@.......9$
</code>```

Try it Online!

Still feeling that there are too many no-ops.  Had a 34 bytes first draft:

```<code><{."@;.)!.8.{{..M.\\.\'.$(...0=..1
</code>```

Expanded 31 bytes solution

```<code>   < 8 ! ~
  \ \ \ . .
 ) \ M \ ~ =
{ { ' $ ; $ @
 . . . . . .
  . 9 $ . .
   . . . .
</code>```

As in the first draft, uses a < to deflect the IP to NW direction.

This trick is found to be quite useful (for me) when the ending path is short enough after a loop.

Instead of using 10, I used 9 and negate it so the loop is still running 10 times (-9 -8 ... 0 all to the "Left" branch).

Although I managed to increase the number of no-ops in the main loop (NW), I can't modify the main loop due to positioning concerns... Maybe easier to golf off more bytes without using the negation trick.

And though I very much like re-using ops, this time I left a lot of no-ops and used a lot of $ skip commands to keep the loop running.

Oh I really love this language!

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:
Hexagony, 31 bytes

<8!~\\\..)\M\~={{'$;$@.......9$

Try it Online!

Still feeling that there are too many no-ops.  Had a 34 bytes first draft:

<{."@;.)!.8.{{..M.\\.\'.$(...0=..1

Expanded 31 bytes solution

   < 8 ! ~
  \ \ \ . .
 ) \ M \ ~ =
{ { ' $ ; $ @
 . . . . . .
  . 9 $ . .
   . . . .

As in the first draft, uses a < to deflect the IP to NW direction.

This trick is found to be quite useful (for me) when the ending path is short enough after a loop.

Instead of using 10, I used 9 and negate it so the loop is still running 10 times (-9 -8 ... 0 all to the "Left" branch).

Although I managed to increase the number of no-ops in the main loop (NW), I can't modify the main loop due to positioning concerns... Maybe easier to golf off more bytes without using the negation trick.

And though I very much like re-using ops, this time I left a lot of no-ops and used a lot of $ skip commands to keep the loop running.

Oh I really love this language!


答:
05AB1E, 3 bytes

Code:

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

Explanation:

```<code>D    # Duplicate the input array
 g   # Get the length
  j  # Left-pad with spaces to the length of the array
</code>```

Try it online! or Verify all test cases.

Title: Spaced-out numbers

Body:
05AB1E, 3 bytes

Code:

Dgj

Explanation:

D    # Duplicate the input array
 g   # Get the length
  j  # Left-pad with spaces to the length of the array

Try it online! or Verify all test cases.


问:
ASCII PPCG Beta Logo Golf
We shall soon have a new logo & site design, let us use this last breath of the simple times and golf this ASCII version of the speech bubble beta logo:

```<code>+-------------------------------------------+
|    .---------------------------------.    |
|   .EPEpEpBPEpEGCXCgCgCGJgCgP&PWP&P&P&Y`   |
|  .RSRsRWRSRsRsHoNoNONxNONONuJuSUSUSVSUS`  |
|  :o@OTO@O@O@W@IDiDIWiDIDIDWZEZeZEWEZeZE-  |
|  :GWGFGfGFKFGFMEMwMEMEMeXEMZLZLWLZLzLZH-  |
|  :rLRLRLXLRLrLMBMGMGmGXGMGMLzTZLZLZLYLZ-  |
|  :AOAoBOAOAOAYAOAoAoBOAOAoAWZEZEZEVEZEZ-  |
|  :MGVGm!'""'!GRLr!'""'!LRKRS!'""'!uSuSU-  |
|  :XEME' .''% !Gf' .;G% 'GFG' .;P% '&PVP-  |
|  :IDID  !DI! !V! .OPoYOPOP!  -gCGCGHGCG-  |
|  :NONw  ``` .OR! .RWRRRRRR! !ONo* 'ONON-  |
|  :GBGC  !CXCGCP! !POP; !xOP  `IJ; `!IDW-  |
|  :P&P&._!&P&P&F~.____.;GFGF~.____.;eJEM-  |
|  :USUSVSUSuSuTLRlRLRWRLRlRLWMGMGmGwGmGM-  |
|  :ZeWEZEZeZWZeOAOaKAOAOaOwOOAoAOXoAoAOA-  |
|  :wLZLZLzHZLZLGMxMgMGMgBGMGLRLXLRLrLRTr-  |
|  :LZLZLYLZLZLzBMEMEMEyEmEMEfBFGFGfGWGFG-  |
|  :EZEVEZEZeZVZDIdIDYdIdIDIx@O@o@oKO@O@o-  |
|  `SkSuSuSUXUSuONOVONOnONWNOSRSRWRSRSRS-   |
|   `.&P&PVP&P&PCXcGCGCGVGcGCEPYPEpEPE?.-   |
|      ```````````````````:STACKE-`````     |
|                         :XCHA-`           |
|                         :NG-`             |
|           ?=W...HWYWVWB :E`               |
+-------------------------------------------+
</code>```

This is kolmogorov-complexity code-golf, so it's straight forward, output all the text that appears in the above code-block in as few bytes of code as possible, without any funny-business.

input

None

Output

The ASCII content of the code-block above as a return value or printed to STDOUT or equivalent;

carriage returns (13) and/or new lines (10) are acceptable;

a trailing empty line is also allowed.

Update

The original aim of this challenge was to have a puzzle aspect. It seems this has not been noticed, so I have decided to make the puzzle portion significantly easier, but still present, by performing a couple of steps to get you going:

There is a use of the string "STACKEXCHANGE" in the very bottom portion of the speech-bubble.

If one reads the rows of text in the main-portion of the speech-bubble, one might notice an almost repetitive nature of pairs of letters, for example the fourth row reads "GWGFGfGFKFGFMEMwMEMEMeXEMZLZLWLZLzLZH" which is almost "GFGFGFGFGFGFMEMEMEMEMEMEMZLZLZLZLZLZH", except some letters have been changed either to another letter (e.g. the second letter from F to W), to lower-case (e.g. the sixth letter from F to f), or both (e.g. the sixteenth letter from E to w). The rows seem to all conform to such a pattern with a 12-13-12 character split (ignoring the mess of the PPG logo's white space and border).

The process described in (2), once noticed, should be quite easy to undo for the unmasked rows of the speech-bubble (the top six and bottom seven), by first converting the whole text to upper-case and then replacing the odd-ones-out and results in:

```<code>+-------------------------------------------+
|    .---------------------------------.    |
|   .EPEPEPEPEPEGCGCGCGCGCGCGP&P&P&P&P&P`   |
|  .RSRSRSRSRSRSNONONONONONONUSUSUSUSUSUS`  |
|  :O@OTO@O@O@O@IDIDIWIDIDIDIZEZEZEZEZEZE-  |
|  :GFGFGFGFGFGFMEMEMEMEMEMEMZLZLZLZLZLZL-  |
|  :RLRLRLRLRLRLMGMGMGMGMGMGMLZLZLZLZLZLZ-  |
|  :AOAOAOAOAOAOAOAOAOBOAOAOAEZEZEZEZEZEZ-  |
|  :MGVGm!'""'!GRLr!'""'!LRKRS!'""'!uSuSU-  |
|  :XEME' .''% !Gf' .;G% 'GFG' .;P% '&PVP-  |
|  :IDID  !DI! !V! .OPoYOPOP!  -gCGCGHGCG-  |
|  :NONw  ``` .OR! .RWRRRRRR! !ONo* 'ONON-  |
|  :GBGC  !CXCGCP! !POP; !xOP  `IJ; `!IDW-  |
|  :P&P&._!&P&P&F~.____.;GFGF~.____.;eJEM-  |
|  :USUSUSUSUSURLRLRLRLRLRLRLGMGMGMGMGMGM-  |
|  :ZEZEZEZEZEZEOAOAOAOAOAOAOOAOAOAOAOAOA-  |
|  :ZLZLZLZLZLZLGMGMGMGMGMGMGLRLRLRLRLRLR-  |
|  :LZLZLZLZLZLZEMEMEMEMEMEMEFGFGFGFGFGFG-  |
|  :EZEZEZEZEZEZDIDIDIDIDIDID@O@O@O@O@O@O-  |
|  `SUSUSUSUSUSUONONONONONONOSRSRSRSRSRS-   |
|   `.&P&P&P&P&PCGCGCGCGCGCGCEPEPEPEPEP.-   |
|      ```````````````````:STACKE-`````     |
|                         :XCHA-`           |
|                         :NG-`             |
|           ?=W...HWYWVWB :E`               |
+-------------------------------------------+
</code>```

While carrying out (3) one may notice a couple of things. First the least obvious: that the only ?, in the very bottom-right became a P, whereas the extra text at the bottom says ?=W..., and that a large proportion of replaced characters were also W. Second that the odd-ones out in upper-case were B,H,J,K,T,V,W,X,Y. Third that the odd-ones out occurred every seven letters. The second and third observation helps to fill in the middle rows - which, if we remove the PCG mask of spaces and non-letters, non & (used in the top and bottom row) and replace it with the letters yields:

```<code>+-------------------------------------------+
|    .---------------------------------.    |
|   .EPEPEPEPEPEGCGCGCGCGCGCGP&P&P&P&P&P`   |
|  .RSRSRSRSRSRSNONONONONONONUSUSUSUSUSUS`  |
|  :O@O@O@O@O@O@IDIDIWIDIDIDIZEZEZEZEZEZE-  |
|  :GFGFGFGFGFGFMEMEMEMEMEMEMZLZLZLZLZLZL-  |
|  :RLRLRLRLRLRLMGMGMGMGMGMGMLZLZLZLZLZLZ-  |
|  :AOAOAOAOAOAOAOAOAOBOAOAOAEZEZEZEZEZEZ-  |
|  :MGMGMGMGMGMGRLRLRLRLRLRLRSUSUSUSUSUSU-  |
|  :MEMEMEMEMEMEGFGFGFGFGFGFG&P&P&P&P&P&P-  |
|  :IDIDIDIDIDIDOPOPOPOPOPOPOCGCGCGCGCGCG-  |
|  :NONONONONONORRRRRRRRRRRRRONONONONONON-  |
|  :GCGCGCGCGCGCPOPOPOPOPOPOPDIDIDIDIDIDI-  |
|  :P&P&P&P&P&P&FGFGFGFGFGFGFEMEMEMEMEMEM-  |
|  :USUSUSUSUSURLRLRLRLRLRLRLGMGMGMGMGMGM-  |
|  :ZEZEZEZEZEZEOAOAOAOAOAOAOOAOAOAOAOAOA-  |
|  :ZLZLZLZLZLZLGMGMGMGMGMGMGLRLRLRLRLRLR-  |
|  :LZLZLZLZLZLZEMEMEMEMEMEMEFGFGFGFGFGFG-  |
|  :EZEZEZEZEZEZDIDIDIDIDIDID@O@O@O@O@O@O-  |
|  `SUSUSUSUSUSUONONONONONONOSRSRSRSRSRS-   |
|   `.&P&P&P&P&PCGCGCGCGCGCGCEPEPEPEPEP.-   |
|      ```````````````````:STACKE-`````     |
|                         :XCHA-`           |
|                         :NG-`             |
|           ?=W...HWYWVWB :E`               |
+-------------------------------------------+
```

Now reading the columns one can see that the "input" text to make this base grid was PROGRAMMINGPUZZLES&CODEGOLFPROGRAMMINGPUZZLES&CODEGOLF@SE.

The lower-casing and replacement characters are to be determined by you, but also note that the ten remaining letters in the alphabet after removing those present in that string are B,H,J,K,Q,T,V,W,X,Y - the replacements plus Q.

Title: ASCII PPCG Beta Logo Golf

Body:
Ruby, 788 bytes

Basically the same method as the PHP solution.

puts Zlib.inflate Base64.decode64 "eJyVlG9vmzAQxt/vU5hKLdIi/AESTQ0QxyEBjCDDwJtSrUk0bRlVqihZVfWz7zmnOG017Y9PdxzRzyf83DkD79/X4MMTw+J/BTlhT4bmIhP34j6gKMMq3MDkHDG7yjQcVrc9zfMif8i1iQ+zLu1SlR7hKt3P98VnWAlvX+hhN1ZLNSbT42jydRJpOEw3olk1Qpvo9bTUcirXcrqYymkikgNcJKtKJE3cxBr+GDczS+/iHFbBd3ESJDKRW1khJvHjkjY0cR03lvaV3wXKJ6spf3nrfPoUWEnR0oks5dZxLy5cR6L+KYvzRV6c0n2Bw1oaXyhcxl33kjlyjWwkL5mLs1CaIb3KyszSdH7GnEnkMKd0GFdZV6tMZQ5jHpQP5QxuaSh7YKxtW4A5aGhvFjartPvIXNL+rGAgQ9RGF2WIgg7KjphzVBlKRPMRax1ob2lqLb9xTIunz/wGC58O8ft8NReJpfvm4uzLOP8O8XVunvqk/QF+ppuVFqbJullB6NsFSX+rDoo0V1VH0bf0wfTrcUZRJsdkg5KbAGVth/PlztJ9c2lLYIZE/BRbxHUwNRNEc2Tpvrmrpmwm0V00qe8oRkdMZTfuFjSdXU+3xbfCNLfCQSFtCf+hUp2qAjNPcw/z7N1pOYlXmlsSVl8kta+UeIqspvuUiWt+pplp5Ps1LJZ+uBCeeWHsNf2bNazCme+1r375I53KN+x7+vqT5pzPdK1LHUCqtyzRg//69/kFnIsxTA=="


答:
JavaScript (ES7), 37 bytes

a=>a.map(v=>v.padStart(a.length,' '))
```
<p>Input: Array of strings<br />
Output: Array of strings</p>
<p><div class="snippet" data-lang="js" data-hide="true" data-console="true" data-babel="false">
<div class="snippet-code snippet-currently-hidden">
<pre class="snippet-code-js lang-js prettyprint-override"><code>f=
  a=>a.map(v=>v.padStart(a.length,' '))
;
console.log(f(['0']))
console.log(f(['1']))
console.log(f(['2','3']))
console.log(f(['2','10']))
console.log(f(['4','5','6']))
console.log(f(['17','19','20']))
console.log(f(['7','8','9','10']))
console.log(f(['100','200','300','0']))
console.log(f(['1000','400','30','7']))
console.log(f(['1','33','333','7777']))
console.log(f(['0','0','0','0','0','0']))</code>```

Title: Spaced-out numbers

Body:
JavaScript (ES7), 37 bytes

a=>a.map(v=>v.padStart(a.length,' '))

Input: Array of strings

Output: Array of strings

f=
  a=>a.map(v=>v.padStart(a.length,' '))
;
console.log(f(['0']))
console.log(f(['1']))
console.log(f(['2','3']))
console.log(f(['2','10']))
console.log(f(['4','5','6']))
console.log(f(['17','19','20']))
console.log(f(['7','8','9','10']))
console.log(f(['100','200','300','0']))
console.log(f(['1000','400','30','7']))
console.log(f(['1','33','333','7777']))
console.log(f(['0','0','0','0','0','0']))


答:
CJam, 11 bytes

```<code>lS%_,f{Se[}
</code>```

Try it online! (As a test suite.)

Explanation

```<code>l      e# Read input.
S%     e# Split around spaces.
_,     e# Copy and get length.
f{     e# Map this block over the list, passing in the length on each iteration.
  Se[  e#   Left-pad to the given length with spaces.
}
</code>```

Title: Spaced-out numbers

Body:
CJam, 11 bytes

lS%_,f{Se[}

Try it online! (As a test suite.)

Explanation

l      e# Read input.
S%     e# Split around spaces.
_,     e# Copy and get length.
f{     e# Map this block over the list, passing in the length on each iteration.
  Se[  e#   Left-pad to the given length with spaces.
}


答:
Perl, 26 bytes

-4 bytes thanks to @Ton Hospel

25 bytes of code + -a flag.

printf"%*s",~~@F,$_ for@F
```
<p>Run with :</p>
```perl -ae 'printf"%*s",~~@F,$_ for@F' <<< "10 11 12"
```

(On some older version of Perl, you might need to add -n)

Title: Spaced-out numbers

Body:
Perl, 26 bytes

-4 bytes thanks to @Ton Hospel

25 bytes of code + -a flag.

printf"%*s",~~@F,$_ for@F

Run with :

perl -ae 'printf"%*s",~~@F,$_ for@F' <<< "10 11 12"

(On some older version of Perl, you might need to add -n)


答:
Kotlin, 90 bytes

Golfed:

```<code>fun main(a:Array<String>){a.forEach{b->for(i in 1..a.size-b.length){print(" ")};print(b)}}
</code>```

Ungolfed:

```<code>fun main(a: Array<String>) {
    a.forEach { b ->
        for (i in 1..a.size - b.length) {
            print(" ")
        }
        print(b)
    }
}
</code>```

Title: Spaced-out numbers

Body:
Kotlin, 90 bytes

Golfed:

fun main(a:Array<String>){a.forEach{b->for(i in 1..a.size-b.length){print(" ")};print(b)}}

Ungolfed:

fun main(a: Array<String>) {
    a.forEach { b ->
        for (i in 1..a.size - b.length) {
            print(" ")
        }
        print(b)
    }
}


答:
Mathematica, 25 bytes

```<code>#~StringPadLeft~Length@#&
</code>```

Both input and output are lists of strings.

Explanation

```<code>Length@#
</code>```

Get the length of the input (number of element).

```<code>#~StringPadLeft~...
</code>```

Pad left each element in the input so that their lengths match the length of the input.

Title: Spaced-out numbers

Body:
Mathematica, 25 bytes

#~StringPadLeft~Length@#&

Both input and output are lists of strings.

Explanation

Length@#

Get the length of the input (number of element).

#~StringPadLeft~...

Pad left each element in the input so that their lengths match the length of the input.


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

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

The Rules

Each submission must be a full program.

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

The program must not write anything to STDERR.

If anyone wants to abuse this by creating a language where the empty program prints Hello, World!, then congrats, they just paved the way for a very boring answer.

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

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

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

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

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

For inspiration, check the Hello World Collection.

The Catalogue

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

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

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

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

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

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

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

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

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

/* Configuration */

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

/* App */

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

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

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

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

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

getAnswers();

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

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

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

function process() {
  var valid = [];

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

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

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

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

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

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

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

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

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

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

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

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

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

table thead {
  font-weight: bold;
}

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

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

Shortest Solution by Language

Language	User	Score

Leaderboard

	Author	Language	Size

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

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

```

答:
StackFuck, 18 bytes

```<code>"!dlroW ,olleH"{o}
</code>```

The first cell is not used for the stack (It's the register), and is 0 at the start of the program, so no need to push a 0 at the start

Title: "Hello, World!"

Body:
StackFuck, 18 bytes

"!dlroW ,olleH"{o}

The first cell is not used for the stack (It's the register), and is 0 at the start of the program, so no need to push a 0 at the start


问:
N(e(s(t))) a string
To "function nest" a string, you must:

Treat the first character as a function, and the following characters as the arguments to that function. For example, if the input string was Hello, then the first step would be:

```<code>H(ello)
</code>```

Then, repeat this same step for every substring. So we get:

```<code>H(ello)
H(e(llo))
H(e(l(lo)))
H(e(l(l(o))))
</code>```

Your task is to write a program or function that "function nests" a string. For example, if the input string was Hello world!, then you should output:

```<code>H(e(l(l(o( (w(o(r(l(d(!)))))))))))
</code>```

The input will only ever contain printable ASCII, and you may take the input and the output in any reasonable format. For example, STDIN/STDOUT, function arguments and return value, reading and writing to a file, etc.

For simplicity's sake, you may also assume the input will not contain parentheses, and will not be empty.

```<code>Input:
Nest a string
Output:
N(e(s(t( (a( (s(t(r(i(n(g))))))))))))

Input:
foobar
Output:
f(o(o(b(a(r)))))

Input:
1234567890
Output:
1(2(3(4(5(6(7(8(9(0)))))))))

Input:
code-golf
Output:
c(o(d(e(-(g(o(l(f))))))))

Input:
a
Output:
a

Input:
42
Output:
4(2)
</code>```

As usual, all of our default rules and loopholes apply, and the shortest answer scored in bytes wins!

答:
Python, <s>41</s> <s>39</s> 34 bytes

lambda e:"(".join(e)+")"*~-len(e)
```

Ideone it

Pretty self explanatory.

It puts a parenthesis between every other character then adds one less than the length parentheses to the end.

Title: N(e(s(t))) a string

Body:
Python, <s>41</s> <s>39</s> 34 bytes

lambda e:"(".join(e)+")"*~-len(e)

Ideone it

Pretty self explanatory.

It puts a parenthesis between every other character then adds one less than the length parentheses to the end.


答:
Retina, <s>22</s> 17 bytes

```<code>\1>`.
($&
T`(p`)_
</code>```

Try it online!

Alternatively:

```<code>S_`
\`¶
(
T`(p`)_
</code>```

Explanation

I always forget that it's possible to print stuff along the way instead of transforming everything into the final result and outputting it in one go...

```<code>\1>`.
($&
</code>```

Here \ tells Retina to print the result of this stage without a trailing linefeed. The 1> is a limit which means that the first match of the regex should be ignored. As for the stage itself, it simply replaces each character (.) except the first with ( followed by that character. In other words, it inserts ( in between each pair of characters. For input abc, this transforms it into (and prints)

```<code>a(b(c
</code>```

All that's left is to print the closing parentheses:

```<code>T`(p`)_
</code>```

This is done with a transliteration which replaces ( with ) and deletes all other printable ASCII characters from the string.

Title: N(e(s(t))) a string

Body:
To "function nest" a string, you must:

Treat the first character as a function, and the following characters as the arguments to that function. For example, if the input string was Hello, then the first step would be:

```<code>H(ello)
</code>```

Then, repeat this same step for every substring. So we get:

```<code>H(ello)
H(e(llo))
H(e(l(lo)))
H(e(l(l(o))))
</code>```

Your task is to write a program or function that "function nests" a string. For example, if the input string was Hello world!, then you should output:

```<code>H(e(l(l(o( (w(o(r(l(d(!)))))))))))
</code>```

The input will only ever contain printable ASCII, and you may take the input and the output in any reasonable format. For example, STDIN/STDOUT, function arguments and return value, reading and writing to a file, etc.

For simplicity's sake, you may also assume the input will not contain parentheses, and will not be empty.

```<code>Input:
Nest a string
Output:
N(e(s(t( (a( (s(t(r(i(n(g))))))))))))

Input:
foobar
Output:
f(o(o(b(a(r)))))

Input:
1234567890
Output:
1(2(3(4(5(6(7(8(9(0)))))))))

Input:
code-golf
Output:
c(o(d(e(-(g(o(l(f))))))))

Input:
a
Output:
a

Input:
42
Output:
4(2)
</code>```

As usual, all of our default rules and loopholes apply, and the shortest answer scored in bytes wins!

Body:
Retina, <s>22</s> 17 bytes

\1>`.
($&
T`(p`)_

Try it online!

Alternatively:

S_`
\`¶
(
T`(p`)_

Explanation

I always forget that it's possible to print stuff along the way instead of transforming everything into the final result and outputting it in one go...

\1>`.
($&

Here \ tells Retina to print the result of this stage without a trailing linefeed. The 1> is a limit which means that the first match of the regex should be ignored. As for the stage itself, it simply replaces each character (.) except the first with ( followed by that character. In other words, it inserts ( in between each pair of characters. For input abc, this transforms it into (and prints)

a(b(c

All that's left is to print the closing parentheses:

T`(p`)_

This is done with a transliteration which replaces ( with ) and deletes all other printable ASCII characters from the string.


答:
PowerShell v2+, 46 bytes

```<code>param([char[]]$a)($a-join'(')+')'*($a.count-1)
</code>```

Takes input string, char-array's it, -joins the array together with open parens (, then concatenates on the appropriate number of closed parens ).

Title: N(e(s(t))) a string

Body:
PowerShell v2+, 46 bytes

param([char[]]$a)($a-join'(')+')'*($a.count-1)

Takes input string, char-array's it, -joins the array together with open parens (, then concatenates on the appropriate number of closed parens ).


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

-1 byte thanks to @Dennis (use mould, ṁ, in place of length, L, and repeat, x)

```<code>j”(³”)ṁṖ
</code>```

TryItOnline

How?

```<code>j”(³”)ṁṖ - Main link: s     e.g. "code-golf"           printed output:
j        - join s with
 ”(      - literal '('           "c(o(d(e(-(g(o(l(f"
    ”)   - literal ')'
      ṁ  - mould like
   ³     - first input, s        ")))))))))"
         - causes print with no newline of z:          c(o(d(e(-(g(o(l(f
       Ṗ - pop (z[:-1])          "))))))))"            c(o(d(e(-(g(o(l(f
         - implicit print                              c(o(d(e(-(g(o(l(f))))))))
</code>```

Title: N(e(s(t))) a string

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

-1 byte thanks to @Dennis (use mould, ṁ, in place of length, L, and repeat, x)

j”(³”)ṁṖ

TryItOnline

How?

j”(³”)ṁṖ - Main link: s     e.g. "code-golf"           printed output:
j        - join s with
 ”(      - literal '('           "c(o(d(e(-(g(o(l(f"
    ”)   - literal ')'
      ṁ  - mould like
   ³     - first input, s        ")))))))))"
         - causes print with no newline of z:          c(o(d(e(-(g(o(l(f
       Ṗ - pop (z[:-1])          "))))))))"            c(o(d(e(-(g(o(l(f
         - implicit print                              c(o(d(e(-(g(o(l(f))))))))


Title: N(e(s(t))) a string

Body:
Ruby, <s>41</s> 29 bytes

<s>->s{s.split("").join(?()+?)*(s.length-1)}</s>

->s{(s.chars*?()+?)*~-s.size}

Thanks @ValueInk


答:
JavaScript (ES6), <s>40</s> <s>34</s> 33 bytes

Saved 6 bytes, thanks to ETHproductions

A recursive function.

```<code>f=([c,...s])=>s+s?c+`(${f(s)})`:c
</code>```

Try it online!

Title: N(e(s(t))) a string

Body:
JavaScript (ES6), <s>40</s> <s>34</s> 33 bytes

Saved 6 bytes, thanks to ETHproductions

A recursive function.

f=([c,...s])=>s+s?c+`(${f(s)})`:c

Try it online!


答:
05AB1E, <s>22</s> <s>21</s> <s>19</s> 18 bytes

```<code>¤Ug<©FN¹è'(}X®')×J
</code>```

Try it online!

Explanation:

```<code>¤Ug<©FN¹è'(}X®')×J #implicit input, call it A
¤U                 #push the last letter of A, save it to X
  g<©              #push the length of A, subtract 1, call it B and save it to register_c
     F     }       #repeat B times
      N¹è          #push the Nth char of A
         '(        #push '('
            X      #push X
             ®')×  #push ')' repeated B times
                 J #join together
                   #implicit print
</code>```

Title: N(e(s(t))) a string

Body:
05AB1E, <s>22</s> <s>21</s> <s>19</s> 18 bytes

¤Ug<©FN¹è'(}X®')×J

Try it online!

Explanation:

¤Ug<©FN¹è'(}X®')×J #implicit input, call it A
¤U                 #push the last letter of A, save it to X
  g<©              #push the length of A, subtract 1, call it B and save it to register_c
     F     }       #repeat B times
      N¹è          #push the Nth char of A
         '(        #push '('
            X      #push X
             ®')×  #push ')' repeated B times
                 J #join together
                   #implicit print


答:
Lua, 88 bytes

Probably not nearly as short as it could be.

```<code>x=""y=...for i=1,#y-1 do x=x..y:sub(i,i).."("end print(x..y:sub(-1,-1)..(")"):rep(#y-1))
</code>```

Takes input from the command line.

Title: N(e(s(t))) a string

Body:
Lua, 88 bytes

Probably not nearly as short as it could be.

x=""y=...for i=1,#y-1 do x=x..y:sub(i,i).."("end print(x..y:sub(-1,-1)..(")"):rep(#y-1))

Takes input from the command line.


问:
String Calculator
Assume you're writing in one method, (or whatever you call them) with 3 inputs: the first string, a character that contains a +, - or * symbol, and the second string.

Example in Java:

```<code>public String strCalc(String str1, char sym, String str2) {
    //code...
}
</code>```

What it should return:

```<code>str1 sym str2 ans
A     +  A   =  B
A     +  B   =  C
B     +  B   =  D
Z     +  A   =  AA
W     +  B   =  Y
A     -  A   =  ' ' (Space Character)
A     -  B   =  -A
A     -  C   =  -B
B     -  A   =  A
CA    -  A   =  BZ
A     *  A   =  A
B     *  B   =  D
</code>```

Think of a one-indexed base 26.
Then convert the numbers back to letters based on their position in the alphabet.

```<code>0 = ' ' (Space Character)
1 = A
2 = B
3 = C
4 = D
5 = E
6 = F
7 = G
8 = H
9 = I
10 = J
11 = K
and so on...
</code>```

This is code-golf, so the shortest code in bytes not including the method declaration wins.

答:
Jelly, <s>64</s> 63 bytes

```<code>Aḃ26ịØA
O_64»0ḅ26
e”-NḤ’×Ç
³Ç;“*×-_”y⁴¤;⁵Ç¤V
¢<0”-x;¢1Ŀ¤
¢⁶¢L¤?
</code>```

Not a particularly clean solution; there are no 3 argument methods in Jelly, so this is a full program.

Accepts negative inputs like "-A", "- A", " -A", ... (note however "--A" is treated as "-A")

Accepts zero inputs like "", " ", "  ", ...

TryItOnline

How?

```<code>Aḃ26ịØA           - Link 1, convert integer to absolute value string: i
A                 - absolute value of i
 ḃ26              - convert to bijective base 26 (a list of integers in [1,26])
    ị             - index into (1-based)
     ØA           - alphabet yield -> "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
                  - (note: 0 will convert to an empty string here.)

O_64»0ḅ26         - Link 2, convert an input string to a positive integer: s
O                 - cast to ordinal (vectorises)
 _64              - subtract 64 from each (A->[1], B->[2], ..., AZ->[1,26], ...)
    »0            - maximum of that and zero ("-" and space become zeros; vectorises)
      ḅ26         - convert from base-26 to an integer (26 place values still work)

e”-NḤ’×Ç          - Link 3, convert an input string to an integer: s
 ”-               - literal '-'
e                 - exists in s?
   N              - negate
    Ḥ             - double
     ’            - increment (if "-" was in s we have -1, else we have 1)
      ×           - multiply by
       Ç          - call last link (2) as a monad

³Ç;“*×-_”y⁴¤;⁵Ç¤V - Link 4, evaluate the operation: niladic
³                 - first program input
 Ç                - call last link (3) as a monad (value of first input as an integer)
  ;               - concatenate with
           ¤      -     nilad followed by link(s) as a nilad
          ⁴       -     second program input
         y        -     map characters
   “*×-_”         -     literal "*×-_" - change "*" to "×" and "-" to "_"
            ;     - concatenate with
               ¤  -     nilad followed by link(s) as a nilad
             ⁵    -     third program input
              Ç   -     call last link (3) as a monad (value of 3rd input as integer)
                V - evaluate string as Jelly code (something like "-76×5" or "3_2")

¢<0”-x;¢1Ŀ¤       - Link 5, form output for non-zero results: niladic
¢                 - call the last link (4) as a nilad (integer result)
 <0               - less than zero?
   ”-             - literal '-'
     x            - repeat ('-' if negative '' if positive or zero)
      ;           - concatenate with
          ¤       -     nilad followed by link(s) as a nilad
       ¢          -     call the last link (4) as a nilad (integer result)
        1Ŀ        -     call the next link (1) as a monad (as absolute string)

¢⁶¢L¤?            - Main link: niladic (the program arguments expected however)
     ?            - ternary if
    ¤             -     nilad followed by link(s) as a nilad
  ¢               -     call the last link (5) as a nilad
   L              -     length
                  - True case (has length)
¢                 -     call the last link (5) as a nilad
                  - False case (no length)
 ⁶                - literal ' '
</code>```

Title: String Calculator

Body:
Jelly, <s>64</s> 63 bytes

Aḃ26ịØA
O_64»0ḅ26
e”-NḤ’×Ç
³Ç;“*×-_”y⁴¤;⁵Ç¤V
¢<0”-x;¢1Ŀ¤
¢⁶¢L¤?

Not a particularly clean solution; there are no 3 argument methods in Jelly, so this is a full program.

Accepts negative inputs like "-A", "- A", " -A", ... (note however "--A" is treated as "-A")

Accepts zero inputs like "", " ", "  ", ...

TryItOnline

How?

Aḃ26ịØA           - Link 1, convert integer to absolute value string: i
A                 - absolute value of i
 ḃ26              - convert to bijective base 26 (a list of integers in [1,26])
    ị             - index into (1-based)
     ØA           - alphabet yield -> "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
                  - (note: 0 will convert to an empty string here.)

O_64»0ḅ26         - Link 2, convert an input string to a positive integer: s
O                 - cast to ordinal (vectorises)
 _64              - subtract 64 from each (A->[1], B->[2], ..., AZ->[1,26], ...)
    »0            - maximum of that and zero ("-" and space become zeros; vectorises)
      ḅ26         - convert from base-26 to an integer (26 place values still work)

e”-NḤ’×Ç          - Link 3, convert an input string to an integer: s
 ”-               - literal '-'
e                 - exists in s?
   N              - negate
    Ḥ             - double
     ’            - increment (if "-" was in s we have -1, else we have 1)
      ×           - multiply by
       Ç          - call last link (2) as a monad

³Ç;“*×-_”y⁴¤;⁵Ç¤V - Link 4, evaluate the operation: niladic
³                 - first program input
 Ç                - call last link (3) as a monad (value of first input as an integer)
  ;               - concatenate with
           ¤      -     nilad followed by link(s) as a nilad
          ⁴       -     second program input
         y        -     map characters
   “*×-_”         -     literal "*×-_" - change "*" to "×" and "-" to "_"
            ;     - concatenate with
               ¤  -     nilad followed by link(s) as a nilad
             ⁵    -     third program input
              Ç   -     call last link (3) as a monad (value of 3rd input as integer)
                V - evaluate string as Jelly code (something like "-76×5" or "3_2")

¢<0”-x;¢1Ŀ¤       - Link 5, form output for non-zero results: niladic
¢                 - call the last link (4) as a nilad (integer result)
 <0               - less than zero?
   ”-             - literal '-'
     x            - repeat ('-' if negative '' if positive or zero)
      ;           - concatenate with
          ¤       -     nilad followed by link(s) as a nilad
       ¢          -     call the last link (4) as a nilad (integer result)
        1Ŀ        -     call the next link (1) as a monad (as absolute string)

¢⁶¢L¤?            - Main link: niladic (the program arguments expected however)
     ?            - ternary if
    ¤             -     nilad followed by link(s) as a nilad
  ¢               -     call the last link (5) as a nilad
   L              -     length
                  - True case (has length)
¢                 -     call the last link (5) as a nilad
                  - False case (no length)
 ⁶                - literal ' '


答:
Brainfuck, 44 bytes

```<code>>+++++[-<++++++++>],.,[<.>.>+<,]<+>>[-<<.>>]
</code>```

Reads a byte at a time, puts an open-paren before each one except the first, puts the same number of close-parens at the end.

Title: N(e(s(t))) a string

Body:
Brainfuck, 44 bytes

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

Reads a byte at a time, puts an open-paren before each one except the first, puts the same number of close-parens at the end.


问:
Make an ASCII bat fly around an ASCII moon
Background

Here is a Halloween related challenge.

As you may have seen from my last challenge I quite like what I term as ascii art animations, that is not just draw a pattern but draw a pattern that progresses. This idea came to me after I was asked a couple of years ago to liven up a (rather dull) presentation by making random ascii bats fly across the screen on Halloween. Needless to say I duly obliged (I was being paid for it) but it made me think that there is more to life than random bats. Inspired by this I would like to propose this challenge.

Challenge

Make a bat fly around the moon.

Here is a bat:

```<code>^o^
</code>```

Here is the moon:

```<code>     mmm
   mmmmmmm
  mmmmmmmmm
   mmmmmmm
     mmm
</code>```

You must show every stage of the bats flight (see output).

Input

None

Output

```<code>      ^o^
      mmm
    mmmmmmm
   mmmmmmmmm
    mmmmmmm
      mmm

      mmm^o^
    mmmmmmm
   mmmmmmmmm
    mmmmmmm
      mmm

      mmm
    mmmmmmm^o^
   mmmmmmmmm
    mmmmmmm
      mmm

      mmm
    mmmmmmm
   mmmmmmmmm^o^
    mmmmmmm
      mmm

      mmm
    mmmmmmm
   mmmmmmmmm
    mmmmmmm^o^
      mmm

      mmm
    mmmmmmm
   mmmmmmmmm
    mmmmmmm
      mmm^o^

      mmm
    mmmmmmm
   mmmmmmmmm
    mmmmmmm
      mmm
      ^o^

      mmm
    mmmmmmm
   mmmmmmmmm
    mmmmmmm
   ^o^mmm

      mmm
    mmmmmmm
   mmmmmmmmm
 ^o^mmmmmmm
      mmm

      mmm
    mmmmmmm
^o^mmmmmmmmm
    mmmmmmm
      mmm

      mmm
 ^o^mmmmmmm
   mmmmmmmmm
    mmmmmmm
      mmm

   ^o^mmm
    mmmmmmm
   mmmmmmmmm
    mmmmmmm
      mmm

      ^o^
      mmm
    mmmmmmm
   mmmmmmmmm
    mmmmmmm
      mmm
</code>```

Rules

No reading from external files or websites

You may submit a full program or a function

Extra spaces and/or newlines are fine by me

Standard loopholes banned as usual

The bat must finish back at the top of the moon

Please feel free to clear the screen between frames if you wish however this is not a requirement. Output as shown above is fine

As this is code golf, the winner will be the answer with the lowest byte count although any answer is welcome

Sample

Reference implementation in totally ungolfed Python 2 (620 bytes but just to prove that it can be done. May golf it later).

```<code>b='^o^'
m=['                     ',
'         mmm         ',
'       mmmmmmm       ',
'      mmmmmmmmm      ',
'       mmmmmmm       ',
'         mmm         ',
'                     ']
p=[(9,12),(12,15),(14,17),(15,18),(14,17),(12,15),(9,12),(6,9),(4,7),(3,6),(4,7),(6,9),(9,12)]
d=0
for z in range(7):
    x=map(str,m[z])
    c="".join(x[:p[z][0]]) + b + "".join(x[p[z][1]:])+"\n"
    print "\n".join(m[:z]) + "\n" + c+"\n".join(m[z+1:])
for z in range(6)[::-1]:
    x=map(str,m[z])
    c="".join(x[:p[z+6][0]]) + b + "".join(x[p[z+6][1]:])+"\n"
    print "\n".join(m[:z]) + "\n" + c+"\n".join(m[z+1:])
</code>```

Result

Although @Jonathan obviously wins on byte count with Jelly, I am going to mark the Brainfuck answer from @Oyarsa as the accepted answer purely because I think that anyone who can actually do something like this in such a crazy language deserves +15 rep no matter how many bytes it takes. This is not because I have any problem with golfing languages. See my answer to a question regarding this on meta if you have any doubts. Many thanks and respect to all who contributed in whatever language.

答:
C#, 615 582 337 bytes

This is my first (still far too readable) attempt at one of these, so I'll gladly welcome any suggestions to shave off a few hundred bytes! Top of my list right now is a shorter way to create the moon array.

```<code>void M(){string[]m={"","      mmm","    mmmmmmm","   mmmmmmmmm","    mmmmmmm","      mmm",""};var b="^o^";for(int x=0;x<13;x++){var a=(string[])m.Clone();int n=x>6?12-x:x;int[] j={0,1,3,6};a[n]=!a[n].Contains("m")?"      "+b:x<=n?a[n]+b:new string(' ',j[Math.Abs(9-x)])+b+a[n].Replace(" ","");foreach(var c in a){Console.WriteLine(c);}}}
</code>```

Ungolfed (includes loop!)

```<code>class Program {
    public static string[] moon = new string[] { "               ", "      mmm      ", "    mmmmmmm    ", "   mmmmmmmmm   ", "    mmmmmmm    ", "      mmm      ", "               " };

    public static string bat = "^o^";

    static void Main(string[] args) {
        while (true) {
            Fly();
        }
    }

    static void Fly() {
        int times = (moon.Length * 2) - 1;
        for (int x = 0; x < times; x++) {
            string[] temp = (string[])moon.Clone(); //create a new array to maintain the original

            int index = x >= moon.Length ? times - x - 1 : x;

            if (!temp[index].Contains("m")) {
                temp[index] = new string(' ', 6) + bat + new string(' ', 6);
            } else if (x <= index) {
                int lastM = temp[index].LastIndexOf('m') + 1;
                temp[index] = temp[index].Insert(lastM, bat);
            } else {
                int firstM = temp[index].IndexOf('m');
                char[] src = temp[index].ToCharArray();
                int i = firstM - bat.Length;
                src[i] = bat[0];
                src[i + 1] = bat[1];
                src[i + 2] = bat[2];

                temp[index] = new string(src);
            }

            for (int y = 0; y < temp.Length; y++) {
                Console.WriteLine(temp[y]);
            }
            Thread.Sleep(100);
            Console.Clear();
        }
    }
}
</code>```

Edit:

Took out 21 bytes by removing trailing spaces in the array declaration. Instead of a grid 15 characters wide, each row is only wide enough for the bat to fit. Removed another 12 for the unnecessary string[]args in Main() declaration.

Edit 2:

Rewrote most of the logic, taking out 245 bytes! Includes suggested changes from the comments. Thanks!

From the comments, turned this into a function M() instead of the previous Main() method - so now, this needs to be called externally.

Body:
C#, 615 582 337 bytes

This is my first (still far too readable) attempt at one of these, so I'll gladly welcome any suggestions to shave off a few hundred bytes! Top of my list right now is a shorter way to create the moon array.

void M(){string[]m={"","      mmm","    mmmmmmm","   mmmmmmmmm","    mmmmmmm","      mmm",""};var b="^o^";for(int x=0;x<13;x++){var a=(string[])m.Clone();int n=x>6?12-x:x;int[] j={0,1,3,6};a[n]=!a[n].Contains("m")?"      "+b:x<=n?a[n]+b:new string(' ',j[Math.Abs(9-x)])+b+a[n].Replace(" ","");foreach(var c in a){Console.WriteLine(c);}}}

Ungolfed (includes loop!)

class Program {
    public static string[] moon = new string[] { "               ", "      mmm      ", "    mmmmmmm    ", "   mmmmmmmmm   ", "    mmmmmmm    ", "      mmm      ", "               " };

    public static string bat = "^o^";

    static void Main(string[] args) {
        while (true) {
            Fly();
        }
    }

    static void Fly() {
        int times = (moon.Length * 2) - 1;
        for (int x = 0; x < times; x++) {
            string[] temp = (string[])moon.Clone(); //create a new array to maintain the original

            int index = x >= moon.Length ? times - x - 1 : x;

            if (!temp[index].Contains("m")) {
                temp[index] = new string(' ', 6) + bat + new string(' ', 6);
            } else if (x <= index) {
                int lastM = temp[index].LastIndexOf('m') + 1;
                temp[index] = temp[index].Insert(lastM, bat);
            } else {
                int firstM = temp[index].IndexOf('m');
                char[] src = temp[index].ToCharArray();
                int i = firstM - bat.Length;
                src[i] = bat[0];
                src[i + 1] = bat[1];
                src[i + 2] = bat[2];

                temp[index] = new string(src);
            }

            for (int y = 0; y < temp.Length; y++) {
                Console.WriteLine(temp[y]);
            }
            Thread.Sleep(100);
            Console.Clear();
        }
    }
}

Edit:

Took out 21 bytes by removing trailing spaces in the array declaration. Instead of a grid 15 characters wide, each row is only wide enough for the bat to fit. Removed another 12 for the unnecessary string[]args in Main() declaration.

Edit 2:

Rewrote most of the logic, taking out 245 bytes! Includes suggested changes from the comments. Thanks!

From the comments, turned this into a function M() instead of the previous Main() method - so now, this needs to be called externally.


问:
Shortest infinite loop producing no output
Your task is to create the shortest infinite loop!

The point of this challenge is to create an infinite loop producing no output, unlike its possible duplicate. The reason to this is because the code might be shorter if no output is given.

Rules

Each submission must be a full program.

You must create the shortest infinite loop.

Even if your program runs out of memory eventually, it is still accepted as long as it is running the whole time from the start to when it runs out of memory. Also when it runs out of memory, it should still not print anything to STDERR.

The program must take no input (however, reading from a file is allowed), and should not print anything to STDOUT. Output to a file is also forbidden.

The program must not write anything to STDERR.

Feel free to use a language (or language version) even if it's newer than this challenge.
-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. :D

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

This is not about finding the language with the shortest infinite loop program. This is about finding the shortest infinite loop program in every language. Therefore, I will not accept an answer.

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

There should be a website such as Wikipedia, Esolangs, or GitHub for the language. For example, if the language is CJam, then one could link to the site in the header like #[CJam](http://sourceforge.net/p/cjam/wiki/Home/), X bytes.

Standard loopholes are not allowed.

(I have taken some of these rules from Martin Büttner's "Hello World" challenge)

Please feel free to post in the comments to tell me how this challenge could be  improved.

Catalogue

This is a Stack Snippet which generates both an alphabetical catalogue of the used languages, and an overall leaderboard. To make sure your answer shows up, please start it with this Markdown header:

```<code># Language name, X bytes
</code>```

Obviously replacing Language name and X bytes with the proper items. If you want to link to the languages' website, use this template, as posted above:

```<code>#[Language name](http://link.to/the/language), X bytes
</code>```

Now, finally, here's the snippet: (Try pressing "Full page" for a better view.)

var QUESTION_ID=59347;var ANSWER_FILTER="!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe";var COMMENT_FILTER="!)Q2B_A2kjfAiU78X(md6BoYk";var OVERRIDE_USER=41805;var answers=[],answers_hash,answer_ids,answer_page=1,more_answers=true,comment_page;function answersUrl(index){return"//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"//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}#answer-list{padding:10px;width:500px;float:left}#language-list{padding:10px;padding-right:40px;width:500px;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">

Shortest Solution by Language

Language	User	Score

Leaderboard

	Author	Language	Size

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

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

```

答:
Bash, <s>10</s> 2 bytes

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

Runs the file specified by $0 (i.e. itself). Requires that the script is executable.

Body:
Bash, <s>10</s> 2 bytes

$0

Runs the file specified by $0 (i.e. itself). Requires that the script is executable.


答:
05AB1E, 11 bytes

```<code>S'(ý¹g<')×J
</code>```

Try it online!

Explanation:

```<code>S'(ý         join input by "("
    ¹g<      push length of input - 1, call it n
       ')×   push a string with char ")" n times
          J  concatenate
</code>```

Title: N(e(s(t))) a string

Body:
05AB1E, 11 bytes

S'(ý¹g<')×J

Try it online!

Explanation:

S'(ý         join input by "("
    ¹g<      push length of input - 1, call it n
       ')×   push a string with char ")" n times
          J  concatenate


答:
APL, 19 bytes

```<code>{∊('(',¨⍵),')'⍴⍨⍴⍵}
</code>```

Explanation:

```<code>{
  ('(',¨⍵)          ⍝ join a ( to each character in ⍵
          ,')'⍴⍨⍴⍵  ⍝ for each character in ⍵, add an ) to the end
 ∊                  ⍝ flatten the list
                   }
</code>```

Alternative solution, also 19 bytes:

```<code>{⊃{∊'('⍺⍵')'}/⍵,⊂⍬}
</code>```

Explanation:

```<code>{
              ⍵,⊂⍬  ⍝ add an empty list behind ⍵ (as a base case)
  {         }/      ⍝ reduce with this function:
    '('⍺⍵')'        ⍝   put braces around input
   ∊                ⍝   flatten the list
 ⊃                  ⍝ take first item from resulting list
                   }
</code>```

Title: N(e(s(t))) a string

Body:
APL, 19 bytes

{∊('(',¨⍵),')'⍴⍨⍴⍵}

Explanation:

{
  ('(',¨⍵)          ⍝ join a ( to each character in ⍵
          ,')'⍴⍨⍴⍵  ⍝ for each character in ⍵, add an ) to the end
 ∊                  ⍝ flatten the list
                   }

Alternative solution, also 19 bytes:

{⊃{∊'('⍺⍵')'}/⍵,⊂⍬}

Explanation:

{
              ⍵,⊂⍬  ⍝ add an empty list behind ⍵ (as a base case)
  {         }/      ⍝ reduce with this function:
    '('⍺⍵')'        ⍝   put braces around input
   ∊                ⍝   flatten the list
 ⊃                  ⍝ take first item from resulting list
                   }