问:
Primes with a twist
Note: this is heavily inspired by this question.

Task:

Your task is to generate the nth prime, when each character of your program is repeated n times in place.

Let's say your program is:

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

Every character in there is repeated once, so it should output 2.

When every character is duplicated in place, like so:

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

This should generate the 2nd prime, which is 3.

Specs:

Your program must accept no input, and output the respective prime.

Your program must work for all primes, given enough time and memory.

Leading and trailing newlines are fine.

The output must be in the default base of the language - if there is no default, any base is fine.

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

答:
Jelly, 13 bytes

```<code>“Ŀo‘’FQỌµḟ;¹V
</code>```

Try it online! or run the first ten programs.

Background

Jelly has several different types of string literals; all of them start with a “. If the literal contains more than one “, a string array is returned, and “ separates the strings from each other.

For example, “abc“def” yields ['abc', 'def'].

Depending on the last character of the literal (any of ”«»‘’, where « is currently unimplemented), one can choose between the different types of literals. For ‘, we get the code points in Jelly's code page instead of the corresponding Unicode characters.

For example, “abc“def‘ yields [[97, 98, 99], [100, 101, 102]].

The literals in the first three programs correspond to the following code point arrays.

```<code>“Ŀo‘           -> [199, 111]
““ĿĿoo‘        -> [[], [199, 199, 111, 111]]
“““ĿĿĿooo‘     -> [[], [], [199, 199, 199, 111, 111, 111]]
</code>```

How it works (n = 3)

```<code>“““ĿĿĿooo‘‘‘’’’FFFQQQỌỌỌµµµḟḟḟ;;;¹¹¹VVV  Main link. Implicit argument: 0

“““ĿĿĿooo‘                               Yield the 2D array
                                         [[], [], [199, 199, 199, 111, 111, 111]].
          ‘‘                             Increment twice, yielding
                                         [[], [], [201, 201, 201, 113, 113, 113]].
            ’’’                          Decrement thrice, yielding
                                         [[], [], [198, 198, 198, 110, 110, 110]].
               F                         Flatten, yielding
                                         [198, 198, 198, 110, 110, 110].
                FF                       Twice more. Does nothing.
                  Q                      Unique; yield [198, 110].
                   QQ                    Twice more. Does nothing.
                     Ọ                   Unordinal; convert the Unicode code points
                                         198 and 110 to 'Æ' and 'n'.
                      ỌỌ                 Twice more. Does nothing.
                        µµµ              Begin three monadic chains, all with
                                         argument s := "Æn".
                           ḟ             Filter-false; remove the characters of s
                                         from s, yielding "".
                            ḟḟ           Twice more. Does nothing.
                              ;;;¹       Concatenate with s three times, yielding
                                         "ÆnÆnÆn".
                                  ¹¹     Identity function. Does nothing.
                                    V    Eval the resulting Jelly code, i.e.,
                                         call the next-prime atom thrice, with
                                         initial implicit argument 0.
                                     VV  Eval two more times. This is a no-op
                                         on integers.
</code>```

Title: Primes with a twist

Body:
Jelly, 13 bytes

“Ŀo‘’FQỌµḟ;¹V

Try it online! or run the first ten programs.

Background

Jelly has several different types of string literals; all of them start with a “. If the literal contains more than one “, a string array is returned, and “ separates the strings from each other.

For example, “abc“def” yields ['abc', 'def'].

Depending on the last character of the literal (any of ”«»‘’, where « is currently unimplemented), one can choose between the different types of literals. For ‘, we get the code points in Jelly's code page instead of the corresponding Unicode characters.

For example, “abc“def‘ yields [[97, 98, 99], [100, 101, 102]].

The literals in the first three programs correspond to the following code point arrays.

“Ŀo‘           -> [199, 111]
““ĿĿoo‘        -> [[], [199, 199, 111, 111]]
“““ĿĿĿooo‘     -> [[], [], [199, 199, 199, 111, 111, 111]]

How it works (n = 3)

“““ĿĿĿooo‘‘‘’’’FFFQQQỌỌỌµµµḟḟḟ;;;¹¹¹VVV  Main link. Implicit argument: 0

“““ĿĿĿooo‘                               Yield the 2D array
                                         [[], [], [199, 199, 199, 111, 111, 111]].
          ‘‘                             Increment twice, yielding
                                         [[], [], [201, 201, 201, 113, 113, 113]].
            ’’’                          Decrement thrice, yielding
                                         [[], [], [198, 198, 198, 110, 110, 110]].
               F                         Flatten, yielding
                                         [198, 198, 198, 110, 110, 110].
                FF                       Twice more. Does nothing.
                  Q                      Unique; yield [198, 110].
                   QQ                    Twice more. Does nothing.
                     Ọ                   Unordinal; convert the Unicode code points
                                         198 and 110 to 'Æ' and 'n'.
                      ỌỌ                 Twice more. Does nothing.
                        µµµ              Begin three monadic chains, all with
                                         argument s := "Æn".
                           ḟ             Filter-false; remove the characters of s
                                         from s, yielding "".
                            ḟḟ           Twice more. Does nothing.
                              ;;;¹       Concatenate with s three times, yielding
                                         "ÆnÆnÆn".
                                  ¹¹     Identity function. Does nothing.
                                    V    Eval the resulting Jelly code, i.e.,
                                         call the next-prime atom thrice, with
                                         initial implicit argument 0.
                                     VV  Eval two more times. This is a no-op
                                         on integers.


问:
Binary Countdown Length
inspired by Count down from infinity

Given a non-negative integer N, output the number of repetitions of the following steps it takes to reach 0:

Convert N to binary (4812390 -> 10010010110111001100110)

Flip each bit (10010010110111001100110 -> 01101101001000110011001)

Trim leading zeroes (01101101001000110011001 -> 1101101001000110011001)

Convert back to decimal (1101101001000110011001 -> 3576217)

Rules

Input and output may be in any unambiguous, consistent format

The input will be within the native representable integer range for your language (if your language supports arbitrarily-large integers, there is no bound)

Test Cases

```<code>0 -> 0
1 -> 1
42 -> 6
97 -> 3
170 -> 8
255 -> 1
682 -> 10
8675309 -> 11
4812390 -> 14
178956970 -> 28
2863311530 -> 32
</code>```

This sequence is A005811 in the OEIS.

答:
Haskell, 34 bytes

```<code>b 0=0
b n|x<-b$div n 2=x+mod(x+n)2
</code>```

ContentLicense: CC BY-SA 3.0

Title: Binary Countdown Length

Body:
Haskell, 34 bytes

b 0=0
b n|x<-b$div n 2=x+mod(x+n)2


答:
Java 7,112 108 100 90 73 bytes

int c(int i){int l=1,j=i;for(;(j=j/2)>0;l*=2);return i<1?0:1+c(2*l-1-i);}
```
<h3>
Basic idea</h3>
``` Lets take an no 10110(21)
 then you do set all bits in no 21 and you will get 11111
 and after that you would subtract the original number from 11111.
 You will get 01001 and loop it until you will get 0
```

Title: Binary Countdown Length

Body:
inspired by Count down from infinity

Given a non-negative integer N, output the number of repetitions of the following steps it takes to reach 0:

Convert N to binary (4812390 -> 10010010110111001100110)

Flip each bit (10010010110111001100110 -> 01101101001000110011001)

Trim leading zeroes (01101101001000110011001 -> 1101101001000110011001)

Convert back to decimal (1101101001000110011001 -> 3576217)

Rules

Input and output may be in any unambiguous, consistent format

The input will be within the native representable integer range for your language (if your language supports arbitrarily-large integers, there is no bound)

Test Cases

```<code>0 -> 0
1 -> 1
42 -> 6
97 -> 3
170 -> 8
255 -> 1
682 -> 10
8675309 -> 11
4812390 -> 14
178956970 -> 28
2863311530 -> 32
</code>```

This sequence is A005811 in the OEIS.

Body:
Java 7,112 108 100 90 73 bytes

int c(int i){int l=1,j=i;for(;(j=j/2)>0;l*=2);return i<1?0:1+c(2*l-1-i);}

Basic idea

 Lets take an no 10110(21)
 then you do set all bits in no 21 and you will get 11111
 and after that you would subtract the original number from 11111.
 You will get 01001 and loop it until you will get 0


答:
GS2 (commit 67fea47), <s>6</s> 3 bytes

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

How it works

Like most commands, GS2‘s d is overloaded. Initially, there's an empty list (the input or the lack thereof) on the stack, so d computes its sum. After the first iteration, there's a 0 on the stack, and d computes its parity (also 0). Thus, no matter how many times we repeat d, the result will always be a single 0.

The next part is straightforward. The command n pops the top of the stack and pushes the next prime number. Thus, repeating n k times computes the k prime.

Finally, the command simply applies str to the top of the stack, which converts a number to its string representation and does no affect strings. Thus, no matter how many times we repeat R, the result will be the string representation of the k prime.

Title: Primes with a twist

Body:
Note: this is heavily inspired by this question.

Task:

Your task is to generate the nth prime, when each character of your program is repeated n times in place.

Let's say your program is:

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

Every character in there is repeated once, so it should output 2.

When every character is duplicated in place, like so:

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

This should generate the 2nd prime, which is 3.

Specs:

Your program must accept no input, and output the respective prime.

Your program must work for all primes, given enough time and memory.

Leading and trailing newlines are fine.

The output must be in the default base of the language - if there is no default, any base is fine.

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

Body:
GS2 (commit 67fea47), <s>6</s> 3 bytes

dnR

How it works

Like most commands, GS2‘s d is overloaded. Initially, there's an empty list (the input or the lack thereof) on the stack, so d computes its sum. After the first iteration, there's a 0 on the stack, and d computes its parity (also 0). Thus, no matter how many times we repeat d, the result will always be a single 0.

The next part is straightforward. The command n pops the top of the stack and pushes the next prime number. Thus, repeating n k times computes the k prime.

Finally, the command simply applies str to the top of the stack, which converts a number to its string representation and does no affect strings. Thus, no matter how many times we repeat R, the result will be the string representation of the k prime.


问:
Shuffle Up and Deal!
It is Friday and I am tired, so let's do a quick one! Take no input, however you should output all thirteen different numbered cards in a standard deck of cards. You should output 2 through Ace (Suit agnostic).

Each card has a top that is denoted with a space   and ten _ and another space .

The second row from the top is denoted with a / and ten spaces   and a \

The third row is the same as all the middle-ish rows excepts the character(s) denoting the card value appear two spaces to right (if at the top) or two space to the left (if at the bottom) of the edge.

Each middle-ish row is a simple | and ten spaces   and one more |

Finally the last line is a \ and ten _ and finally a /

If the value is multi-digit the overall width by height of the card should not change. (i.e. the 10 will not make the card's sides wider)

King Example:

```<code> __________
/          \
| K        |
|          |
|          |
|          |
|          |
|          |
|        K |
\__________/
</code>```

9 Example

```<code> __________
/          \
| 9        |
|          |
|          |
|          |
|          |
|          |
|        9 |
\__________/
</code>```

10 Example

```<code> __________
/          \
| 10       |
|          |
|          |
|          |
|          |
|          |
|       10 |
\__________/
</code>```

Output them in order from least to greatest (Aces are high!).

This is code-golf so the shortest code wins.

Have fun and have a fun weekend!

答:
Actually, 91 bytes

```<code>"JQKA"#9⌐2x+`;k' ;'_9u*@++'\' 9u*'/++"| {:<9}|"5'|;' 9u*@++n"|{:>9} |"'/'_9u*'\++kp@'
jf`Mi
</code>```

Try it online!

Explanation

Part 1: setting up the list of face values:

```<code>"JQKA"#9⌐2x+`PART 2 CODE`Mi
       9⌐2x                  range(2,11) ([2, 10])
"JQKA"#    +                 extend with ["J", "Q", "K", "A"]
            `PART 2 CODE`M   do Part 2 for each item in list
                          i  flatten resulting list and implicitly print
</code>```

Part 2: creating the cards (newline replaced with \n for readability):

```<code>;k' ;'_9u*@++'\' 9u*'/++"| {:<9}|"5'|;' 9u*@++n"|{:>9} |"'/'_9u*'\++kp@'\njf
;k                                                                            duplicate the face value, push both copies to a list
  ' ;'_9u*@++                                                                 construct the top line
             '\' 9u*'/++                                                      construct the second line
                        "| {:<9}|"                                            create a format string to place the value in a left-aligned 9-width field in the top left of the card, one space away from the edge
                                  5'|;' 9u*@++n                               create 5 copies of the blank middle section
                                               "|{:>9} |"                     like before, but right-align the face value
                                                         '/'_9u*'/++          construct the bottom of the card
                                                                    kp@'\nj   push entire stack to a list, pop the list containing the face values out of that list, and join the rest (the card strings) with newlines
                                                                           f  format the card with the face values
</code>```

Title: Shuffle Up and Deal!

Body:
Actually, 91 bytes

"JQKA"#9⌐2x+`;k' ;'_9u*@++'\' 9u*'/++"| {:<9}|"5'|;' 9u*@++n"|{:>9} |"'/'_9u*'\++kp@'
jf`Mi

Try it online!

Explanation

Part 1: setting up the list of face values:

"JQKA"#9⌐2x+`PART 2 CODE`Mi
       9⌐2x                  range(2,11) ([2, 10])
"JQKA"#    +                 extend with ["J", "Q", "K", "A"]
            `PART 2 CODE`M   do Part 2 for each item in list
                          i  flatten resulting list and implicitly print

Part 2: creating the cards (newline replaced with \n for readability):

;k' ;'_9u*@++'\' 9u*'/++"| {:<9}|"5'|;' 9u*@++n"|{:>9} |"'/'_9u*'\++kp@'\njf
;k                                                                            duplicate the face value, push both copies to a list
  ' ;'_9u*@++                                                                 construct the top line
             '\' 9u*'/++                                                      construct the second line
                        "| {:<9}|"                                            create a format string to place the value in a left-aligned 9-width field in the top left of the card, one space away from the edge
                                  5'|;' 9u*@++n                               create 5 copies of the blank middle section
                                               "|{:>9} |"                     like before, but right-align the face value
                                                         '/'_9u*'/++          construct the bottom of the card
                                                                    kp@'\nj   push entire stack to a list, pop the list containing the face values out of that list, and join the rest (the card strings) with newlines
                                                                           f  format the card with the face values


答:
Racket 349 bytes

```<code>(define(h s)(apply string(map(λ(x)(if(eq? x #\0)#\1 #\0))(string->list s))))(define(g s)(let*
((l(string-length s))(k(for/list((i s)(n l)#:final(not(equal? i #\0)))n)))(substring s(last k))))
(define(f n)(if(= 0 n)0(begin(let loop((n n)(c 1))(define m(string->number(string-append "#b"
(g(h(number->string n 2))))))(if(> m 0)(loop m(add1 c))c))))
</code>```

Ungolfed:

```<code>(define (invertBinary s)
  (apply string
         (map
          (λ(x)(if(eq? x #\0)#\1 #\0))
          (string->list s))))

(define (trimLeading0s s)
  (let* ((l (string-length s))
         (k (for/list ((i s)
                       (n l)
                       #:final (not(equal? i #\0)))
              n)))
    (substring s (last k))))

(define (f n)
  (if (= 0 n) 0
      (begin
        (let loop ((n n)
                   (c 1))
          (define m
            (string->number
             (string-append
              "#b"
              (trimLeading0s
               (invertBinary
                (number->string n 2))))))

          (if (> m 0)
              (loop m (add1 c))
              c)))))
</code>```

Testing:

```<code>(f 0)
(f 1)
(f 42)
(f 97)
(f 170)
(f 255)
(f 682)
(f 8675309)
(f 4812390)
(f 178956970)
(f 2863311530)
</code>```

Output:

```<code>0
1
6
3
8
1
10
11
14
28
32
</code>```

Title: Binary Countdown Length

Body:
Racket 349 bytes

(define(h s)(apply string(map(λ(x)(if(eq? x #\0)#\1 #\0))(string->list s))))(define(g s)(let*
((l(string-length s))(k(for/list((i s)(n l)#:final(not(equal? i #\0)))n)))(substring s(last k))))
(define(f n)(if(= 0 n)0(begin(let loop((n n)(c 1))(define m(string->number(string-append "#b"
(g(h(number->string n 2))))))(if(> m 0)(loop m(add1 c))c))))

Ungolfed:

(define (invertBinary s)
  (apply string
         (map
          (λ(x)(if(eq? x #\0)#\1 #\0))
          (string->list s))))

(define (trimLeading0s s)
  (let* ((l (string-length s))
         (k (for/list ((i s)
                       (n l)
                       #:final (not(equal? i #\0)))
              n)))
    (substring s (last k))))

(define (f n)
  (if (= 0 n) 0
      (begin
        (let loop ((n n)
                   (c 1))
          (define m
            (string->number
             (string-append
              "#b"
              (trimLeading0s
               (invertBinary
                (number->string n 2))))))

          (if (> m 0)
              (loop m (add1 c))
              c)))))

Testing:

(f 0)
(f 1)
(f 42)
(f 97)
(f 170)
(f 255)
(f 682)
(f 8675309)
(f 4812390)
(f 178956970)
(f 2863311530)

Output:

0
1
6
3
8
1
10
11
14
28
32


答:
PHP, 64 bytes

based on my countdown solution

```<code>for($n=$argv[1];$n;print 1)$n=bindec(strtr(decbin($n),"01",10));
</code>```

prints 1 character k times, where k is the number of iterations.

+4 bytes for integer output: (empty output for 0)

```<code>for($n=$argv[1];$n;$i++)$n=bindec(strtr(decbin($n),"01",10));echo$i;
</code>```

Title: Binary Countdown Length

Body:
PHP, 64 bytes

based on my countdown solution

for($n=$argv[1];$n;print 1)$n=bindec(strtr(decbin($n),"01",10));

prints 1 character k times, where k is the number of iterations.

+4 bytes for integer output: (empty output for 0)

for($n=$argv[1];$n;$i++)$n=bindec(strtr(decbin($n),"01",10));echo$i;


问:
Next Friday the 13th
What is the shortest program that can predict the next time Friday will fall on the 13th day of the month?

Must be an complete functioning program (not just a function/subroutine)

Must print out date in the following format: YYYY-MM-DD

Allow user to provide a start date either as a command line argument or through STDIN

If user provides no start date, use today as the start date.

If the start date is a Friday the 13th, the program should find the next Friday the 13th.

If I were to run the program today (Feb 16 2011) I should get the following output.

```<code>$ ./fr13th 2013-05-09
2013-09-13
$ ./fr13th 2007-06-29
2007-07-13
$ ./fr13th 2007-07-13
2008-06-13
$ ./fr13th
2011-05-13
</code>```

答:
C#

240 characters. C# needs a "run inside of a function only" mode!

```<code>using System;class P{static void Main(string[] a){var n=DateTime.Now;if(a.Length>0)DateTime.TryParse(args[0],out n);while(true){n=n.AddDays(1);if((n.Day==13)&&(n.DayOfWeek==(DayOfWeek)5))break;}Console.WriteLine(n.ToString("yyyy-MM-dd"));}}
</code>```

Un-golfed:

```<code>using System;

class P
{
    static void Main(string[] a)
    {
        var n = DateTime.Now;
        if (a.Length > 0) DateTime.TryParse(args[0], out n);
        while (true)
        {
            n = n.AddDays(1);
            if ((n.Day == 13) && (n.DayOfWeek == (DayOfWeek)5)) break;
        }
        Console.WriteLine(n.ToString("yyyy-MM-dd"));
    }
}
</code>```

Test output

```<code>\Debug> f13.exe 2013-05-09
2013-09-13

\Debug> f13.exe 2007-06-29
2007-07-13

\Debug> f13.exe 2007-07-13
2008-06-13

\Debug> f13.exe
2011-05-13
</code>```

ContentLicense: CC BY-SA 2.5

Title: Next Friday the 13th

Body:
C#

240 characters. C# needs a "run inside of a function only" mode!

using System;class P{static void Main(string[] a){var n=DateTime.Now;if(a.Length>0)DateTime.TryParse(args[0],out n);while(true){n=n.AddDays(1);if((n.Day==13)&&(n.DayOfWeek==(DayOfWeek)5))break;}Console.WriteLine(n.ToString("yyyy-MM-dd"));}}

Un-golfed:

using System;

class P
{
    static void Main(string[] a)
    {
        var n = DateTime.Now;
        if (a.Length > 0) DateTime.TryParse(args[0], out n);
        while (true)
        {
            n = n.AddDays(1);
            if ((n.Day == 13) && (n.DayOfWeek == (DayOfWeek)5)) break;
        }
        Console.WriteLine(n.ToString("yyyy-MM-dd"));
    }
}

Test output

\Debug> f13.exe 2013-05-09
2013-09-13

\Debug> f13.exe 2007-06-29
2007-07-13

\Debug> f13.exe 2007-07-13
2008-06-13

\Debug> f13.exe
2011-05-13


答:
05AB1E, <s>7</s> 5 bytes

Saved 2 bytes thanks to Dennis.

```<code>b0ÛÔg
</code>```

Without the edge case of 0 this could be 3 bytes bÔg.

Try it online! or as a Test suite

Explanation

```<code>b      # convert to binary
 0Û    # trim off leading zeroes
   Ô   # remove adjacent duplicates
    g  # length
</code>```

Title: Binary Countdown Length

Body:
05AB1E, <s>7</s> 5 bytes

Saved 2 bytes thanks to Dennis.

b0ÛÔg

Without the edge case of 0 this could be 3 bytes bÔg.

Try it online! or as a Test suite

Explanation

b      # convert to binary
 0Û    # trim off leading zeroes
   Ô   # remove adjacent duplicates
    g  # length


问:
Depalindromize this string!
Given a palindrome generated according to this challenge, depalindromize it.

Test cases

```<code>abcdedcba -> abcde
johncenanecnhoj -> johncena
ppapapp -> ppap
codegolflogedoc -> codegolf
</code>```

As this is about depalindromizing, your code cannot be a palindrome.

Remember, this is code-golf, so the code with the fewest bytes wins.

答:
Brachylog, 4 bytes

```<code>@2tr
</code>```

Try it online!

Explanation

```<code>@2        Split in half
  t       Take the second half
   r      Reverse it
</code>```

If the input has odd length, the second half generated by @2 is the one that is the longest, that is the one we should return (after reversing it).

Title: Depalindromize this string!

Body:
Brachylog, 4 bytes

@2tr

Try it online!

Explanation

@2        Split in half
  t       Take the second half
   r      Reverse it

If the input has odd length, the second half generated by @2 is the one that is the longest, that is the one we should return (after reversing it).


问:
Palindromize this string!
Your task is to palindromize a string as follows:

Take the string.

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

Reverse it.

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

Remove the first letter.

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

Glue it onto the original string.

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

But here's the catch: since this challenge is about palindromes, your code itself also has to be a palindrome.

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

答:
Mathematica, 67 bytes

```<code>f=#~Join~Rest@Reverse@#//Function;noitcnuF//#@esreveR@tseR~nioJ~#=f
</code>```

Defines a named function f that takes a list of characters as input and returns the appropriate palindromized list as output. The bit after the semicolon (is fortunately syntactically valid and) gives a second, way more complicated name to this same function.

It was fun trying to make Mathematica make sense without any brackets!

Title: Palindromize this string!

Body:
Mathematica, 67 bytes

f=#~Join~Rest@Reverse@#//Function;noitcnuF//#@esreveR@tseR~nioJ~#=f

Defines a named function f that takes a list of characters as input and returns the appropriate palindromized list as output. The bit after the semicolon (is fortunately syntactically valid and) gives a second, way more complicated name to this same function.

It was fun trying to make Mathematica make sense without any brackets!


答:
Brachylog, 11 bytes

```<code>:Lc.r
r.cL:
</code>```

Try it online!

Explanation

```<code>:Lc.         Input concatenated with a string L results in the Output
   .r(.)     The Output reversed is still the Output
</code>```

The second line is a new predicate declaration that never gets called in that code.

Title: Palindromize this string!

Body:
Your task is to palindromize a string as follows:

Take the string.

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

Reverse it.

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

Remove the first letter.

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

Glue it onto the original string.

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

But here's the catch: since this challenge is about palindromes, your code itself also has to be a palindrome.

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

Body:
Brachylog, 11 bytes

:Lc.r
r.cL:

Try it online!

Explanation

:Lc.         Input concatenated with a string L results in the Output
   .r(.)     The Output reversed is still the Output

The second line is a new predicate declaration that never gets called in that code.


答:
JavaScript (ES6), 44

Recursive function

Limited to javascript positive integer, 31 bits:

```<code>f=(a,s=0)=>a?f((-1>>>Math.clz32(a))-a,s+1):s
</code>```

Managing double precision number up to 53 significant bits - 59 bytes:

```<code>F=(a,s=0)=>a?F('0b'+a.toString(2).replace(/./g,1)-a,s+1):s
</code>```

In another way: using the amazing algorithm by @Dennis, non recursive function managing up 53 bits, 43 bytes:

```<code>a=>a&&a.toString(2).match(/(.)\1*/g).length
</code>```

Title: Binary Countdown Length

Body:
JavaScript (ES6), 44

Recursive function

Limited to javascript positive integer, 31 bits:

f=(a,s=0)=>a?f((-1>>>Math.clz32(a))-a,s+1):s

Managing double precision number up to 53 significant bits - 59 bytes:

F=(a,s=0)=>a?F('0b'+a.toString(2).replace(/./g,1)-a,s+1):s

In another way: using the amazing algorithm by @Dennis, non recursive function managing up 53 bits, 43 bytes:

a=>a&&a.toString(2).match(/(.)\1*/g).length


答:
C#, (<s>51</s> 50 + 1)*2 = <s>104</s> 102 bytes

saved 2 bytes to the use of .Aggregate()

s=>s+s.Aggregate("",(a,b)=>b+a,s=>s.Substring(1));//;))1(gnirtsbuS.s>=s,a+b>=)b,a(,""(etagerggA.s+s>=s
```

<p>You can capture this lambda with</p>

<pre class="lang-cs prettyprint-override"><code>Func<string,string> f = <lambda here>
</code>```

and call it like this

f("abcde")
```

Title: Palindromize this string!

Body:
C#, (<s>51</s> 50 + 1)*2 = <s>104</s> 102 bytes

saved 2 bytes to the use of .Aggregate()

s=>s+s.Aggregate("",(a,b)=>b+a,s=>s.Substring(1));//;))1(gnirtsbuS.s>=s,a+b>=)b,a(,""(etagerggA.s+s>=s

You can capture this lambda with

Func<string,string> f = <lambda here>

and call it like this

f("abcde")


答:
C, <s>31</s> 30 bytes

Saving 1 byte thanks to Cyoce.

f(char*c){c[-~strlen(c)/2]=0;}
```
<p>Usage:</p>
<pre class="lang-c prettyprint-override"><code>main(){
 char a[]="hellolleh";
 f(a);
 printf("%s\n",a);
}
</code>```

Title: Depalindromize this string!

Body:
Given a palindrome generated according to this challenge, depalindromize it.

Test cases

```<code>abcdedcba -> abcde
johncenanecnhoj -> johncena
ppapapp -> ppap
codegolflogedoc -> codegolf
</code>```

As this is about depalindromizing, your code cannot be a palindrome.

Remember, this is code-golf, so the code with the fewest bytes wins.

Body:
C, <s>31</s> 30 bytes

Saving 1 byte thanks to Cyoce.

f(char*c){c[-~strlen(c)/2]=0;}

Usage:

main(){
 char a[]="hellolleh";
 f(a);
 printf("%s\n",a);
}


答:
Python 3,  <s>28</s> <s>26</s> 24 bytes

Python 3 strings don't like non-int indexes...

```<code>lambda S:S[:len(S)//2+1]
</code>```

Alternatively, with the same byte count,

```<code>lambda S:S[:-~len(S)//2]
</code>```

Title: Depalindromize this string!

Body:
Python 3,  <s>28</s> <s>26</s> 24 bytes

Python 3 strings don't like non-int indexes...

lambda S:S[:len(S)//2+1]

Alternatively, with the same byte count,

lambda S:S[:-~len(S)//2]


答:
Actually, 5 bytes

```<code>l½KßH
</code>```

Try it online!

-1 byte thanks to Sherlock9

Explanation:

```<code>l½K@H
l½K    ceil(len(input)/2)
   ßH  first (len(input)//2 + 1) characters of input
</code>```

Title: Depalindromize this string!

Body:
Actually, 5 bytes

l½KßH

Try it online!

-1 byte thanks to Sherlock9

Explanation:

l½K@H
l½K    ceil(len(input)/2)
   ßH  first (len(input)//2 + 1) characters of input


答:
Actually, <s>14</s> 13 bytes

```<code>RiXßRkΣkRßXiR
</code>```

Try it online!

Explanation

```<code>R          # reverse input
 i         # flatten
  X        # discard top of stack
   ßR      # push reversed input
     kΣ    # concatenate each
k          # wrap in list
 R         # reverse
  ß        # push input
   X       # discard it
    i      # flatten list to string
     R     # reverse string
</code>```

Title: Palindromize this string!

Body:
Actually, <s>14</s> 13 bytes

RiXßRkΣkRßXiR

Try it online!

Explanation

R          # reverse input
 i         # flatten
  X        # discard top of stack
   ßR      # push reversed input
     kΣ    # concatenate each
k          # wrap in list
 R         # reverse
  ß        # push input
   X       # discard it
    i      # flatten list to string
     R     # reverse string


答:
Java 7, 146 bytes

(Enter is added for readibility and not part of the code.)

```<code>String c(String s){return s+new StringBuffer(s).reverse().substring(1);}/
/};)1(gnirtsbus.)(esrever.)s(reffuBgnirtS wen+s nruter{)s gnirtS(c gnirtS
</code>```

Title: Palindromize this string!

Body:
Java 7, 146 bytes

(Enter is added for readibility and not part of the code.)

String c(String s){return s+new StringBuffer(s).reverse().substring(1);}/
/};)1(gnirtsbus.)(esrever.)s(reffuBgnirtS wen+s nruter{)s gnirtS(c gnirtS


答:
C# <s>51</s> 50 bytes

s=>string.Join("",s.Where((_,i)=>i<=s.Count()/2));
```

<p>It's a lambda, woo!<br>
You can catch it with:</p>

<pre class="lang-cs prettyprint-override"><code>Func<string,string> f=<your lambda here>
</code>```

it requires the string to be a palindrome.

Title: Depalindromize this string!

Body:
C# <s>51</s> 50 bytes

s=>string.Join("",s.Where((_,i)=>i<=s.Count()/2));

It's a lambda, woo!

You can catch it with:

Func<string,string> f=<your lambda here>

it requires the string to be a palindrome.


答:
Java 7, 152 bytes

String c(char[]s,int i){return s.length==i+1?s[i]+"":s[i]+c(s,++i)+s[i-1];}//};]1-i[s+)i++,s(c+]i[s:""+]i[s?1+i==htgnel.s nruter{)i tni,s][rahc(c gnirtS
```

Title: Palindromize this string!


答:
C, 162 bytes

f(char*c,char*d){char*e=c;while(*d++=*c++);c-=2;d-=2;do{*d++=*c--;}while(e<=c);}//};)c=<e(elihw};--c*=++d*{od;2=-d;2=-c;)++c*=++d*(elihw;c=e*rahc{)d*rahc,c*rahc(f
```
<p>Ungolfed, unpalindromized:</p>
<pre class="lang-c prettyprint-override"><code>f(char* c,char* d){
 char*e=c;
 while(*d++=*c++);
 c-=2;d-=2;
 do{*d++=*c--;}while(e<=c);
}
</code>```

c is is input string, assumes output string d has sufficient length.

Usage:

int main() {
 char a[] = "abcde";
 char* b=malloc(strlen(a)*2);
 f(a,b);
 printf("%s\n",b);
}
```

Title: Palindromize this string!

Body:
C, 162 bytes

f(char*c,char*d){char*e=c;while(*d++=*c++);c-=2;d-=2;do{*d++=*c--;}while(e<=c);}//};)c=<e(elihw};--c*=++d*{od;2=-d;2=-c;)++c*=++d*(elihw;c=e*rahc{)d*rahc,c*rahc(f

Ungolfed, unpalindromized:

f(char* c,char* d){
 char*e=c;
 while(*d++=*c++);
 c-=2;d-=2;
 do{*d++=*c--;}while(e<=c);
}

c is is input string, assumes output string d has sufficient length.

Usage:

int main() {
 char a[] = "abcde";
 char* b=malloc(strlen(a)*2);
 f(a,b);
 printf("%s\n",b);
}


答:
Java 7, 57 bytes

String c(String s){return s.substring(0,s.length()/2+1);}
```

Title: Depalindromize this string!


答:
Java 7, 57 bytes

```<code>String c(String s){return s.substring(0,-~s.length()/2);}
</code>```

At first I misinterpreted the question and also made code that supported even palindromes (which isn't necessary due to this being the reverse of that other challenge, and therefore there aren't any even palindrome test-cases). So I deleted my answer.

After seeing @KarlNapf's great answer however, I undeleted and edited this. It's the same byte count as the other Java 7 answer, but works for both odd and even length palindromes (although only odd were asked for this challenge).

Ungolfed & test code:

Try it here.

```<code>class M{
  static String c(String s){
    return s.substring(0, -~s.length()/2);
  }

  public static void main(String[] a){
    System.out.println(c("abcdedcba"));
    System.out.println(c("abcddcba"));
  }
}
</code>```

Output:

```<code>abcde
abcd
</code>```

Title: Depalindromize this string!

Body:
Java 7, 57 bytes

String c(String s){return s.substring(0,-~s.length()/2);}

At first I misinterpreted the question and also made code that supported even palindromes (which isn't necessary due to this being the reverse of that other challenge, and therefore there aren't any even palindrome test-cases). So I deleted my answer.

After seeing @KarlNapf's great answer however, I undeleted and edited this. It's the same byte count as the other Java 7 answer, but works for both odd and even length palindromes (although only odd were asked for this challenge).

Ungolfed & test code:

Try it here.

class M{
  static String c(String s){
    return s.substring(0, -~s.length()/2);
  }

  public static void main(String[] a){
    System.out.println(c("abcdedcba"));
    System.out.println(c("abcddcba"));
  }
}

Output:

abcde
abcd


答:
J, 14 bytes

```<code>**1+/@,2~:/\#:
</code>```

Counts the number of runs in the binary digits of n with the special case returning 0 for n = 0.

Usage

```<code>   f =: **1+/@,2~:/\#:
   (,.f"0) 0 1 42 97 170 255 682 8675309 4812390 178956970 2863311530
         0  0
         1  1
        42  6
        97  3
       170  8
       255  1
       682 10
   8675309 11
   4812390 14
 178956970 28
2863311530 32
</code>```

Explanation

```<code>**1+/@,2~:/\#:  Input: integer n
            #:  Get the binary digits of n
       2   \    For each overlapping sublist of size 2
        ~:/       Reduce by not-equals
  1   ,         Prepend a 1
   +/@          Reduce by addition
*               Sign(n), returns 0 for n = 0 else 1
 *              Multiply with the previous sum and return
</code>```

Title: Binary Countdown Length

Body:
inspired by Count down from infinity

Given a non-negative integer N, output the number of repetitions of the following steps it takes to reach 0:

Convert N to binary (4812390 -> 10010010110111001100110)

Flip each bit (10010010110111001100110 -> 01101101001000110011001)

Trim leading zeroes (01101101001000110011001 -> 1101101001000110011001)

Convert back to decimal (1101101001000110011001 -> 3576217)

Rules

Input and output may be in any unambiguous, consistent format

The input will be within the native representable integer range for your language (if your language supports arbitrarily-large integers, there is no bound)

Test Cases

```<code>0 -> 0
1 -> 1
42 -> 6
97 -> 3
170 -> 8
255 -> 1
682 -> 10
8675309 -> 11
4812390 -> 14
178956970 -> 28
2863311530 -> 32
</code>```

This sequence is A005811 in the OEIS.

Body:
J, 14 bytes

**1+/@,2~:/\#:

Counts the number of runs in the binary digits of n with the special case returning 0 for n = 0.

Usage

   f =: **1+/@,2~:/\#:
   (,.f"0) 0 1 42 97 170 255 682 8675309 4812390 178956970 2863311530
         0  0
         1  1
        42  6
        97  3
       170  8
       255  1
       682 10
   8675309 11
   4812390 14
 178956970 28
2863311530 32

Explanation

**1+/@,2~:/\#:  Input: integer n
            #:  Get the binary digits of n
       2   \    For each overlapping sublist of size 2
        ~:/       Reduce by not-equals
  1   ,         Prepend a 1
   +/@          Reduce by addition
*               Sign(n), returns 0 for n = 0 else 1
 *              Multiply with the previous sum and return


答:
Python 3, 26 bytes

```<code>lambda c:c[:(len(c)+1)//2]
</code>```

This squeezes 2 chars out of the other Python3 answer by replacing the int() with division with //.

Title: Depalindromize this string!

Body:
Python 3, 26 bytes

lambda c:c[:(len(c)+1)//2]

This squeezes 2 chars out of the other Python3 answer by replacing the int() with division with //.


答:
PHP, 51 bytes

```<code><?=preg_match_all('/(1+|0+)/',decbin($argv[1])?:o);
</code>```

Uses a regex to count the number of runs of 1 or 0. Unfortunately this needs a special case for input of 0 that requires 3 additional bytes (and gives a notice).

Title: Binary Countdown Length

Body:
PHP, 51 bytes

<?=preg_match_all('/(1+|0+)/',decbin($argv[1])?:o);

Uses a regex to count the number of runs of 1 or 0. Unfortunately this needs a special case for input of 0 that requires 3 additional bytes (and gives a notice).


答:
Haskell, <s>46</s> 44 bytes

p s=init s++reverse s--s esrever++s tini=s p
```

Try it on Ideone. Saved 2 bytes thanks to Damien.

Straight forward solution. init takes everything but the last character of a string (or last element of a list). -- enables a single line comment.

Title: Palindromize this string!

Body:
Your task is to palindromize a string as follows:

Take the string.

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

Reverse it.

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

Remove the first letter.

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

Glue it onto the original string.

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

But here's the catch: since this challenge is about palindromes, your code itself also has to be a palindrome.

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

Body:
Haskell, <s>46</s> 44 bytes

p s=init s++reverse s--s esrever++s tini=s p

Try it on Ideone. Saved 2 bytes thanks to Damien.

Straight forward solution. init takes everything but the last character of a string (or last element of a list). -- enables a single line comment.


答:
JavaScript (ES6), 26 bytes

```<code>f=n=>n&&(n^(n>>=1))%2+f(n)
</code>```

Works by counting the transitions between 0 and 1. Only works up to 31 bits. 29 bytes to support 53 bits:

```<code>f=n=>1<=n&&(n%2^n/2%2)+f(n/2)
</code>```

Title: Binary Countdown Length

Body:
JavaScript (ES6), 26 bytes

f=n=>n&&(n^(n>>=1))%2+f(n)

Works by counting the transitions between 0 and 1. Only works up to 31 bits. 29 bytes to support 53 bits:

f=n=>1<=n&&(n%2^n/2%2)+f(n/2)


答:
Pyke, 1 bytes

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

Try it here!

Yes, this is the same builtin as the digital root one. This time it takes a sting and turns it into a palindrome. Added with this commit (actually on the same day as the digital root question)

Title: Palindromize this string!

Body:
Pyke, 1 bytes

s

Try it here!

Yes, this is the same builtin as the digital root one. This time it takes a sting and turns it into a palindrome. Added with this commit (actually on the same day as the digital root question)


答:
Dyalog APL, 9 bytes

⊢↑⍨2÷⍨1+≢
```

⊢ the argument

↑⍨ truncated at

2÷⍨ half of

1+ one plus

≢  the length

TryAPL online!

Title: Depalindromize this string!

Body:
Given a palindrome generated according to this challenge, depalindromize it.

Test cases

```<code>abcdedcba -> abcde
johncenanecnhoj -> johncena
ppapapp -> ppap
codegolflogedoc -> codegolf
</code>```

As this is about depalindromizing, your code cannot be a palindrome.

Remember, this is code-golf, so the code with the fewest bytes wins.

Body:
Dyalog APL, 9 bytes

⊢↑⍨2÷⍨1+≢

⊢ the argument

↑⍨ truncated at

2÷⍨ half of

1+ one plus

≢  the length

TryAPL online!


答:
MATL, 7 bytes

```<code>BY'nwa*
</code>```

Try it online!

Explanation

```<code>          % Implicit input, for example 97
          % STACK: 97
B         % Convert to binary
          % STACK: [1 1 0 0 0 0 1]
 Y'       % Run-length encoding
          % STACK: [1 0 1], [2 4 1]
   n      % Number of elements
          % STACK: [1 0 1], 3
    w     % Swap
          % STACK: 3, [1 0 1]
     a    % Any: gives 1 if any element is nonzero
          % STACK: 3, 1
      *   % Multiply
          % STACK: 3
          % Implicit display
</code>```

Title: Binary Countdown Length

Body:
MATL, 7 bytes

BY'nwa*

Try it online!

Explanation

          % Implicit input, for example 97
          % STACK: 97
B         % Convert to binary
          % STACK: [1 1 0 0 0 0 1]
 Y'       % Run-length encoding
          % STACK: [1 0 1], [2 4 1]
   n      % Number of elements
          % STACK: [1 0 1], 3
    w     % Swap
          % STACK: 3, [1 0 1]
     a    % Any: gives 1 if any element is nonzero
          % STACK: 3, 1
      *   % Multiply
          % STACK: 3
          % Implicit display


答:
Pyke, 4 bytes

```<code>le>_
</code>```

Try it here!

```<code>l    -    len(input)
 e   -   ^//2
  >  -  input[^:]
   _ - reversed(^)
</code>```

Title: Depalindromize this string!

Body:
Pyke, 4 bytes

le>_

Try it here!

l    -    len(input)
 e   -   ^//2
  >  -  input[^:]
   _ - reversed(^)


答:
IBM/Lotus Notes Formula, 21 bytes

```<code>@Left(a;@Length(a)/2)
</code>```

Computed field that takes input from an editable field a. Works because Notes rounds up when an odd number is divided by 2.

Test Cases

Title: Depalindromize this string!

Body:
IBM/Lotus Notes Formula, 21 bytes

@Left(a;@Length(a)/2)

Computed field that takes input from an editable field a. Works because Notes rounds up when an odd number is divided by 2.

Test Cases


问:
How many significant figures?
Given a number as input, determine how many significant figures it has. This number will should be taken as a string because you have to do some special formatting. You'll see what I mean soon (I think).

A digit is a sig-fig if at least one of the following apply:

Non-zero digits are always significant.

Any zeros between two significant digits are significant.

final zero or trailing zeros in the decimal portion only are significant.

all digits are significant if nothing follows the decimal place.

when there are only zeroes, all but the last zero are considered leading zeroes

Input

A string or string array of the number. It might have a decimal point at the end without a digit after it. It might not have a decimal point at all.

Output

How many sig-figs there are.

Examples

```<code>1.240 -> 4
0. -> 1
83900 -> 3
83900.0 -> 6
0.025 -> 2
0.0250 -> 3
2.5 -> 2
970. -> 3
0.00 -> 1
</code>```

答:
Batch, <s>204</s> 202 bytes

```<code>@set/ps=
:t
@if %s:.=%%s:~-1%==%s%0 set s=%s:~,-1%&goto t
@set s=%s:.=%
:l
@if not %s%==0 if %s:~,1%==0 set s=%s:~1%&goto l
@set n=0
:n
@if not "%s%"=="" set/an+=1&set s=%s:~1%&goto n
@echo %n%
</code>```

Takes input on STDIN. Works by removing trailing zeros if the number does not contain a ., then removing the . and leading zeros, unless there are only zeros, in which case it leaves one zero. Finally it takes the length of the remaining string.

Title: How many significant figures?

Body:
Batch, <s>204</s> 202 bytes

@set/ps=
:t
@if %s:.=%%s:~-1%==%s%0 set s=%s:~,-1%&goto t
@set s=%s:.=%
:l
@if not %s%==0 if %s:~,1%==0 set s=%s:~1%&goto l
@set n=0
:n
@if not "%s%"=="" set/an+=1&set s=%s:~1%&goto n
@echo %n%

Takes input on STDIN. Works by removing trailing zeros if the number does not contain a ., then removing the . and leading zeros, unless there are only zeros, in which case it leaves one zero. Finally it takes the length of the remaining string.


问:
Print/Output the L-phabet
Inspired by George Gibson's Print a Tabula Recta.

You are to print/output this exact text:

```<code>ABCDEFGHIJKLMNOPQRSTUVWXYZ
BBCDEFGHIJKLMNOPQRSTUVWXYZ
CCCDEFGHIJKLMNOPQRSTUVWXYZ
DDDDEFGHIJKLMNOPQRSTUVWXYZ
EEEEEFGHIJKLMNOPQRSTUVWXYZ
FFFFFFGHIJKLMNOPQRSTUVWXYZ
GGGGGGGHIJKLMNOPQRSTUVWXYZ
HHHHHHHHIJKLMNOPQRSTUVWXYZ
IIIIIIIIIJKLMNOPQRSTUVWXYZ
JJJJJJJJJJKLMNOPQRSTUVWXYZ
KKKKKKKKKKKLMNOPQRSTUVWXYZ
LLLLLLLLLLLLMNOPQRSTUVWXYZ
MMMMMMMMMMMMMNOPQRSTUVWXYZ
NNNNNNNNNNNNNNOPQRSTUVWXYZ
OOOOOOOOOOOOOOOPQRSTUVWXYZ
PPPPPPPPPPPPPPPPQRSTUVWXYZ
QQQQQQQQQQQQQQQQQRSTUVWXYZ
RRRRRRRRRRRRRRRRRRSTUVWXYZ
SSSSSSSSSSSSSSSSSSSTUVWXYZ
TTTTTTTTTTTTTTTTTTTTUVWXYZ
UUUUUUUUUUUUUUUUUUUUUVWXYZ
VVVVVVVVVVVVVVVVVVVVVVWXYZ
WWWWWWWWWWWWWWWWWWWWWWWXYZ
XXXXXXXXXXXXXXXXXXXXXXXXYZ
YYYYYYYYYYYYYYYYYYYYYYYYYZ
ZZZZZZZZZZZZZZZZZZZZZZZZZZ
</code>```

(Yes, I typed that by hand)

You are allowed to use all lowercase instead of all uppercase.

However, your choice of case must be consistent throughout the whole text.

Rules/Requirements

Each submission should be either a full program or function. If it is a function, it must be runnable by only needing to add the function call to the bottom of the program. Anything else (e.g. headers in C), must be included.

If it is possible, provide a link to a site where your program can be tested.

Your program must not write anything to STDERR.

Standard Loopholes are forbidden.

Your program can output in any case, but it must be printed (not an array or similar).

Scoring

Programs are scored according to bytes, in UTF-8 by default or a different character set of your choice.

Eventually, the answer with the least bytes will win.

Submissions

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

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

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

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

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

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

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

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

Leaderboard

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

/* Configuration */

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

/* App */

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

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

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

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

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

getAnswers();

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

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

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

function process() {
  var valid = [];

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

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

  });

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

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

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

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

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

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

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

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

table thead {
  font-weight: bold;
}

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

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

Leaderboard

	Author	Language	Size

Winners by Language

Language	User	Score

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

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

```

答:
C#, <s>139</s> <s>136</s> <s>134</s> 131 bytes

```<code>void a(){for(char i='A';i<'[';i++){char j;for(j='A';j<i;j++)Console.Write(i);for(;j<'[';j++)Console.Write(j);Console.WriteLine();}}
</code>```

Ungolfed:

```<code>void a()
{
    for (char i = 'A'; i < '['; i++)
    {
        char j;

        for (j = 'A'; j < i; j++)
            Console.Write(i);

        for (; j < '['; j++)
            Console.Write(j);

        Console.WriteLine();
    }
}
</code>```

EDIT1: Sharing j variable by inner loops maked profit of 3 bytes.

EDIT2: Changing i <= 'Z' to i < '[' maked profit of 2 bytes.

EDIT3: Removal of j initialization in second inner loop maked profit of 3 bytes.

Title: Print/Output the L-phabet

Body:
C#, <s>139</s> <s>136</s> <s>134</s> 131 bytes

void a(){for(char i='A';i<'[';i++){char j;for(j='A';j<i;j++)Console.Write(i);for(;j<'[';j++)Console.Write(j);Console.WriteLine();}}

Ungolfed:

void a()
{
    for (char i = 'A'; i < '['; i++)
    {
        char j;

        for (j = 'A'; j < i; j++)
            Console.Write(i);

        for (; j < '['; j++)
            Console.Write(j);

        Console.WriteLine();
    }
}

EDIT1: Sharing j variable by inner loops maked profit of 3 bytes.

EDIT2: Changing i <= 'Z' to i < '[' maked profit of 2 bytes.

EDIT3: Removal of j initialization in second inner loop maked profit of 3 bytes.


答:
R, 59 bytes

Not pretty but it gets the job done.

```<code>cat(strsplit(scan(,""),"")[[1]][0:(nchar(x)%/%2)+1],sep="")
</code>```

Title: Depalindromize this string!

Body:
R, 59 bytes

Not pretty but it gets the job done.

cat(strsplit(scan(,""),"")[[1]][0:(nchar(x)%/%2)+1],sep="")


答:
R, 107 bytes

This is the boring solution which just uses comments to make it a palindrome.

```<code>cat(x<-scan(,""),rev(strsplit(x,"")[[1]])[-1],sep="")#)""=pes,]1-[)]]1[[)"",x(tilpsrts(ver,)"",(nacs-<x(tac
</code>```

R with few comments, 271 bytes

While this code is longer, only 89 of the bytes (33%) are comments, rather than the 50% in the above code. R relies extensively on parentheses for function application, so this was rather difficult.

```<code>`%q%`=function
(x,y)cat(x,y,sep=e)#
`%p%`=function
(x,y)`if`(length(y),rev(y)[-1],x)#
x=strsplit(scan(,e<-""),e)[[1]]#
n=NULL
e%q%x%p%n
n%p%x%q%e
LLUN=n
#]]1[[)e,)""-<e,(nacs(tilpsrts=x
#)x,]1-[)y(ver,)y(htgnel(`fi`)y,x(
noitcnuf=`%p%`
#)e=pes,y,x(tac)y,x(
noitcnuf=`%q%`
</code>```

Title: Palindromize this string!

Body:
R, 107 bytes

This is the boring solution which just uses comments to make it a palindrome.

cat(x<-scan(,""),rev(strsplit(x,"")[[1]])[-1],sep="")#)""=pes,]1-[)]]1[[)"",x(tilpsrts(ver,)"",(nacs-<x(tac

R with few comments, 271 bytes

While this code is longer, only 89 of the bytes (33%) are comments, rather than the 50% in the above code. R relies extensively on parentheses for function application, so this was rather difficult.

`%q%`=function
(x,y)cat(x,y,sep=e)#
`%p%`=function
(x,y)`if`(length(y),rev(y)[-1],x)#
x=strsplit(scan(,e<-""),e)[[1]]#
n=NULL
e%q%x%p%n
n%p%x%q%e
LLUN=n
#]]1[[)e,)""-<e,(nacs(tilpsrts=x
#)x,]1-[)y(ver,)y(htgnel(`fi`)y,x(
noitcnuf=`%p%`
#)e=pes,y,x(tac)y,x(
noitcnuf=`%q%`


Title: Depalindromize this string!

Body:
GolfSharp, 20 bytes

v=>v.R(0,v.L()/2+1);


答:
CJam, <s>11</s> 10 bytes

Thanks to @Dennis for saving one byte!

```<code>ri_2be`,e&
</code>```

Try it online!

Explanation

```<code>ri            #e Read as integer
              #e STACK: 97
  _           #e Duplicate
              #e STACK: 97, 97
   2b         #e Convert to binary
              #e STACK: 97, [1 1 0 0 0 0 1]
     e`       #e Run-length encoding
              #e STACK: 97, [[2 1] [4 0] [1 1]]
       ,      #e Length
              #e STACK: 97, 3
        e&    #e Return first value if 0, or else the second value
              #e STACK: 3
</code>```

Title: Binary Countdown Length

Body:
inspired by Count down from infinity

Given a non-negative integer N, output the number of repetitions of the following steps it takes to reach 0:

Convert N to binary (4812390 -> 10010010110111001100110)

Flip each bit (10010010110111001100110 -> 01101101001000110011001)

Trim leading zeroes (01101101001000110011001 -> 1101101001000110011001)

Convert back to decimal (1101101001000110011001 -> 3576217)

Rules

Input and output may be in any unambiguous, consistent format

The input will be within the native representable integer range for your language (if your language supports arbitrarily-large integers, there is no bound)

Test Cases

```<code>0 -> 0
1 -> 1
42 -> 6
97 -> 3
170 -> 8
255 -> 1
682 -> 10
8675309 -> 11
4812390 -> 14
178956970 -> 28
2863311530 -> 32
</code>```

This sequence is A005811 in the OEIS.

Body:
CJam, <s>11</s> 10 bytes

Thanks to @Dennis for saving one byte!

ri_2be`,e&

Try it online!

Explanation

ri            #e Read as integer
              #e STACK: 97
  _           #e Duplicate
              #e STACK: 97, 97
   2b         #e Convert to binary
              #e STACK: 97, [1 1 0 0 0 0 1]
     e`       #e Run-length encoding
              #e STACK: 97, [[2 1] [4 0] [1 1]]
       ,      #e Length
              #e STACK: 97, 3
        e&    #e Return first value if 0, or else the second value
              #e STACK: 3


问:
Count without 3

Background

When I was in elementary school, we used to play a game in math class that goes as follows.

All kids sit in a big circle and take turns counting, starting from 1.

However, the following numbers must be skipped while counting:

Numbers that are multiples of 3.

Numbers that have a 3 in its decimal representation.

The first 15 numbers the kids should say are

```<code>1 2 4 5 7 8 10 11 14 16 17 19 20 22 25
</code>```

Whenever somebody gets a number wrong – says a number that isn't in the sequence or skips a number that is – he's removed from the circle. This goes on until there's only one kid left.

Task

You're bad at this game, so you decide to cheat. Write a program or a function that, given a number of the sequence, calculates the next number of the sequence.

You don't have to handle numbers that cannot be represented using your language's native numeric type, provided that your program works correctly up to input 251 and that your algorithm works for arbitrarily large inputs.

Input and output can use any convenient base.

Since you have to conceal your code, it must be as short as possible. In fact, this is code-golf, so the shortest code in bytes wins.

Test cases

```<code>  1 ->   2
  2 ->   4
 11 ->  14
 22 ->  25
 29 ->  40
251 -> 254
</code>```

答:
Pyke, 13 bytes

```<code>Whii3%!3`i`{|
</code>```

Try it here!

```<code>              - i = input
W             - do:
 hi           -  i += 1
   i3%!       -    not (i % 3)
            | -   ^ or V
       3`i`{  -    "3" in str(i)
              - while ^
</code>```

Title: Count without 3

Body:
Pyke, 13 bytes

Whii3%!3`i`{|

Try it here!

              - i = input
W             - do:
 hi           -  i += 1
   i3%!       -    not (i % 3)
            | -   ^ or V
       3`i`{  -    "3" in str(i)
              - while ^


答:
, 16 chars / 20 bytes

```<code>ï+ïĦ⬮Đ1//1Đ⬮Ħï+ï
</code>```

Try it here (ES6 browsers only).

Generated from the interpreter console using this:

```<code>c.value=`ï+ï${alias(String.prototype,'reverse')}⬮${alias(String.prototype,'slice')}1//1${alias(String.prototype,'slice')}⬮${alias(String.prototype,'reverse')}ï+ï`
</code>```

Title: Palindromize this string!

Body:
Your task is to palindromize a string as follows:

Take the string.

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

Reverse it.

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

Remove the first letter.

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

Glue it onto the original string.

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

But here's the catch: since this challenge is about palindromes, your code itself also has to be a palindrome.

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

Body:
, 16 chars / 20 bytes

ï+ïĦ⬮Đ1//1Đ⬮Ħï+ï

Try it here (ES6 browsers only).

Generated from the interpreter console using this:

c.value=`ï+ï${alias(String.prototype,'reverse')}⬮${alias(String.prototype,'slice')}1//1${alias(String.prototype,'slice')}⬮${alias(String.prototype,'reverse')}ï+ï`


答:
Brachylog, 10 bytes

```<code><.='e3:I'*
</code>```

Try it online!

Explanation

```<code>(?)<.                Output > Input
    .=               Assign a value to the Output
    . 'e3            3 cannot be an element of the Output (i.e. one of its digits)
        3:I'*(.)     There is no I such that 3*I = Output
</code>```

Title: Count without 3

Body:
Background

When I was in elementary school, we used to play a game in math class that goes as follows.

All kids sit in a big circle and take turns counting, starting from 1.

However, the following numbers must be skipped while counting:

Numbers that are multiples of 3.

Numbers that have a 3 in its decimal representation.

The first 15 numbers the kids should say are

```<code>1 2 4 5 7 8 10 11 14 16 17 19 20 22 25
</code>```

Whenever somebody gets a number wrong – says a number that isn't in the sequence or skips a number that is – he's removed from the circle. This goes on until there's only one kid left.

Task

You're bad at this game, so you decide to cheat. Write a program or a function that, given a number of the sequence, calculates the next number of the sequence.

You don't have to handle numbers that cannot be represented using your language's native numeric type, provided that your program works correctly up to input 251 and that your algorithm works for arbitrarily large inputs.

Input and output can use any convenient base.

Since you have to conceal your code, it must be as short as possible. In fact, this is code-golf, so the shortest code in bytes wins.

Test cases

```<code>  1 ->   2
  2 ->   4
 11 ->  14
 22 ->  25
 29 ->  40
251 -> 254
</code>```

Body:
Brachylog, 10 bytes

<.='e3:I'*

Try it online!

Explanation

(?)<.                Output > Input
    .=               Assign a value to the Output
    . 'e3            3 cannot be an element of the Output (i.e. one of its digits)
        3:I'*(.)     There is no I such that 3*I = Output


答:
R, 46 bytes

```<code>n=scan()+1;while(!n%%3|grepl(3,n))n=n+1;cat(n)
</code>```

Title: Count without 3

Body:
R, 46 bytes

n=scan()+1;while(!n%%3|grepl(3,n))n=n+1;cat(n)


答:
Haskell, <s>50</s> 48 bytes

f n=[x|x<-[n..],mod x 3>0,notElem '3'$show x]!!1
```
<p>Try it on Ideone. Saved 2 bytes thanks to @Charlie Harding.</p>
<p>Alternative: (50 bytes)</p>
<pre class="lang-haskell prettyprint-override"><code>g=f.(+1)
f n|mod n 3<1||(elem '3'.show)n=g n|1<3=n
</code>```

Title: Count without 3

Body:
Haskell, <s>50</s> 48 bytes

f n=[x|x<-[n..],mod x 3>0,notElem '3'$show x]!!1

Try it on Ideone. Saved 2 bytes thanks to @Charlie Harding.

Alternative: (50 bytes)

g=f.(+1)
f n|mod n 3<1||(elem '3'.show)n=g n|1<3=n


答:
05AB1E, 11 bytes

```<code>[>Ð3ås3Ö~_#
</code>```

Try it online!

Explanation

```<code>               # implicit input
[              # start loop
 >             # increase current number
  Ð            # triplicate
          #    # break loop IF
         _     # logical negation of
   3å          # number has one or more 3's in it
        ~      # OR
     s3Ö       # number % 3 == 0
</code>```

Title: Count without 3

Body:
05AB1E, 11 bytes

[>Ð3ås3Ö~_#

Try it online!

Explanation

               # implicit input
[              # start loop
 >             # increase current number
  Ð            # triplicate
          #    # break loop IF
         _     # logical negation of
   3å          # number has one or more 3's in it
        ~      # OR
     s3Ö       # number % 3 == 0


答:
PowerShell, 46 36 bytes

Unfortunately there's no PowerShell on Try it Online. Alas, here's my attempt.

$args[0][0..(($args[0].Length-1)/2)]

Title: Depalindromize this string!

Body:
Given a palindrome generated according to this challenge, depalindromize it.

Test cases

```<code>abcdedcba -> abcde
johncenanecnhoj -> johncena
ppapapp -> ppap
codegolflogedoc -> codegolf
</code>```

As this is about depalindromizing, your code cannot be a palindrome.

Remember, this is code-golf, so the code with the fewest bytes wins.


答:
Java 7, 71 bytes

int b(Long a){return a==0?0:1+b(~a&-1L>>>64-a.toString(a,2).length());}

I know this is beaten by Geobits' split solution (which will eventually be posted) but this was still fun to write

Title: Binary Countdown Length


Title: Count without 3

Body:
GolfSharp, 43 bytes

m=>r(m,m).w(n=>n%3>0&!n.t().I("3")).a()[1];


问:
Tips for golfing in Haskell
What general tips do you have for golfing in Haskell? I am looking for ideas that can be applied to code golf problems in general that are at least somewhat specific to Haskell. Please post only one tip per answer.

If you are new to golfing in Haskell, please have a look at the Guide to Golfing Rules in Haskell. There is also a dedicated Haskell chat room: Of Monads and Men.

答:
Partition a string with mapM and words

This function computes all partitions of a given string into nonempty contiguous substrings:

```<code>map(words.concat).mapM(\c->[[c],c:" "])
</code>```

The idea is that the mapM non-deteministically replaces each character c with either "c" or "c ", and the resulting lists are concatenated and split at spaces.
There are two gotchas: the string must not contain spaces (if it contains spaces but not line breaks, use "\n" and lines for one extra byte), and each partition occurs twice in the resulting list (with and without a trailing space, which gets eaten by words).

I've used this technique a couple of times (at least here, here and here).
It's pretty flexible, since you can apply more functions after words to modify the partitions, and/or replace map with another iteration function, like any.

Title: Tips for golfing in Haskell

Body:
Partition a string with mapM and words

This function computes all partitions of a given string into nonempty contiguous substrings:

map(words.concat).mapM(\c->[[c],c:" "])

The idea is that the mapM non-deteministically replaces each character c with either "c" or "c ", and the resulting lists are concatenated and split at spaces.
There are two gotchas: the string must not contain spaces (if it contains spaces but not line breaks, use "\n" and lines for one extra byte), and each partition occurs twice in the resulting list (with and without a trailing space, which gets eaten by words).

I've used this technique a couple of times (at least here, here and here).
It's pretty flexible, since you can apply more functions after words to modify the partitions, and/or replace map with another iteration function, like any.


问:
The PPCG Handicap System
As we all know, meta is overflowing with complaints about scoring code-golf between languages (yes, each word is a separate link, and these may be just the tip of the iceberg).

With so much jealousy towards those who actually bothered to look up the Pyth documentation, I thought it would be nice to have a little bit more of a constructive challenge, befitting of a website that specializes in code challenges.

The challenge is rather straightforward. As input, we have the language name and byte count. You can take those as function inputs, stdin or your languages default input method.

As output, we have a corrected byte count, i.e., your score with the handicap applied. Respectively, the output should be the function output, stdout or your languages default output method. Output will be rounded to integers, because we love tiebreakers.

Using the most ugly, hacked together query (link - feel free to clean it up), I have managed to create a dataset (zip with .xslx, .ods and .csv) that contains a snapshot of all answers to code-golf questions. You can use this file (and assume it to be available to your program, e.g., it's in the same folder) or convert this file to another conventional format (.xls, .mat, .sav etc - but it may only contain the original data!). The name should remain QueryResults.ext with  ext the extension of choice.

Now for the specifics. For each language, there is a Boilerplate \$B\$ and Verbosity \$V\$ parameters. Together, they can be used to create a linear model of the language. Let \$n\$ be the actual number of bytes, and \$c\$ be the corrected score. Using a simple model \$n=Vc+B\$, we get for the corrected score:

$$c = \frac{n-B}V$$

Simple enough, right? Now, for determining \$V\$ and \$B\$. As you might expect, we're going to do some linear regression, or more precise, a least squares weighted linear regression. I'm not going to explain the details on that - if you're not sure how to do that, Wikipedia is your friend, or if you're lucky, your language's documentation.

The data will be as follows. Each data point will be the byte count \$n\$ and the question's average bytecount \$c\$. To account for votes, the points will be weighted, by their number of votes plus one (to account for 0 votes), let's call that \$v\$. Answers with negative votes should be discarded. In simple terms, an answer with 1 vote should count the same as two answers with 0 votes.

This data is then fitted into the aforementioned model \$n=Vc+B\$ using weighted linear regression.

For example, given the data for a given language

$$
\begin{array} \\
n_1=20, & c_1=8.2,  & v_1=1 \\
n_2=25, & c_2=10.3, & v_2=2 \\
n_3=15, & c_3=5.7,  & v_3=5
\end{array}$$

Now, we compose the relevant matrices and vectors \$A\$, \$y\$ and \$W\$, with our parameters in the vector

$$
A = \left[\begin{matrix}
1 & c_1 \\
1 & c_2 \\
1 & c_3 \\
\end{matrix}\right]
y = \left[\begin{matrix}
n_1 \\
n_2 \\
n_3 \\
\end{matrix}\right]
W = \left[\begin{matrix}
1 & 0 & 0 \\
0 & 2 & 0 \\
0 & 0 & 5 \\
\end{matrix}\right]
x = \left[\begin{matrix}
B \\
V \\
\end{matrix}\right]
$$

we solve the matrix equation (with \${}^T\$ denoting the matrix transpose)

$$A^TWAx=A^TWy$$

for \$x\$ (and consequently, we get our \$B\$ and \$V\$ parameter).

Your score will be the output of your program, when given your own language name and bytecount. So yes, this time even Java and C++ users can win!

WARNING: The query generates a dataset with a lot of invalid rows due to people using 'cool' header formatting and people tagging their code-challenge questions as code-golf. The download I provided has most of the outliers removed. Do NOT use the CSV provided with the query.

Happy coding!

答:
Python3, 765.19 (765) bytes

Probably some room for golfing here.  Requires numpy for matrix stuff.  Reads from stdin, formatted as follows: [lang] [bytes/n].  Stops when you send q.

```<code>import numpy as n,csv
L={};Q={};X={};D=n.dot;f=open('QueryResults.csv',encoding="utf8");R=csv.reader(f);f.readline();Z=list.append;M=n.matrix
for r in R:
 if r[1] not in L:L[r[1]]=[]
 if r[4] not in Q:Q[r[4]]=[]
 Z(L[r[1]],r);Z(Q[r[4]],r)
for l in L:
 b=[];a=[];v=[];t=[]
 for r in L[l]:
  if int(r[3])>-1:
   Z(b,int(r[2]));o=[]
   for q in Q[r[4]]:Z(o,int(q[2]))
   Z(a,sum(o)/len(o));Z(v,int(r[3])+1)
 for k in a:Z(t,[1,k])
 if len(t)<1:continue
 A=M(t);T=A.transpose();W=n.diag(v);y=M(b).reshape((len(b),1));e=D(D(T,W),A)
 if n.linalg.det(e)==0:continue
 i=n.linalg.inv(e);X[l]=D(i,D(D(T,W),y))
p=input()
while(p!="q"):
 S=p.split()
 if S[1]=='n':print("(n-("+str(X[S[0]].item(0))+"))/"+str(X[S[0]].item(1)))
 else:print(str((int(S[1])-X[S[0]].item(0))/X[S[0]].item(1)))
 p=input()
</code>```

Results

I might have done something wrong at some point; I get different results than the Mathematica answer:

```<code>python3 808 -> 765.19
python3 n   -> (n-(32.41))/1.01

c++ n        -> (n-(71.86))/1.17
cjam n       -> (n-(-14.09))/0.51
java n       -> (n-(18.08))/1.64
pyth n       -> (n-(1.42))/0.28
jelly n      -> (n-(-4.88))/0.34
golfscript n -> (n-(-0.31))/0.44
</code>```

ContentLicense: CC BY-SA 4.0

Title: The PPCG Handicap System

Body:
Python3, 765.19 (765) bytes

Probably some room for golfing here.  Requires numpy for matrix stuff.  Reads from stdin, formatted as follows: [lang] [bytes/n].  Stops when you send q.

import numpy as n,csv
L={};Q={};X={};D=n.dot;f=open('QueryResults.csv',encoding="utf8");R=csv.reader(f);f.readline();Z=list.append;M=n.matrix
for r in R:
 if r[1] not in L:L[r[1]]=[]
 if r[4] not in Q:Q[r[4]]=[]
 Z(L[r[1]],r);Z(Q[r[4]],r)
for l in L:
 b=[];a=[];v=[];t=[]
 for r in L[l]:
  if int(r[3])>-1:
   Z(b,int(r[2]));o=[]
   for q in Q[r[4]]:Z(o,int(q[2]))
   Z(a,sum(o)/len(o));Z(v,int(r[3])+1)
 for k in a:Z(t,[1,k])
 if len(t)<1:continue
 A=M(t);T=A.transpose();W=n.diag(v);y=M(b).reshape((len(b),1));e=D(D(T,W),A)
 if n.linalg.det(e)==0:continue
 i=n.linalg.inv(e);X[l]=D(i,D(D(T,W),y))
p=input()
while(p!="q"):
 S=p.split()
 if S[1]=='n':print("(n-("+str(X[S[0]].item(0))+"))/"+str(X[S[0]].item(1)))
 else:print(str((int(S[1])-X[S[0]].item(0))/X[S[0]].item(1)))
 p=input()

Results

I might have done something wrong at some point; I get different results than the Mathematica answer:

python3 808 -> 765.19
python3 n   -> (n-(32.41))/1.01

c++ n        -> (n-(71.86))/1.17
cjam n       -> (n-(-14.09))/0.51
java n       -> (n-(18.08))/1.64
pyth n       -> (n-(1.42))/0.28
jelly n      -> (n-(-4.88))/0.34
golfscript n -> (n-(-0.31))/0.44


问:
Run-Length Encoding
Write a program uses run-length encoding to shorten a list of non-negative integers it has to read in.

You can assume the non-negative integers can fit in 32bit signed integers.

Input Format

The length, n, of the list on the first line.

On the second line, a space-separated list of integers representing the list of integers.

Output Format

A space separated list of integers. The first 2 integers represent the first run, the next 2 integers the second run and so on. For each pair of integers representing a run, the first integer represents the length of the run and the second represents the value of the integer in the run.

Sample Input

1.

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

2.

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

Sample Output

1.

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

2.

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

Limits

```<code>0<n<10000
</code>```

答:
JavaScript, 126 bytes

```<code>(x,j=0)=>(x=x.split` `).reduce((a,v,i)=>(v!=x[i-1]?(a[++j]=[]):a[j]).push(v)&&a,[]).reduce((a,v)=>a+v.length+" "+v[0]+" " ,"")
</code>```

I'm guessing this can be reduced further, but I'm just happy it works.

First I split based on the space, then I convert the array from [1,1,1,2,2,3,3] to a series of array representing each run [[1,1,1],[2,2],[3,3]], then I reduce that again to produce the required output of "3 1 2 2 2 3".

Title: Run-Length Encoding

Body:
JavaScript, 126 bytes

(x,j=0)=>(x=x.split` `).reduce((a,v,i)=>(v!=x[i-1]?(a[++j]=[]):a[j]).push(v)&&a,[]).reduce((a,v)=>a+v.length+" "+v[0]+" " ,"")

I'm guessing this can be reduced further, but I'm just happy it works.

First I split based on the space, then I convert the array from [1,1,1,2,2,3,3] to a series of array representing each run [[1,1,1],[2,2],[3,3]], then I reduce that again to produce the required output of "3 1 2 2 2 3".


答:
Retina, 24 bytes

I basically took this from another answer of mine.

```<code>^((.)*?.??)(?<-2>.)*$
$1
</code>```

Try it online

Title: Depalindromize this string!

Body:
Retina, 24 bytes

I basically took this from another answer of mine.

^((.)*?.??)(?<-2>.)*$
$1

Try it online


问:
Square-unspiral the string!
Given a string, first square it as follows:

First, write the string.

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

Next, write the string rotated one left.

```<code>abcde
bcdea
</code>```

Keep doing this until you have written len(string) lines.

```<code>abcde
bcdea
cdeab
deabc
eabcd
</code>```

Now, read from the string like this:

```<code>----+
+--+|
|+>||
|+-+|
+---+
</code>```

Which gives:

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

Print this string.

Test cases

```<code>abcdef -> abcdefabcdedcbafedcbcdefabcbafedefaf
cena! -> cena!cenanec!anena!cec!a!
ppcg -> ppcgppcppgcpcgpg
abc -> abcabacbc
ab -> abab
a -> a
 ->
</code>```

Please comment if a test case is incorrect.

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

答:
JavaScript (ES7), <s>83</s> <s>80</s> <s>78</s> 77 bytes

```<code>s=>s.repeat(l=s.length).replace(/./g,_=>s[(c-=--i**.5-l&1||-1)%l],c=-1,i=l*l)
</code>```

Bonus ES3-compliant program:

```<code>for(s=prompt(r=""),c=-1,l=s.length,i=l*l;i;)r+=s[(c-=l-Math.sqrt(i--)&1||-1)%l];alert(r)
</code>```

Explanation

This takes advantage of the fact that the output for e.g. a length 5 string can be represented as:

```<code>abcdeabcd cbaedcb cdeab aed e
012345678 7654321 23456 543 4
</code>```

where each digit represents an index in the string (starting at 0), modulo the length of the string. In other words, if n is the length of the string, we increment the index 2n - 1 times, then decrement it 2(n - 1) - 1 times, then increment it 2(n - 2) - 1 times, etc. This can be simplified to the following algorithm:

Start the index i at -1.

For each integer x in the range [n2..1]:

If floor(sqrt(x)) is of the same parity (even/odd) as n, increment i.

Otherwise, decrement i.

Add the character at index i mod n to the output.

This works because floor(sqrt(x)) switches parities after 2n - 1 iterations, then 2(n - 1) - 1 iterations, etc.

Title: Square-unspiral the string!

Body:
JavaScript (ES7), <s>83</s> <s>80</s> <s>78</s> 77 bytes

s=>s.repeat(l=s.length).replace(/./g,_=>s[(c-=--i**.5-l&1||-1)%l],c=-1,i=l*l)

Bonus ES3-compliant program:

for(s=prompt(r=""),c=-1,l=s.length,i=l*l;i;)r+=s[(c-=l-Math.sqrt(i--)&1||-1)%l];alert(r)

Explanation

This takes advantage of the fact that the output for e.g. a length 5 string can be represented as:

abcdeabcd cbaedcb cdeab aed e
012345678 7654321 23456 543 4

where each digit represents an index in the string (starting at 0), modulo the length of the string. In other words, if n is the length of the string, we increment the index 2n - 1 times, then decrement it 2(n - 1) - 1 times, then increment it 2(n - 2) - 1 times, etc. This can be simplified to the following algorithm:

Start the index i at -1.

For each integer x in the range [n2..1]:

If floor(sqrt(x)) is of the same parity (even/odd) as n, increment i.

Otherwise, decrement i.

Add the character at index i mod n to the output.

This works because floor(sqrt(x)) switches parities after 2n - 1 iterations, then 2(n - 1) - 1 iterations, etc.


问:
Let's abbreviate those numbers! Now reverse?
Introduction:

Like Twitter and Instagram and others, I wanted to display numbers like 1.2K and 3.8 M instead of 1,222 or 3,823,456.

But that's not all! As we all know, there might be some human beings which undoubtely won't like these abbreviations and will try to reverse them. So, 1.2k will become 1,200 and 3.8 M will become 3,800,000.

The task:

your task is to write a program or a function that converts a list of numbers (which are given as strings) into their abbreviate pairs and vice-versa.

For example, if the input list (or any STDIN) was ['1.4k', '1,234,567', '7.99M'], then you should output:

```<code>['1,400', '1.2M', '7,990,000']
</code>```

You can follow the next schema for abbreviations:

103 -> one kilo -> K

106 -> one million -> M

109 -> one billion -> B

Your code may assume all lowercase, all uppercase, mixed case or undefined case for input and use any of these for output, but should be consistent.

Rules and restrictions:

you may write a program or function, taking input via STDIN (or closest alternative), command-line argument or function argument and outputting the result via STDOUT (or closest alternative), function return value or function (out) parameter.

input may be in any convenient list or string format. You may assume that the ai are less than 231 each and that the list contains at least one element.

each abbreviated number will contain only one . while a normal number will contain as many , as necessary (you may assume that this numbers won't be altered).

you MAY NOT enter a number as '123456' but rather 123,456

standard code-golf rules apply.

Test cases:

```<code>Input: ['1.5M', '77.6k', '123,456,789']         Output: ['1,500,000', '77,600', '123.4M']
Input: ['3,000,000,000', '581k', '2b']          Output: ['3B', '581,000', '2,000,000,000']
Input: ['0.1k']                                 Output: ['100']
Input: ['888', '33']                            Output: ['0.888k', '0.033k']
</code>```

Clarifications:

for numbers < 1000 after the decimal point in abbreviation output you should have as many digits as required to get the correct result. (e.g: 2 -> will become 0.002k) - that means 3 decimals at most; for numbers > 1000 you can have a maximum of 1 decimal.

the abbreviation may be in both lower or upper case

I removed the built-ins restriction as suggested in the comments

The shortest code in bytes wins!

答:
PHP, <s>234</s> <s>224</s> <s>213</s> <s>201</s> 205 bytes

```<code>for(;$x=$argv[++$n];){$y=str_replace(",","",$x)/1e3;for($i=0;$y>999;$i++)$y=($y|0)/1e3;echo(A<$c=substr($x,strlen($x)-1))?number_format($x*[k=>1e3,m=>1e6,b=>1e9][$c]):($i?($y*10|0)/10:$y).kmb[$i]," ";}
</code>```

6 bytes saved by insertusernamehere, 4 bytes inspired by that.

takes input from command line arguments, prints results space-separated with a trailing separator

expects lower case abbreviation

run with -r

-2 bytes if underscore as separator is ok: Replace " " with _.

-1 byte if correct rounding is ok: Replace ($y*10|0)/10 with round($y,1).

-17 bytes for PHP 7.1: Replace substr($x,strlen($x)-1) with $x[-1].

80 (63) bytes for expanding one argument only:

```<code><?=number_format(($x=$argv[1])*[K=>1e3,M=>1e6,B=>1e9][substr($x,strlen($x)-1)]);
</code>```

save to file, then execute (or replace <?= with echo +space and run with -r.

Body:
PHP, <s>234</s> <s>224</s> <s>213</s> <s>201</s> 205 bytes

for(;$x=$argv[++$n];){$y=str_replace(",","",$x)/1e3;for($i=0;$y>999;$i++)$y=($y|0)/1e3;echo(A<$c=substr($x,strlen($x)-1))?number_format($x*[k=>1e3,m=>1e6,b=>1e9][$c]):($i?($y*10|0)/10:$y).kmb[$i]," ";}

6 bytes saved by insertusernamehere, 4 bytes inspired by that.

takes input from command line arguments, prints results space-separated with a trailing separator

expects lower case abbreviation

run with -r

-2 bytes if underscore as separator is ok: Replace " " with _.

-1 byte if correct rounding is ok: Replace ($y*10|0)/10 with round($y,1).

-17 bytes for PHP 7.1: Replace substr($x,strlen($x)-1) with $x[-1].

80 (63) bytes for expanding one argument only:

<?=number_format(($x=$argv[1])*[K=>1e3,M=>1e6,B=>1e9][substr($x,strlen($x)-1)]);

save to file, then execute (or replace <?= with echo +space and run with -r.


答:
Python 2.7 (in CMD.EXE), 91 bytes

This requires a terminal with a working backspace(\b), and will not work on repl.it or ideone.com. A print statement ending in a comma separates further output with space instead of a newline or return. The backspace allows us to overwrite the separating space.

```<code>s=input();r=s[::-1];n=len(s)-1;i=0
while i<=n:print'\b'+s[i:]+s[:n-i]+r[i+2:]+r[:n-i],;i+=2
</code>```

Python 2.7, 96 bytes

Try it on ideone.com or repl.it (thanks to Oliver). Input must be a python string, e.g.'cena!'.

```<code>s=input();r=s[::-1];n=len(s)-1;i=0;S=''
while i<=n:S+=s[i:]+s[:n-i]+r[i+2:]+r[:n-i];i+=2
print S
</code>```

The four slices appended by the loop (s[i:],s[:n-i],r[i+2:],r[:n-i]) are taken from four edges of the spiral. For instance with 01234 the square is:

```<code>01234
12340
23401
34012
40123
</code>```

So we take 01234,0123,210,4321. The variable i is the index of the top-left value in each step of the process. In the final spiral several of the slices may be empty.

Title: Square-unspiral the string!

Body:
Given a string, first square it as follows:

First, write the string.

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

Next, write the string rotated one left.

```<code>abcde
bcdea
</code>```

Keep doing this until you have written len(string) lines.

```<code>abcde
bcdea
cdeab
deabc
eabcd
</code>```

Now, read from the string like this:

```<code>----+
+--+|
|+>||
|+-+|
+---+
</code>```

Which gives:

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

Print this string.

Test cases

```<code>abcdef -> abcdefabcdedcbafedcbcdefabcbafedefaf
cena! -> cena!cenanec!anena!cec!a!
ppcg -> ppcgppcppgcpcgpg
abc -> abcabacbc
ab -> abab
a -> a
 ->
</code>```

Please comment if a test case is incorrect.

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

Body:
Python 2.7 (in CMD.EXE), 91 bytes

This requires a terminal with a working backspace(\b), and will not work on repl.it or ideone.com. A print statement ending in a comma separates further output with space instead of a newline or return. The backspace allows us to overwrite the separating space.

s=input();r=s[::-1];n=len(s)-1;i=0
while i<=n:print'\b'+s[i:]+s[:n-i]+r[i+2:]+r[:n-i],;i+=2

Python 2.7, 96 bytes

Try it on ideone.com or repl.it (thanks to Oliver). Input must be a python string, e.g.'cena!'.

s=input();r=s[::-1];n=len(s)-1;i=0;S=''
while i<=n:S+=s[i:]+s[:n-i]+r[i+2:]+r[:n-i];i+=2
print S

The four slices appended by the loop (s[i:],s[:n-i],r[i+2:],r[:n-i]) are taken from four edges of the spiral. For instance with 01234 the square is:

01234
12340
23401
34012
40123

So we take 01234,0123,210,4321. The variable i is the index of the top-left value in each step of the process. In the final spiral several of the slices may be empty.


答:
PowerShell v2+, 46 bytes

```<code>for($a=$args[0]+1;$a-match3-or!($a%3)){$a++}$a
</code>```

Takes input $args[0], adds 1, saves into $a, starts a for loop. The conditional keeps the loop going while either $a-match3 (regex match) -or $a%3 is zero (the ! of which is 1). The loop simply increments $a++. At the end of the loop, we simply place $a on the pipeline, and output via implicit Write-Output happens at program completion.

Examples

```<code>PS C:\Tools\Scripts\golfing> 1,2,11,22,29,33,102,251,254|%{"$_ --> "+(.\count-without-three.ps1 $_)}
1 --> 2
2 --> 4
11 --> 14
22 --> 25
29 --> 40
33 --> 40
102 --> 104
251 --> 254
254 --> 256
</code>```

Title: Count without 3

Body:
PowerShell v2+, 46 bytes

for($a=$args[0]+1;$a-match3-or!($a%3)){$a++}$a

Takes input $args[0], adds 1, saves into $a, starts a for loop. The conditional keeps the loop going while either $a-match3 (regex match) -or $a%3 is zero (the ! of which is 1). The loop simply increments $a++. At the end of the loop, we simply place $a on the pipeline, and output via implicit Write-Output happens at program completion.

Examples

PS C:\Tools\Scripts\golfing> 1,2,11,22,29,33,102,251,254|%{"$_ --> "+(.\count-without-three.ps1 $_)}
1 --> 2
2 --> 4
11 --> 14
22 --> 25
29 --> 40
33 --> 40
102 --> 104
251 --> 254
254 --> 256


问:
Palindromic palindrome generator
Create a program, that converts input string to a palindrome starting with the input string. The program itself must be a palindrome.

For example input: neverod, print neveroddoreven. You should handle multi-word, multi-line inputs as well.

答:
PHP, 28+1+28=57 bytes

```<code><?=($x=$argv[1]).strrev($x);#;)x$(verrts.)]1[vgra$=x$(=?<
</code>```

takes input from command line argument. quote for multi-word, escape newlines for multi-line.

Title: Palindromic palindrome generator

Body:
PHP, 28+1+28=57 bytes

<?=($x=$argv[1]).strrev($x);#;)x$(verrts.)]1[vgra$=x$(=?<

takes input from command line argument. quote for multi-word, escape newlines for multi-line.


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

```

答:
JLisp, 23 bytes

```<code>(write "Hello, World!")
</code>```

Call the write function, which print a text to stdout

Title: "Hello, World!"

Body:
JLisp, 23 bytes

(write "Hello, World!")

Call the write function, which print a text to stdout