问:
Make me a mooncake!
The mid-autumn festival has begun!

Unfortunately, all my mooncakes were stolen -- they're getting too expensive for small folk such as myself, and I fear I won't be able to eat any this year!

So I turn to you for help. Would you be able to make me some?

For those unaware, let me educate you on what a mooncake looks like.

Mooncakes come in many different sizes!

So I'm gonna give you my input, n, when I want one.

Here are some examples of the output I want:

Mooncake of size n = 3:

```<code>    (@@@@@)
    (@MAF@)
    (@@@@@)
</code>```

Mooncake of size n = 6:

```<code>    (@@@@@@@@@@@)
    (@         @)
    (@    M    @)
    (@    F    @)
    (@         @)
    (@@@@@@@@@@@)
</code>```

That is to say, a mooncake of size n is:

n lines high

2n - 1 @s long

2n + 1 characters long (@s and brackets)

And you better not throw me your too-tiny practice mooncakes!

Assume input will always be n >= 3.

Mooncakes also contain one of the following decorations:

MF

MAF

HMF

JCJ

TTT

ZJ

LF

RF

CF

Which one, it doesn't matter - as long as it is vertically and horizontally centered.

It can be written vertically or horizontally too!

I want variety!

If you're really going to make me two of the same mooncake, the decoration better be different!

That is, multiple executions of your program with the exact same input must not always yield the same decoration.

I can't wait to eat your moon cakes, so the sooner I can receive them (the shorter your code) the better!

Good Luck!

For those wondering about the decorations:

They are the initials of all alternative names for the Mid-Autumn Festival.

A list can be found in the Wikipedia page linked at the top of this post.

Clarifications:

There are no rules regarding leading and trailing whitespace.

Have as much or as little as you like!

The decorations must be in the very center of your mooncake!

On horizontal decorations, this means it must be on the middle line of your cake, and the number of characters to the left and right of the decoration string must be equal.

On vertical decorations, this means it must reside in the middle column of your cake, and the number of characters above and below the decoration must be equal.

Not all decorations must be used!

The only requirement is that there must be more than one possibility for any given input n. The possibilities also do not need to be even.

Functions are acceptable.

答:
Ruby 2.3.1, <s>449</s> <s>265</s> <s>245</s> <s>233</s> 230 characters

Seems like there should be a ruby answer, so here is a ruby answer. It's really not that clever, Hopefully someone else here will be more clever ;)

Golfed version:

```<code>def m(n)
d,s=n.odd?? [[%w{MAF HMF}.sample],n/2]:[%w{RF LF}.sample.chars,(n-2)/2]
r=->f{l=f.size;q=($i-l)/2;($c=' '*$i)[q...l+q]=f;puts "(@#$c@)"}
$i=2*n-1;a='@'*$i
r[a]
(1..n-2).map{|x|(s...s+d.size)===x ?r[d[x-s]]:r['']}
r[a]
end
</code>```

Golfing tricks:

replace method declaration with a stabby string interpolation of

$globals doesn't need #{global}, only #$global

=== for ranges is shorter than .covers?

Readable version

```<code>def row(inner_width, fillchar='')
  padding = ( inner_width - fillchar.size) / 2
  (center =(' ' * inner_width))[padding...fillchar.size+padding]=fillchar
  puts "(@"+center+"@)"
end

def mooncake(n)
  decoration = n.odd?? [%w{ MAF HMF JCJ TTT }.sample] : %w{ ZJ LF RF CF }.sample.chars
  start_row = n.odd?? (n/2) : (n - 2) / 2
  inner_width = 2 * n - 1
  row(inner_width,'@'*inner_width)
  (1...(n-1)).each do |row|
    if (start_row ... start_row + decoration.size).include? row
      row(inner_width,decoration[row - start_row])
    else
      row(inner_width)
    end
  end
  row(inner_width,'@'*inner_width)
end
</code>```

Testing

```<code>mooncake(3)
mooncake(4)
mooncake(5)
mooncake(6)
</code>```

Title: Make me a mooncake!

Body:
Ruby 2.3.1, <s>449</s> <s>265</s> <s>245</s> <s>233</s> 230 characters

Seems like there should be a ruby answer, so here is a ruby answer. It's really not that clever, Hopefully someone else here will be more clever ;)

Golfed version:

def m(n)
d,s=n.odd?? [[%w{MAF HMF}.sample],n/2]:[%w{RF LF}.sample.chars,(n-2)/2]
r=->f{l=f.size;q=($i-l)/2;($c=' '*$i)[q...l+q]=f;puts "(@#$c@)"}
$i=2*n-1;a='@'*$i
r[a]
(1..n-2).map{|x|(s...s+d.size)===x ?r[d[x-s]]:r['']}
r[a]
end

Golfing tricks:

replace method declaration with a stabby string interpolation of

$globals doesn't need #{global}, only #$global

=== for ranges is shorter than .covers?

Readable version

def row(inner_width, fillchar='')
  padding = ( inner_width - fillchar.size) / 2
  (center =(' ' * inner_width))[padding...fillchar.size+padding]=fillchar
  puts "(@"+center+"@)"
end

def mooncake(n)
  decoration = n.odd?? [%w{ MAF HMF JCJ TTT }.sample] : %w{ ZJ LF RF CF }.sample.chars
  start_row = n.odd?? (n/2) : (n - 2) / 2
  inner_width = 2 * n - 1
  row(inner_width,'@'*inner_width)
  (1...(n-1)).each do |row|
    if (start_row ... start_row + decoration.size).include? row
      row(inner_width,decoration[row - start_row])
    else
      row(inner_width)
    end
  end
  row(inner_width,'@'*inner_width)
end

Testing

mooncake(3)
mooncake(4)
mooncake(5)
mooncake(6)


问:
Bake a slice of Pi
Write a program or function that prints or outputs this exact text (consisting of 142 characters):

```<code>()()()()()()
|\3.1415926|
|:\53589793|
\::\2384626|
 \::\433832|
  \::\79502|
   \::\8841|
    \::\971|
     \::\69|
      \::\3|
       \__\|
</code>```

Your program must take no input (except in languages where this is impossible, such as sed), and produce the above text (and only the above text) as output. A trailing newline is acceptable.

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

ContentLicense: CC BY-SA 3.0

Title: Bake a slice of Pi

Body:
Python 2, <s>193</s> 176 bytes

P="3.1415926 53589793 2384626 433832 79502 8841 971 69 3".split()
f="()"*6+"\n|\%s|\n|:\%s|\n"%(P[0],P[1])
for s in range(7):f+=" "*s+"\::\\"+P[s+2]+"|\n"
print f+" "*7+"\__\|"

Or a shorter, more boring answer:

print r"""()()()()()()
|\3.1415926|
|:\53589793|
\::\2384626|
 \::\433832|
  \::\79502|
   \::\8841|
    \::\971|
     \::\69|
      \::\3|
       \__\|"""


问:
Round to n Sig Figs

Challenge

Given a number x and a number n, round number x to n significant figures and output the result.

Significant figures

The significant figures of a number are digits that carry meaning contributing to its measurement resolution. This includes all numbers except leading zeroes.

Bear in mind that leading zeroes after a decimal point are still insignificant figures.

When rounding a digit, you must round away from zero if the following digit is greater or equal than five.

All trailing zeroes after a decimal point are counted as significant.

Input

The first number will be x, the number to be rounded. The second number will be n, the number of significant figures you should round x to.

x will be a number (your code should handle both integers and floating points) between -1,000,000,000 and 1,000, 000,000 inclusive. n will be a positive integer between 1 and 50 inclusive. n will never be greater than the nunber of digits in x.

The input will never be 0 or any form of 0, e.g. 0.000 or 000.

Examples

```<code>Inputs: 2.6754, 2
Output: 2.7
</code>```

An output of 2.7000 would be invalid because the trailing zeroes after the decimal point are counted as significant figures.

```<code>Inputs: 0.00034551, 4
Output: 0.0003455
</code>```

```<code>Inputs: 50237.1238, 3
Output: 50200
</code>```

Note that this must not have a decimal point.

```<code>Inputs: 2374905, 1
Output: 2000000
</code>```

```<code>Inputs: 543.0489, 4
Output: 543.0
</code>```

```<code>Inputs: 15, 1
Output: 20
</code>```

```<code>Inputs: 520.3, 3
Output: 520
</code>```

If you wish, you can output 520. instead but not 520.0.

```<code>Inputs: -53.87, 2
Output: -54
</code>```

```<code>Inputs: 0.0999, 2
Output: 0.10
</code>```

Rules

Built-in functions and libraries which allow you to round a number to n significant figures are disallowed.

Winning

The shortest code in bytes wins.

答:
Python 3, 83 bytes

(similar to the PHP answer)

from math import *
def s(x,n):
 y=10**(ceil(log10(abs(x)))-n)
 return y*round(x/y)
```
<p>Test cases:</p>
<pre class="lang-py prettyprint-override"><code>tests = [(2.6754,2), (0.00034551, 4), (50237.1238, 3),
        (2374905, 1), (543.0489, 4), (15, 1), (520.3, 3), (-53.87, 2)]

print ([s(x,n) for x,n in tests])
</code>```

Output:

[2.7, 0.0003455, 50200, 2000000, 543.0, 20, 520, -54]
```
<p>Apart from being slightly longer, another approach that I considered:</p>
<pre class="lang-py prettyprint-override"><code>from math import *
def s(x,n):
 z=ceil(log10(abs(x)))
 return "%.*f"%(n-z,10**z*round(x/10**z,n))
</code>```

... produces an incorrect output for the input of (15, 1):

['2.7', '0.0003455', '50200', '2000000', '543.0', '10', '520', '-54']
```

... due to floating point imprecision in the round() function. It seems likely to me that I could find test cases that would break the "round to zero decimal places" method also if I looked hard enough.

Thus, it seems to me that my solution probably isn't 100% correct for all cases and wouldn't be unless it was computed in decimal. This issue may therefore affect solutions in any language that use FP arithmetic.

Title: Round to n Sig Figs

Body:
Python 3, 83 bytes

(similar to the PHP answer)

from math import *
def s(x,n):
 y=10**(ceil(log10(abs(x)))-n)
 return y*round(x/y)

Test cases:

tests = [(2.6754,2), (0.00034551, 4), (50237.1238, 3),
        (2374905, 1), (543.0489, 4), (15, 1), (520.3, 3), (-53.87, 2)]

print ([s(x,n) for x,n in tests])

Output:

[2.7, 0.0003455, 50200, 2000000, 543.0, 20, 520, -54]

Apart from being slightly longer, another approach that I considered:

from math import *
def s(x,n):
 z=ceil(log10(abs(x)))
 return "%.*f"%(n-z,10**z*round(x/10**z,n))

... produces an incorrect output for the input of (15, 1):

['2.7', '0.0003455', '50200', '2000000', '543.0', '10', '520', '-54']

... due to floating point imprecision in the round() function. It seems likely to me that I could find test cases that would break the "round to zero decimal places" method also if I looked hard enough.

Thus, it seems to me that my solution probably isn't 100% correct for all cases and wouldn't be unless it was computed in decimal. This issue may therefore affect solutions in any language that use FP arithmetic.


问:
print 1 to 100 without using recursion and conditions
can we print 1 to 100 without using any if conditions and loops in c&c++?

Conditon:
main point is you must not use recursion...and doesnt hardcode code in it
for e.g

print(1 2 3..etc);

答:
Ruby (11)  [non-competitive]

```<code>p *(1..100)
</code>```

(Thanks to histocrat)

Previous 14-character solution:

```<code>p *1.upto(100)
</code>```

This is a non-competitive answer (not C/C++ as requested)

Body:
Ruby (11)  [non-competitive]

p *(1..100)

(Thanks to histocrat)

Previous 14-character solution:

p *1.upto(100)

This is a non-competitive answer (not C/C++ as requested)


问:
Print a layered cake

Challenge

Given an input n, print an ASCII art cake n layers tall, viewed from the side, with two candles on top. Refer to the examples below for details.

Output

```<code>>> cake(1)

 _|_|_
|     |
+-----+

>> cake(3)

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

...and so on.

Rules

Standard loopholes prohibited

Please make an attempt at a clever solution

This is code-golf, so shortest answer in bytes wins. However, the answer will not be selected.

Have fun!

Title: Print a layered cake

Body:
Python 2, 122 bytes

a='  '*input()
b='+-+'
c=d=' '
while a:b='+----'+b[1:];c=d*4+c;a=a[2:];print a+[' _|_|_',b][c>d*5]+'\n%s|%%s|'%a%c
print b


问:
Output the largest number with the fewest digits
Given a nonempty list of positive decimal integers, output the largest number from the set of numbers with the fewest digits.

The input list will not be in any particular order and may contain repeated values.

Examples:

```<code>[1] -> 1
[9] -> 9
[1729] -> 1729
[1, 1] -> 1
[34, 3] -> 3
[38, 39] -> 39
[409, 12, 13] -> 13
[11, 11, 11, 1] -> 1
[11, 11, 11, 11] -> 11
[78, 99, 620, 1] -> 1
[78, 99, 620, 10] -> 99
[78, 99, 620, 100] -> 99
[1, 5, 9, 12, 63, 102] -> 9
[3451, 29820, 2983, 1223, 1337] -> 3451
[738, 2383, 281, 938, 212, 1010] -> 938
</code>```

The shortest code in bytes wins.

答:
Racket 148 bytes

```<code>(λ(l)(define l2(map number->string l))(apply max(map string->number
(filter(lambda(x)(eq?(string-length x)(apply min(map string-length l2))))l2))))
</code>```

Testing:

```<code>(f (list 1 5 9 12 63 102))
</code>```

Output:

```<code>9
</code>```

Detailed version:

```<code>(define (f sl)
  (define sl2 (map number->string sl))
  (apply max
         (map string->number
              (filter (lambda(x)
                        (equal? (string-length x)
                                (apply min (map string-length sl2))
                                )) sl2))))
</code>```

Body:
Racket 148 bytes

(λ(l)(define l2(map number->string l))(apply max(map string->number
(filter(lambda(x)(eq?(string-length x)(apply min(map string-length l2))))l2))))

Testing:

(f (list 1 5 9 12 63 102))

Output:

9

Detailed version:

(define (f sl)
  (define sl2 (map number->string sl))
  (apply max
         (map string->number
              (filter (lambda(x)
                        (equal? (string-length x)
                                (apply min (map string-length sl2))
                                )) sl2))))


问:
StringgnirtSStringgnirtSStringgnirtS
Here is a relatively simple challenge for you.

Given a string of length N, output the string forwards, then backwards, then forwards, then backwards... etc. N times. For example, if your input was

```<code>Hello!
</code>```

You should output:

```<code>Hello!!olleHHello!!olleHHello!!olleH
</code>```

You may also optionally output one trailing newline.

Your submission may be either a full program or a function, and you may take input and output in any reasonable format. For example, you may take IO from STDIN/STDOUT, function arguments and return value, from a file, etc. You can safely assume that the input string will not be empty, and will only contain printable ASCII. You must output the new string on a single line. So, for example, if the output to the last example was

```<code>Hello!
!olleH
Hello!
!olleH
Hello!
!olleH
</code>```

This would not be a valid solution!

Here are some more test cases:

```<code>Input:
a
Output:
a

Input:
abcd
Output:
abcddcbaabcddcba

Input:
OK!
Output:
OK!!KOOK!

Input:
4815162342
Output:
4815162342243261518448151623422432615184481516234224326151844815162342243261518448151623422432615184

Input:
PPCG
Output:
PPCGGCPPPPCGGCPP

Input:
42
Output:
4224
</code>```

Leaderboards

Since this is a code-golf challenge, standard loopholes are banned, and the shortest answer in bytes wins! However, this is also a competition to have the shortest answer in any particular langauge. While it's unlikely that a Java answer will beat an answer in perl, or some golfing language, it's still very impressive to have the shortest Java answer. So, you can use this leaderboard to see both

The shortest answer out of all languages, and

The shortest answer in each individual 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=93261,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

```

答:
Python 3, 84 70 67 characters

```<code>def s(d,i=1):
 t=d[::(i%2)*2-1]
 if i<len(d):t+=s(d,i+1)
 return t
</code>```

Title: StringgnirtSStringgnirtSStringgnirtS

Body:
Python 3, 84 70 67 characters

def s(d,i=1):
 t=d[::(i%2)*2-1]
 if i<len(d):t+=s(d,i+1)
 return t


答:
Haskell, 103 bytes

f(a:b)n=a:([0..4*n]>>b)++[a]
x!n=x:[f"| "n,f"+-"n]
g 1=" _|_|_"!1
g n=map("  "++)(init.g$n-1)++f"+-"n!n
```

Defines a function g which returns a list of strings containing the lines of the output

Title: Print a layered cake

Body:
Challenge

Given an input n, print an ASCII art cake n layers tall, viewed from the side, with two candles on top. Refer to the examples below for details.

Output

```<code>>> cake(1)

 _|_|_
|     |
+-----+

>> cake(3)

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

...and so on.

Rules

Standard loopholes prohibited

Please make an attempt at a clever solution

This is code-golf, so shortest answer in bytes wins. However, the answer will not be selected.

Have fun!

Body:
Haskell, 103 bytes

f(a:b)n=a:([0..4*n]>>b)++[a]
x!n=x:[f"| "n,f"+-"n]
g 1=" _|_|_"!1
g n=map("  "++)(init.g$n-1)++f"+-"n!n

Defines a function g which returns a list of strings containing the lines of the output


答:
Python 3, 162 characters

```<code>p=print
t=int(input())
d=4*'-'
s='  '
a='+\n'
r=(t-1)*s
p(r+' _|_|_\n'+r+'|     |')
for i in range(2,t+1):b=(t-i)*s;p(b+'+-'+i*d+a+b+'| '+i*2*s+'|')
p('+-'+t*d+a)
</code>```

It's not very clever, but I've never done one of these before. (Edit: removed unnecessary parentheses; reduced by one more character)

Title: Print a layered cake

Body:
Python 3, 162 characters

p=print
t=int(input())
d=4*'-'
s='  '
a='+\n'
r=(t-1)*s
p(r+' _|_|_\n'+r+'|     |')
for i in range(2,t+1):b=(t-i)*s;p(b+'+-'+i*d+a+b+'| '+i*2*s+'|')
p('+-'+t*d+a)

It's not very clever, but I've never done one of these before. (Edit: removed unnecessary parentheses; reduced by one more character)


问:
Decipher Neurotic Frogs

Decipher Neurotic Frogs

Now that Puzzling.SE has finally cracked my amphibian-obsessed cipher, let's write a program or function to decrypt it!

(If you want to look at the puzzle before having it spoiled for you, click the above link now.)

How the cipher works

In Neurotic Frogs Ought To Relax In Mud Baths ("Neurotic Frogs" for short), every letter is encrypted as one or two words:

The length of a non-italicized word represents a letter.

neurotic => 8 letters => H

frogs => 5 letters => E

perpendicular => 13 letters = M

A word that contains italics modifies the following word, adding 10 if the italicized word was odd in length or 20 if the italicized word was even in length. Any or all of the word may be italicized. An italicized word is always followed by a non-italicized word.

*o*ught to => odd, 2 => 12 => L

lo*u*nging calms => even, 5 => 25 => Y

Every word of plaintext corresponds to a sentence of ciphertext, and every sentence of plaintext corresponds to a paragraph of ciphertext.

Input format

Your program or function shall input a message in Neurotic Frogs, formatted in Markdown. The input will consist only of printable ASCII and newlines.

Words are runs of characters that match the regex [A-Za-z0-9'].

Numbers and letters both count toward the length of a word. QB64 represents D.

NOTE: Apostrophes do not count toward the length of a word. Isn't represents D, not E.

Italicized letters are wrapped in a pair of asterisks (*letters*).

One or more consecutive letters may be italicized, up to an entire word (masseus*es*, *all*); multiple non-consecutive letters in a word may also be italicized (g*e*n*e*rates).

Italics never span multiple words, never include punctuation, and never include apostrophes.

Unpaired asterisks and multiple adjacent asterisks will never occur.

Punctuation is any of the following characters: .,?!:;-()".

Words within a sentence are separated by one or more punctuation characters and/or a single space. Examples: *all* welcomed, toad*s*, newts, Ever*y*one--frogs, cap... bliss, they're (I

Sentences end with one or more punctuation characters and are separated by a double space: Th*e* Montgomery A*m*phibian Salon!  Come luxuriate today!

Paragraphs are separated by a single newline. (The last sentence of a paragraph still has one or more punctuation characters at the end.)

Other characters will not appear in input and do not need to be handled.

Your code may, at your discretion, expect input to have a single trailing newline.

Output format

The result of decrypting the input will be one or more sentences. Letters of plaintext may be any combination of upper- and lowercase. Words within a sentence must be separated by single spaces. Sentences must end with a period (.) and be separated by a single space. You may output a trailing space after the last sentence. Your output will all be on one line, but you may output a trailing newline.

Miscellaneous details

Your code may use any of the standard input and output methods. It must receive input as a multiline string, not a list or other data structure, and it must output a string.

The shortest code in bytes wins!

Test cases

```<code>-->
Neurotic Frogs *O*ught To Rel*a*x In *M*ud Baths!
<--
HELLO.

-->
Business standards all*o*w only *adult* amphibians.
<--
HINT.

-->
Rejoice, *a*ll frogs an*d* toads also!  Montgomery Sal*o*n opens up!  Ha*pp*y throng fill*s* street ecstatically!
<--
GOOD JOB PPL.

-->
I like 3.1415926535897.
IM*O*, it's a *b*la*st*, yeah!
<--
ADAM. MAN.

-->
*I*, happily, *th*anks 2 u *e*ditin*g* specific wor*ding*--clarifying a *bit*--betterment :D!
<--
QUARTATA.

-->
Perpendicular l*ou*nging calms.  *A* frog, a m*u*d cap... bliss!  Wallowing g*e*n*e*rates happiness.  Amphibian sp*a* isn't expensive--seventy d*o*llars--cheap!  That'*s* not *a* large e*x*pens*e* from an*y* discerning fr*o*g's money, unlik*e* Super 8.
Ever*y*one--frogs, toad*s*, newts, *a*nd salamanders!  G*e*t a wonderful shiat*s*u, or recei*v*e an other kind.  Masseus*es* are her*e* today!  Invite a fianc*e*e, supervisor, roommate, niece: *all* welcomed!
Y*o*u simply ne*v*er believed these p*o*ssibilitie*s*; they're (I *swear*) absolute truth!  Th*e* Montgomery A*m*phibian Salon!  Come luxuriate today!
<--
MY NAME IS INIGO MONTOYA. YOU KILLED MY FATHER. PREPARE TO DIE.
</code>```

答:
Pip, <s>65</s> 64 bytes

The score is 62 bytes of code + 2 for the -rs flags.

```<code>Flg{O{{(zy*t+#a-1)X!Y'*Na&2-#a%2}MJa@`[\w*]+`}MlRM''^sX2O". "}
</code>```

Try it online!

Explanation

The -r flag reads all lines of stdin and stores a list of them in g. The -s flag sets the output format of lists to space-separated.

The easiest way to read this code is from the outside in:

```<code>Flg{...}                   For each line l in g, do:

O{...}MlRM''^sX2O". "      Translate a paragraph into a sentence of plaintext:
       lRM''               Remove apostrophe characters
            ^sX2           Split on "  " into sentences
 {...}M                    Map the below function to each sentence
O                          Output the result list, space-separated, without newline
                O". "      Output that string, without newline

{...}MJa@`[\w*]+`          Translate a sentence into a word of plaintext:
       a@`[\w*]+`          Find all matches of regex (runs of alphanumeric and *)
{...}MJ                    Map the below function to each word and join into string

(zy*t+#a-1)X!Y'*Na&2-#a%2  Translate a word into a letter of plaintext:
      #a-1                 Length of word minus 1
  y*t+                     Add 10 or 20 if y is set (see below)
(z        )                Use that number to index into lowercase alphabet
              '*Na&        Count * characters in word, logical AND with...
                   2-#a%2  2 if word is even length, 1 if odd
             Y             Yank that value into y, to modify the following word
           X!              String multiply the character by not(y)
                           If y is truthy, the word had italics, and we get ""
                           If y is falsy, the word had no italics, and we get a letter
</code>```

Title: Decipher Neurotic Frogs

Body:
Pip, <s>65</s> 64 bytes

The score is 62 bytes of code + 2 for the -rs flags.

Flg{O{{(zy*t+#a-1)X!Y'*Na&2-#a%2}MJa@`[\w*]+`}MlRM''^sX2O". "}

Try it online!

Explanation

The -r flag reads all lines of stdin and stores a list of them in g. The -s flag sets the output format of lists to space-separated.

The easiest way to read this code is from the outside in:

Flg{...}                   For each line l in g, do:

O{...}MlRM''^sX2O". "      Translate a paragraph into a sentence of plaintext:
       lRM''               Remove apostrophe characters
            ^sX2           Split on "  " into sentences
 {...}M                    Map the below function to each sentence
O                          Output the result list, space-separated, without newline
                O". "      Output that string, without newline

{...}MJa@`[\w*]+`          Translate a sentence into a word of plaintext:
       a@`[\w*]+`          Find all matches of regex (runs of alphanumeric and *)
{...}MJ                    Map the below function to each word and join into string

(zy*t+#a-1)X!Y'*Na&2-#a%2  Translate a word into a letter of plaintext:
      #a-1                 Length of word minus 1
  y*t+                     Add 10 or 20 if y is set (see below)
(z        )                Use that number to index into lowercase alphabet
              '*Na&        Count * characters in word, logical AND with...
                   2-#a%2  2 if word is even length, 1 if odd
             Y             Yank that value into y, to modify the following word
           X!              String multiply the character by not(y)
                           If y is truthy, the word had italics, and we get ""
                           If y is falsy, the word had no italics, and we get a letter


问:
Minecraft castle fractal
Inpsired by a youtube video from a fellow PPCG user...

You challenge is to use ASCII-art draw a Minecraft castle wall of Andesite and Diorite. The shape of the wall is the Cantor Set. For reference, the Cantor Set is made by repeating the following N times:

Triple the current step

Replace the middle one with blank space

Add a full line below it

This creates the following for the first four steps:

```<code>*

* *
***

* *   * *
***   ***
*********

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

However, your challenge is not quite that simple. You see, after the cantor set gets really big, it becomes boring to look at the same character repeated over and over and over. So we're going to change that by overlaying an alternating series of asterisks * and pound signs #. You should alternate on every three characters horizontally, and on every row vertically. (Of course leaving the spaces the same) For example, the second example will become:

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

and the third example will become:

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

For completeness, here are examples four and five:

```<code>#4
* *   * *         * *   * *
###   ###         ###   ###
***###***         ***###***
###***###***###***###***###

#5
* *   * *         * *   * *                           * *   * *         * *   * *
###   ###         ###   ###                           ###   ###         ###   ###
***###***         ***###***                           ***###***         ***###***
###***###***###***###***###                           ###***###***###***###***###
***###***###***###***###***###***###***###***###***###***###***###***###***###***
</code>```

And one mega example, the 6th iteration:

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

The challenge

You must write a full program or function that accepts a positive integer for input, and outputs the N'th generation of this minecraft castle fractal. You can take Input and output by any reasonable method, and you do not have to worry about invalid inputs (such as numbers less than 1, floating point numbers, non-numbers, etc.).

The shortest answer, measured in bytes wins!

答:
Jelly, <s>43</s> <s>36</s> 35 bytes

```<code>ḶṚ3*µ5B¤xÐ€ṁ€Ṁ×\Ṛ©1,‘xS$¤ṁ×®ị“*# ”Y
</code>```

Just a start, I'm sure this could be shorter.

Try it online!

*For n > 5, your browser might wrap the output but if you copy-paste it into a non-wrapping editor, you will see the proper output.

Explanation

```<code>ḶṚ3*µ5B¤xÐ€ṁ€Ṁ×\Ṛ©1,‘xS$¤ṁ×®ị“*# ”Y  Input: integer n
Ḷ                                    Create the range [0, n)
 Ṛ                                   Reverse it
  3*                                 Raise 3 to the power of each
    µ                                Begin a new monadic chain on the powers of 3
     5B¤                             Nilad. Get the binary digits of 5 = [1, 0, 1]
        xÐ€                          Duplicate each of [1, 0, 1] to a power of 3 times
             Ṁ                       Get the maximum of the powers of 3
           ṁ€                        Reshape each to a length of that value
              ×\                     Cumulative products
                Ṛ©                   Reverse and save the result
                  1,‘xS$¤            Niladic chain.
                  1                    Start with 1
                    ‘                  Increment it
                   ,                   Pair them to get [1, 2]
                       $               Operate on [1, 2]
                      S                  Sum it to get 3
                     x                   Repeat each 3 times to get [1, 1, 1, 2, 2, 2]
                         ṁ           Reshape that to the saved table
                          ×®         Multiply elementwise with the saved table
                            ị“*# ”   Use each to as an index to select from "*# "
                                  Y  Join using newlines
                                     Return and print implicitly
</code>```

Title: Minecraft castle fractal

Body:
Jelly, <s>43</s> <s>36</s> 35 bytes

ḶṚ3*µ5B¤xÐ€ṁ€Ṁ×\Ṛ©1,‘xS$¤ṁ×®ị“*# ”Y

Just a start, I'm sure this could be shorter.

Try it online!

*For n > 5, your browser might wrap the output but if you copy-paste it into a non-wrapping editor, you will see the proper output.

Explanation

ḶṚ3*µ5B¤xÐ€ṁ€Ṁ×\Ṛ©1,‘xS$¤ṁ×®ị“*# ”Y  Input: integer n
Ḷ                                    Create the range [0, n)
 Ṛ                                   Reverse it
  3*                                 Raise 3 to the power of each
    µ                                Begin a new monadic chain on the powers of 3
     5B¤                             Nilad. Get the binary digits of 5 = [1, 0, 1]
        xÐ€                          Duplicate each of [1, 0, 1] to a power of 3 times
             Ṁ                       Get the maximum of the powers of 3
           ṁ€                        Reshape each to a length of that value
              ×\                     Cumulative products
                Ṛ©                   Reverse and save the result
                  1,‘xS$¤            Niladic chain.
                  1                    Start with 1
                    ‘                  Increment it
                   ,                   Pair them to get [1, 2]
                       $               Operate on [1, 2]
                      S                  Sum it to get 3
                     x                   Repeat each 3 times to get [1, 1, 1, 2, 2, 2]
                         ṁ           Reshape that to the saved table
                          ×®         Multiply elementwise with the saved table
                            ị“*# ”   Use each to as an index to select from "*# "
                                  Y  Join using newlines
                                     Return and print implicitly


问:
Shortest program that throws StackOverflow Error
Write a program that throws a StackOverflow Error or the equivalent in the language used. For example, in java, the program should throw java.lang.StackOverflowError.

You are not allowed to define a function that calls itself or a new class(except the one containing main in java). It should use the classes of the selected programming language.

And it should not throw the error explicitly.

答:
Python (2.7.3), 35 characters

```<code>import sys
sys.setrecursionlimit(1)
</code>```

This operation itself succeeds, but both script and interactive will immediately throw RuntimeError: 'maximum recursion depth exceeded' afterward as a consequence.

Inspired by elssar's answer.

Body:
Python (2.7.3), 35 characters

import sys
sys.setrecursionlimit(1)

This operation itself succeeds, but both script and interactive will immediately throw RuntimeError: 'maximum recursion depth exceeded' afterward as a consequence.

Inspired by elssar's answer.


答:
Ruby, 115 103 102 bytes

```<code>->n{g=->{T.tr"*#","#*"}
*s=?*
(n-1).times{|i|T=s[-1]
s=s.map{|l|l+' '*3**i+l}+[i<1??#*3:g[]+T+g[]]}
s}
</code>```

Based on jsvnm's solution to the standard Cantor set golf.

-12 bytes thanks to Jordan.

Title: Minecraft castle fractal

Body:
Inpsired by a youtube video from a fellow PPCG user...

You challenge is to use ASCII-art draw a Minecraft castle wall of Andesite and Diorite. The shape of the wall is the Cantor Set. For reference, the Cantor Set is made by repeating the following N times:

Triple the current step

Replace the middle one with blank space

Add a full line below it

This creates the following for the first four steps:

```<code>*

* *
***

* *   * *
***   ***
*********

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

However, your challenge is not quite that simple. You see, after the cantor set gets really big, it becomes boring to look at the same character repeated over and over and over. So we're going to change that by overlaying an alternating series of asterisks * and pound signs #. You should alternate on every three characters horizontally, and on every row vertically. (Of course leaving the spaces the same) For example, the second example will become:

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

and the third example will become:

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

For completeness, here are examples four and five:

```<code>#4
* *   * *         * *   * *
###   ###         ###   ###
***###***         ***###***
###***###***###***###***###

#5
* *   * *         * *   * *                           * *   * *         * *   * *
###   ###         ###   ###                           ###   ###         ###   ###
***###***         ***###***                           ***###***         ***###***
###***###***###***###***###                           ###***###***###***###***###
***###***###***###***###***###***###***###***###***###***###***###***###***###***
</code>```

And one mega example, the 6th iteration:

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

The challenge

You must write a full program or function that accepts a positive integer for input, and outputs the N'th generation of this minecraft castle fractal. You can take Input and output by any reasonable method, and you do not have to worry about invalid inputs (such as numbers less than 1, floating point numbers, non-numbers, etc.).

The shortest answer, measured in bytes wins!

Body:
Ruby, 115 103 102 bytes

->n{g=->{T.tr"*#","#*"}
*s=?*
(n-1).times{|i|T=s[-1]
s=s.map{|l|l+' '*3**i+l}+[i<1??#*3:g[]+T+g[]]}
s}

Based on jsvnm's solution to the standard Cantor set golf.

-12 bytes thanks to Jordan.


答:
Turtlèd, <s>135</s> 129 bytes

(the interpreter isn't really <s> slightly</s> buggèd (anymore :])<s>, but it does not affect this program</s>)

By restructuring and rewriting my program, I golfed... six bytes

And now I have to make new explanation...

Still could be shorter probs though

At least the best solution in this lang isn't just writing in the raw data ¯\(ツ)/¯

```<code>#3.141592653589793238462643383279502884197169#")()()()()()">10:[)'|l]:[)d'\l]d"(||"2uuu[|;"::"uuu];>"__"[|r'\d]dl[ l[|.+l][\r]ul]
</code>```

Try it online
Explanation

Honestly, this doesn't describe the actual program very well, but it does give hints about the commands, so you might understand a little better

```<code>#3.141592653589793238462643383279502884197169# Some pi. Set the string to thing between #s
                                               the last digit was same as first, and the
                                               string wraps, so digit could be removed
")()()()()()"  Write this string, by writing char 1 to current cell, moving right, char 2...

>              turn right

10             set register to ten

:[)'|l]:       move right by amount in register, while current cell isn't ), write |
               and move left. move right by amount in register

[)d'\l]        while cell is not (, move down, write \, move left

d"(||"         move down and string-write "(||"

2              set register to 2

uuu[|;"::"uuu] Move up three, and while the cell is not |, move down by
               register (2), string-write "::", move up three

               Just remember the turtle is currently pointing right, so up is right.

;>"__"         move down by amount in register, turn right, string-write "__"

[|r'\d]dl      while cell is not |{ move right, write \, move down}, move down, left
</code>```

COMPLEX THING: NESTED LOOPS

```<code>[ l[|.+l][\r]ul]
</code>```

While the current cell is not space {move left, execute loop:(While cell not |, write current char of string variable (remember that pi?), increment string pointer, move left), execute loop:(while cell not \, move right), move up, left}

Title: Bake a slice of Pi

Body:
Write a program or function that prints or outputs this exact text (consisting of 142 characters):

```<code>()()()()()()
|\3.1415926|
|:\53589793|
\::\2384626|
 \::\433832|
  \::\79502|
   \::\8841|
    \::\971|
     \::\69|
      \::\3|
       \__\|
</code>```

Your program must take no input (except in languages where this is impossible, such as sed), and produce the above text (and only the above text) as output. A trailing newline is acceptable.

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

Body:
Turtlèd, <s>135</s> 129 bytes

(the interpreter isn't really <s> slightly</s> buggèd (anymore :])<s>, but it does not affect this program</s>)

By restructuring and rewriting my program, I golfed... six bytes

And now I have to make new explanation...

Still could be shorter probs though

At least the best solution in this lang isn't just writing in the raw data ¯\(ツ)/¯

#3.141592653589793238462643383279502884197169#")()()()()()">10:[)'|l]:[)d'\l]d"(||"2uuu[|;"::"uuu];>"__"[|r'\d]dl[ l[|.+l][\r]ul]

Try it online
Explanation

Honestly, this doesn't describe the actual program very well, but it does give hints about the commands, so you might understand a little better

#3.141592653589793238462643383279502884197169# Some pi. Set the string to thing between #s
                                               the last digit was same as first, and the
                                               string wraps, so digit could be removed
")()()()()()"  Write this string, by writing char 1 to current cell, moving right, char 2...

>              turn right

10             set register to ten

:[)'|l]:       move right by amount in register, while current cell isn't ), write |
               and move left. move right by amount in register

[)d'\l]        while cell is not (, move down, write \, move left

d"(||"         move down and string-write "(||"

2              set register to 2

uuu[|;"::"uuu] Move up three, and while the cell is not |, move down by
               register (2), string-write "::", move up three

               Just remember the turtle is currently pointing right, so up is right.

;>"__"         move down by amount in register, turn right, string-write "__"

[|r'\d]dl      while cell is not |{ move right, write \, move down}, move down, left

COMPLEX THING: NESTED LOOPS

[ l[|.+l][\r]ul]

While the current cell is not space {move left, execute loop:(While cell not |, write current char of string variable (remember that pi?), increment string pointer, move left), execute loop:(while cell not \, move right), move up, left}

ContentLicense: CC BY-SA 4.0


答:
Python 2, <s>142</s> <s>138</s> 136 bytes

r=range
def f(n):
 for i in r(n+1):
  s="";d=i%2<1
  for k in r(3**i):s+="#*"[(6+d-1+k*(d*2-1))%6<3]
  exec"s+=len(s)*' '+s;"*(n-i);print s
```

This is the piece of code from here, and then edited for this challenge.

Will post an explanation later.

Also, BTW, two spaces are tabs.

Edit 1: 4 bytes saved thanks to @DJMcMayhem.

Edit 2: 2 bytes saved thanks to @daHugLenny.

Title: Minecraft castle fractal

Body:
Python 2, <s>142</s> <s>138</s> 136 bytes

r=range
def f(n):
 for i in r(n+1):
  s="";d=i%2<1
  for k in r(3**i):s+="#*"[(6+d-1+k*(d*2-1))%6<3]
  exec"s+=len(s)*' '+s;"*(n-i);print s

This is the piece of code from here, and then edited for this challenge.

Will post an explanation later.

Also, BTW, two spaces are tabs.

Edit 1: 4 bytes saved thanks to @DJMcMayhem.

Edit 2: 2 bytes saved thanks to @daHugLenny.


问:
Tips for golfing in MATL
MATL is a golfing language created by Luis Mendo. MATL has proven to be highly competitive, often beating submissions in other golfing languages such as Pyth, CJam and Jelly.

What are some useful tips for golfing in MATL? (As always, one tip per answer, please!)

For the record, MATL can be tested online here.

Documentation can be found on Github

答:
For loop of size n-1

Consider replacing

```<code>tnq:"...
</code>```

with

```<code>td"...
</code>```

to save up to an entire byte or more.

Title: Tips for golfing in MATL

Body:
For loop of size n-1

Consider replacing

tnq:"...

with

td"...

to save up to an entire byte or more.


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

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

Rules

Each submission must be a full program.

You must create the shortest infinite loop.

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

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

The program must not write anything to STDERR.

Feel free to use a language (or language version) even if it's newer than this challenge.
-Note that there must be an interpreter so the submission can be tested. It is allowed (and even encouraged) to write this interpreter yourself for a previously unimplemented language. :D

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

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

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

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

Standard loopholes are not allowed.

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

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

Catalogue

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

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

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

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

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

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

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

Shortest Solution by Language

Language	User	Score

Leaderboard

	Author	Language	Size

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

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

```

答:
Turtlèd, 3 bytes

any character but * works in the middle

```<code>[-]
</code>```

alt:

```<code>{*}
</code>```

Explanation:

```<code>[    ] Brackets make a while loop. The character after the opening bracket is taken, and
       the loop is executed while the current cell is not that character.
</code>```

hence

```<code>[-]
</code>```

Runs whilst the current cell is not -, but will never change it to that value, so infinitely runs, and never ouputs as it only outputs at the end.

```<code>{*}
</code>```

works similarly, but it runs while the current cell IS that value. by default, the starting cell is *, so it runs forever, since it will never change its value

(nontrivial) Polyglot, Turtlèd and Brainf*** 5 or 4 bytes, depending on implementation

doesn't make use of BF non instruction nops.

If you happen to have another cool esolang that might be able to be fitted in, tell me.

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

In wrapping implementations,

in non-wrapping:

```<code>+[+]
</code>```

Explanation:

```<code>+    - essentially a nop in Turtlèd with no string, increments cell in BF
 [+] - loops while current cell is not: {BF:0, Turtlèd:"+"}. increments cell in BF
</code>```

```<code> [+-] - loops while current cell is not {BF:0, Turtlèd:"+"}. - is nop in Turtlèd with
        no string, and `+-` together is nop (+1,-1) in BF
</code>```

Body:
Turtlèd, 3 bytes

any character but * works in the middle

[-]

alt:

{*}

Explanation:

[    ] Brackets make a while loop. The character after the opening bracket is taken, and
       the loop is executed while the current cell is not that character.

hence

[-]

Runs whilst the current cell is not -, but will never change it to that value, so infinitely runs, and never ouputs as it only outputs at the end.

{*}

works similarly, but it runs while the current cell IS that value. by default, the starting cell is *, so it runs forever, since it will never change its value

(nontrivial) Polyglot, Turtlèd and Brainf*** 5 or 4 bytes, depending on implementation

doesn't make use of BF non instruction nops.

If you happen to have another cool esolang that might be able to be fitted in, tell me.

+[-+]

In wrapping implementations,

in non-wrapping:

+[+]

Explanation:

+    - essentially a nop in Turtlèd with no string, increments cell in BF
 [+] - loops while current cell is not: {BF:0, Turtlèd:"+"}. increments cell in BF

 [+-] - loops while current cell is not {BF:0, Turtlèd:"+"}. - is nop in Turtlèd with
        no string, and `+-` together is nop (+1,-1) in BF


答:
JavaScript (ES7), <s>132</s> 125 bytes

```<code>n=>[...Array(n)].map((_,i)=>[...Array(3**~-n)].map((_,j)=>/1/.test((j/3**i|0).toString(3))?" ":`*#`[j/3+i&1]).join``).join`\n`
</code>```

Where \n represents the literal newline characer. ES6 version for 141 bytes:

f=
n=>[...Array(n)].map((_,i)=>[...Array(Math.pow(3,n-1))].map((_,j)=>/1/.test((j*3).toString(3).slice(0,~i))?" ":`*#`[j/3+i&1]).join``).join`
`
;```
<pre class="snippet-code-html lang-html prettyprint-override"><code><input type=number min=1 oninput=o.textContent=f(+this.value)><pre id=o></code>```

Title: Minecraft castle fractal

Body:
JavaScript (ES7), <s>132</s> 125 bytes

n=>[...Array(n)].map((_,i)=>[...Array(3**~-n)].map((_,j)=>/1/.test((j/3**i|0).toString(3))?" ":`*#`[j/3+i&1]).join``).join`\n`

Where \n represents the literal newline characer. ES6 version for 141 bytes:

f=
n=>[...Array(n)].map((_,i)=>[...Array(Math.pow(3,n-1))].map((_,j)=>/1/.test((j*3).toString(3).slice(0,~i))?" ":`*#`[j/3+i&1]).join``).join`
`
;

<input type=number min=1 oninput=o.textContent=f(+this.value)><pre id=o>


答:
VBScript, 88 bytes

```<code>a=WScript.Arguments(0)
For i=1 To Len(a)
WScript.StdOut.Write a
a=StrReverse(a)
Next
</code>```

Note: This does require the script execute using cscript.exe. For example...

```<code>cscript.exe rev.vbs Hello!
</code>```

Title: StringgnirtSStringgnirtSStringgnirtS

Body:
Here is a relatively simple challenge for you.

Given a string of length N, output the string forwards, then backwards, then forwards, then backwards... etc. N times. For example, if your input was

```<code>Hello!
</code>```

You should output:

```<code>Hello!!olleHHello!!olleHHello!!olleH
</code>```

You may also optionally output one trailing newline.

Your submission may be either a full program or a function, and you may take input and output in any reasonable format. For example, you may take IO from STDIN/STDOUT, function arguments and return value, from a file, etc. You can safely assume that the input string will not be empty, and will only contain printable ASCII. You must output the new string on a single line. So, for example, if the output to the last example was

```<code>Hello!
!olleH
Hello!
!olleH
Hello!
!olleH
</code>```

This would not be a valid solution!

Here are some more test cases:

```<code>Input:
a
Output:
a

Input:
abcd
Output:
abcddcbaabcddcba

Input:
OK!
Output:
OK!!KOOK!

Input:
4815162342
Output:
4815162342243261518448151623422432615184481516234224326151844815162342243261518448151623422432615184

Input:
PPCG
Output:
PPCGGCPPPPCGGCPP

Input:
42
Output:
4224
</code>```

Leaderboards

Since this is a code-golf challenge, standard loopholes are banned, and the shortest answer in bytes wins! However, this is also a competition to have the shortest answer in any particular langauge. While it's unlikely that a Java answer will beat an answer in perl, or some golfing language, it's still very impressive to have the shortest Java answer. So, you can use this leaderboard to see both

The shortest answer out of all languages, and

The shortest answer in each individual 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=93261,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

```

Body:
VBScript, 88 bytes

a=WScript.Arguments(0)
For i=1 To Len(a)
WScript.StdOut.Write a
a=StrReverse(a)
Next

Note: This does require the script execute using cscript.exe. For example...

cscript.exe rev.vbs Hello!


问:
Invert a boolean array
A nice simple one

Input

Given a boolean array (Or an acceptable alternative), you can assume the array will never be more than 32 elements long.

```<code>[false, false, true, false, false]
</code>```

Output

Invert every element of the array and output it.

```<code>[true, true, false, true, true]
</code>```

Rules

You can write a full program or just a function

Standard loopholes apply

Shortest code in bytes, per language, wins!

Test cases

```<code>Input:
[true, false]
Output:
[false, true]

Input: //Example of acceptable alternative
[0,1,1]
Output:
[1,0,0]
</code>```

答:
dc, 47 bytes

?zsN0sI[z:az0R]dsRx
```

<p>The actual code to invert a boolean (0 or 1) is <code>1r-</code>. The rest is for reading the list and printing it in the same order, which is quite hard because of the (LIFO) stack that dc uses to store the input.</p>

<p><strong>Explanation:</strong></p>

<pre class="lang-dc prettyprint-override"><code>?zsN0sI         # read input, LIFO, initialize N = nr_elements and I = 0 (iterator)
[z:az0<A]dsAx   # loop A: move the stack content into array 'a' (I add a[n] first,
                #then a[n-1], ..., then a[1] and a[0] is not used)
[lI1+ddsI;a     # loop R: increment iterator and push a[I] to stack (input order)
   1r-n32P         #invert value and print it with a space separator
lN>R]dsRx       #repeat (R)
</code>```

Run:

dc -f invert_boolean.dc <<< "1 0 1 1"
```

<p><strong>Output:</strong> there is a trailing separator (space) at the end, but I hope that's ok</p>

<pre class="lang-sh prettyprint-override"><code>0 1 0 0
</code>```

Note: my answer is similar in concept to that of @Joe's, but there are differences in terms of I/O handling, stack manipulation (I use arrays) and lack of warnings. Do check his answer as well.

Title: Invert a boolean array

Body:
dc, 47 bytes

?zsN0sI[z:az0<A]dsAx[lI1+ddsI;a1r-n32PlN>R]dsRx

The actual code to invert a boolean (0 or 1) is 1r-. The rest is for reading the list and printing it in the same order, which is quite hard because of the (LIFO) stack that dc uses to store the input.

Explanation:

?zsN0sI         # read input, LIFO, initialize N = nr_elements and I = 0 (iterator)
[z:az0<A]dsAx   # loop A: move the stack content into array 'a' (I add a[n] first,
                #then a[n-1], ..., then a[1] and a[0] is not used)
[lI1+ddsI;a     # loop R: increment iterator and push a[I] to stack (input order)
   1r-n32P         #invert value and print it with a space separator
lN>R]dsRx       #repeat (R)

Run:

dc -f invert_boolean.dc <<< "1 0 1 1"

Output: there is a trailing separator (space) at the end, but I hope that's ok

0 1 0 0

Note: my answer is similar in concept to that of @Joe's, but there are differences in terms of I/O handling, stack manipulation (I use arrays) and lack of warnings. Do check his answer as well.


答:
Python 2, <s>183</s> 171 bytes

```<code>p,d=[2384626,433832,79502,8841,971,69,3],"|\n"
c=("()"*6)+d[1]+"|\\"+`3.1415926`+d+"|:\\"+`53589793`+d
for x in range(7):c+=" "*x+"\\::\\"+`p[x]`+d
print c+" "*7+"\\__\\|"
</code>```

Does't really do anything clever. Just builds up a big string then prints it out.

EDIT

Reduced to 171 after reading @Lynn's answer and learning. Sorry if it is wrong to (shamelessly) steal some bytes from you without you suggesting it. Please tell me if so and I will roll back the change.

Output

```<code>python pi.pie.py

()()()()()()
|\3.1415926|
|:\53589793|
\::\2384626|
 \::\433832|
  \::\79502|
   \::\8841|
    \::\971|
     \::\69|
      \::\3|
       \__\|
</code>```

Title: Bake a slice of Pi

Body:
Python 2, <s>183</s> 171 bytes

p,d=[2384626,433832,79502,8841,971,69,3],"|\n"
c=("()"*6)+d[1]+"|\\"+`3.1415926`+d+"|:\\"+`53589793`+d
for x in range(7):c+=" "*x+"\\::\\"+`p[x]`+d
print c+" "*7+"\\__\\|"

Does't really do anything clever. Just builds up a big string then prints it out.

EDIT

Reduced to 171 after reading @Lynn's answer and learning. Sorry if it is wrong to (shamelessly) steal some bytes from you without you suggesting it. Please tell me if so and I will roll back the change.

Output

python pi.pie.py

()()()()()()
|\3.1415926|
|:\53589793|
\::\2384626|
 \::\433832|
  \::\79502|
   \::\8841|
    \::\971|
     \::\69|
      \::\3|
       \__\|


答:
Fourier, <s>196</s> 190 bytes

New feature alert!

Code

```<code>|SaCaaSa|f|~Y0~jY(32aj^~j)|w6(40a41ai^~i)10a~N124a~W92a~S3o46a1415926oWaNaWa58a~CSa53589793oWaNaf2384626oWaNa1wf433832oWaNa2wf79502oWaNa3wf8841oWaNa4wf971oWaNa5wf69oWaNa6wf3oWaNa7wSa95aaSaWa
</code>```

Explanation

This program is my first demonstration of functions in Fourier:

Functions are defined like so:

```<code>|code goes here|f
</code>```

The first pipe starts the function declaration. You then put the code in between the pipes. The last pipe ends the function declaration. Finally, the f is the variable in which the function is stored. This can be any character, as long as it isn't a reserved function.

For example, in my code, one of the function s is:

```<code>|SaCaaSa|f
</code>```

Where the variable S stores the number 92 and C stores the number 58.

When called, the function outputs the following:

```<code>\::\
</code>```

Since it is the most repeated thing in the pie.

Similarly, to golf down the output, I have used a loop:

```<code>6(40a41ai^~i)
</code>```

Which repeats the code 40a41a 6 times. 40a41a on its own outputs:

```<code>()
</code>```

So repeating the code six times outputs:

```<code>()()()()()()
</code>```

Thereby outputting the crust of the pie.

Try it on FourIDE!

Because I haven't implemented functions in the Python interpreter, this program will not work on http://tryitonline.net

Title: Bake a slice of Pi

Body:
Fourier, <s>196</s> 190 bytes

New feature alert!

Code

|SaCaaSa|f|~Y0~jY(32aj^~j)|w6(40a41ai^~i)10a~N124a~W92a~S3o46a1415926oWaNaWa58a~CSa53589793oWaNaf2384626oWaNa1wf433832oWaNa2wf79502oWaNa3wf8841oWaNa4wf971oWaNa5wf69oWaNa6wf3oWaNa7wSa95aaSaWa

Explanation

This program is my first demonstration of functions in Fourier:

Functions are defined like so:

|code goes here|f

The first pipe starts the function declaration. You then put the code in between the pipes. The last pipe ends the function declaration. Finally, the f is the variable in which the function is stored. This can be any character, as long as it isn't a reserved function.

For example, in my code, one of the function s is:

|SaCaaSa|f

Where the variable S stores the number 92 and C stores the number 58.

When called, the function outputs the following:

\::\

Since it is the most repeated thing in the pie.

Similarly, to golf down the output, I have used a loop:

6(40a41ai^~i)

Which repeats the code 40a41a 6 times. 40a41a on its own outputs:

()

So repeating the code six times outputs:

()()()()()()

Thereby outputting the crust of the pie.

Try it on FourIDE!

Because I haven't implemented functions in the Python interpreter, this program will not work on http://tryitonline.net


问:
Print all integers
Write a program or function which will provably print all integers exactly once given infinite time and memory.

Possible outputs could be:

```<code>0, 1, -1, 2, -2, 3, -3, 4, -4, …

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, -1, -2, -3, -4, -5, -6, -7, -8, -9, 10, 11, …
</code>```

This is not a valid output, as this would never enumerate negative numbers:

<s>```0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, …```</s>

The output must be in decimal, unless your language does not support decimal integer (in that case use the natural representation of integers your language uses).

Your program has to work up to the numbers with the biggest magnitude of the standard integer type of your language.

Each integer must be separated from the next using any separator (a space, a comma, a linebreak, etc.) that is not a digit nor the negative sign of your language.

The separator must not change at any point.

The separator can consist of multiple characters, as long as none of them is a digit nor the negative sign (e.g. ,  is as valid as just ,).

Any supported integer must eventually be printed after a finite amount of time.

Scoring

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

Leaderboard

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

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

Leaderboard

	Author	Language	Size

Winners by Language

Language	User	Score

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

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

```

答:
Java, 49 bytes

```<code>o->{for(int n=1<<31;n<0;)o.println(n+"\n"+~n++);}
</code>```

Notes:

o is a java.io.PrintStream but its import is not required given it's the parameter of a lambda expression.

This must be run on a Unix machine to properly use the same separator.

Ungolfed

```<code>import java.io.PrintStream;
import java.util.function.Consumer;

public class Main {
    public static void main(String[] args) {
        Consumer<PrintStream> func = o -> { // define the output and start the function.
          for (int n = 1 << 31; n < 0; n++) { // for each negative integer increasing from Integer.MIN_VALUE
            o.println(n + "\n" + ~n); // Print the negative number and its complement to 2 value.
          }
        };
        func.accept(System.out);
    }
}
</code>```

Result

```<code>-2147483648
2147483647
-2147483647
2147483646
-2147483646
2147483645
-2147483645
2147483644
-2147483644
2147483643
-2147483643
2147483642
-2147483642
2147483641
-2147483641
2147483640
...
-7
6
-6
5
-5
4
-4
3
-3
2
-2
1
-1
0
</code>```

Title: Print all integers

Body:
Java, 49 bytes

o->{for(int n=1<<31;n<0;)o.println(n+"\n"+~n++);}

Notes:

o is a java.io.PrintStream but its import is not required given it's the parameter of a lambda expression.

This must be run on a Unix machine to properly use the same separator.

Ungolfed

import java.io.PrintStream;
import java.util.function.Consumer;

public class Main {
    public static void main(String[] args) {
        Consumer<PrintStream> func = o -> { // define the output and start the function.
          for (int n = 1 << 31; n < 0; n++) { // for each negative integer increasing from Integer.MIN_VALUE
            o.println(n + "\n" + ~n); // Print the negative number and its complement to 2 value.
          }
        };
        func.accept(System.out);
    }
}

Result

-2147483648
2147483647
-2147483647
2147483646
-2147483646
2147483645
-2147483645
2147483644
-2147483644
2147483643
-2147483643
2147483642
-2147483642
2147483641
-2147483641
2147483640
...
-7
6
-6
5
-5
4
-4
3
-3
2
-2
1
-1
0


Title: Bake a slice of Pi

Body:
C# 220 213 209 208 202 201  (171*) Bytes

*I find this to be unoriginal and cheating

void F()=>Console.Write(@"()()()()()()
|\3.1415926|
|:\53589793|
\::\2384626|
 \::\433832|
  \::\79502|
   \::\8841|
    \::\971|
     \::\69|
      \::\3|
       \__\|");

201 Bytes:

void f(){var s="()()()()()()\n";for(int i=0;i<9;)s+=(i<1?"|":i<2?"|:":"\\::".PadLeft(i+1))+$"\\{new[]{3.1415926,53589793,2384626,433832,79502,8841,971,69,3}[i++]}|\n";Console.Write(s+@"       \__\|");}

220 bytes:

I'm sure that there is something to be golfed here

void f(){string s="()()()()()()\n",x="       ";for(int i=9,j=0;i>0;j+=i--)s+=(i>7?"|"+(i<9?":":"")+"\\":x.Substring(i)+@"\::\")+$"{Math.PI}32384626433832795028841971693".Substring(j,i)+"|\n";Console.Write(s+x+@"\__\|");}


答:
Pyke, 2 bytes

```<code>m!
</code>```

Try it here!

```<code>map(not, input)
</code>```

Title: Invert a boolean array

Body:
A nice simple one

Input

Given a boolean array (Or an acceptable alternative), you can assume the array will never be more than 32 elements long.

```<code>[false, false, true, false, false]
</code>```

Output

Invert every element of the array and output it.

```<code>[true, true, false, true, true]
</code>```

Rules

You can write a full program or just a function

Standard loopholes apply

Shortest code in bytes, per language, wins!

Test cases

```<code>Input:
[true, false]
Output:
[false, true]

Input: //Example of acceptable alternative
[0,1,1]
Output:
[1,0,0]
</code>```

Body:
Pyke, 2 bytes

m!

Try it here!

map(not, input)


问:
Invert png image
Create program or function that takes file name as an argument or reads it from standard input, and completes the following task:

Read image from a png file (name given as argument).

Reverse colors in that image, so that for example dark green (0, 75, 30) would become (255, 180, 225) (because 255-0=255, 255-75=180 and 255-30=225). You should not change alpha channel value.

Output that image to a file called a.png (in png format), or show it in GUI window.

This is code-golf. Standard loopholes apply.

答:
Golang, 311 bytes

```<code>package main
import("image"
."image/png"
."image/color"
."os")
func main(){f,_:=Open(Args[1])
i,_:=Decode(f)
q:=i.Bounds()
n:=image.NewRGBA(q)
s:=q.Size()
for x:=0;x<s.X;x++{for y:=0;y<s.Y;y++{r,g,b,a:=i.At(x,y).RGBA()
n.Set(x,y,RGBA{byte(255-r),byte(255-g),byte(255-b),byte(a)})}}
o,_:=Create("o")
Encode(o,n)}
</code>```

ungolfed

```<code>package main
import(
    "image"
    "image/png"
    "image/color"
    "os"
)

func main(){
    // open a png image.
    f, _ := os.Open(Args[1])

    // decode the png image to a positive image object(PIO).
    p, _ := png.Decode(f)

    // get a rectangle from the PIO.
    q := p.Bounds()

    // create a negative image object(NIO).
    n := image.NewRGBA(q)

    // get the size of the PIO.
    s := q.Size()

    // invert the PIO.
    for x := 0; x < s.X; x++ {
        for y := 0; y < s.Y; y++ {
            // fetch the value of a pixel from the POI.
            r, g, b, a := p.At(x, y).RGBA()

            // set the value of an inverted pixel to the NIO.
            // Note: byte is an alias for uint8 in Golang.
            n.Set(x, y, color.RGBA{uint8(255-r), uint8(255-g), uint8(255-b), uint8(a)})
        }
    }

    // create an output file.
    o, _ := os.Create("out.png")

    // output a png image from the NIO.
    png.Encode(o, n)
}
</code>```

Title: Invert png image

Body:
Golang, 311 bytes

package main
import("image"
."image/png"
."image/color"
."os")
func main(){f,_:=Open(Args[1])
i,_:=Decode(f)
q:=i.Bounds()
n:=image.NewRGBA(q)
s:=q.Size()
for x:=0;x<s.X;x++{for y:=0;y<s.Y;y++{r,g,b,a:=i.At(x,y).RGBA()
n.Set(x,y,RGBA{byte(255-r),byte(255-g),byte(255-b),byte(a)})}}
o,_:=Create("o")
Encode(o,n)}

ungolfed

package main
import(
    "image"
    "image/png"
    "image/color"
    "os"
)

func main(){
    // open a png image.
    f, _ := os.Open(Args[1])

    // decode the png image to a positive image object(PIO).
    p, _ := png.Decode(f)

    // get a rectangle from the PIO.
    q := p.Bounds()

    // create a negative image object(NIO).
    n := image.NewRGBA(q)

    // get the size of the PIO.
    s := q.Size()

    // invert the PIO.
    for x := 0; x < s.X; x++ {
        for y := 0; y < s.Y; y++ {
            // fetch the value of a pixel from the POI.
            r, g, b, a := p.At(x, y).RGBA()

            // set the value of an inverted pixel to the NIO.
            // Note: byte is an alias for uint8 in Golang.
            n.Set(x, y, color.RGBA{uint8(255-r), uint8(255-g), uint8(255-b), uint8(a)})
        }
    }

    // create an output file.
    o, _ := os.Create("out.png")

    // output a png image from the NIO.
    png.Encode(o, n)
}


问:
Draw some ASCII-boxes
Take two lists of non-negative integers, and output an ASCII-box as it's defined below.

Corners and intersections are pluses: + (ASCII-code 43)

Vertical lines are bars | (ASCII-code 124)

Horizontal lines are minuses - (ASCII-code 45)

The first input list specifies the number of minuses between each plus sign, in the horizontal direction.

The second input list specifies the number of bars between each plus sign, in the vertical direction.

It's easier to explain with a few examples:

```<code>0    // No minuses between each + sign
0    // No bars between + signs

++
++

------------------
1 2   // First a single minus, then two minuses
1 2   // First  one bar, then two bars

+-+--+
| |  |
+-+--+
| |  |
| |  |
+-+--+

------------------
1 0 3 0 2 0
2 1 0 0

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

Clarifications:

Input order and format are optional

Only the boxes should be printed/displayed, but a trailing space or newlines are accepted.

You may optionally add 1 to all input values if that's more convenient. The second example would then be: 2 3; 2 3.

This is code golf, so the shortest code in bytes win.

答:
Python 2, 117 Bytes

```<code>def f(h,v):r="+"+"+".join("-"*i for i in h)+"+\n";print r+r.join(("|"+"|".join(" "*i for i in h)+"|\n")*i for i in v)+r
</code>```

Try it on ideone.

Not expecting too much from this. Really simple, just uses python joins and string multiplication to pull everything together.

Title: Draw some ASCII-boxes

Body:
Python 2, 117 Bytes

def f(h,v):r="+"+"+".join("-"*i for i in h)+"+\n";print r+r.join(("|"+"|".join(" "*i for i in h)+"|\n")*i for i in v)+r

Try it on ideone.

Not expecting too much from this. Really simple, just uses python joins and string multiplication to pull everything together.


答:
Python 2.7 (12 chars)

```<code>exec('{'*99)
</code>```

results in a «s_push: parser stack overflow»

Title: Shortest program that throws StackOverflow Error

Body:
Write a program that throws a StackOverflow Error or the equivalent in the language used. For example, in java, the program should throw java.lang.StackOverflowError.

You are not allowed to define a function that calls itself or a new class(except the one containing main in java). It should use the classes of the selected programming language.

And it should not throw the error explicitly.

Body:
Python 2.7 (12 chars)

exec('{'*99)

results in a «s_push: parser stack overflow»


答:
MATL, <s>25</s> <s>22</s> 21 bytes

```<code>'|-+ '2:"1tiYsQ(]E!+)
</code>```

Uses inputs with 1 added (allowed by the challenge).

Try it online!

Explanation

The code initially builds an array containing 1 for the column indices of non-space characters in the final result, and 0 otherwise. So if the first input is [2 1 4 1 3 1] (would be [1 0 3 0 2 0] in the 0-based format) this array will be

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

Note how the length of runs of zeros is related to the input. Specifically, this array is built as follows:

Initiallize the array to a single 1.

Compute the cumulative sum of the input and add 1. In the example this gives [3 4 8 9 12 13].

Extend the array from step 1 by assigning 1 to the entries with (1-based) indices given by step 2. Intermediate entries are automatically set to 0.

A similar array is built for the rows. Second input [3 2 1 1] (or [2 1 0 0 ]) gives

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

Now the second array is multiplied by 2, transposed and added with broadcast to the first. This gives the 2D array

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

Indexing into the string '|-+ ' gives the final result as a 2D char array. Since indexing is modular and 1-based, index 0 corresponds to the last element (space).

```<code>'|-+ '                   % Push this string
      2:"       ]        % Do this twice
         1               % Push 1 (initial array)
          t              % Push another 1 (contents to be filled in)
           i             % Take input
            Ys           % Cumulative sum
              Q          % Add 1
               (         % Fill 1 into those entries of the array
                 E       % Multiply by 2
                  !      % Transpose
                   +     % Add, with broadcast
                    )    % Index (modular, 1-based) into the string
</code>```

Title: Draw some ASCII-boxes

Body:
Take two lists of non-negative integers, and output an ASCII-box as it's defined below.

Corners and intersections are pluses: + (ASCII-code 43)

Vertical lines are bars | (ASCII-code 124)

Horizontal lines are minuses - (ASCII-code 45)

The first input list specifies the number of minuses between each plus sign, in the horizontal direction.

The second input list specifies the number of bars between each plus sign, in the vertical direction.

It's easier to explain with a few examples:

```<code>0    // No minuses between each + sign
0    // No bars between + signs

++
++

------------------
1 2   // First a single minus, then two minuses
1 2   // First  one bar, then two bars

+-+--+
| |  |
+-+--+
| |  |
| |  |
+-+--+

------------------
1 0 3 0 2 0
2 1 0 0

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

Clarifications:

Input order and format are optional

Only the boxes should be printed/displayed, but a trailing space or newlines are accepted.

You may optionally add 1 to all input values if that's more convenient. The second example would then be: 2 3; 2 3.

This is code golf, so the shortest code in bytes win.

Body:
MATL, <s>25</s> <s>22</s> 21 bytes

'|-+ '2:"1tiYsQ(]E!+)

Uses inputs with 1 added (allowed by the challenge).

Try it online!

Explanation

The code initially builds an array containing 1 for the column indices of non-space characters in the final result, and 0 otherwise. So if the first input is [2 1 4 1 3 1] (would be [1 0 3 0 2 0] in the 0-based format) this array will be

1 0 1 1 0 0 0 1 1 0 0 1 1

Note how the length of runs of zeros is related to the input. Specifically, this array is built as follows:

Initiallize the array to a single 1.

Compute the cumulative sum of the input and add 1. In the example this gives [3 4 8 9 12 13].

Extend the array from step 1 by assigning 1 to the entries with (1-based) indices given by step 2. Intermediate entries are automatically set to 0.

A similar array is built for the rows. Second input [3 2 1 1] (or [2 1 0 0 ]) gives

1 0 0 1 0 1 1 1

Now the second array is multiplied by 2, transposed and added with broadcast to the first. This gives the 2D array

3 2 3 3 2 2 2 3 3 2 2 3 3
1 0 1 1 0 0 0 1 1 0 0 1 1
1 0 1 1 0 0 0 1 1 0 0 1 1
3 2 3 3 2 2 2 3 3 2 2 3 3
1 0 1 1 0 0 0 1 1 0 0 1 1
3 2 3 3 2 2 2 3 3 2 2 3 3
3 2 3 3 2 2 2 3 3 2 2 3 3
3 2 3 3 2 2 2 3 3 2 2 3 3

Indexing into the string '|-+ ' gives the final result as a 2D char array. Since indexing is modular and 1-based, index 0 corresponds to the last element (space).

'|-+ '                   % Push this string
      2:"       ]        % Do this twice
         1               % Push 1 (initial array)
          t              % Push another 1 (contents to be filled in)
           i             % Take input
            Ys           % Cumulative sum
              Q          % Add 1
               (         % Fill 1 into those entries of the array
                 E       % Multiply by 2
                  !      % Transpose
                   +     % Add, with broadcast
                    )    % Index (modular, 1-based) into the string


答:
Golang, 40 bytes

```<code>func(a[]bool){for i,b:=range a{a[i]=!b}}
</code>```

usage

```<code>package main
import "fmt"
func main() {
    a:=[]bool{true, true, false}
    func(a []bool){for i,b:=range a{a[i]=!b}}(a)
    fmt.Print(a) // => [false false true]
}
</code>```

Title: Invert a boolean array

Body:
Golang, 40 bytes

func(a[]bool){for i,b:=range a{a[i]=!b}}

usage

package main
import "fmt"
func main() {
    a:=[]bool{true, true, false}
    func(a []bool){for i,b:=range a{a[i]=!b}}(a)
    fmt.Print(a) // => [false false true]
}


Title: Bake a slice of Pi

Body:
Write a program or function that prints or outputs this exact text (consisting of 142 characters):

```<code>()()()()()()
|\3.1415926|
|:\53589793|
\::\2384626|
 \::\433832|
  \::\79502|
   \::\8841|
    \::\971|
     \::\69|
      \::\3|
       \__\|
</code>```

Your program must take no input (except in languages where this is impossible, such as sed), and produce the above text (and only the above text) as output. A trailing newline is acceptable.

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

Body:
Python 2, 131 bytes

print'()'*6+'\n|\\3.1415926|\n|:\\53589793|'
for n in 2384626,433832,79502,8841,971,69,3,'':print'%11s|'%('\%s'*2%('_:'[n<'']*2,n))

Joint effort between Sp3000 and Lynn. Copper saved a byte, too! Ideone link.


问:
What is the smallest positive base 10 integer that can be printed by a program shorter (in characters) than itself?
I think the question as above is clear, but just in case:

Write a full program (not just a function) which prints a positive base 10 integer, optionally followed by a single newline.

Qualifying programs will be those whose output is longer (in bytes) than the source code of the program, measured in bytes (assuming ASCII or UTF-8 encoding for the program source code).

I.e. the code must be shorter than the number of digits in the resulting number.

Leading zeros are disallowed under all circumstances. Counting leading zeroes trivialises the problem; ignoring leading zeros unnecessarily complicates the question.

The winning program will be the qualifying program which prints the integer with the smallest magnitude.

Leaderboard snippet

var QUESTION_ID = 67921;
var ANSWER_FILTER = "!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe"; var COMMENT_FILTER = "!)Q2B_A2kjfAiU78X(md6BoYk";
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) { if (data.has_more) getComments(); else if (more_answers) getAnswers(); else process(); } }); }
getAnswers();
var SCORE_REG = /<h\d>\s*([^\n,<]*(?:<(?:[^\n>]*>[^\n<]*<\/[^\n>]*>)[^\n,<]*)*)(?:,|[-\u2013] ).*?([\d,^!e+]+)(?=\:?[^\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.replace(/([^\n<]*)<\/sup>/g, "^$1").replace(/\(\d+(?:\^\d+,)? [\w\s]+\)/g, "").replace(/floor\(10\^(\d+)\/9\)/g, "$1 ones").replace(/(\d+) ones/g, function (_, x) { return Array(+x + 1).join(1); }).match(SCORE_REG); if (match) valid.push({ user: getAuthorName(a), size: +match[2].replace(/,/g, "").replace(/(\d+)\s*\^\s*(\d+)/, function (_, a, b) { return Math.pow(a, b); }).replace(/(\d+)!/, function (_, n) { for (var i = 1, j = 1; i <= n; i++) j *= i; return j; }), language: match[1], link: a.share_link, }); else console.log(body); }); valid.sort(function (a, b) { var aB = a.size, bB = b.size; return aB - bB }); var languages = {}; var place = 1; var lastSize = null; var lastPlace = 1; valid.forEach(function (a) { if (a.size != lastSize) lastPlace = place; lastSize = a.size; ++place; var answer = jQuery("#answer-template").html(); answer = answer.replace("{{PLACE}}", lastPlace + ".") .replace("{{NAME}}", a.user) .replace("{{LANGUAGE}}", a.language) .replace("{{SIZE}}", a.size) .replace("{{LINK}}", a.link); answer = jQuery(answer); jQuery("#answers").append(answer); var lang = a.language; lang = jQuery(''+lang+'').text(); languages[lang] = languages[lang] || {lang: a.language, lang_raw: lang.toLowerCase(), user: a.user, size: a.size, link: a.link}; }); var langs = []; for (var lang in languages) if (languages.hasOwnProperty(lang)) langs.push(languages[lang]); langs.sort(function (a, b) { if (a.lang_raw > b.lang_raw) return 1; if (a.lang_raw < b.lang_raw) return -1; return 0; }); for (var i = 0; i < langs.length; ++i) { var language = jQuery("#language-template").html(); var lang = langs[i]; language = language.replace("{{LANGUAGE}}", lang.lang) .replace("{{NAME}}", lang.user) .replace("{{SIZE}}", lang.size) .replace("{{LINK}}", lang.link); language = jQuery(language); jQuery("#languages").append(language); } }```
<pre class="snippet-code-html lang-html prettyprint-override"><code><script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<style>body { text-align: left !important} #answer-list { padding: 10px; width: 290px; float: left; } #language-list { padding: 10px; width: 290px; float: left; } table thead { font-weight: bold; } table td { padding: 5px; }</style>
<link rel="stylesheet" type="text/css" href="//cdn.sstatic.net/codegolf/all.css?v=83c949450c8b">
<div id="language-list"> <h2>Shortest Solution by Language</h2> <table class="language-list"> <thead> <tr><td>Language</td><td>User</td><td>Score</td></tr> </thead> <tbody id="languages"> </tbody> </table> </div> <div id="answer-list"> <h2>Leaderboard</h2> <table class="answer-list"> <thead> <tr><td></td><td>Author</td><td>Language</td><td>Size</td></tr> </thead> <tbody id="answers"> </tbody> </table> </div> <table style="display: none"> <tbody id="answer-template"> <tr><td>{{PLACE}}</td><td>{{NAME}}</td><td>{{LANGUAGE}}</td><td>{{SIZE}}</td><td>Link</td></tr> </tbody> </table> <table style="display: none"> <tbody id="language-template"> <tr><td>{{LANGUAGE}}</td><td>{{NAME}}</td><td>{{SIZE}}</td><td>Link</td></tr> </tbody> </table></code>```

答:
Turtlèd, 100000000000

```<code>11:[*'0l]'1
</code>```

11- set register to 11

: move right by amount in register

[*'0l] loop: [*   ]- while current cell is not *, '0- write zero to cell, l -move left

'1- write one

Body:
Turtlèd, 100000000000

11:[*'0l]'1

11- set register to 11

: move right by amount in register

[*'0l] loop: [*   ]- while current cell is not *, '0- write zero to cell, l -move left

'1- write one


Title: Draw some ASCII-boxes

Body:
CJam, 50 Bytes

0lS/:i0++:H;lS/:i0+{H{'-*}%'+*N+o{H{S*}%'|*N+o}*}%

Try it online!


答:
SQLite, 49 bytes

```<code>SELECT n FROM a ORDER BY length(n),n DESC LIMIT 1
</code>```

Of course only if the list is allowed to be in a table. The type of the field should be INTEGER.

Title: Output the largest number with the fewest digits

Body:
Given a nonempty list of positive decimal integers, output the largest number from the set of numbers with the fewest digits.

The input list will not be in any particular order and may contain repeated values.

Examples:

```<code>[1] -> 1
[9] -> 9
[1729] -> 1729
[1, 1] -> 1
[34, 3] -> 3
[38, 39] -> 39
[409, 12, 13] -> 13
[11, 11, 11, 1] -> 1
[11, 11, 11, 11] -> 11
[78, 99, 620, 1] -> 1
[78, 99, 620, 10] -> 99
[78, 99, 620, 100] -> 99
[1, 5, 9, 12, 63, 102] -> 9
[3451, 29820, 2983, 1223, 1337] -> 3451
[738, 2383, 281, 938, 212, 1010] -> 938
</code>```

The shortest code in bytes wins.

Body:
SQLite, 49 bytes

SELECT n FROM a ORDER BY length(n),n DESC LIMIT 1

Of course only if the list is allowed to be in a table. The type of the field should be INTEGER.


答:
C++11, 109 bytes

```<code>[](auto a){sort(a.begin(),a.end(),[](auto x,auto y){return (int)log10(x)<=(int)log10(y)&&x>y;});return a[0];}
</code>```

a should be a container like vector or list. E.g. (lambda as f)

```<code>cout<<f(vector<int>{ 10, 13, 19, 100, 12200 });
</code>```

Body:
C++11, 109 bytes

[](auto a){sort(a.begin(),a.end(),[](auto x,auto y){return (int)log10(x)<=(int)log10(y)&&x>y;});return a[0];}

a should be a container like vector or list. E.g. (lambda as f)

cout<<f(vector<int>{ 10, 13, 19, 100, 12200 });