答:
C (Windows), 311 bytes

```<code>#include <windows.h>
main(int c,char**v){float x,y,a,b,N=atoi(*++v);HDC d=GetDC(GetDesktopWindow());for(x=0;x<N;x+=1)for(y=0;y<N;y+=1){a=2*x/N-1;b=2*y/N-1;SetPixel(d,x,y,(a>0&&a<.8&&b*b<.04)?0xF48542:(a*a+b*b>1||a*a+b*b<.36)?0xFFFFFF:(a*a<b*b)?((b<0)?3490794:5482548):(a<0)?376059:(b<-.2)?0xFFFFFF:0xF48542);}}
</code>```

Takes "N" as command line argument and draws directly on the screen.

Un-golfed:

```<code>#include <windows.h>
// atoi() will work fine without any #include file!
// -> don't #include it!

main(int c,char **v)
{
    float x,y,a,b,N=atoi(*++v);

    /* Access the screen for directly drawing! */
    HDC d=GetDC(GetDesktopWindow());

    /* Iterate over the pixels */
    for(x=0;x<N;x+=1)
        for(y=0;y<N;y+=1)
    {
        /* Convert x,y into "relative" coordinates: The image
         * is 2.0x2.0 in size with (0.0,0.0) in the center */
        a=2*x/N-1;
        b=2*y/N-1;

        /* Draw each pixel */
        SetPixel(d,x,y,
            (a>0 && a<.8 && b*b<.04)?0xF48542: /* The bar of the "G" in the middle */
            (a*a+b*b>1 || a*a+b*b<.36)?0xFFFFFF: /* Not on one of the circle segments */
            (a*a<b*b)?((b<0)?0x3543EA:0x53A834): /* Top and bottom segments */
            (a<0)?0x5BCFB: /* Left segment */
            (b<-.2)?0xFFFFFF:0xF48542); /* Right segment: A bit more complicated... */
    }

    /* Note: Under good old Windows 3.x we would require to
     * call "ReleaseDC" here; otherwise the system would
     * "crash" (however the image would have been drawn!)
     * No need for this in modern Windows versions! */
}
</code>```

Title: Appease Your Google Overlords: Draw the "G" Logo

Body:
Write a program or function that takes in a positive integer N, and outputs an N×N pixel image of Google's "G" logo according to this* construction:

For example, if N is 400, a 400×400 pixel logo should be output, with correct dimensions and colors:

It should look accurate regardless of how large or small N is. e.g. here is N = 13:

Your code should not need to connect to the internet. For example, scaling an externally hosted svg is not allowed. (Scaling an svg encoded in your code would be fine though.)

Anti-aliasing may be used or not. It's up to you.

Notice that the horizontal bar of the "G" does not extend all the way to the right edge of the image. The circle curves normally inward on the right edge before it is cut off.

The shortest code in bytes wins.

* The construction of the logo has been simplified for this challenge. The correct construction can be seen here and here.

Body:
C (Windows), 311 bytes

#include <windows.h>
main(int c,char**v){float x,y,a,b,N=atoi(*++v);HDC d=GetDC(GetDesktopWindow());for(x=0;x<N;x+=1)for(y=0;y<N;y+=1){a=2*x/N-1;b=2*y/N-1;SetPixel(d,x,y,(a>0&&a<.8&&b*b<.04)?0xF48542:(a*a+b*b>1||a*a+b*b<.36)?0xFFFFFF:(a*a<b*b)?((b<0)?3490794:5482548):(a<0)?376059:(b<-.2)?0xFFFFFF:0xF48542);}}

Takes "N" as command line argument and draws directly on the screen.

Un-golfed:

#include <windows.h>
// atoi() will work fine without any #include file!
// -> don't #include it!

main(int c,char **v)
{
    float x,y,a,b,N=atoi(*++v);

    /* Access the screen for directly drawing! */
    HDC d=GetDC(GetDesktopWindow());

    /* Iterate over the pixels */
    for(x=0;x<N;x+=1)
        for(y=0;y<N;y+=1)
    {
        /* Convert x,y into "relative" coordinates: The image
         * is 2.0x2.0 in size with (0.0,0.0) in the center */
        a=2*x/N-1;
        b=2*y/N-1;

        /* Draw each pixel */
        SetPixel(d,x,y,
            (a>0 && a<.8 && b*b<.04)?0xF48542: /* The bar of the "G" in the middle */
            (a*a+b*b>1 || a*a+b*b<.36)?0xFFFFFF: /* Not on one of the circle segments */
            (a*a<b*b)?((b<0)?0x3543EA:0x53A834): /* Top and bottom segments */
            (a<0)?0x5BCFB: /* Left segment */
            (b<-.2)?0xFFFFFF:0xF48542); /* Right segment: A bit more complicated... */
    }

    /* Note: Under good old Windows 3.x we would require to
     * call "ReleaseDC" here; otherwise the system would
     * "crash" (however the image would have been drawn!)
     * No need for this in modern Windows versions! */
}


问:
The Letter E with E
Your task is to display the below letter "E" shaped ASCII art, given five inputs.

Examples:

Input: 7,2,+,|,- (Note: You don't have to follow this exact input format, and if you don't use it, then you must explain how your own input format works)

Explanation:

7 total width, including the left and right edge characters.

2 Number of vertical characters.

+ The character that should display at the edges.

| The character that should display vertically between the edges.

- The character that should display horizontally.

Output of the above example:

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

Other examples:

Input: 7,2,@,|,-

Output:

```<code>@-----@
|
|
@-----@
|
|
@-----@
</code>```

Input: 7,2,+,|,#

Output:

```<code>+#####+
|
|
+#####+
|
|
+#####+
</code>```

Input: 8,3,+,|,#

Output:

```<code>+######+
|
|
|
+######+
|
|
|
+######+
</code>```

Input: 8,3,+,@,#

Output:

```<code>+######+
@
@
@
+######+
@
@
@
+######+
</code>```

Input: 9,4,^,$,!

Output:

```<code>^!!!!!!!^
$
$
$
$
^!!!!!!!^
$
$
$
$
^!!!!!!!^
</code>```

Cheating and standard loopholes are not allowed.

Your code must not print anything to STDERR.

Your code may accept any character encoding you choose as the input, but any character encoding you choose must, as a minimum, support all the 95 printable ASCII characters.

The shortest code, in bytes, that completes this challenge successfully, is the winning code.

Leaderboard

var QUESTION_ID=92138,OVERRIDE_USER=58717;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

```

答:
CJam, 23 bytes

```<code>riri)N*r2*\r*\@r**a3*\*
</code>```

Try it online!

The input is is in the given order, but should be space separated instead of using a comma. Some of the difficulty is getting the input the right order for CJam's join operation *; for comparison rearranging the input in could save 4 bytes.

If the inputs are dubbed A B C D E then the program works something like this:

```<code>ri     e# get A as integer
ri)N*  e# create B+1 newlines
r2*    e# create 2 Cs
\r*    e# join newlines with D (hereafter ND)
\@     e# bring A & Cs to the front
r*     e# create A Es
*      e# join, puts Es between Cs (hereafter CEC)
a3*    e# makes 3 copies of CEC strings
\*     e# join, puts NDs between CECs
</code>```

ContentLicense: CC BY-SA 3.0

Title: The Letter E with E

Body:
CJam, 23 bytes

riri)N*r2*\r*\@r**a3*\*

Try it online!

The input is is in the given order, but should be space separated instead of using a comma. Some of the difficulty is getting the input the right order for CJam's join operation *; for comparison rearranging the input in could save 4 bytes.

If the inputs are dubbed A B C D E then the program works something like this:

ri     e# get A as integer
ri)N*  e# create B+1 newlines
r2*    e# create 2 Cs
\r*    e# join newlines with D (hereafter ND)
\@     e# bring A & Cs to the front
r*     e# create A Es
*      e# join, puts Es between Cs (hereafter CEC)
a3*    e# makes 3 copies of CEC strings
\*     e# join, puts NDs between CECs


问:
Is it an Odd Word?

Challenge

Given a single word as input, determine if the word is odd or even.

Odd and Even words

Assume the general rules:

```<code>odd + odd = even
even + odd = odd
odd + even = odd
even + even = even
</code>```

In the alphabet, the odd letters are:

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

And the even letters are:

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

The same applies to capital letters (AEIOU are odd and BCDFGHJKLMNPQRSTVWXYZ are even).

You then 'add' each of the letters in the word together. For example, the word cats is equivalent to:

```<code>even + odd + even + even
</code>```

Which simplifies to:

```<code>odd + even
</code>```

Which simplifies further to:

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

So the word cats is odd.

Examples

```<code>Input:  trees
Output: even
</code>```

```<code>Input:  brush
Output: odd
</code>```

```<code>Input:  CAts
Output: odd
</code>```

```<code>Input:  Savoie
Output: even
</code>```

```<code>Input:  rhythm
Output: even
</code>```

Rules

All input will be a single word which will only contain alphabetical characters.

If the word is odd, output a truthy value. If the word is even, output a falsey value.

Winning

The shortest code in bytes wins.

答:
Racket 127 bytes

```<code>(if(= 0(modulo(for/sum((i(map(λ(i)(ormap(λ(x)(equal? i x))(string->list"aieouAEIOU")))(string->list s))))(if i 1 0))2))#f #t)
</code>```

Ungolfed:

```<code>(define(f s)
  (let* ((vl (string->list "aieouAEIOU"))
         (od (λ(i) (ormap (λ (x) (equal? i x)) vl)))
         (ol (map od (string->list s)))
         (s (count (λ(i) i) ol ))
         (m (modulo s 2)))
    (if (= m 0) "even" "odd")
  ))
</code>```

A longer (240 bytes) but more direct version:

```<code>(let*((vl(string->list"aieouAEIOU"))(od(λ(i)(ormap(λ(x)(equal? i x))vl))))(let lp((l(string->list s))
(st #t)(d 0))(cond((null? l)(if d"odd""even"))(st(lp(cdr l)#f(if(od(car l))#t #f)))
(else(lp(cdr l)#f(if(equal? d(od(car l)))#f #t))))))
</code>```

Ungolfed:

```<code>(define (f s)
  (let* ((vl (string->list "aieouAEIOU"))
         (od (λ (i) (ormap (λ (x) (equal? i x)) vl) )))
    (let loop ((l (string->list s))
               (starting #t)
               (odd 0))
      (cond
        ((null? l)
         (if odd "odd" "even"))
        (starting
         (loop (rest l) #f
               (if(od (first l))
                  #t #f )))
        (else
         (loop (rest l) #f
               (if (equal? odd
                           (od (first l)))
                   #f #t)))))))
</code>```

Testing:

```<code>(f "trees")
(f "brush")
(f "CAts")
(f "Savoie")
(f "rhythm")
</code>```

Output:

```<code>"even"
"odd"
"odd"
"even"
"even"
</code>```

Title: Is it an Odd Word?

Body:
Racket 127 bytes

(if(= 0(modulo(for/sum((i(map(λ(i)(ormap(λ(x)(equal? i x))(string->list"aieouAEIOU")))(string->list s))))(if i 1 0))2))#f #t)

Ungolfed:

(define(f s)
  (let* ((vl (string->list "aieouAEIOU"))
         (od (λ(i) (ormap (λ (x) (equal? i x)) vl)))
         (ol (map od (string->list s)))
         (s (count (λ(i) i) ol ))
         (m (modulo s 2)))
    (if (= m 0) "even" "odd")
  ))

A longer (240 bytes) but more direct version:

(let*((vl(string->list"aieouAEIOU"))(od(λ(i)(ormap(λ(x)(equal? i x))vl))))(let lp((l(string->list s))
(st #t)(d 0))(cond((null? l)(if d"odd""even"))(st(lp(cdr l)#f(if(od(car l))#t #f)))
(else(lp(cdr l)#f(if(equal? d(od(car l)))#f #t))))))

Ungolfed:

(define (f s)
  (let* ((vl (string->list "aieouAEIOU"))
         (od (λ (i) (ormap (λ (x) (equal? i x)) vl) )))
    (let loop ((l (string->list s))
               (starting #t)
               (odd 0))
      (cond
        ((null? l)
         (if odd "odd" "even"))
        (starting
         (loop (rest l) #f
               (if(od (first l))
                  #t #f )))
        (else
         (loop (rest l) #f
               (if (equal? odd
                           (od (first l)))
                   #f #t)))))))

Testing:

(f "trees")
(f "brush")
(f "CAts")
(f "Savoie")
(f "rhythm")

Output:

"even"
"odd"
"odd"
"even"
"even"


问:
Appease Your Google Overlords: Draw the "G" Logo
Write a program or function that takes in a positive integer N, and outputs an N×N pixel image of Google's "G" logo according to this* construction:

For example, if N is 400, a 400×400 pixel logo should be output, with correct dimensions and colors:

It should look accurate regardless of how large or small N is. e.g. here is N = 13:

Your code should not need to connect to the internet. For example, scaling an externally hosted svg is not allowed. (Scaling an svg encoded in your code would be fine though.)

Anti-aliasing may be used or not. It's up to you.

Notice that the horizontal bar of the "G" does not extend all the way to the right edge of the image. The circle curves normally inward on the right edge before it is cut off.

The shortest code in bytes wins.

* The construction of the logo has been simplified for this challenge. The correct construction can be seen here and here.

答:
Python 2, <s>244</s> 220 bytes

using Martin Rosenau's transformation on the [-1,1]^2 plane and minor golfing like removing 0. or brackets

N=input()
R=[2*z/(N-1.)-1for z in range(N)]
B="\xFF"*3,"B\x85\xF4"
print"P6 %d %d 255 "%(N,N)+"".join([B[0<x<.8and.04>y*y],["4\xA8S",B[y>-.2],"\xFB\xBC\x05","\xEAC5"][(x>y)+2*(-x>y)]][.36<x*x+y*y<1]for y in R for x in R)
```

<p>Explanation:</p>

<pre class="lang-python prettyprint-override"><code>N=input()
R=[2*z/(N-1.)-1for z in range(N)]
#N*N points on the [-1,1]^2 plane

B="\xFF"*3,"B\x85\xF4"
#white and blue

print"P6 %d %d 255 "%(N,N) + "".join(
#binary PPM header
 [
  B[0<x<.8and.04>y*y],
  #blue rectangle part of the G, or white
  ["4\xA8S",B[y>-.2],"\xFB\xBC\x05","\xEAC5"][(x>y)+2*(-x>y)]
  #[green, [white,blue], yellow, red]-arcs with 4 way selector
 ]
 [.36<x*x+y*y<1]
 #radius checker, outside=0 blue rectangle or white, inside=1 colored arcs
  for y in R for x in R
  #for all points
 )
</code>```

Output as binary PPM, usage:

python golf_google.py > google.ppm
```

<h2>Examples</h2>

<ul>
<li>13</li>
</ul>

<p><img src="https://i.stack.imgur.com/p1Feu.png" alt="13"></p>

<ul>
<li>50</li>
</ul>

<p><img src="https://i.stack.imgur.com/BR4bz.png" alt="50"></p>

<ul>
<li>100</li>
</ul>

<p><img src="https://i.stack.imgur.com/aSMbY.png" alt="100"></p>

<ul>
<li>1337</li>
</ul>

<p><img src="https://i.stack.imgur.com/Hgqq8.png" alt="1337"></p>

<h3>previous 244 bytes solution</h3>

<pre class="lang-python prettyprint-override"><code>N=input()
S="P6 %d %d 255 "%(N,N)
R=range(N)
B=["\xFF"*3,"B\x85\xF4"]
for Y in R:
 for X in R:y=Y-N/2;x=X-N/2;S+=[B[0<x<0.4*N and abs(y)<0.1*N],["4\xA8S",B[y>-0.1*N],"\xFB\xBC\x05","\xEAC5"][(x>y)+2*(-x>y)]][0.3*N<(y**2+x**2)**.5<0.5*N]
print S
</code>```

Ungolfed beta Version before if/else elimination:

N=input()
print"P3 %d %d 255 "%(N,N)
R=range
M=N/2
r="255 0 0 "
g="0 255 0 "
b="0 0 255 "
c="255 255 0 "
w="255 255 255 "
for Y in R(N):
 for X in R(N):
  y=Y-M
  x=X-M
  d=(y**2+x**2)**.5 #radius
  if 0.3*N<d<0.5*N: #inside circle
   if x>y:          #diagonal cut bottom-left to top right
    if -x>y:        #other diagonal cut
     print r
    else:
     if y>-0.1*N:print b #leave some whitespace at blue
     else: print w
   else:
     if -x>y:
      print c
     else:
      print g
  else:
   if 0<x<0.4*N and -0.1*N<y<0.1*N: #the straight part of G
    print b
   else:
    print w
```

Body:
Python 2, <s>244</s> 220 bytes

using Martin Rosenau's transformation on the [-1,1]^2 plane and minor golfing like removing 0. or brackets

N=input()
R=[2*z/(N-1.)-1for z in range(N)]
B="\xFF"*3,"B\x85\xF4"
print"P6 %d %d 255 "%(N,N)+"".join([B[0<x<.8and.04>y*y],["4\xA8S",B[y>-.2],"\xFB\xBC\x05","\xEAC5"][(x>y)+2*(-x>y)]][.36<x*x+y*y<1]for y in R for x in R)

Explanation:

N=input()
R=[2*z/(N-1.)-1for z in range(N)]
#N*N points on the [-1,1]^2 plane

B="\xFF"*3,"B\x85\xF4"
#white and blue

print"P6 %d %d 255 "%(N,N) + "".join(
#binary PPM header
 [
  B[0<x<.8and.04>y*y],
  #blue rectangle part of the G, or white
  ["4\xA8S",B[y>-.2],"\xFB\xBC\x05","\xEAC5"][(x>y)+2*(-x>y)]
  #[green, [white,blue], yellow, red]-arcs with 4 way selector
 ]
 [.36<x*x+y*y<1]
 #radius checker, outside=0 blue rectangle or white, inside=1 colored arcs
  for y in R for x in R
  #for all points
 )

Output as binary PPM, usage:

python golf_google.py > google.ppm

Examples

13

50

100

1337

previous 244 bytes solution

N=input()
S="P6 %d %d 255 "%(N,N)
R=range(N)
B=["\xFF"*3,"B\x85\xF4"]
for Y in R:
 for X in R:y=Y-N/2;x=X-N/2;S+=[B[0<x<0.4*N and abs(y)<0.1*N],["4\xA8S",B[y>-0.1*N],"\xFB\xBC\x05","\xEAC5"][(x>y)+2*(-x>y)]][0.3*N<(y**2+x**2)**.5<0.5*N]
print S

Ungolfed beta Version before if/else elimination:

N=input()
print"P3 %d %d 255 "%(N,N)
R=range
M=N/2
r="255 0 0 "
g="0 255 0 "
b="0 0 255 "
c="255 255 0 "
w="255 255 255 "
for Y in R(N):
 for X in R(N):
  y=Y-M
  x=X-M
  d=(y**2+x**2)**.5 #radius
  if 0.3*N<d<0.5*N: #inside circle
   if x>y:          #diagonal cut bottom-left to top right
    if -x>y:        #other diagonal cut
     print r
    else:
     if y>-0.1*N:print b #leave some whitespace at blue
     else: print w
   else:
     if -x>y:
      print c
     else:
      print g
  else:
   if 0<x<0.4*N and -0.1*N<y<0.1*N: #the straight part of G
    print b
   else:
    print w


答:
Bash with Imagemagick (but really Postscript), <s>268</s> <s>255</s> 249 bytes

C=' setrgbcolor 2.5 2.5 2'
A=' arc stroke '
echo "%!PS
122.4 dup scale
.92 .26 .21$C 45 136$A.98 .74 .02$C 135 226$A.20 .66 .33$C 225 316$A.26 .52 .96$C 315 371$A
4.95 2.5 moveto
2.5 2.5 lineto
stroke"|convert - -crop 612x612+0+180 -scale "$1" o.png
```

<p>Doubled the scaling to remove <code>setlinewidth</code>, replaced one scale factor with <code>dup</code>, and merged a space into the <code>A</code> variable (can't with <code>C</code> because <code>$C45</code> is parsed as "the variable <code>C45</code>").</p>

<p>Thanks to joojaa for suggesting these edits!</p>

<h3>Old Scale, 255 bytes</h3>

<pre class="lang-sh prettyprint-override"><code>C=' setrgbcolor 5 5 4'
A=' arc stroke'
echo "%!PS
61.2 61.2 scale
2 setlinewidth
.92 .26 .21$C 45 136$A
.98 .74 .02$C 135 226$A
.20 .66 .33$C 225 316$A
.26 .52 .96$C 315 371$A
9.9 5 moveto
5 5 lineto
stroke"|convert - -crop 612x612+0+180 -scale "$1" o.png
</code>```

Takes N as the lone argument and outputs to o.png.

Ungolfed Postscript for Old Scale

```<code>%!PS
% Scale so default page has width of 10
61.2 61.2 scale
2 setlinewidth
% Red arc
.92 .26 .21 setrgbcolor
5 5 4 45 136 arc
stroke
% Yellow arc
.98 .74 .02 setrgbcolor
5 5 4 135 226 arc
stroke
% Green arc
.20 .66 .33 setrgbcolor
5 5 4 225 316 arc
stroke
% Blue arc
.26 .52 .96 setrgbcolor
5 5 4 315 371 arc
% Blue in-tick
9.9 5 moveto
5 5 lineto
stroke
</code>```

Body:
Bash with Imagemagick (but really Postscript), <s>268</s> <s>255</s> 249 bytes

C=' setrgbcolor 2.5 2.5 2'
A=' arc stroke '
echo "%!PS
122.4 dup scale
.92 .26 .21$C 45 136$A.98 .74 .02$C 135 226$A.20 .66 .33$C 225 316$A.26 .52 .96$C 315 371$A
4.95 2.5 moveto
2.5 2.5 lineto
stroke"|convert - -crop 612x612+0+180 -scale "$1" o.png

Doubled the scaling to remove setlinewidth, replaced one scale factor with dup, and merged a space into the A variable (can't with C because $C45 is parsed as "the variable C45").

Thanks to joojaa for suggesting these edits!

Old Scale, 255 bytes

C=' setrgbcolor 5 5 4'
A=' arc stroke'
echo "%!PS
61.2 61.2 scale
2 setlinewidth
.92 .26 .21$C 45 136$A
.98 .74 .02$C 135 226$A
.20 .66 .33$C 225 316$A
.26 .52 .96$C 315 371$A
9.9 5 moveto
5 5 lineto
stroke"|convert - -crop 612x612+0+180 -scale "$1" o.png

Takes N as the lone argument and outputs to o.png.

Ungolfed Postscript for Old Scale

%!PS
% Scale so default page has width of 10
61.2 61.2 scale
2 setlinewidth
% Red arc
.92 .26 .21 setrgbcolor
5 5 4 45 136 arc
stroke
% Yellow arc
.98 .74 .02 setrgbcolor
5 5 4 135 226 arc
stroke
% Green arc
.20 .66 .33 setrgbcolor
5 5 4 225 316 arc
stroke
% Blue arc
.26 .52 .96 setrgbcolor
5 5 4 315 371 arc
% Blue in-tick
9.9 5 moveto
5 5 lineto
stroke


答:
JavaScript (ES6), <s>408 ... 321</s> 317 bytes

<s>384 383 371 367 359 327 316 308</s> 304 bytes of JavaScript + <s>24</s> 13 bytes for the canvas element

(f=d.style).width=f.height=(d.width=d.height=n=prompt(f.background='#FFF'))+'px';q=n/2;with(d.getContext`2d`)['#EA4335','#FBBC05','#34A853','#4285F4'].map((c,i)=>beginPath(lineWidth=y=n/5,strokeStyle=fillStyle=c,arc(q,q,z=q-y/2,(j=2*i+1)*(r=-.7854),(j+(i-3?2:1.256))*r,1),stroke(),fillRect(q,z,q*.98,y)))```
<pre class="snippet-code-html lang-html prettyprint-override"><code><canvas id=d></code>```

1 byte saved by drawing counter-clockwise.

11 bytes saved on the HTML thanks to Conor O'Brien.

12 bytes saved using with block thanks to Prinzhorn.

4 bytes saved with better use of z=q-y/2.

8 bytes saved by using parentNode and background thanks to Alexis Tyler.

32 bytes saved by using a more precise drawing of the blue arc/bar so I don't need to erase a part of it anymore.

11 bytes saved by setting canvas css instead of its parentNode thanks to Tejas Kale.

8 bytes saved using with and map with a single statement, `2d` instead of ('2d'), n/5 instead of .2*n and initializing the background in the prompt(...).

4 bytes saved replacing Math.PI/4 by .7854 which seems enough precision thanks to RobAu.

Explanation:

(f=d.style).width=f.height=(d.width=d.height=n=prompt(f.background='#FFF'))+'px';q=n/2
```
<p>The canvas dimensions are initilized with user input and the background is set to white. <code>q</code> is initialized.</p>
<pre class="lang-js prettyprint-override"><code>with(d.getContext`2d`)['#EA4335','#FBBC05','#34A853','#4285F4'].map((c,i)=>beginPath(lineWidth=y=n/5,strokeStyle=fillStyle=c,arc(q,q,z=q-y/2,(j=2*i+1)*(r=-.7854),(j+(i-3?2:1.256))*r,1),stroke(),fillRect(q,z,q*.98,y)))
</code>```

For each color draws the circle part, with some adjustement for the last (blue) one. The bar is drawn for each color at the same place with the same dimensions so only the last (blue) one is visible.

Body:
JavaScript (ES6), <s>408 ... 321</s> 317 bytes

<s>384 383 371 367 359 327 316 308</s> 304 bytes of JavaScript + <s>24</s> 13 bytes for the canvas element

(f=d.style).width=f.height=(d.width=d.height=n=prompt(f.background='#FFF'))+'px';q=n/2;with(d.getContext`2d`)['#EA4335','#FBBC05','#34A853','#4285F4'].map((c,i)=>beginPath(lineWidth=y=n/5,strokeStyle=fillStyle=c,arc(q,q,z=q-y/2,(j=2*i+1)*(r=-.7854),(j+(i-3?2:1.256))*r,1),stroke(),fillRect(q,z,q*.98,y)))

<canvas id=d>

1 byte saved by drawing counter-clockwise.

11 bytes saved on the HTML thanks to Conor O'Brien.

12 bytes saved using with block thanks to Prinzhorn.

4 bytes saved with better use of z=q-y/2.

8 bytes saved by using parentNode and background thanks to Alexis Tyler.

32 bytes saved by using a more precise drawing of the blue arc/bar so I don't need to erase a part of it anymore.

11 bytes saved by setting canvas css instead of its parentNode thanks to Tejas Kale.

8 bytes saved using with and map with a single statement, `2d` instead of ('2d'), n/5 instead of .2*n and initializing the background in the prompt(...).

4 bytes saved replacing Math.PI/4 by .7854 which seems enough precision thanks to RobAu.

Explanation:

(f=d.style).width=f.height=(d.width=d.height=n=prompt(f.background='#FFF'))+'px';q=n/2

The canvas dimensions are initilized with user input and the background is set to white. q is initialized.

with(d.getContext`2d`)['#EA4335','#FBBC05','#34A853','#4285F4'].map((c,i)=>beginPath(lineWidth=y=n/5,strokeStyle=fillStyle=c,arc(q,q,z=q-y/2,(j=2*i+1)*(r=-.7854),(j+(i-3?2:1.256))*r,1),stroke(),fillRect(q,z,q*.98,y)))

For each color draws the circle part, with some adjustement for the last (blue) one. The bar is drawn for each color at the same place with the same dimensions so only the last (blue) one is visible.


Body:
PHP + SVG, 300 Bytes

<svg width=<?=$_GET["w"]?> viewBox=0,0,10,10><def><path id=c d=M0,5A5,5,0,0,1,5,0V2A3,3,0,0,0,2,5 /></def><?foreach(["fbbc05"=>-45,"ea4335"=>45,"4285f4"=>168.5,"34a853"=>225]as$k=>$v)echo"<use xlink:href=#c fill=#$k transform=rotate($v,5,5) />"?><rect x=5 y=4 fill=#4285f4 width=4.9 height=2 /></svg>

The scaling part is width=<?=$_GET[w]?>

Output for value 333

<svg width="333" viewBox="0 0 10 10">
<def><path id="c" d="M 0,5 A 5 5 0 0 1 5,0 V 2 A 3,3 0 0 0 2,5"/></def>
<use xlink:href="#c" fill="#fbbc05" transform="rotate(-45,5,5)"/><use xlink:href="#c" fill="#ea4335" transform="rotate(45,5,5)"/><use xlink:href="#c" fill="#4285f4" transform="rotate(168.5,5,5)"/><use xlink:href="#c" fill="#34a853" transform="rotate(225,5,5)"/>
<rect x="5" y="4" fill="#4285f4" width="4.9" height="2"/>
</svg>


问:
Divisibility test

Task

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

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

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

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

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

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

Test cases

```<code> n,  d    output

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

Leaderboard

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

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

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

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

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

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

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

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

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

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

Shortest Solution by Language

Language	User	Score

Leaderboard

	Author	Language	Size

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

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

```

答:
C#

```<code>using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication181
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Enter the Maximum Range of the Array:");
            int N = Convert.ToInt32(Console.ReadLine());
            int[] div = new int[N];
            int[] num = new int[N];
            int[] quo = new int[N];
            int d = 0, n = 0, q = 0;
            Console.WriteLine("\n");
            Console.WriteLine("Enter the numbers:");
            for (n = 0; n < N; n++)
            {
                num[n] = Convert.ToInt32(Console.ReadLine());
            }
            Console.WriteLine("\n");
            Console.WriteLine("Enter the Divident values:");
            for (d = 0; d < N; d++)
            {
                div[d] = Convert.ToInt32(Console.ReadLine());
            }
            Console.WriteLine("\n");
            for (d = 0; d < N; d++)
            {
                for (n = 0; n < N; n++)
                {
                    if (d == n)
                    {
                        quo[q] = (num[n] / div[d]);
                        q++;
                    }
                }
            }
            Console.WriteLine("\n");
            Console.WriteLine("The Quotient values are:");
            for (q = 0; q < N; q++)
            {
                Console.Write("{0} ", quo[q]);
            }
            Console.WriteLine("\n");
            Console.WriteLine("d      n    output");
            for (d = 0; d < N; d++)
            {
                for (n = 0; n < N; n++)
                {
                    for (q = 0; q < N; q++)
                    {
                        if ((d == n)&&(n == q)&&(q==d))
                        {
                            if ((quo[d] * div[d]) == num[n])
                            {
                                Console.WriteLine("{0}      {1}    truthy", div[d], num[n]);
                            }
                            else
                            {
                                Console.WriteLine("{0}      {1}    False ",div[d],num[n]);
                            }
                        }
                    }
                }
            }
            Console.WriteLine("\n");
            Console.ReadLine();
        }
    }
}
</code>```

Title: Divisibility test

Body:
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication181
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Enter the Maximum Range of the Array:");
            int N = Convert.ToInt32(Console.ReadLine());
            int[] div = new int[N];
            int[] num = new int[N];
            int[] quo = new int[N];
            int d = 0, n = 0, q = 0;
            Console.WriteLine("\n");
            Console.WriteLine("Enter the numbers:");
            for (n = 0; n < N; n++)
            {
                num[n] = Convert.ToInt32(Console.ReadLine());
            }
            Console.WriteLine("\n");
            Console.WriteLine("Enter the Divident values:");
            for (d = 0; d < N; d++)
            {
                div[d] = Convert.ToInt32(Console.ReadLine());
            }
            Console.WriteLine("\n");
            for (d = 0; d < N; d++)
            {
                for (n = 0; n < N; n++)
                {
                    if (d == n)
                    {
                        quo[q] = (num[n] / div[d]);
                        q++;
                    }
                }
            }
            Console.WriteLine("\n");
            Console.WriteLine("The Quotient values are:");
            for (q = 0; q < N; q++)
            {
                Console.Write("{0} ", quo[q]);
            }
            Console.WriteLine("\n");
            Console.WriteLine("d      n    output");
            for (d = 0; d < N; d++)
            {
                for (n = 0; n < N; n++)
                {
                    for (q = 0; q < N; q++)
                    {
                        if ((d == n)&&(n == q)&&(q==d))
                        {
                            if ((quo[d] * div[d]) == num[n])
                            {
                                Console.WriteLine("{0}      {1}    truthy", div[d], num[n]);
                            }
                            else
                            {
                                Console.WriteLine("{0}      {1}    False ",div[d],num[n]);
                            }
                        }
                    }
                }
            }
            Console.WriteLine("\n");
            Console.ReadLine();
        }
    }
}


问:
Run Length Decoding
Write the shortest code in the language of your choice to perform run length decoding of the given string.

The string will be supplied as input on stdin in the form

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

where each C could be any printable ASCII character and each N is a digit 1 to 9 (inclusive).

Sample input:

```<code>:144,1'1
</code>```

Corresponding output:

```<code>:4444,'
</code>```

答:
JavaScript (ES6), 40 bytes

s=>s.replace(/../g,v=>v[0].repeat(v[1]))
```
<p><div class="snippet" data-lang="js" data-hide="true" data-console="true" data-babel="false">
<div class="snippet-code snippet-currently-hidden">
<pre class="snippet-code-js lang-js prettyprint-override"><code>f=
  s=>s.replace(/../g,v=>v[0].repeat(v[1]))
;
console.log(f(":144,1'1"))</code>```

Title: Run Length Decoding

Body:
JavaScript (ES6), 40 bytes

s=>s.replace(/../g,v=>v[0].repeat(v[1]))

f=
  s=>s.replace(/../g,v=>v[0].repeat(v[1]))
;
console.log(f(":144,1'1"))


问:
Determine the depth of an array
A simple challenge for your Monday evening (well, or Tuesday morning in the other half of the world...)

You're given as input a nested, potentially ragged array of positive integers:

```<code>[1, [[2, 3, [[4], 5], 6, [7, 8]], 9, [10, [[[11]]]], 12, 13], 14]
</code>```

Your task is to determine its depth, which is the greatest nesting-depth of any integer in the list. In this case, the depth of 11 is 6, which is largest.

You may assume that none of the arrays will be empty.

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 taken in any convenient list or string format that supports non-rectangular arrays (with nested arrays of different depths), as long as the actual information isn't preprocessed.

You must not use any built-ins related to the shape of arrays (including built-ins that solve this challenge, that get you the dimensions of a nested array). The only exception to this is getting the length of an array.

Standard code-golf rules apply.

Test Cases

```<code>[1]                                                               -> 1
[1, 2, 3]                                                         -> 1
[[1, 2, 3]]                                                       -> 2
[3, [3, [3], 3], 3]                                               -> 3
[[[[1], 2], [3, [4]]]]                                            -> 4
[1, [[3]], [5, 6], [[[[8]]]], 1]                                  -> 5
[1, [[2, 3, [[4], 5], 6, [7, 8]], 9, [10, [[[11]]]], 12, 13], 14] -> 6
[[[[[[[3]]]]]]]                                                   -> 7
</code>```

答:
Hexagony, 61 bytes

Edit: Thanks @Martin Ender♦ for saving me 1 byte from the marvelous -1 trick!

```<code>|/'Z{>"-\..(.."/'&<'..{>-&,=+<$.{\$._{..><.Z=/...({=Z&"&@!-"
</code>```

Try it online to verify test cases!

The images below are not modified but the flow is basically the same.  Also note that this will return -1 if the input is not an array (i.e. without []).

I have lots of no-ops inside the Hexagon... I guess it can definitely be golfed more.

Explanation

In brief, it adds -1 when encounters a [ and adds 1 when encounters a ].  Finally it prints the max it has got.

Let's run along Test Case 5 to see its behaviour when it runs along the String [1, [[3]], [5, 6], [[[[8]]]], 1]:

It starts at the beginning and takes its input at the W corner:

Since there is still input (not the null character \0 or EOL), it wraps to the top and starts the crimson path.

Here is what happens when from there till cute ><:

, reads [ into Buffer, and { and Z sets the constant Z to be 90. ' moves to Diff and - calculates the difference.  For [ and ] the difference will be 1 and 3 respectively.  For numbers and spaces and commas it'll be negative.

Then we run ( twice (once at the end of crimson path, one at the start after wrapping at the green path) to get -1 and 1 resp for [ and ].  Here we change the naming of Diff to Value.  Add this Value to Depth. (I used Z& to ensure that it copies the right neighbor).  Then we calculate lastMin - Depth and got a number on the Memory edge minLR.

Then we apply & (at the end of green path) to minLR: If the number is <=0, it copies the left value (i.e. lastMin - Depth <= 0 => lastMin <= Depth), otherwise it takes the right value.

We wraps to the horizontal blue path and we see Z& again which copies the minLR.  Then we "& and made a copy of the calculated min.  The brackets are assumed to be balanced, so the min must be <=0.  After wrapping, the blue path go left and hit (, making the copy 1 less than the real min.  Reusing the -, we created one more 1-off copy as a neighbor of Buffer:

Note: copy is renamed as 1-off

When blue path hits \ and got a nice " and < catches it back to the main loop.

When the loop hits 1, , or  or other numbers as input:

The Diff will become negative and it got reflected back to the main loop for next input.

When everything has gone through the main loop, we reach EOL which makes Buffer -1 and it finally goes to the bottom edge:

' moves the MP to the 1-off copy and ) increments it, and with ~ negation it got the correct Max Depth value which is printed with !

And the story ends with a @.

I guess I must have over complicating things a little bit.  If I have had to only "move back" and "print" without incrementing and negation, I would have well saved 2 bytes without using the full Hexagon.

Great thanks to Timwi for Esoteric IDE and Hexagony Colorer!

Title: Determine the depth of an array

Body:
Hexagony, 61 bytes

Edit: Thanks @Martin Ender♦ for saving me 1 byte from the marvelous -1 trick!

|/'Z{>"-\..(.."/'&<'..{>-&,=+<$.{\$._{..><.Z=/...({=Z&"&@!-"

<a href="http://hexagony.tryitonline.net/#code=fC8nWns-Ii1cLi4oLi4iLycmPCcuLns-LSYsPSs8JC57XCQuX3suLj48Llo9Ly4uLih7PVomIiZAIS0i&input=WzFdICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLT4gMQpbMSwgMiwgM10gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtPiAxCltbMSwgMiwgM11dICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC0-IDIKWzMsIFszLCBbM10sIDNdLCAzXSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLT4gMwpbW1tbMV0sIDJdLCBbMywgWzRdXV1dICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtPiA0ClsxLCBbWzNdXSwgWzUsIDZdLCBbW1tbOF1dXV0sIDFdICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC0-IDUKWzEsIFtbMiwgMywgW1s0XSwgNV0sIDYsIFs3LCA4XV0sIDksIFsxMCwgW1tbMTFdXV1dLCAxMiwgMTNdLCAxNF0gLT4gNgpbW1tbW1tbM11dXV1dXV0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtPiA3" rel="nofollow noreferrer">Try it online to verify test cases!

The images below are not modified but the flow is basically the same.  Also note that this will return -1 if the input is not an array (i.e. without []).

I have lots of no-ops inside the Hexagon... I guess it can definitely be golfed more.

Explanation

In brief, it adds -1 when encounters a [ and adds 1 when encounters a ].  Finally it prints the max it has got.

Let's run along Test Case 5 to see its behaviour when it runs along the String [1, [[3]], [5, 6], [[[[8]]]], 1]:

It starts at the beginning and takes its input at the W corner:

Since there is still input (not the null character \0 or EOL), it wraps to the top and starts the crimson path.

Here is what happens when from there till cute ><:

, reads [ into Buffer, and { and Z sets the constant Z to be 90. ' moves to Diff and - calculates the difference.  For [ and ] the difference will be 1 and 3 respectively.  For numbers and spaces and commas it'll be negative.

Then we run ( twice (once at the end of crimson path, one at the start after wrapping at the green path) to get -1 and 1 resp for [ and ].  Here we change the naming of Diff to Value.  Add this Value to Depth. (I used Z& to ensure that it copies the right neighbor).  Then we calculate lastMin - Depth and got a number on the Memory edge minLR.

Then we apply & (at the end of green path) to minLR: If the number is <=0, it copies the left value (i.e. lastMin - Depth <= 0 => lastMin <= Depth), otherwise it takes the right value.

We wraps to the horizontal blue path and we see Z& again which copies the minLR.  Then we "& and made a copy of the calculated min.  The brackets are assumed to be balanced, so the min must be <=0.  After wrapping, the blue path go left and hit (, making the copy 1 less than the real min.  Reusing the -, we created one more 1-off copy as a neighbor of Buffer:

Note: copy is renamed as 1-off

When blue path hits \ and got a nice " and < catches it back to the main loop.

When the loop hits 1, , or  or other numbers as input:

The Diff will become negative and it got reflected back to the main loop for next input.

When everything has gone through the main loop, we reach EOL which makes Buffer -1 and it finally goes to the bottom edge:

' moves the MP to the 1-off copy and ) increments it, and with ~ negation it got the correct Max Depth value which is printed with !

And the story ends with a @.

I guess I must have over complicating things a little bit.  If I have had to only "move back" and "print" without incrementing and negation, I would have well saved 2 bytes without using the full Hexagon.

Great thanks to Timwi for Esoteric IDE and Hexagony Colorer!


答:
Lua(5.2), 144 bytes

```<code>k,a,p,q=loadstring,arg,io.write,print l,d=k"for i=3,a[1]do p(a[5])end",k"for i=1,a[2]do q(a[4])end"b=a[3]p(b)l()q(b)d()p(b)l()q(b)d()p(b)l()p(b)
</code>```

Try it online! (Coding Ground)

It should output something like that right now:

```<code>+@@@@@+
l
l
+@@@@@+
l
l
+@@@@@+
</code>```

Own input: 7 2 + l @

You can change the input in project->compile options  and there change the values, each value as in the example but not separated by commas but by spaces.

Title: The Letter E with E

Body:
Your task is to display the below letter "E" shaped ASCII art, given five inputs.

Examples:

Input: 7,2,+,|,- (Note: You don't have to follow this exact input format, and if you don't use it, then you must explain how your own input format works)

Explanation:

7 total width, including the left and right edge characters.

2 Number of vertical characters.

+ The character that should display at the edges.

| The character that should display vertically between the edges.

- The character that should display horizontally.

Output of the above example:

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

Other examples:

Input: 7,2,@,|,-

Output:

```<code>@-----@
|
|
@-----@
|
|
@-----@
</code>```

Input: 7,2,+,|,#

Output:

```<code>+#####+
|
|
+#####+
|
|
+#####+
</code>```

Input: 8,3,+,|,#

Output:

```<code>+######+
|
|
|
+######+
|
|
|
+######+
</code>```

Input: 8,3,+,@,#

Output:

```<code>+######+
@
@
@
+######+
@
@
@
+######+
</code>```

Input: 9,4,^,$,!

Output:

```<code>^!!!!!!!^
$
$
$
$
^!!!!!!!^
$
$
$
$
^!!!!!!!^
</code>```

Cheating and standard loopholes are not allowed.

Your code must not print anything to STDERR.

Your code may accept any character encoding you choose as the input, but any character encoding you choose must, as a minimum, support all the 95 printable ASCII characters.

The shortest code, in bytes, that completes this challenge successfully, is the winning code.

Leaderboard

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

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

Leaderboard

	Author	Language	Size

Winners by Language

Language	User	Score

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

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

```

Body:
Lua(5.2), 144 bytes

k,a,p,q=loadstring,arg,io.write,print l,d=k"for i=3,a[1]do p(a[5])end",k"for i=1,a[2]do q(a[4])end"b=a[3]p(b)l()q(b)d()p(b)l()q(b)d()p(b)l()p(b)

Try it online! (Coding Ground)

It should output something like that right now:

+@@@@@+
l
l
+@@@@@+
l
l
+@@@@@+

Own input: 7 2 + l @

You can change the input in project->compile options  and there change the values, each value as in the example but not separated by commas but by spaces.


问:
Terminating, Purely Periodic, or Eventually Periodic?

Introduction

A decimal is terminating if it has a finite number of decimal digits. For example, 0.4 (2/5) is terminating because it has one decimal digit.

A decimal is purely periodic if it has an infinite number of decimal digits and has no decimal digits before its repetent (the part of the decimal that repeats.) For example, 0.142857142857142… (1/7) is purely periodic because it has a repetend 142857, which starts repeating immediately after the decimal point.

A decimal is eventually periodic if it has an infinite number of decimal digits and has a finite number of decimal digits before its repetent (the part of the decimal that repeats.) For example, 0.166666666666666… (1/6) is eventually periodic because its repetend 6 starts repeating after a 1.

Your task

Write a program or function that, when given numbers p and q (integers, 0 <= p < q <= 100), will determine if the decimal representation of p/q is terminating, purely periodic, or eventually periodic.

You must output a if it's Terminating (i.e. 0.1), b if it's Purely Periodic (i.e. 0.333...), or c if it's Eventually Periodic (i.e. 0.166...), where a, b, and c are any distinct, constant strings of your choice.

Test cases

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

You can find all test cases here.

You are allowed to choose your own 3 values for the output, but it must be clear as to which one it is.

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

Hints

Terminating:

 The prime factorization of a terminating decimal's denominator in simplest form consists only of 2s and 5s.

Purely Periodic:

 The prime factorization of a purely periodic decimal's denominator in simplest form does not include any 2s or 5s.

Eventually Periodic:

 The prime factorization of an eventually periodic decimal's denominator in simplest form includes at least one 2 or 5, but also includes other numbers.

Leaderboards

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

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=95926,OVERRIDE_USER=12537;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

```

答:
Actually, 15 bytes

This is based on Dennis' Jelly answer. 0 is terminating, 1 is purely periodic, and 2 is eventually periodic. Golfing suggestions welcome. Try it online!

```<code>▼Ny9u♀%SR♂b╔2@¿
</code>```

Ungolfing

```<code>      Implicit input [a, b].
▼     Divide a and b by gcd(a,b).
Ny    Get the unique prime divisors of the reduced denominator.
9u    Push 10.
♀%    10 mod every member of uniq_p_d.
SR    Sort the mods and reverse.
♂b    Logical buffer. Converts every (10 % p != 0) to 1, and everything else to 0.
        Meaning if 2 or 5 divided b, they are now 0, and every other prime is now 1.
╔     Uniquify the list.
        If terminating, return [0].
        If purely periodic, return [1].
        If eventually periodic, return [1, 0].
        Else, (if b was 1), return [].
2@¿   Convert from binary to decimal. Return 0, 1, or 2.
      Implicit return.
</code>```

Body:
Actually, 15 bytes

This is based on Dennis' Jelly answer. 0 is terminating, 1 is purely periodic, and 2 is eventually periodic. Golfing suggestions welcome. Try it online!

▼Ny9u♀%SR♂b╔2@¿

Ungolfing

      Implicit input [a, b].
▼     Divide a and b by gcd(a,b).
Ny    Get the unique prime divisors of the reduced denominator.
9u    Push 10.
♀%    10 mod every member of uniq_p_d.
SR    Sort the mods and reverse.
♂b    Logical buffer. Converts every (10 % p != 0) to 1, and everything else to 0.
        Meaning if 2 or 5 divided b, they are now 0, and every other prime is now 1.
╔     Uniquify the list.
        If terminating, return [0].
        If purely periodic, return [1].
        If eventually periodic, return [1, 0].
        Else, (if b was 1), return [].
2@¿   Convert from binary to decimal. Return 0, 1, or 2.
      Implicit return.


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

```

Title: Draw an ASCII chess board!

Body:
Python 3, 60 bytes

print('rnbqkbnr','p'*8,*['.'*8]*4,'P'*8,'RNBQKBNR',sep='\n')


答:
PARI/GP, 64 bytes

```<code>f(x,y)=if(setminus(factor(y=y/gcd(x,y))[,1]~,[2,5]),gcd(y,10)>1)
</code>```

Outputs nothing for terminating, 0 for purely and 1 for eventually periodic.

Not very fancy, I hoped for something better when I started.

Title: Terminating, Purely Periodic, or Eventually Periodic?

Body:
Introduction

A decimal is terminating if it has a finite number of decimal digits. For example, 0.4 (2/5) is terminating because it has one decimal digit.

A decimal is purely periodic if it has an infinite number of decimal digits and has no decimal digits before its repetent (the part of the decimal that repeats.) For example, 0.142857142857142… (1/7) is purely periodic because it has a repetend 142857, which starts repeating immediately after the decimal point.

A decimal is eventually periodic if it has an infinite number of decimal digits and has a finite number of decimal digits before its repetent (the part of the decimal that repeats.) For example, 0.166666666666666… (1/6) is eventually periodic because its repetend 6 starts repeating after a 1.

Your task

Write a program or function that, when given numbers p and q (integers, 0 <= p < q <= 100), will determine if the decimal representation of p/q is terminating, purely periodic, or eventually periodic.

You must output a if it's Terminating (i.e. 0.1), b if it's Purely Periodic (i.e. 0.333...), or c if it's Eventually Periodic (i.e. 0.166...), where a, b, and c are any distinct, constant strings of your choice.

Test cases

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

You can find all test cases here.

You are allowed to choose your own 3 values for the output, but it must be clear as to which one it is.

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

Hints

Terminating:

 The prime factorization of a terminating decimal's denominator in simplest form consists only of 2s and 5s.

Purely Periodic:

 The prime factorization of a purely periodic decimal's denominator in simplest form does not include any 2s or 5s.

Eventually Periodic:

 The prime factorization of an eventually periodic decimal's denominator in simplest form includes at least one 2 or 5, but also includes other numbers.

Leaderboards

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

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

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

Leaderboard

	Author	Language	Size

Winners by Language

Language	User	Score

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

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

```

Body:
PARI/GP, 64 bytes

f(x,y)=if(setminus(factor(y=y/gcd(x,y))[,1]~,[2,5]),gcd(y,10)>1)

Outputs nothing for terminating, 0 for purely and 1 for eventually periodic.

Not very fancy, I hoped for something better when I started.


答:
PHP, 51 bytes

for(;--$z?:($c=$argn[$i++]).$z=$argn[$i++];)echo$c;
```

<p>Try it online!</p>

<h1>PHP, 54 bytes</h1>

<pre class="lang-php prettyprint-override"><code>for(;~$c=$argn[$i++];)echo str_repeat($c,$argn[$i++]);
</code>```

Try it online!

PHP, 54 bytes

for(;~$c=$argn[$i++];)echo str_pad($c,$argn[$i++],$c);
```

Try it online!

Title: Run Length Decoding

Body:
Write the shortest code in the language of your choice to perform run length decoding of the given string.

The string will be supplied as input on stdin in the form

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

where each C could be any printable ASCII character and each N is a digit 1 to 9 (inclusive).

Sample input:

```<code>:144,1'1
</code>```

Corresponding output:

```<code>:4444,'
</code>```

Body:
PHP, 51 bytes

for(;--$z?:($c=$argn[$i++]).$z=$argn[$i++];)echo$c;

Try it online!

PHP, 54 bytes

for(;~$c=$argn[$i++];)echo str_repeat($c,$argn[$i++]);

Try it online!

PHP, 54 bytes

for(;~$c=$argn[$i++];)echo str_pad($c,$argn[$i++],$c);

Try it online!


问:
Draw an asterisk triangle
Inspired by a task for Programming 101, here's a challenge that hopefully isn't too easy (or a duplicate).

Input:

A positive integer n >= 1.

Output:

n lines of asterisks, where every new line has one asterisk more than the line before, and starting with one asterisk in the first line.

Test case (n=5):

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

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

答:
TI-Basic, <s>28</s> 22 bytes

```<code>Prompt A
"*
For(B,1,A
Disp Ans
Ans+"*
End
</code>```

ContentLicense: CC BY-SA 4.0

Title: Draw an asterisk triangle

Body:
TI-Basic, <s>28</s> 22 bytes

Prompt A
"*
For(B,1,A
Disp Ans
Ans+"*
End


答:
GameMaker Language, 68 bytes

```<code>a="*"for(i=2;i<=argument0;i++){a+="#"for(j=0;j<i;j++)a+="*"}return a
</code>```

Title: Draw an asterisk triangle

Body:
Inspired by a task for Programming 101, here's a challenge that hopefully isn't too easy (or a duplicate).

Input:

A positive integer n >= 1.

Output:

n lines of asterisks, where every new line has one asterisk more than the line before, and starting with one asterisk in the first line.

Test case (n=5):

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

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

Body:
GameMaker Language, 68 bytes

a="*"for(i=2;i<=argument0;i++){a+="#"for(j=0;j<i;j++)a+="*"}return a


答:
Perl 5, 486 477 476 450 (+7 for -MImager flag) = 457 bytes

I saved a few bytes thanks to Dada by using functional new calls and getting rid of parens, and by using pop instead of $ARGV[0] as well as the final semicolon. I saved some more by putting that $n=pop where it's first used, and by using Perl 4 namespace notation with ' instead of ::.

```<code>$i=new Imager xsize=>$n=pop,ysize=>$n;$h=$n/2;$s=$n*.6;$f=$n*.4;$c='color';($b,$r,$y,$g,$w)=map{new Imager'Color"#$_"}qw(4285f4 ea4335 fbbc05 34a853 fff);$i->box(filled=>1,$c,$w);$i->arc($c,$$_[0],r=>$h,d1=>$$_[1],d2=>$$_[2])for[$b,315,45],[$r,225,315],[$y,135,225],[$g,45,135];$i->circle($c,$w,r=>$n*.3,filled=>1);$i->box($c,$b,ymin=>$f,ymax=>$s,xmin=>$h,xmax=>$n*.9,filled=>1);$i->polygon($c,$w,x=>[$n,$n,$s],y=>[0,$f,$f]);$i->write(file=>'g.png')
</code>```

It requires the module Imager, which needs to be installed from CPAN. Takes one integer as a command line argument. The image is not anti-aliased, so it's a bit ugly.

Copy the below code into a file g.pl. We need an additional +7 bytes for the -MImager flag, but it saves a few bytes because we don't need to use Imager;.

```<code>$ perl -MImager g.pl 200
</code>```

Here are various sizes:

N=10

N=100

N=200

The completely ungolfed code is straight-forward.

```<code>use Imager;
my $n = $ARGV[0];
my $i = Imager->new( xsize => $n, ysize => $n );

my $blue   = Imager::Color->new('#4285f4');
my $red    = Imager::Color->new('#ea4335');
my $yellow = Imager::Color->new('#fbbc05');
my $green  = Imager::Color->new('#34a853');
my $white  = Imager::Color->new('white');

$i->box( filled => 1, color => 'white' );
$i->arc( color => $blue,   r => $n / 2, d1 => 315, d2 => 45 );     # b
$i->arc( color => $red,    r => $n / 2, d1 => 225, d2 => 315 );    # r
$i->arc( color => $yellow, r => $n / 2, d1 => 135, d2 => 225 );    # y
$i->arc( color => $green,  r => $n / 2, d1 => 45,  d2 => 135 );    # g
$i->circle( color => $white, r => $n * .3, filled => 1 );
$i->box(
    color  => $blue,
    ymin   => $n * .4,
    ymax   => $n * .6,
    xmin   => $n / 2,
    xmax   => $n * .9,
    filled => 1
);
$i->polygon( color => $white, x => [ $n, $n, $n * .6 ], y => [ 0, $n * .4, $n * .4 ] );
$i->write( file => 'g.png' );
</code>```

This post previously had the code shaped like the output image. Since that is against the rules for code golf I had to remove it. See the revision history if you want to take a look. I used Acme::EyeDrops to create that, with a shape that I created from an image created with the program itself that I converted to ASCII art. The code I obfuscated was already golfed, which can be seen by replacing the first eval with a print.

Body:
Write a program or function that takes in a positive integer N, and outputs an N×N pixel image of Google's "G" logo according to this* construction:

For example, if N is 400, a 400×400 pixel logo should be output, with correct dimensions and colors:

It should look accurate regardless of how large or small N is. e.g. here is N = 13:

Your code should not need to connect to the internet. For example, scaling an externally hosted svg is not allowed. (Scaling an svg encoded in your code would be fine though.)

Anti-aliasing may be used or not. It's up to you.

Notice that the horizontal bar of the "G" does not extend all the way to the right edge of the image. The circle curves normally inward on the right edge before it is cut off.

The shortest code in bytes wins.

* The construction of the logo has been simplified for this challenge. The correct construction can be seen here and here.

Body:
Perl 5, 486 477 476 450 (+7 for -MImager flag) = 457 bytes

I saved a few bytes thanks to Dada by using functional new calls and getting rid of parens, and by using pop instead of $ARGV[0] as well as the final semicolon. I saved some more by putting that $n=pop where it's first used, and by using Perl 4 namespace notation with ' instead of ::.

$i=new Imager xsize=>$n=pop,ysize=>$n;$h=$n/2;$s=$n*.6;$f=$n*.4;$c='color';($b,$r,$y,$g,$w)=map{new Imager'Color"#$_"}qw(4285f4 ea4335 fbbc05 34a853 fff);$i->box(filled=>1,$c,$w);$i->arc($c,$$_[0],r=>$h,d1=>$$_[1],d2=>$$_[2])for[$b,315,45],[$r,225,315],[$y,135,225],[$g,45,135];$i->circle($c,$w,r=>$n*.3,filled=>1);$i->box($c,$b,ymin=>$f,ymax=>$s,xmin=>$h,xmax=>$n*.9,filled=>1);$i->polygon($c,$w,x=>[$n,$n,$s],y=>[0,$f,$f]);$i->write(file=>'g.png')

It requires the module Imager, which needs to be installed from CPAN. Takes one integer as a command line argument. The image is not anti-aliased, so it's a bit ugly.

Copy the below code into a file g.pl. We need an additional +7 bytes for the -MImager flag, but it saves a few bytes because we don't need to use Imager;.

$ perl -MImager g.pl 200

Here are various sizes:

N=10

N=100

N=200

The completely ungolfed code is straight-forward.

use Imager;
my $n = $ARGV[0];
my $i = Imager->new( xsize => $n, ysize => $n );

my $blue   = Imager::Color->new('#4285f4');
my $red    = Imager::Color->new('#ea4335');
my $yellow = Imager::Color->new('#fbbc05');
my $green  = Imager::Color->new('#34a853');
my $white  = Imager::Color->new('white');

$i->box( filled => 1, color => 'white' );
$i->arc( color => $blue,   r => $n / 2, d1 => 315, d2 => 45 );     # b
$i->arc( color => $red,    r => $n / 2, d1 => 225, d2 => 315 );    # r
$i->arc( color => $yellow, r => $n / 2, d1 => 135, d2 => 225 );    # y
$i->arc( color => $green,  r => $n / 2, d1 => 45,  d2 => 135 );    # g
$i->circle( color => $white, r => $n * .3, filled => 1 );
$i->box(
    color  => $blue,
    ymin   => $n * .4,
    ymax   => $n * .6,
    xmin   => $n / 2,
    xmax   => $n * .9,
    filled => 1
);
$i->polygon( color => $white, x => [ $n, $n, $n * .6 ], y => [ 0, $n * .4, $n * .4 ] );
$i->write( file => 'g.png' );

This post previously had the code shaped like the output image. Since that is against the rules for code golf I had to remove it. See the revision history if you want to take a look. I used Acme::EyeDrops to create that, with a shape that I created from an image created with the program itself that I converted to ASCII art. The code I obfuscated was already golfed, which can be seen by replacing the first eval with a print.


问:
Random dice tipping
In a standard dice (die) the numbers are arranged so that opposite faces add to seven.
Write the shortest possible program in your preferred language which outputs a random throw followed by 9 random tippings. A tipping is a quarter turn of the dice, e.g. if the dice is facing 5, all possible tippings are 1,3,4 and 6.

Example of desired output:

1532131356

答:
J, 30 characters

```<code>>:(?@4:{(i.6)-.],5&-)^:(<10)?6
</code>```

6 2 3 5 4 2 4 1 3 6

Explanations (read from right to left):

?6 returns a random number between 0 and 5

^:(<10) applies a function 9 times, accumulating the results along the way.  The function is:

?@4:{(i.6)-.],5&-

] , 5&- returns an array of the input number and its complement to 5 (we're handling 0-based numbers currently, so the sum of opposite faces is 5)

(i. 6) -. removes them from the full set of integers 0 to 5.  We're left with all valid positions after a single tipping operation from the input position.

?@4: { picks one of those at random.

>: increments the whole sequence to bring the figures back to the 1 to 6 interval.

ContentLicense: CC BY-SA 2.5

Title: Random dice tipping

Body:
J, 30 characters

>:(?@4:{(i.6)-.],5&-)^:(<10)?6

6 2 3 5 4 2 4 1 3 6

Explanations (read from right to left):

?6 returns a random number between 0 and 5

^:(<10) applies a function 9 times, accumulating the results along the way.  The function is:

?@4:{(i.6)-.],5&-

] , 5&- returns an array of the input number and its complement to 5 (we're handling 0-based numbers currently, so the sum of opposite faces is 5)

(i. 6) -. removes them from the full set of integers 0 to 5.  We're left with all valid positions after a single tipping operation from the input position.

?@4: { picks one of those at random.

>: increments the whole sequence to bring the figures back to the 1 to 6 interval.


答:
Java, 128 bytes

```<code>boolean f(String k){return k.chars().flatMap(i->"aeiouAEIOU".contains(((char)i)+"")?IntStream.of(1):IntStream.of(0)).sum()%2>0;}
</code>```

There's definitely a better way than using Instream.of(0) and Instream.of(1).

Title: Is it an Odd Word?

Body:
Challenge

Given a single word as input, determine if the word is odd or even.

Odd and Even words

Assume the general rules:

```<code>odd + odd = even
even + odd = odd
odd + even = odd
even + even = even
</code>```

In the alphabet, the odd letters are:

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

And the even letters are:

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

The same applies to capital letters (AEIOU are odd and BCDFGHJKLMNPQRSTVWXYZ are even).

You then 'add' each of the letters in the word together. For example, the word cats is equivalent to:

```<code>even + odd + even + even
</code>```

Which simplifies to:

```<code>odd + even
</code>```

Which simplifies further to:

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

So the word cats is odd.

Examples

```<code>Input:  trees
Output: even
</code>```

```<code>Input:  brush
Output: odd
</code>```

```<code>Input:  CAts
Output: odd
</code>```

```<code>Input:  Savoie
Output: even
</code>```

```<code>Input:  rhythm
Output: even
</code>```

Rules

All input will be a single word which will only contain alphabetical characters.

If the word is odd, output a truthy value. If the word is even, output a falsey value.

Winning

The shortest code in bytes wins.

Body:
Java, 128 bytes

boolean f(String k){return k.chars().flatMap(i->"aeiouAEIOU".contains(((char)i)+"")?IntStream.of(1):IntStream.of(0)).sum()%2>0;}

There's definitely a better way than using Instream.of(0) and Instream.of(1).


答:
C 173 Bytes

Takes two integers from stdin, prints 1 for purely periodic, -1 for eventually periodic, and 0 for terminating.

```<code>int r;main(_,n,d){_-1?_-2?d-1?d%2&&d%5?r=1:d%2?main(3,n,d/5):main(3,n,d/2),r=r?-1:0:r=0:d?main(2,d,n%d):r=n:scanf("%d %d",&n,&d),main(2,n,d),main(3,n/r,d/r),printf("%d",r);}
</code>```

Ungolfed:

```<code>// returns 1 for periodic, 0 for terminating, <0 for eventually periodic
int periodic(int num, int den) { // 3
    if (den == 1) return 0;
    if (den % 2 && den % 5) // pure periodic
        return 1;
    if (den % 2) return periodic(num,den/5) ? -1 : 0;
    return periodic(num,den/2) ? -1 : 0;
}

int gcd(int num, int den) { // 2
    if (den)
        return gcd(den,num%den);
    return num;
}

int main(n,d) // 1
{
    scanf("%d %d",&n,&d);
    printf("%d",periodic(n/gcd(n,d),d/gcd(n,d)));
    return 0;
}
</code>```

Half-golfed:

```<code>int r;main(_,n,d){
    _-1?
    _-2?
    // periodic
    d-1?
        d%2&&d%5?
            r=1:
                d%2?
                    main(3,n,d/5): //periodic
                    main(3,n,d/2), //periodic
                        r=r?-1:0:
                r=0
    // gcd
    :d?main(2,d,n%d):r=n // gcd
    // main
    :scanf("%d %d",&n,&d),
     main(2,n,d), // gcd
     main(3,n/r,d/r), // periodic
     printf("%d",r);
}
</code>```

Body:
C 173 Bytes

Takes two integers from stdin, prints 1 for purely periodic, -1 for eventually periodic, and 0 for terminating.

int r;main(_,n,d){_-1?_-2?d-1?d%2&&d%5?r=1:d%2?main(3,n,d/5):main(3,n,d/2),r=r?-1:0:r=0:d?main(2,d,n%d):r=n:scanf("%d %d",&n,&d),main(2,n,d),main(3,n/r,d/r),printf("%d",r);}

Ungolfed:

// returns 1 for periodic, 0 for terminating, <0 for eventually periodic
int periodic(int num, int den) { // 3
    if (den == 1) return 0;
    if (den % 2 && den % 5) // pure periodic
        return 1;
    if (den % 2) return periodic(num,den/5) ? -1 : 0;
    return periodic(num,den/2) ? -1 : 0;
}

int gcd(int num, int den) { // 2
    if (den)
        return gcd(den,num%den);
    return num;
}

int main(n,d) // 1
{
    scanf("%d %d",&n,&d);
    printf("%d",periodic(n/gcd(n,d),d/gcd(n,d)));
    return 0;
}

Half-golfed:

int r;main(_,n,d){
    _-1?
    _-2?
    // periodic
    d-1?
        d%2&&d%5?
            r=1:
                d%2?
                    main(3,n,d/5): //periodic
                    main(3,n,d/2), //periodic
                        r=r?-1:0:
                r=0
    // gcd
    :d?main(2,d,n%d):r=n // gcd
    // main
    :scanf("%d %d",&n,&d),
     main(2,n,d), // gcd
     main(3,n/r,d/r), // periodic
     printf("%d",r);
}


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

```

答:
Y, 19 bytes

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

Call the special function O (output) with the string Hello, World!

Title: "Hello, World!"

Body:
Y, 19 bytes

∅O("Hello, World!")

Call the special function O (output) with the string Hello, World!


答:
MoonScript, 31 bytes

```<code>(n)->for i=1,n
 print "*"\rep i
</code>```

Sample call:

```<code>_ 5
</code>```

Title: Draw an asterisk triangle

Body:
MoonScript, 31 bytes

(n)->for i=1,n
 print "*"\rep i

Sample call:

_ 5


Body:
HTML/JS, <s>680</s> 624 bytes

To get 624 bytes, remove the last ;, this is needed for the snippet below due to the way it imports the HTML. Also, Firefox seems to not support image-rendering: pixelated and needs -moz-crisp-edges instead (thanks @alldayremix!) which makes a Firefox solution +7 but this does work in Chrome as expected.

Utilises JavaScript to request N and a <style> block to position/colour the elements. Uses basic HTML elements, rather than applying styles to a canvas (which, it appears, was a much shorter approach!). This is a revamped approach using a data: URI background image instead of just coloured elements. I've kept the previous approach below in case this new one works on fewer browsers.

I thought this was going to be a lot smaller than it ended up being, but it was an interesting exercise nonetheless!

<body id=x onload=x.style.fontSize=prompt()+'px'><u><a></a><b></b><i></i><s><style>u,a,b,i,s{position:relative;display:block}b,i,s{position:absolute}a,u{width:1em;height:1em}a,b{border-radius:50%}a{image-rendering:pixelated;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAIAAAD91JpzAAAAFklEQVQI12N45Wzq1PqF4fceVpMVwQAsHQYJ1N3MAQAAAABJRU5ErkJggg)no-repeat;background-size:100%;transform:rotate(45deg)}b{top:.2em;left:.2em;width:.6em;height:.6em;background:#fff}i{border-top:.4em solid transparent;border-right:.4em solid#fff;top:0;right:0}s{top:.4em;right:.1em;width:.4em;height:.2em;background:#4285f4;

Previous version:

<body id=x onload=x.style.fontSize=prompt()+'px'><a b><b l style=padding-left:.5em></b><b y></b><b g></b></a><i style=height:.4em></i><i style="background:#ea4335;border-radius:0 1em 0 0;transform-origin:0%100%;transform:rotate(-45deg)"></i><i b z style=top:.2em;left:.2em;width:.6em;height:.6em></i><i l z style="top:.4em;height:.2em;border-radius:0 2%10%0/0 50%50%0;width:.4em"><style>*{position:relative;background:#fff}a,b,i{display:block;float:left;width:.5em;height:.5em}a{height:1em;width:1em;transform:rotate(45deg);overflow:hidden}i{position:absolute;top:0;left:.5em}[b]{border-radius:50%}[g]{background:#34a853}[l]{background:#4285f4}[y]{background:#fbbc05}[z]{z-index:1