答:
C#, 276 + 21 = 297 bytes

276 bytes for method + 21 bytes for System.Drawing import.

```<code>using System.Drawing;n=>{var q=new Bitmap(n,n);uint W=0xFFFFFFFF,B=0xFF4285F4;for(int y=0,x=0;x<n;y=++y<n?y:x-x++){float a=2f*x/n-1,b=2f*y/n-1,c=b*b;q.SetPixel(x,y,Color.FromArgb((int)(a>0&&a<.8&&c<.04?B:a*a+c>1||a*a+c<.36?W:a*a<c?b<0?0xFFEA4335:0xFF34A853:a<0?0xFFFBBC05:b<-.2?W:B)));}return q;};
</code>```

Based on Martin Rosenau's algorithm. Thanks for doing the hard part of coming up with a way to construct the image!

```<code>using System.Drawing;             // Import System.Drawing
/*Func<int, Bitmap>*/ n =>
{
    var q = new Bitmap(n, n);     // Create nxn output bitmap
    uint W=0xFFFFFFFF,            // White, color used more than once
         B=0xFF4285F4;            // Blue, color used more than once
    for(int y = 0, x = 0; x < n;  // Loops for(x=0;x<N;x+=1) for(y=0;y<N;y+=1) combined
        y = ++y < n               // Increment y first until it reaches n
            ? y
            : x - x++)            // Then increment x, resetting y
    {
        float a = 2f * x / n - 1, // Relative coords. Refer to Martin Rosenau's
              b = 2f * y / n - 1, // for what this magic is.
              c = b * b;          // b*b is used more than 3 times

        q.SetPixel(x, y,          // Set pixel (x,y) to the appropriate color
            Color.FromArgb((int)  // Cast uint to int :(
            ( // Here lies magic
                a > 0 && a < .8 && c < .04
                    ? B
                    : a * a + c > 1 || a * a + c < .36
                        ? W
                        : a * a < c
                            ? b < 0
                                ? 0xFFEA4335
                                : 0xFF34A853
                            : a < 0
                                ? 0xFFFBBC05
                                : b < -.2
                                    ? W
                                    : B
            )));
    }
    return q;
};
</code>```

26:

400:

Body:
C#, 276 + 21 = 297 bytes

276 bytes for method + 21 bytes for System.Drawing import.

using System.Drawing;n=>{var q=new Bitmap(n,n);uint W=0xFFFFFFFF,B=0xFF4285F4;for(int y=0,x=0;x<n;y=++y<n?y:x-x++){float a=2f*x/n-1,b=2f*y/n-1,c=b*b;q.SetPixel(x,y,Color.FromArgb((int)(a>0&&a<.8&&c<.04?B:a*a+c>1||a*a+c<.36?W:a*a<c?b<0?0xFFEA4335:0xFF34A853:a<0?0xFFFBBC05:b<-.2?W:B)));}return q;};

Based on Martin Rosenau's algorithm. Thanks for doing the hard part of coming up with a way to construct the image!

using System.Drawing;             // Import System.Drawing
/*Func<int, Bitmap>*/ n =>
{
    var q = new Bitmap(n, n);     // Create nxn output bitmap
    uint W=0xFFFFFFFF,            // White, color used more than once
         B=0xFF4285F4;            // Blue, color used more than once
    for(int y = 0, x = 0; x < n;  // Loops for(x=0;x<N;x+=1) for(y=0;y<N;y+=1) combined
        y = ++y < n               // Increment y first until it reaches n
            ? y
            : x - x++)            // Then increment x, resetting y
    {
        float a = 2f * x / n - 1, // Relative coords. Refer to Martin Rosenau's
              b = 2f * y / n - 1, // for what this magic is.
              c = b * b;          // b*b is used more than 3 times

        q.SetPixel(x, y,          // Set pixel (x,y) to the appropriate color
            Color.FromArgb((int)  // Cast uint to int :(
            ( // Here lies magic
                a > 0 && a < .8 && c < .04
                    ? B
                    : a * a + c > 1 || a * a + c < .36
                        ? W
                        : a * a < c
                            ? b < 0
                                ? 0xFFEA4335
                                : 0xFF34A853
                            : a < 0
                                ? 0xFFFBBC05
                                : b < -.2
                                    ? W
                                    : B
            )));
    }
    return q;
};

26:

400:


问:
Division of not so little numbers
Write a program or function that takes in positive integers a, b and c, and prints or returns a/b to c decimal places, using the operations +-*/% [add, subtract, multiply, divide, modulate] on the positive integers: you can use all that your language allows, but not on floating point numbers. The range of a,b,c would be the range allowed for unsigned integers in your language.
The number result will be truncated to the last digit to print (so no round).

This means that if your language does not have an integer type (only float), you can participate by using these float numbers as positive integers only.
The clue of this exercise it would be to write the function that find the
digits in a float point division, using only the operation +-*/%  on
[unsigned] integers.

Examples

print(1,2,1) would print 0.5

print(1,2,2) would print 0.50

print(13,7,27) would print 1.857142857142857142857142857

print(2,3,1) would print 0.6

print(4,5,7) would print 0.8000000

print(4,5,1) would print 0.8

print(9999,23,1) would print 434.7

print(12345613,2321,89) would print if your Language has 32 bit unsigned 5319.09220163722533390779836277466609220163722533390779836277466609220163722533390779836277466

The shortest code in bytes wins. I'm sorry if this appear not clear... I don't know languages too, not remember words well...
It is better to have one link to Ideone.com or some other place for easily try the answer especially for to test some input different from proposed.

答:
JavaScript (ES6), <s>55</s> 50 bytes

```<code>f=(a,b,c,d=".")=>~c?(a/b|0)+d+f(a%b*10,b,c-1,""):d
</code>```

(a/b|0) performs float division but immediately casts to an integer. Please let me know if this is not allowed.

ContentLicense: CC BY-SA 3.0

Title: Division of not so little numbers

Body:
JavaScript (ES6), <s>55</s> 50 bytes

f=(a,b,c,d=".")=>~c?(a/b|0)+d+f(a%b*10,b,c-1,""):d

(a/b|0) performs float division but immediately casts to an integer. Please let me know if this is not allowed.


Title: Division of not so little numbers

Body:
Write a program or function that takes in positive integers a, b and c, and prints or returns a/b to c decimal places, using the operations +-*/% [add, subtract, multiply, divide, modulate] on the positive integers: you can use all that your language allows, but not on floating point numbers. The range of a,b,c would be the range allowed for unsigned integers in your language.
The number result will be truncated to the last digit to print (so no round).

This means that if your language does not have an integer type (only float), you can participate by using these float numbers as positive integers only.
The clue of this exercise it would be to write the function that find the
digits in a float point division, using only the operation +-*/%  on
[unsigned] integers.

Examples

print(1,2,1) would print 0.5

print(1,2,2) would print 0.50

print(13,7,27) would print 1.857142857142857142857142857

print(2,3,1) would print 0.6

print(4,5,7) would print 0.8000000

print(4,5,1) would print 0.8

print(9999,23,1) would print 434.7

print(12345613,2321,89) would print if your Language has 32 bit unsigned 5319.09220163722533390779836277466609220163722533390779836277466609220163722533390779836277466

The shortest code in bytes wins. I'm sorry if this appear not clear... I don't know languages too, not remember words well...
It is better to have one link to Ideone.com or some other place for easily try the answer especially for to test some input different from proposed.

Body:
q, 196 bytes

w:{((x 0)div 10;1+x 1)}/[{0<x 0};(a;0)]1;{s:x 0;m:x 2;r:(10*x 1)+$[m<0;{x*10}/[-1*m;a];{x div 10}/[m;a]]mod 10;d:1#.Q.s r div b;($[m=-1;s,".",d;$[s~,:'["0"];d;s,d]];r mod b;m-1)}/[c+w;("";0;w-1)]0

To run: set a, b, c first.


问:
Fibonacci Factorization

Fibonacci Numbers

Fibonacci Numbers start with f(1) = 1 and f(2) = 1 (some includes f(0) = 0 but this is irrelevant to this challenge. Then, for n > 2, f(n) = f(n-1) + f(n-2).

The challenge

Your task is to find and output the n-th positive number that can be expressed as products of Fibonacci numbers. You can choose to make it 0-indexed or 1-indexed, whichever suits you better, but you must specify this in your answer.

Also, your answer must compute the 100th term in a reasonable time.

Testcases

```<code>n   result corresponding product (for reference)
1   1      1
2   2      2
3   3      3
4   4      2*2
5   5      5
6   6      2*3
7   8      2*2*2 or 8
8   9      3*3
9   10     2*5
10  12     2*2*3
11  13     13
12  15     3*5
13  16     2*2*2*2 or 2*8
14  18     2*3*3
15  20     2*2*5
16  21     21
17  24     2*2*2*3 or 3*8
18  25     5*5
19  26     2*13
20  27     3*3*3
100 315    3*5*21
</code>```

References

Obligatory OEIS A065108

答:
Haskell, 123 bytes

```<code>f=2:scanl(+)3f
m((a:b):c)=a:m(b?(a#c))
v#((a:b):c)|v==a=b?(v#c)
_#l=l
y?(z:e)|y>z=z:y?e
a?b=a:b
l=1:m[[a*b|b<-l]|a<-f]
(l!!)
</code>```

Very lazy, much infinite!

Possibly not the shortes way, but I had to try this approach, a generalization of a quite well known method to compute the list of hamming numbers. f is the list of fibonacci numbers starting from 2. For brevity, let's say that a lol (list of lists) is an infinite list of ordered infinite lists, ordered by their first elements. m is a function to merge a lol, removing duplicates. It uses two infix helper functions. ? inserts an infinite sorted list into a lol. # removes a value from a lol that may appear as head of the first lists, reinserting the remaining list with ?.

Finally, l is the list of numbers which are products of fibonacci numbers, defined as 1 followed by the merge of all the lists obtained by multiplying l with a fibonacci number. The last line states the required function (as usual without binding it to a name, so don't copy it as is) using !! to index into the list, which makes the function 0-indexed.

There is no problem computing the 100th or 100,000th number.

Title: Fibonacci Factorization

Body:
Haskell, 123 bytes

f=2:scanl(+)3f
m((a:b):c)=a:m(b?(a#c))
v#((a:b):c)|v==a=b?(v#c)
_#l=l
y?(z:e)|y>z=z:y?e
a?b=a:b
l=1:m[[a*b|b<-l]|a<-f]
(l!!)

Very lazy, much infinite!

Possibly not the shortes way, but I had to try this approach, a generalization of a quite well known method to compute the list of hamming numbers. f is the list of fibonacci numbers starting from 2. For brevity, let's say that a lol (list of lists) is an infinite list of ordered infinite lists, ordered by their first elements. m is a function to merge a lol, removing duplicates. It uses two infix helper functions. ? inserts an infinite sorted list into a lol. # removes a value from a lol that may appear as head of the first lists, reinserting the remaining list with ?.

Finally, l is the list of numbers which are products of fibonacci numbers, defined as 1 followed by the merge of all the lists obtained by multiplying l with a fibonacci number. The last line states the required function (as usual without binding it to a name, so don't copy it as is) using !! to index into the list, which makes the function 0-indexed.

There is no problem computing the 100th or 100,000th number.


问:
Produce the number 2014 without any numbers in your source code

Note to challenge writers as per meta consensus:
This question was well-received when it was posted, but challenges
like this, asking answerers to Do X without using
Y
are likely to be poorly received. Try using the
sandbox
to get feedback on if you want to post a similar challenge.

It's <s>2017</s> <s>2018</s> <s>2019</s> <s>2020</s> <s>2021</s> <s>2022</s> 2023 already, folks, go home.

So, now that it's 2014, it's time for a code question involving the number 2014.

Your task is to make a program that prints the number 2014, without using any of the characters 0123456789 in your code, and independently of any external variables such as the date or time or a random seed.

The shortest code (counting in bytes) to do so in any language in which numbers are valid tokens wins.

Leaderboard:

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

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

Leaderboard

	Author	Language	Size

Winners by Language

Language	User	Score

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

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

```

答:
The Shakespeare Programming Language, 219 bytes

I am using drsam94's compiler.

```<code>.
Ajax,.
Puck,.
Act I:
Scene I:
[Enter Ajax and Puck]
Ajax:
You is the difference between a fat fat fat fat fat fat fat fat fat fat fat cat and the sum of a fat fat fat fat fat cat and a fat cat!Open thy heart!
[Exeunt]
</code>```

Explanation

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

Everything from the first line to the first period is the title, parsed as a comment.

```<code>Ajax,.
Puck,.
</code>```

These are characters from Shakespeare's plays, and descriptions (also comments)

```<code>Act I:
Scene I:
</code>```

Act I and Scene I, used for gotos (not used here)

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

The character speaking.

```<code>You is the difference between
</code>```

Assigns the difference of the next two values to the character being spoken to.

```<code>a fat fat fat fat fat fat fat fat fat fat fat cat
</code>```

Every adjective multiplies by 2, a noun is either 1 or -1 depending on its connotation (in this case it's 1). 2^11 * 1 = 2048.

```<code>the sum of a fat fat fat fat fat cat and a fat cat
</code>```

The sum of the next two values. 32 + 2 = 34, so 2048 - 34 = 2014

```<code>Open thy heart!
</code>```

Prints the value of the character being spoken to as a number.

ContentLicense: CC BY-SA 4.0

Body:
The Shakespeare Programming Language, 219 bytes

I am using drsam94's compiler.

.
Ajax,.
Puck,.
Act I:
Scene I:
[Enter Ajax and Puck]
Ajax:
You is the difference between a fat fat fat fat fat fat fat fat fat fat fat cat and the sum of a fat fat fat fat fat cat and a fat cat!Open thy heart!
[Exeunt]

Explanation

.

Everything from the first line to the first period is the title, parsed as a comment.

Ajax,.
Puck,.

These are characters from Shakespeare's plays, and descriptions (also comments)

Act I:
Scene I:

Act I and Scene I, used for gotos (not used here)

Ajax:

The character speaking.

You is the difference between

Assigns the difference of the next two values to the character being spoken to.

a fat fat fat fat fat fat fat fat fat fat fat cat

Every adjective multiplies by 2, a noun is either 1 or -1 depending on its connotation (in this case it's 1). 2^11 * 1 = 2048.

the sum of a fat fat fat fat fat cat and a fat cat

The sum of the next two values. 32 + 2 = 34, so 2048 - 34 = 2014

Open thy heart!

Prints the value of the character being spoken to as a number.


答:
Racket 203 bytes

```<code>(let*((s(~r(/ a b)#:precision c))(sl(string-split s "."))(s2(list-ref sl 1))(n(string-length s2)))
(if(< n c)(begin(for((i(- c n)))(set! s2(string-append s2 "0")))(string-append(list-ref sl 0)"."s2))s))
</code>```

Ungolfed:

```<code>(define (f a b c)
  (let* ((s (~r(/ a b)#:precision c))
         (sl (string-split s "."))
         (s2 (list-ref sl 1))
         (n (string-length s2)))
    (if (< n c)
        (begin
          (for ((i (- c n)))
            (set! s2 (string-append s2 "0")))
          (string-append (list-ref sl 0) "." s2))
        s )))
</code>```

Usage:

```<code>(f 7 5 3)
(f 1 2 1)
(f 1 2 2)
(f 13 7 27)
</code>```

Output:

```<code>"1.400"
"0.5"
"0.50"
"1.857142857142857142857142857"
</code>```

Other method (not valid answer here):

```<code>(real->decimal-string(/ a b)c)
</code>```

Title: Division of not so little numbers

Body:
Racket 203 bytes

(let*((s(~r(/ a b)#:precision c))(sl(string-split s "."))(s2(list-ref sl 1))(n(string-length s2)))
(if(< n c)(begin(for((i(- c n)))(set! s2(string-append s2 "0")))(string-append(list-ref sl 0)"."s2))s))

Ungolfed:

(define (f a b c)
  (let* ((s (~r(/ a b)#:precision c))
         (sl (string-split s "."))
         (s2 (list-ref sl 1))
         (n (string-length s2)))
    (if (< n c)
        (begin
          (for ((i (- c n)))
            (set! s2 (string-append s2 "0")))
          (string-append (list-ref sl 0) "." s2))
        s )))

Usage:

(f 7 5 3)
(f 1 2 1)
(f 1 2 2)
(f 13 7 27)

Output:

"1.400"
"0.5"
"0.50"
"1.857142857142857142857142857"

Other method (not valid answer here):

(real->decimal-string(/ a b)c)


问:
Smallest palindrome divisible by the input
Given a positive integer N, output the smallest positive integer such that this number is a palindrome (i.e. is its own reverse) and is divisible by N.

The palindrome (i.e. the output) must not need a leading zero to be a palindrome, e.g. 080 is not the valid answer for 16.

The input will never be a multiple of 10, because of the previous reason.

Your program may take as much time as necessary, even if in practice it would be way too long to output the answer.

Inputs and outputs

You may take the input through STDIN, as a function argument, or anything similar.

You may print the output to STDOUT, return it from a function, or anything similar.

Inputs and outputs must be in the decimal base.

Test cases

```<code>N        Output
1        1
2        2
16       272
17       272
42       252
111      111
302      87278
1234     28382
</code>```

Scoring

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

答:
RProgN, 31 Bytes

```<code>►x=01¿1+]x*]''.S.\''.≡!}x*
</code>```

Explained

```<code>►x=01¿1+]x*]''.S.\''.≡!}x*  # ► Defines spaceless segment.
 x=                         # Define the input as x
   01                       # Push 0, 1 to the stack. 1 is used as a truthy for the while, 0 is our incrementing product.
     ¿                 }    # While the value on top of the stack (popped) is truthy.
      1+                    # Increment the product by one.
        ]x*                 # Duplicate the producter, multiply by the input.
           ]''.S.\''.≡!     # Check to see if the result is a palindrome.
           ]''.             # Push a duplicate of the multiplied number, convert to a string.
               S.           # Convert it to a stack and re-concatinate it. This reverses the string.
                 \''.≡!     # Flip the top two values, exposing the original product. Conver it to a string and test inverse equality.
                        x*  # Once the loop ends, the last number times the input will be a palindrome. Thus, do that.
</code>```

The equality sugar was only added after the discovery of this challenge, as was the bugfix that allowed strings to be used in spaceless segments.

Try it Online!

Body:
RProgN, 31 Bytes

►x=01¿1+]x*]''.S.\''.≡!}x*

Explained

►x=01¿1+]x*]''.S.\''.≡!}x*  # ► Defines spaceless segment.
 x=                         # Define the input as x
   01                       # Push 0, 1 to the stack. 1 is used as a truthy for the while, 0 is our incrementing product.
     ¿                 }    # While the value on top of the stack (popped) is truthy.
      1+                    # Increment the product by one.
        ]x*                 # Duplicate the producter, multiply by the input.
           ]''.S.\''.≡!     # Check to see if the result is a palindrome.
           ]''.             # Push a duplicate of the multiplied number, convert to a string.
               S.           # Convert it to a stack and re-concatinate it. This reverses the string.
                 \''.≡!     # Flip the top two values, exposing the original product. Conver it to a string and test inverse equality.
                        x*  # Once the loop ends, the last number times the input will be a palindrome. Thus, do that.

The equality sugar was only added after the discovery of this challenge, as was the bugfix that allowed strings to be used in spaceless segments.

Try it Online!


问:
Square, diamond, square, diamond

Task

Given a non-empty string of lowercase ASCII letters a-z, take its first character, and:

Surround it with a square of copies of the second character,

Surround that with a diamond of copies of the third character,

Surround that with a square of copies of the fourth character…

…alternating between square and diamond borders until the end of the string. Empty space between the borders should be represented by ASCII spaces ().

To add a square border, draw a square exactly around the entire current “working array”:

```<code>                                               sssssssssss
                                t              s    t    s
                               t t             s   t t   s
                              t   t            s  t   t  s
                             t aaa t           s t aaa t s
                            t  aca  t    =>    st  aca  ts
                             t aaa t           s t aaa t s
                              t   t            s  t   t  s
                               t t             s   t t   s
                                t              s    t    s
                                               sssssssssss
</code>```

To add a diamond border, draw a centered diamond shape that touches the outermost square diagonally, but not orthogonally:

```<code>                                                     s
                                                    s s
                                                   s   s
                                                  s     s
                                                 s       s
                                                s         s
                                               s           s
                    wwwwwwwwwww               s wwwwwwwwwww s
                    w    o    w              s  w    o    w  s
                    w   o o   w             s   w   o o   w   s
                    w  o   o  w            s    w  o   o  w    s
                    w o eee o w           s     w o eee o w     s
                    wo  eme  ow    =>    s      wo  eme  ow      s
                    w o eee o w           s     w o eee o w     s
                    w  o   o  w            s    w  o   o  w    s
                    w   o o   w             s   w   o o   w   s
                    w    o    w              s  w    o    w  s
                    wwwwwwwwwww               s wwwwwwwwwww s
                                               s           s
                                                s         s
                                                 s       s
                                                  s     s
                                                   s   s
                                                    s s
                                                     s
</code>```

Your program must output the final array.

Each line may contain any amount of trailing spaces.

You may output a list of strings representing lines, or a single newline-separated string with an optional trailing newline.

Leading/trailing blank lines are disallowed.

Leading columns of spaces are also disallowed.

This is code-golf. The shortest code in bytes wins.

Test cases

The above examples are expected outputs for cat, cats, meow, and meows, in reading order. Some other cases worth handling:

For the input a, your program should output:

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

For the input ab, your program should output:

```<code>bbb
bab
bbb
</code>```

For the input codegolf, your program should output:

```<code>fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
f                            l                            f
f                           l l                           f
f                          l   l                          f
f                         l     l                         f
f                        l       l                        f
f                       l         l                       f
f                      l           l                      f
f                     l             l                     f
f                    l               l                    f
f                   l                 l                   f
f                  l                   l                  f
f                 l                     l                 f
f                l                       l                f
f               l                         l               f
f              l                           l              f
f             l ooooooooooooooooooooooooooo l             f
f            l  o            g            o  l            f
f           l   o           g g           o   l           f
f          l    o          g   g          o    l          f
f         l     o         g     g         o     l         f
f        l      o        g       g        o      l        f
f       l       o       g         g       o       l       f
f      l        o      g           g      o        l      f
f     l         o     g eeeeeeeeeee g     o         l     f
f    l          o    g  e    d    e  g    o          l    f
f   l           o   g   e   d d   e   g   o           l   f
f  l            o  g    e  d   d  e    g  o            l  f
f l             o g     e d ooo d e     g o             l f
fl              og      ed  oco  de      go              lf
f l             o g     e d ooo d e     g o             l f
f  l            o  g    e  d   d  e    g  o            l  f
f   l           o   g   e   d d   e   g   o           l   f
f    l          o    g  e    d    e  g    o          l    f
f     l         o     g eeeeeeeeeee g     o         l     f
f      l        o      g           g      o        l      f
f       l       o       g         g       o       l       f
f        l      o        g       g        o      l        f
f         l     o         g     g         o     l         f
f          l    o          g   g          o    l          f
f           l   o           g g           o   l           f
f            l  o            g            o  l            f
f             l ooooooooooooooooooooooooooo l             f
f              l                           l              f
f               l                         l               f
f                l                       l                f
f                 l                     l                 f
f                  l                   l                  f
f                   l                 l                   f
f                    l               l                    f
f                     l             l                     f
f                      l           l                      f
f                       l         l                       f
f                        l       l                        f
f                         l     l                         f
f                          l   l                          f
f                           l l                           f
f                            l                            f
fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
</code>```

Reference implementation

I wrote some Julia code that your program’s output should match (at least visually). Try it online!

答:
Haskell, <s>138</s> <s>137</s> 136 bytes

q 1=0
q x=(mod x 2+1)*(q(x-1)+1)
f x|m<-q$length x,n<-abs<$>[-m..m]=[do j<-n;max" "[c|(k,c)<-zip[1..]x,cycle[max i j,i+j]!!k==q k]|i<-n]
```

Defines a function f which returns the result as a list of lines

-1 byte thanks to @Lynn

Title: Square, diamond, square, diamond

Body:
Haskell, <s>138</s> <s>137</s> 136 bytes

q 1=0
q x=(mod x 2+1)*(q(x-1)+1)
f x|m<-q$length x,n<-abs<$>[-m..m]=[do j<-n;max" "[c|(k,c)<-zip[1..]x,cycle[max i j,i+j]!!k==q k]|i<-n]

Defines a function f which returns the result as a list of lines

-1 byte thanks to @Lynn


问:
Universal Spooky Meme Translator

Introduction

Turns out, aliens love memes just as much as we do. Every alien race we've encountered so far has their own version of 2spooky4me (see the following question) and equivalent, though, with some variation. The inhabitants of planet CUTE1f can't handle a lot of spook, so their preferred spook is 1spooky2me, while skeletor7 memers love them some spook, so they tend to use 9spooky11me.

Challenge

Translating memes is hard work, so you've been tasked with writing a universal meme translator to help these guys access the memenet correctly. Your program will accept a meme and a transformation to apply to the digit sequences in that meme to make it appropriate for the inhabitants of a different planet.

Input

Your program will receive two string inputs:

The input meme (e.g. 2spooky4me). Matches [a-zA-Z0-9]+.

The transformation to apply to it (e.g. +1, to go from 2spooky4me to 3spooky5me). Matches [+\-*/^]\d+ (you must accept +, -, *, /, and ^ as operators, regardless of the native representation in your language).

Output

Your program must return a string output (printed to standard output or equivalent) with the given transformation applied to the digit sequences in the input meme. In a weird turn of events, it also turns out that all races encountered so far prefer integral memes over fractional ones, so these transformations should perform integer arithmetic (e.g. 1spooky1me /2 should result in 0spooky0me).

Examples

Standard arithmetic operations apply:

```<code>Input:  2spooky4me +1
Output: 3spooky5me

Input:  2spooky4me -1
Output: 1spooky3me

Input:  2spooky4me *15
Output: 30spooky60me

Input:  10spooky900me /5
Output: 2spooky180me
</code>```

Digit sequences are integral; integer truncation should occur in cases like this:

```<code>Input:  idontunderstandmemes3 /2
Output: idontunderstandmemes1
</code>```

Your input may not have any digit sequences:

```<code>Input:  notreallyafunnymeme *100
Output: notreallyafunnymeme
</code>```

You must support exponentiation, even if it is not a native operation in your language of choice:

```<code>Input:  2spooky4me ^3
Output: 8spooky64me
</code>```

There's no limit on string length of number of digit sequences in the string:

```<code>Input:  some1meme2sequences3can4be5really6long7 /2
Output: some0meme1sequences1can2be2really3long3
</code>```

Addendum

If your language supports arbitrary-precision integers as a language feature, you must use those. If it does not, you do not need to support arbitrary-precision integers. For example, you must use Integer in Haskell instead of Int because it's available as part of the language; in Java, you are not required to use BigInteger because it's a library feature, not a language feature.

```<code>Input:  2000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000spooky4me /2
Output: 1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000spooky2me
</code>```

This is code-golf, so standard loopholes are forbidden, and the shortest answer in bytes wins!

Leaderboard

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

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

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

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

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

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

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

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

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

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

Shortest Solution by Language

Language	User	Score

Leaderboard

	Author	Language	Size

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

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

```

答:
RProgN, 39 Bytes

```<code>►x='%d+'§x'%D+'''Rx'%d+'''Rg'y'=y_}R
</code>```

Explained

```<code>►x='%d+'§x'%D+'''Rx'%d+'''Rg'y'=y_}R
►                                       # Spaceless segment.
 x=                                     # Assign the top value of the stack '[+*/-]\d+'
   '$d+'§                         }R     # Replace everything in the pattern %d+ (all numbers) based on an anonymous function
         x'%D+'''R                      # Replace all Non-digits in the modifer with nothing, leaving just the second argument for the operator.
                  x'%d+'''R             # Snip all digits, separating our operator from our digits such that digit operator exists in the stack.
                           g'y'=        # Grab the function that is represented by the top of the stack (the operator in this case)
                                y       # Run it
                                 _      # Floor the result.
</code>```

Technically invalid answer, because this language did not exist for it. However, it was not specifically designed for it, nor any particular addition. So I'm running it. Sue me.

Try it Online!

Title: Universal Spooky Meme Translator

Body:
RProgN, 39 Bytes

►x='%d+'§x'%D+'''Rx'%d+'''Rg'y'=y_}R

Explained

►x='%d+'§x'%D+'''Rx'%d+'''Rg'y'=y_}R
►                                       # Spaceless segment.
 x=                                     # Assign the top value of the stack '[+*/-]\d+'
   '$d+'§                         }R     # Replace everything in the pattern %d+ (all numbers) based on an anonymous function
         x'%D+'''R                      # Replace all Non-digits in the modifer with nothing, leaving just the second argument for the operator.
                  x'%d+'''R             # Snip all digits, separating our operator from our digits such that digit operator exists in the stack.
                           g'y'=        # Grab the function that is represented by the top of the stack (the operator in this case)
                                y       # Run it
                                 _      # Floor the result.

Technically invalid answer, because this language did not exist for it. However, it was not specifically designed for it, nor any particular addition. So I'm running it. Sue me.

Try it Online!


答:
Perl 6, <s> 58 57 55 </s> 48 bytes

{(($^a.FatRat/$^b*10**$^c).Int.FatRat/10**$c).base(10,$c)}
```

<pre class="lang-perl6 prettyprint-override"><code>{(Int($^a.FatRat/$^b*10**$^c).FatRat/10**$c).base(10,$c)}
</code>```

{base Int($^a.FatRat/$^b*10**$^c).FatRat/10**$c: 10,$c}
```

<pre class="lang-perl6 prettyprint-override"><code>{base ($^a*10**$^c div$^b).FatRat/10**$c: 10,$c}
</code>```

What is fairly annoying is that it could be shortened to just {($^a.FatRat/$^b).base(10,$^c)} if it was allowed to round to the nearest value.

Explanation:

# bare block lambda with 3 placeholder parameters ｢$^a｣, ｢$^b｣ and ｢$^c｣
{
  (
    (

      # create an Int containing all of the digits we care about
      $^a * 10 ** $^c div $^b

    ).FatRat / 10**$c  # turn it into a Rational

  ).base( 10, $c )     # force it to display ｢$c｣ digits after the decimal point
}
```

Title: Division of not so little numbers

Body:
Perl 6, <s> 58 57 55 </s> 48 bytes

{(($^a.FatRat/$^b*10**$^c).Int.FatRat/10**$c).base(10,$c)}

{(Int($^a.FatRat/$^b*10**$^c).FatRat/10**$c).base(10,$c)}

{base Int($^a.FatRat/$^b*10**$^c).FatRat/10**$c: 10,$c}

{base ($^a*10**$^c div$^b).FatRat/10**$c: 10,$c}

What is fairly annoying is that it could be shortened to just {($^a.FatRat/$^b).base(10,$^c)} if it was allowed to round to the nearest value.

Explanation:

# bare block lambda with 3 placeholder parameters ｢$^a｣, ｢$^b｣ and ｢$^c｣
{
  (
    (

      # create an Int containing all of the digits we care about
      $^a * 10 ** $^c div $^b

    ).FatRat / 10**$c  # turn it into a Rational

  ).base( 10, $c )     # force it to display ｢$c｣ digits after the decimal point
}


问:
1, 2, Fizz, 4, Buzz

Introduction

In our recent effort to collect catalogues of shortest solutions for standard programming exercises, here is PPCG's first ever vanilla FizzBuzz challenge. If you wish to see other catalogue challenges, there is "Hello World!" and "Is this number a prime?".

Challenge

Write a program that prints the decimal numbers from 1 to 100 inclusive. But for multiples of three print “Fizz” instead of the number and for the multiples of five print “Buzz”. For numbers which are multiples of both three and five print “FizzBuzz”.

Output

The output will be a list of numbers (and Fizzes, Buzzes and FizzBuzzes) separated by a newline (either \n or \r\n). A trailing newline is acceptable, but a leading newline is not.  Apart from your choice of newline, the output should look exactly like this:

```<code>1
2
Fizz
4
Buzz
Fizz
7
8
Fizz
Buzz
11
Fizz
13
14
FizzBuzz
16
17
Fizz
19
Buzz
Fizz
22
23
Fizz
Buzz
26
Fizz
28
29
FizzBuzz
31
32
Fizz
34
Buzz
Fizz
37
38
Fizz
Buzz
41
Fizz
43
44
FizzBuzz
46
47
Fizz
49
Buzz
Fizz
52
53
Fizz
Buzz
56
Fizz
58
59
FizzBuzz
61
62
Fizz
64
Buzz
Fizz
67
68
Fizz
Buzz
71
Fizz
73
74
FizzBuzz
76
77
Fizz
79
Buzz
Fizz
82
83
Fizz
Buzz
86
Fizz
88
89
FizzBuzz
91
92
Fizz
94
Buzz
Fizz
97
98
Fizz
Buzz
</code>```

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

Further Rules

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

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

Nothing can be printed to STDERR.

Feel free to use a language (or language version) even if it's newer than this challenge. If anyone wants to abuse this by creating a language where the empty program generates FizzBuzz output, then congrats for paving the way for a very boring answer.

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

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

Because the output is fixed, you may hardcode the output (but this may not be the shortest option).

You may use preexisting solutions, as long as you credit the original author of the program.

Standard loopholes are otherwise disallowed.

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.

Catalogue

var QUESTION_ID=58615;var ANSWER_FILTER="!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe";var COMMENT_FILTER="!)Q2B_A2kjfAiU78X(md6BoYk";var OVERRIDE_USER=30525;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.toLowerCase(),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>b.lang_raw)return 1;if(a.lang_raw<b.lang_raw)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:700}table td{padding:5px}</code>```

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

Shortest Solution by Language

Language	User	Score

Leaderboard

	Author	Language	Size

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

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

```

答:
Vim, 44 bytes

33o<CR>Fizz<CR><Esc>qqABuzz<Esc>5kq19@q:%s/^$/\=line('.')<CR>

On vimgolf.com we have the classic Remember FizzBuzz?, which is similar to this, but keeps the numbers on all the lines. There's also Neither Fizz nor Buzz, which uses a similar format, but provides a useful input file. Those small differences drastically change the optimal solution. I did exactly this same variation 2 years ago in the edit to this reddit post. I had to check whether visual increment (not available back then) creates an improvement, like it has for the other variations, but it looks like it hasn't.

33o<CR>Fizz<CR><Esc>: Create the Fizz lines AND the blank lines with a simple insert mode repeat. Much quicker than a macro. AFAIK first discovered by @KersonHsiao in the vimgolf.com version, and used by every top solution since.

qqABuzz<Esc>5kq19@q: A very simple macro appends the Buzzes.

:%s/^$/\=line('.')<CR>: Replaces all blank lines with that line's line number. The expression replacement is very long, so this tactic is rarely used in vimgolf, but the alternatives are all worse.

Title: 1, 2, Fizz, 4, Buzz


Title: Square, diamond, square, diamond

Body:
Task

Given a non-empty string of lowercase ASCII letters a-z, take its first character, and:

Surround it with a square of copies of the second character,

Surround that with a diamond of copies of the third character,

Surround that with a square of copies of the fourth character…

…alternating between square and diamond borders until the end of the string. Empty space between the borders should be represented by ASCII spaces ().

To add a square border, draw a square exactly around the entire current “working array”:

```<code>                                               sssssssssss
                                t              s    t    s
                               t t             s   t t   s
                              t   t            s  t   t  s
                             t aaa t           s t aaa t s
                            t  aca  t    =>    st  aca  ts
                             t aaa t           s t aaa t s
                              t   t            s  t   t  s
                               t t             s   t t   s
                                t              s    t    s
                                               sssssssssss
</code>```

To add a diamond border, draw a centered diamond shape that touches the outermost square diagonally, but not orthogonally:

```<code>                                                     s
                                                    s s
                                                   s   s
                                                  s     s
                                                 s       s
                                                s         s
                                               s           s
                    wwwwwwwwwww               s wwwwwwwwwww s
                    w    o    w              s  w    o    w  s
                    w   o o   w             s   w   o o   w   s
                    w  o   o  w            s    w  o   o  w    s
                    w o eee o w           s     w o eee o w     s
                    wo  eme  ow    =>    s      wo  eme  ow      s
                    w o eee o w           s     w o eee o w     s
                    w  o   o  w            s    w  o   o  w    s
                    w   o o   w             s   w   o o   w   s
                    w    o    w              s  w    o    w  s
                    wwwwwwwwwww               s wwwwwwwwwww s
                                               s           s
                                                s         s
                                                 s       s
                                                  s     s
                                                   s   s
                                                    s s
                                                     s
</code>```

Your program must output the final array.

Each line may contain any amount of trailing spaces.

You may output a list of strings representing lines, or a single newline-separated string with an optional trailing newline.

Leading/trailing blank lines are disallowed.

Leading columns of spaces are also disallowed.

This is code-golf. The shortest code in bytes wins.

Test cases

The above examples are expected outputs for cat, cats, meow, and meows, in reading order. Some other cases worth handling:

For the input a, your program should output:

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

For the input ab, your program should output:

```<code>bbb
bab
bbb
</code>```

For the input codegolf, your program should output:

```<code>fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
f                            l                            f
f                           l l                           f
f                          l   l                          f
f                         l     l                         f
f                        l       l                        f
f                       l         l                       f
f                      l           l                      f
f                     l             l                     f
f                    l               l                    f
f                   l                 l                   f
f                  l                   l                  f
f                 l                     l                 f
f                l                       l                f
f               l                         l               f
f              l                           l              f
f             l ooooooooooooooooooooooooooo l             f
f            l  o            g            o  l            f
f           l   o           g g           o   l           f
f          l    o          g   g          o    l          f
f         l     o         g     g         o     l         f
f        l      o        g       g        o      l        f
f       l       o       g         g       o       l       f
f      l        o      g           g      o        l      f
f     l         o     g eeeeeeeeeee g     o         l     f
f    l          o    g  e    d    e  g    o          l    f
f   l           o   g   e   d d   e   g   o           l   f
f  l            o  g    e  d   d  e    g  o            l  f
f l             o g     e d ooo d e     g o             l f
fl              og      ed  oco  de      go              lf
f l             o g     e d ooo d e     g o             l f
f  l            o  g    e  d   d  e    g  o            l  f
f   l           o   g   e   d d   e   g   o           l   f
f    l          o    g  e    d    e  g    o          l    f
f     l         o     g eeeeeeeeeee g     o         l     f
f      l        o      g           g      o        l      f
f       l       o       g         g       o       l       f
f        l      o        g       g        o      l        f
f         l     o         g     g         o     l         f
f          l    o          g   g          o    l          f
f           l   o           g g           o   l           f
f            l  o            g            o  l            f
f             l ooooooooooooooooooooooooooo l             f
f              l                           l              f
f               l                         l               f
f                l                       l                f
f                 l                     l                 f
f                  l                   l                  f
f                   l                 l                   f
f                    l               l                    f
f                     l             l                     f
f                      l           l                      f
f                       l         l                       f
f                        l       l                        f
f                         l     l                         f
f                          l   l                          f
f                           l l                           f
f                            l                            f
fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
</code>```

Reference implementation

I wrote some Julia code that your program’s output should match (at least visually). Try it online!

Body:
Mathematica, 167 bytes

Grid@Fold[g=Normal@SparseArray[h=f;a_List/;Plus@@Abs[a-#-1]==#->#3,2{#,#}+1]+a[#2,#/2+1]&[Length@#+1,#,#2]&;h=f=(h=g;a=ArrayPad)[#,1,#2]&;h@##&,{{#}},{##2}]/.Rule[0,]&

The input must be a list of characters.

e.g.

Grid@Fold[ ... ]/.Rule[0,]&["i","n","p","u","t"]


问:
EvenSt-ring C ode - g ol!f
An 'Even string' is any string where the parity of the ASCII values of the characters is always alternating. For example, the string EvenSt-ring$! is an even-string because the ASCII values of the characters are:

```<code>69 118 101 110 83 116 45 114 105 110 103 36 33
</code>```

And the parities of these numbers are:

```<code>Odd Even Odd Even Odd Even Odd Even Odd Even Odd Even Odd
</code>```

Which is alternating the whole way. However, a string like Hello world! is not an even string because the ASCII values are:

```<code>72 101 108 108 111 32 87 111 114 108 100 33
</code>```

And the parities are:

```<code>Even Odd Even Even Odd Even Odd Odd Even Even Even Odd
</code>```

Which is clearly not always alternating.

The challenge

You must write either a full program or a function that accepts a string for input and outputs a truthy value if the string is even, and a falsy value otherwise. You can take your input and output in any reasonable format, and you can assume that the input will only have printable ASCII (the 32-127 range). You do not have to handle empty input.

Examples

Here are some examples of even strings:

```<code>#define
EvenSt-ring$!
long
abcdABCD
3.141
~
0123456789
C ode - g ol!f
HatchingLobstersVexinglyPopulateJuvenileFoxglove
</code>```

And all of these examples are not even strings:

```<code>Hello World
PPCG
3.1415
babbage
Code-golf
Standard loopholes apply
Shortest answer in bytes wins
Happy golfing!
</code>```

You may also use this ungolfed solution to test any strings if you're curious about a certain test-case.

答:
Pyth (fork), 9 bytes

```<code>.A%R2.+CM
</code>```

No Try It Online link because the fork does not have its own version in the online interpreters.

Explanation:

```<code>       CM       Map characters to their ASCII codes.
     .+         Get deltas (differences between consecutive character codes)
  %R2           Take the modulo of each base 2
.A              all are truthy (all deltas are odd)
</code>```

Title: EvenSt-ring C ode - g ol!f

Body:
Pyth (fork), 9 bytes

.A%R2.+CM

No Try It Online link because the fork does not have its own version in the online interpreters.

Explanation:

       CM       Map characters to their ASCII codes.
     .+         Get deltas (differences between consecutive character codes)
  %R2           Take the modulo of each base 2
.A              all are truthy (all deltas are odd)


答:
Jelly, <s>7</s> <s>5</s> 4 bytes

```<code>OIḂẠ
</code>```

Saved 2 bytes using the deltas idea from @Steven H.

Saved 1 byte thanks to @Lynn.

Try it online! or Verify all test cases.

Explanation

```<code>OIḂẠ  Input: string S
O     Ordinal
 I    Increments
  Ḃ   Mod 2
   Ạ  All, 0 if it contains a falsey value, else 1
</code>```

Title: EvenSt-ring C ode - g ol!f

Body:
An 'Even string' is any string where the parity of the ASCII values of the characters is always alternating. For example, the string EvenSt-ring$! is an even-string because the ASCII values of the characters are:

```<code>69 118 101 110 83 116 45 114 105 110 103 36 33
</code>```

And the parities of these numbers are:

```<code>Odd Even Odd Even Odd Even Odd Even Odd Even Odd Even Odd
</code>```

Which is alternating the whole way. However, a string like Hello world! is not an even string because the ASCII values are:

```<code>72 101 108 108 111 32 87 111 114 108 100 33
</code>```

And the parities are:

```<code>Even Odd Even Even Odd Even Odd Odd Even Even Even Odd
</code>```

Which is clearly not always alternating.

The challenge

You must write either a full program or a function that accepts a string for input and outputs a truthy value if the string is even, and a falsy value otherwise. You can take your input and output in any reasonable format, and you can assume that the input will only have printable ASCII (the 32-127 range). You do not have to handle empty input.

Examples

Here are some examples of even strings:

```<code>#define
EvenSt-ring$!
long
abcdABCD
3.141
~
0123456789
C ode - g ol!f
HatchingLobstersVexinglyPopulateJuvenileFoxglove
</code>```

And all of these examples are not even strings:

```<code>Hello World
PPCG
3.1415
babbage
Code-golf
Standard loopholes apply
Shortest answer in bytes wins
Happy golfing!
</code>```

You may also use this ungolfed solution to test any strings if you're curious about a certain test-case.

Body:
Jelly, <s>7</s> <s>5</s> 4 bytes

OIḂẠ

Saved 2 bytes using the deltas idea from @Steven H.

Saved 1 byte thanks to @Lynn.

Try it online! or Verify all test cases.

Explanation

OIḂẠ  Input: string S
O     Ordinal
 I    Increments
  Ḃ   Mod 2
   Ạ  All, 0 if it contains a falsey value, else 1


答:
Mathematica, <s>50</s> 44 bytes

The current version is basically all Martin Ender's virtuosity.

```<code>Differences@ToCharacterCode@#~Mod~2~FreeQ~0&
</code>```

Returns True or False. Nothing too clever: takes the mod-2 sum of each pair of consecutive ASCII codes, and checks that 0 is never obtained.

Old version:

```<code>Union@Mod[Most[a=ToCharacterCode@#]+Rest@a,2]=={1}&
</code>```

Title: EvenSt-ring C ode - g ol!f

Body:
Mathematica, <s>50</s> 44 bytes

The current version is basically all Martin Ender's virtuosity.

Differences@ToCharacterCode@#~Mod~2~FreeQ~0&

Returns True or False. Nothing too clever: takes the mod-2 sum of each pair of consecutive ASCII codes, and checks that 0 is never obtained.

Old version:

Union@Mod[Most[a=ToCharacterCode@#]+Rest@a,2]=={1}&


答:
J, 15 bytes

```<code>0=1#.2=/\2|3&u:
</code>```

Usage

```<code>   f =: 0=1#.2=/\2|3&u:
   f 'C ode - g ol!f'
1
   f 'Code-golf'
0
</code>```

Explanation

```<code>0=1#.2=/\2|3&u:  Input: string S
           3&u:  Get ordinals of each char
         2|      Take each modulo 2
     2  \        For each pair of values
      =/           Test if they are equal, 1 if true else 0
  1#.            Treat the list of integers as base 1 digits and convert to decimal
                 This is equivalent to taking the sum
0=               Is it equal to 0, 1 if true else 0, and return
</code>```

Title: EvenSt-ring C ode - g ol!f

Body:
J, 15 bytes

0=1#.2=/\2|3&u:

Usage

   f =: 0=1#.2=/\2|3&u:
   f 'C ode - g ol!f'
1
   f 'Code-golf'
0

Explanation

0=1#.2=/\2|3&u:  Input: string S
           3&u:  Get ordinals of each char
         2|      Take each modulo 2
     2  \        For each pair of values
      =/           Test if they are equal, 1 if true else 0
  1#.            Treat the list of integers as base 1 digits and convert to decimal
                 This is equivalent to taking the sum
0=               Is it equal to 0, 1 if true else 0, and return


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

Saved 1 byte thanks to Adnan.

```<code>Ç¥ÉP
</code>```

Try it online!

Explanation

```<code>Ç       # convert to ascii values
 ¥      # compute delta's
  É     # mod by 2
   P    # product
</code>```

Title: EvenSt-ring C ode - g ol!f

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

Saved 1 byte thanks to Adnan.

Ç¥ÉP

Try it online!

Explanation

Ç       # convert to ascii values
 ¥      # compute delta's
  É     # mod by 2
   P    # product


答:
Brachylog, 17 bytes

```<code>@c:{:2%}a@b:{l1}a
</code>```

Try it online!

Explanation

```<code>@c                   Input to a list of char codes
  :{:2%}a            Apply X mod 2 for each X in the list of char codes
         @b          Split the list into a list of lists where each sublist elements are the
                       same, e.g. turn [1,0,1,1,0,0] into [[1],[0],[1,1],[0,0]]
           :{l1}a    The length of each sublist must be 1
</code>```

Title: EvenSt-ring C ode - g ol!f

Body:
Brachylog, 17 bytes

@c:{:2%}a@b:{l1}a

Try it online!

Explanation

@c                   Input to a list of char codes
  :{:2%}a            Apply X mod 2 for each X in the list of char codes
         @b          Split the list into a list of lists where each sublist elements are the
                       same, e.g. turn [1,0,1,1,0,0] into [[1],[0],[1,1],[0,0]]
           :{l1}a    The length of each sublist must be 1


答:
R, 41 35 bytes

EDIT:
Saved a few bytes thanks to @JDL by using diff instead of rle.

```<code>all(diff(utf8ToInt(readline())%%2))
</code>```

```<code>all(rle(utf8ToInt(readline())%%2)[[1]]<2)
</code>```

Explanation

readline() read input.

utf8ToInt()%%2 convert to ascii values and mod 2 (store as R-vector)

all(rle()==1) run length encoding of to find runs. All runs should be equal to one or smaller than 2 since no runs cant be negative or 0 (saves one byte instead of ==).

Title: EvenSt-ring C ode - g ol!f

Body:
R, 41 35 bytes

EDIT:
Saved a few bytes thanks to @JDL by using diff instead of rle.

all(diff(utf8ToInt(readline())%%2))

all(rle(utf8ToInt(readline())%%2)[[1]]<2)

Explanation

readline() read input.

utf8ToInt()%%2 convert to ascii values and mod 2 (store as R-vector)

all(rle()==1) run length encoding of to find runs. All runs should be equal to one or smaller than 2 since no runs cant be negative or 0 (saves one byte instead of ==).


答:
Vim, 38 bytes

qqs<C-R>=char2nr(@")%2<CR><Esc>l@qq@q:g/00\|11/d<CR>

Assumes input string in buffer, and empty "q. Outputs binary nonsense if true, nothing if false.

s<C-R>=char2nr(@")%2<CR>: Replaces a character with 1 if odd, 0 if even. The macro this is in just does this to every character in the line (no matter how long it is).

:g/00\|11/d<CR>: Deletes the line if 2 consecutive "bits" have the same value. Faster than a back-reference.

Normally, in vimgolf, when you use an expression function inside a macro, you're supposed to do the macro itself on the expression register and use some trickery to tab-complete. That's more difficult this time. I may find a way to shorten that later.

Title: EvenSt-ring C ode - g ol!f


答:
JavaScript (ES6), <s>60</s> <s>50</s> 46 bytes

```<code>s=>[...s].every(c=>p-(p=c.charCodeAt()%2),p=2)
</code>```

I tried recursion, but at 51 bytes, it doesn't seem to be quite worth it:

```<code>f=([c,...s],p=2)=>c?p-(p=c.charCodeAt()%2)&f(s,p):1
</code>```

Test snippet

f=s=>[...s].every(c=>p-(p=c.charCodeAt()%2),p=2)```
<pre class="snippet-code-html lang-html prettyprint-override"><code><input id=I value="Evenst-ring"><button onclick="console.log(f(I.value))">Run</button></code>```

Title: EvenSt-ring C ode - g ol!f

Body:
JavaScript (ES6), <s>60</s> <s>50</s> 46 bytes

s=>[...s].every(c=>p-(p=c.charCodeAt()%2),p=2)

I tried recursion, but at 51 bytes, it doesn't seem to be quite worth it:

f=([c,...s],p=2)=>c?p-(p=c.charCodeAt()%2)&f(s,p):1

Test snippet

f=s=>[...s].every(c=>p-(p=c.charCodeAt()%2),p=2)

<input id=I value="Evenst-ring"><button onclick="console.log(f(I.value))">Run</button>


答:
Python 2, 54 Bytes

lambda s:all((ord(x)-ord(y))%2for x,y in zip(s,s[1:]))
```

Title: EvenSt-ring C ode - g ol!f


答:
Perl, 24 + 1 (-p) = 25 bytes

-4 bytes thanks to @Ton Hospel !

s/./$&&v1/eg;$_=!/(.)\1/
```
<p>Needs <code>-p</code> flag. Outputs 1 is the string is even, nothing otherwise. For instance :</p>
```perl -pe 's/./$&&v1/eg;$_=!/(.)\1/' <<< "#define
Hello World"
```

Explanations : replaces each character by its value mod 2 (so the string contains only 0s and 1s after that). Then search for two following 1 or 0 : if it finds some, then the string isn't even, otherwise it is.

Title: EvenSt-ring C ode - g ol!f

Body:
Perl, 24 + 1 (-p) = 25 bytes

-4 bytes thanks to @Ton Hospel !

s/./$&&v1/eg;$_=!/(.)\1/

Needs -p flag. Outputs 1 is the string is even, nothing otherwise. For instance :

perl -pe 's/./$&&v1/eg;$_=!/(.)\1/' <<< "#define
Hello World"

Explanations : replaces each character by its value mod 2 (so the string contains only 0s and 1s after that). Then search for two following 1 or 0 : if it finds some, then the string isn't even, otherwise it is.


答:
05AB1E, <s>17 13 11 19</s> 14 bytes

Input in the form b, a, c.

Saved 5 bytes thanks to Grimy.

```<code>‰`¹+I°*¹÷¦'.sJ
</code>```

Try it online!

Title: Division of not so little numbers

Body:
Write a program or function that takes in positive integers a, b and c, and prints or returns a/b to c decimal places, using the operations +-*/% [add, subtract, multiply, divide, modulate] on the positive integers: you can use all that your language allows, but not on floating point numbers. The range of a,b,c would be the range allowed for unsigned integers in your language.
The number result will be truncated to the last digit to print (so no round).

This means that if your language does not have an integer type (only float), you can participate by using these float numbers as positive integers only.
The clue of this exercise it would be to write the function that find the
digits in a float point division, using only the operation +-*/%  on
[unsigned] integers.

Examples

print(1,2,1) would print 0.5

print(1,2,2) would print 0.50

print(13,7,27) would print 1.857142857142857142857142857

print(2,3,1) would print 0.6

print(4,5,7) would print 0.8000000

print(4,5,1) would print 0.8

print(9999,23,1) would print 434.7

print(12345613,2321,89) would print if your Language has 32 bit unsigned 5319.09220163722533390779836277466609220163722533390779836277466609220163722533390779836277466

The shortest code in bytes wins. I'm sorry if this appear not clear... I don't know languages too, not remember words well...
It is better to have one link to Ideone.com or some other place for easily try the answer especially for to test some input different from proposed.

Body:
05AB1E, <s>17 13 11 19</s> 14 bytes

Input in the form b, a, c.

Saved 5 bytes thanks to Grimy.

‰`¹+I°*¹÷¦'.sJ

Try it online!


问:
Draw an ASCII chess board!
Here is a simple challenge for you: You must produce this ASCII representation of a chess board. White is represented by uppercase characters, and black is represented by lowercase. Empty tiles are represented by a .. Here is the full board:

```<code>rnbqkbnr
pppppppp
........
........
........
........
PPPPPPPP
RNBQKBNR
</code>```

Since this is a kolmogorov-complexity question, you may not take any input and you must output this board by any default method, for example, saving a file, printing to STDOUT or returning from a function. You may optionally produce one trailing newline. Standard loopholes apply, and the shortest program in bytes!

However, remember this is equally as much a competition between submissions in the same language. While it's unlikely that a languages like Java could beat a language like perl, or a golfing language like pyth or cjam, having the shortest Java answer is still really impressive! To help you track the shortest answer in each language, you may use this leaderboard, which will show the shortest submission by language and overall.

Leaderboards

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>```

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

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

Leaderboard

	Author	Language	Size

Winners by Language

Language	User	Score

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

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

```

答:
C, 87 bytes

```<code>#define E "........\n"
main(){puts("rnbqkbnr\npppppppp\n"E E E E"PPPPPPPP\nRNBQKBNR");}
</code>```

This uses preprocessor and string literal joining. Sorry, Matthew Greci and CSM, I don't have any reputation here to comment on your solution

Title: Draw an ASCII chess board!

Body:
C, 87 bytes

#define E "........\n"
main(){puts("rnbqkbnr\npppppppp\n"E E E E"PPPPPPPP\nRNBQKBNR");}

This uses preprocessor and string literal joining. Sorry, Matthew Greci and CSM, I don't have any reputation here to comment on your solution


答:
C#, 69 bytes

```<code>s=>{int i=1,e=0;for(;i<s.Length;)e+=(s[i-1]+s[i++]+1)%2;return e<1;};
</code>```

Full program with test cases:

```<code>using System;

namespace EvenStrings
{
    class Program
    {
        static void Main(string[] args)
        {
            Func<string,bool>f= s=>{int i=1,e=0;for(;i<s.Length;)e+=(s[i-1]+s[i++]+1)%2;return e<1;};

            Console.WriteLine(f("lno")); //false

            //true:
            Console.WriteLine(f("#define"));
            Console.WriteLine(f("EvenSt-ring$!"));
            Console.WriteLine(f("long"));
            Console.WriteLine(f("abcdABCD"));
            Console.WriteLine(f("3.141"));
            Console.WriteLine(f("~"));
            Console.WriteLine(f("0123456789"));
            Console.WriteLine(f("C ode - g ol!f"));
            Console.WriteLine(f("HatchingLobstersVexinglyPopulateJuvenileFoxglove"));

            //false:
            Console.WriteLine(f("Hello World"));
            Console.WriteLine(f("PPCG"));
            Console.WriteLine(f("3.1415"));
            Console.WriteLine(f("babbage"));
            Console.WriteLine(f("Code-golf"));
            Console.WriteLine(f("Standard loopholes apply"));
            Console.WriteLine(f("Shortest answer in bytes wins"));
            Console.WriteLine(f("Happy golfing!"));
        }
    }
}
</code>```

Title: EvenSt-ring C ode - g ol!f

Body:
C#, 69 bytes

s=>{int i=1,e=0;for(;i<s.Length;)e+=(s[i-1]+s[i++]+1)%2;return e<1;};

Full program with test cases:

using System;

namespace EvenStrings
{
    class Program
    {
        static void Main(string[] args)
        {
            Func<string,bool>f= s=>{int i=1,e=0;for(;i<s.Length;)e+=(s[i-1]+s[i++]+1)%2;return e<1;};

            Console.WriteLine(f("lno")); //false

            //true:
            Console.WriteLine(f("#define"));
            Console.WriteLine(f("EvenSt-ring$!"));
            Console.WriteLine(f("long"));
            Console.WriteLine(f("abcdABCD"));
            Console.WriteLine(f("3.141"));
            Console.WriteLine(f("~"));
            Console.WriteLine(f("0123456789"));
            Console.WriteLine(f("C ode - g ol!f"));
            Console.WriteLine(f("HatchingLobstersVexinglyPopulateJuvenileFoxglove"));

            //false:
            Console.WriteLine(f("Hello World"));
            Console.WriteLine(f("PPCG"));
            Console.WriteLine(f("3.1415"));
            Console.WriteLine(f("babbage"));
            Console.WriteLine(f("Code-golf"));
            Console.WriteLine(f("Standard loopholes apply"));
            Console.WriteLine(f("Shortest answer in bytes wins"));
            Console.WriteLine(f("Happy golfing!"));
        }
    }
}


Title: Division of not so little numbers

Body:
Java 7, 105 bytes

import java.math.*;String c(int...a){return new BigDecimal(a[0]).divide(new BigDecimal(a[1]),a[2],3)+"";}

Ungolfed & test code:

Try it here.

import java.math.*;
class M{
  static String c(int... a){
    return new BigDecimal(a[0]).divide(new BigDecimal(a[1]), a[2], 3)+"";
  }

  public static void main(String[] a){
    System.out.println(c(1, 2, 1));
    System.out.println(c(1, 2, 2));
    System.out.println(c(13, 7, 27));
    System.out.println(c(2, 3, 1));
    System.out.println(c(4, 5, 7));
    System.out.println(c(4, 5, 0));
    System.out.println(c(9999, 23, 0));
    System.out.println(c(12345613, 2321, 89));
  }
}

Output:

0.5
0.50
1.857142857142857142857142857
0.6
0.8000000
0
434
5319.09220163722533390779836277466609220163722533390779836277466609220163722533390779836277466


答:
Java 8, <s>77</s> <s>76</s> <s>72</s> 57 bytes

a->{int i=2,b=1;for(int c:a)b=i==(i=c%2)?0:b;return b>0;}
```
<p>-4 bytes thanks to <em>@Geobits</em>.</p>
<p><strong>Explanation:</strong></p>
<p>Try it online.</p>
<pre class="lang-java prettyprint-override"><code>a->{               // Method with character-array parameter and boolean return-type
  int i=2,         //  Integer `i`, starting at any integer not 0 or 1
      b=1;         //  Flag-integer `b`, starting at 1
  for(int c:a)     //  Loop over the input-array
    b=i==(i=c%2)?  //   If two adjacent characters were both odd or even:
       0           //    Set the flag-integer `b` to 0
      :            //   Else:
       b;          //    The flag-integer `b` remains the same
  return b>0;}     //  Return if the flag-integer `b` is still 1
</code>```

Title: EvenSt-ring C ode - g ol!f

Body:
Java 8, <s>77</s> <s>76</s> <s>72</s> 57 bytes

a->{int i=2,b=1;for(int c:a)b=i==(i=c%2)?0:b;return b>0;}

-4 bytes thanks to @Geobits.

Explanation:

<a href="https://tio.run/##nZTfb9MwEMff@1dcC0iJWLK22/jRKEMjY1SITZWK4AHxcHacxMPzRbbTLZrKv16cbm8DJPxi6ez7fO9O95WvcYMJtUJflz93XKG1cIlS348ApHbCVMgFXA0hACNSAjXwiDdovv8AjDP/sB35wzp0ksMVaMhhh8npvcdB5vMDls@yikw0xHyBMctlnkcy5y/m8bvpgmVGuM5oYKfTbLvLBrG2Y8qLPWpuSJZw45uK1s5IXe8LP3R0eAhfTOeafrEP17114ialzqWtz3SRTnk0eVaKSmoxSR0Vvu8zY7CP4hhewuRgsp/gb@SHjdBrlwxFn48DeEW6DsCQ8fLsfXEegB6ls@NZAPcrgJnO5kfHJ69ev3kbABdApYAEaiA1rv5LQOkHiSU63vjVfCbmE4z9Ku58pPoVtZ1CJz51fn1SiQu6qxVtnhjgUd576AKVFf/00FIoRfCNjCoDhl2tio@hyzwJABkyhnWI4wu/laQmVQWwa4e6RFOCImob/1VYwLZVfYhUQ8YJ6wC1vRXGf0XAen8Bt1LbAL2lb6SHYS7vkPEfjbAdbXe/AQ" rel="noreferrer">Try it online.

a->{               // Method with character-array parameter and boolean return-type
  int i=2,         //  Integer `i`, starting at any integer not 0 or 1
      b=1;         //  Flag-integer `b`, starting at 1
  for(int c:a)     //  Loop over the input-array
    b=i==(i=c%2)?  //   If two adjacent characters were both odd or even:
       0           //    Set the flag-integer `b` to 0
      :            //   Else:
       b;          //    The flag-integer `b` remains the same
  return b>0;}     //  Return if the flag-integer `b` is still 1


答:
Retina, 39 bytes

Byte count assumes ISO 8859-1 encoding.

```<code>S_`
%{2`
$`
}T01`p`_p
..

Mm`.¶.|^¶$
^0
</code>```

Outputs 1 for truthy and 0 for falsy.

Try it online! (The first line enables a linefeed-separated test suite.)

Explanation

Inspired by a answer of mbomb007's I recently developed a reasonably short ord() implementation in Retina. This is largely based on that, although I was able to make a few simplifications since I don't need a decimal result in since I only need to support printable ASCII (and I only care about the parity of the result, so ending up with an arbitrary offset is fine, too).

Stage 1: Split

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

This simply splits the input into its individual characters by splitting it around the empty match and dropping the empty results at the beginning and end with _.

Stage 2: Replace

```<code>%{2`
$`
</code>```

The %{ tells Retina a) that this stage and the next should be run in a loop until the string stops changing through a full iteration, and that these two stages should be applied to each line (i.e each character) of the input separately.

The stage itself is the standard technique for duplicating the first character of the input. We match the empty string (but only look at the first two matches) and insert the prefix of that match. The prefix of the first match (at the beginning of the string) is empty, so this doesn't do anything, and the prefix of the second match is the first character, which is therefore duplicated.

Stage 3: Transliterate

```<code>}T01`p`_o
</code>```

} indicates the end of the loop. The stage itself is a transliteration. 01 indicates that it should only be applied to the first character of the string. p is shorthand for all printable ASCII characters and _ means "delete". So if we expand this, the transliteration does the following transformation:

```<code>from:   !"#$%...
to:    _ !"#$...
</code>```

So spaces are deleted and all other characters are decremented. That means, these two stages together will create a character range from space to the given character (because they'll repeatedly duplicate and decrement the first character until it becomes a space at which point the duplication and deletion cancel).

The length of this range can be used to determine the parity of the character.

Stage 4: Replace

```<code>..

</code>```

We simply drop all pairs of characters. This clears even-length lines and reduces odd-length lines to a single character (the input character, in fact, but that doesn't really matter).

Stage 5: Match

```<code>Mm`.¶.|^¶$
</code>```

It's easier to find inputs which aren't even, so we count the number of matches of either two successive empty lines or two successive non-empty lines. We should get 0 for even inputs and something non-zero otherwise.

Stage 6: Match

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

All that's left is to invert the result, which we do by counting the number of matches of this regex, which checks that the input starts with a 0. This is only possible if the result of the first stage was 0.

Title: EvenSt-ring C ode - g ol!f

Body:
Retina, 39 bytes

Byte count assumes ISO 8859-1 encoding.

S_`
%{2`
$`
}T01`p`_p
..

Mm`.¶.|^¶$
^0

Outputs 1 for truthy and 0 for falsy.

Try it online! (The first line enables a linefeed-separated test suite.)

Explanation

Inspired by a answer of mbomb007's I recently developed a reasonably short ord() implementation in Retina. This is largely based on that, although I was able to make a few simplifications since I don't need a decimal result in since I only need to support printable ASCII (and I only care about the parity of the result, so ending up with an arbitrary offset is fine, too).

Stage 1: Split

S_`

This simply splits the input into its individual characters by splitting it around the empty match and dropping the empty results at the beginning and end with _.

Stage 2: Replace

%{2`
$`

The %{ tells Retina a) that this stage and the next should be run in a loop until the string stops changing through a full iteration, and that these two stages should be applied to each line (i.e each character) of the input separately.

The stage itself is the standard technique for duplicating the first character of the input. We match the empty string (but only look at the first two matches) and insert the prefix of that match. The prefix of the first match (at the beginning of the string) is empty, so this doesn't do anything, and the prefix of the second match is the first character, which is therefore duplicated.

Stage 3: Transliterate

}T01`p`_o

} indicates the end of the loop. The stage itself is a transliteration. 01 indicates that it should only be applied to the first character of the string. p is shorthand for all printable ASCII characters and _ means "delete". So if we expand this, the transliteration does the following transformation:

from:   !"#$%...
to:    _ !"#$...

So spaces are deleted and all other characters are decremented. That means, these two stages together will create a character range from space to the given character (because they'll repeatedly duplicate and decrement the first character until it becomes a space at which point the duplication and deletion cancel).

The length of this range can be used to determine the parity of the character.

Stage 4: Replace

..

We simply drop all pairs of characters. This clears even-length lines and reduces odd-length lines to a single character (the input character, in fact, but that doesn't really matter).

Stage 5: Match

Mm`.¶.|^¶$

It's easier to find inputs which aren't even, so we count the number of matches of either two successive empty lines or two successive non-empty lines. We should get 0 for even inputs and something non-zero otherwise.

Stage 6: Match

^0

All that's left is to invert the result, which we do by counting the number of matches of this regex, which checks that the input starts with a 0. This is only possible if the result of the first stage was 0.