答:
Python 2, 25 bytes, A000583, cracked

Y=input("");print`Y**4`,X
```

<p>This program exits with an error after printing the output.</p>

<hr>

<p>My hidden code (substantially different from the cracked solution!):</p>

<h2>Actually, 25 bytes</h2>

```4,n`*`Y")ii(*nppruttY;="X
```

<p>Try it online!</p>

<p>Explanation:</p>

```4,n`*`Y")ii(*nppruttY;="X
4,n                        input, repeat 4 times
   `*`Y                    do * until the stack stops changing (fixed-point combinator)
       ")ii(*nppruttY;="X  push this string and immediately pop and discard it
```

Title: Polyglot Anagrams Cops' Thread

Body:
This challenge has two threads.  This is the cops' thread. The robbers' thread is located here.

Your challenge is to choose an OEIS sequence and write two full programs in two different languages that produces that nth item in the sequence when given an n via STDIN, or an other forms of standard input, where n is any positive number.  However your two programs must be anagrams, meaning each can be rearranged from the other's letters.

Programs must output the decimal of the number followed by optional whitespace to STDOUT.  Programs may output to STDERR however it should be ignored and if the hidden case does so it must be clearly stated that this is the case.

If you wish you may also output by character code.  However if you do so in your hidden solution you must state such in the body of your submission.

You will then present the OEIS number, the source code for and the name of one language it is in.

Robbers will crack your submission if they find an anagram of the original  submission that runs in a language other than the one you already presented.  To crack an answer they must only find any language and program which produces the sequence and is an anagram of the original, not necessarily the answer the you were thinking about.

Thus you are incentivized to make it as hard as possible to find any language that does the task using their list of symbols.

Scoring

This is code-golf so the shortest un-cracked program is the winner.

Languages

Languages will be considered different if the two proposed solutions do not complete the task in both languages.  This will include different versions of the same language as long as neither the cop's solution or the robber's solution produce the correct output in the other's language.

i.e. If the there are two solutions 1 and 2 that are in language A and B respectively solution 2 must not produce the correct output in language A and solution 1 must not produce the correct output in language B.

Safety

Once your submission has been uncracked for a week you may post your solution and declare your post safe.  If after a week you choose not to post a solution your answer may still be cracked.

Body:
Python 2, 25 bytes, A000583, cracked

Y=input("");print`Y**4`,X

This program exits with an error after printing the output.

My hidden code (substantially different from the cracked solution!):

Actually, 25 bytes

4,n`*`Y")ii(*nppruttY;="X

Try it online!

Explanation:

4,n`*`Y")ii(*nppruttY;="X
4,n                        input, repeat 4 times
   `*`Y                    do * until the stack stops changing (fixed-point combinator)
       ")ii(*nppruttY;="X  push this string and immediately pop and discard it


问:
Polyglot Anagrams Cops' Thread
This challenge has two threads.  This is the cops' thread. The robbers' thread is located here.

Your challenge is to choose an OEIS sequence and write two full programs in two different languages that produces that nth item in the sequence when given an n via STDIN, or an other forms of standard input, where n is any positive number.  However your two programs must be anagrams, meaning each can be rearranged from the other's letters.

Programs must output the decimal of the number followed by optional whitespace to STDOUT.  Programs may output to STDERR however it should be ignored and if the hidden case does so it must be clearly stated that this is the case.

If you wish you may also output by character code.  However if you do so in your hidden solution you must state such in the body of your submission.

You will then present the OEIS number, the source code for and the name of one language it is in.

Robbers will crack your submission if they find an anagram of the original  submission that runs in a language other than the one you already presented.  To crack an answer they must only find any language and program which produces the sequence and is an anagram of the original, not necessarily the answer the you were thinking about.

Thus you are incentivized to make it as hard as possible to find any language that does the task using their list of symbols.

Scoring

This is code-golf so the shortest un-cracked program is the winner.

Languages

Languages will be considered different if the two proposed solutions do not complete the task in both languages.  This will include different versions of the same language as long as neither the cop's solution or the robber's solution produce the correct output in the other's language.

i.e. If the there are two solutions 1 and 2 that are in language A and B respectively solution 2 must not produce the correct output in language A and solution 1 must not produce the correct output in language B.

Safety

Once your submission has been uncracked for a week you may post your solution and declare your post safe.  If after a week you choose not to post a solution your answer may still be cracked.

答:
<s>2sable, 13 bytes, A002378</s>, Cracked!

Hoping I didn't miss something. Computes a(n) = n × (n + 1):

```<code>>*?"!&)<=@\\}
</code>```

My version:

```<code>?"\>@&*})<\=!
</code>```

Or the unfolded version:

```<code>  ? " \
 > @ & *
} ) < \ =
 ! . . .
  . . .
</code>```

Note that the > in the top-left corner is unused (except for the 2sable program). I did this to confuse the robbers (but that obviously didn't work haha).

Try it online!

ContentLicense: CC BY-SA 3.0

Title: Polyglot Anagrams Cops' Thread

Body:
<s>2sable, 13 bytes, A002378</s>, Cracked!

Hoping I didn't miss something. Computes a(n) = n × (n + 1):

>*?"!&)<=@\\}

My version:

?"\>@&*})<\=!

Or the unfolded version:

  ? " \
 > @ & *
} ) < \ =
 ! . . .
  . . .

Note that the > in the top-left corner is unused (except for the 2sable program). I did this to confuse the robbers (but that obviously didn't work haha).

Try it online!


问:
Alternating Fibonacci
In the alternating Fibonacci sequence, you first start with 1 and 1 as usual.

However, instead of always adding the last two values to get the next number, you alternate starting with adding, and every other time you subtract instead.

The sequence starts like this:

```<code>1
1
2    # 1 + 1
-1   # 1 - 2
1    # 2 + -1
-2   # -1 - 1
-1   # 1 + -2
-1   # -2 - -1
-2   # -1 + -1
1    # -1 - -2
-1   # -2 + 1
2    # 1 - -1
1    # -1 + 2
1    # 2 - 1
</code>```

etc.

Notice that after it starts over once it gets to 1 and 1 again.

Given a number N, print the Nth term of the alternating fibonacci sequence.

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

答:
Actually, 22 bytes

```<code>34*@%"334130110314"E≈¬
</code>```

Try it online!

Explanation:

```<code>34*@%"334130110314"E≈¬
34*@%                   input % 12
     "334130110314"E    get that character in the string
                    ≈¬  convert to int, subtract 2
</code>```

Title: Alternating Fibonacci

Body:
Actually, 22 bytes

34*@%"334130110314"E≈¬

Try it online!

Explanation:

34*@%"334130110314"E≈¬
34*@%                   input % 12
     "334130110314"E    get that character in the string
                    ≈¬  convert to int, subtract 2


问:
Polyglot Anagrams Robbers' Thread
This is the robbers' thread of this challenge

The cops will choose an OEIS sequence and write two full programs in two different languages that produces that nth item in the sequence when given an n via STDIN.  The two programs must be anagrams of each other, meaning each can be rearranged from the other's letters.

They will present the OEIS number, the source code for and the name of one language it is in.

You must find an anagram of the original cop's submission that runs in a language other than the one used by the cop.  To crack an answer you must only find any language and program which produces the sequence and is an anagram of the original, not necessarily the answer the cop was thinking about.

You may output by character code or include STDERR in your solution, but only if the cop has indicated their hidden solution does so.  Decimal output to STDOUT is always a valid crack.

Thus cops are incentivized to make it as hard as possible to find any language that does the task using their list of symbols.

Scoring

The person with the most cracks will be the winner of this section.  Only the first crack for each solution will count towards one's score.

Leader Board

Big thanks to every one that took place in this challenge.

Here is the leader board as it stands

```<code>Place  User             Score
-----------------------------
1      Adnan            3
1      Kritixi Lithos   3
1      Emigna           3
1      milk             3
5      Steven H.        2
5      Wheat Wizard     2
5      jimmy23013       2
8      ETH Productions  1
8      Dennis           1
8      alleks           1
8      Martin Ender     1
8      Oliver           1
8      Conor O'Brien    1
</code>```

答:
05AB1E, 25 bytes, Mego, A000583

Code:

```<code>nnYi=put("");prit`Y**4`,X
</code>```

Explanation:

```<code>n       # Square the input
 n      # Square the squared input
  Y     # Constant that pushes 2
   i    # If equal to 1, do the following:
    =put...
</code>```

Try it online!

Title: Polyglot Anagrams Robbers' Thread

Body:
05AB1E, 25 bytes, Mego, A000583

Code:

nnYi=put("");prit`Y**4`,X

Explanation:

n       # Square the input
 n      # Square the squared input
  Y     # Constant that pushes 2
   i    # If equal to 1, do the following:
    =put...

Try it online!


答:
Java 7, <s>88</s> <s>82</s> 79 bytes

golfed:

```<code>int f(int n){int c,i=0,a=1,b=1;for(;i<n;){c=i++%2>0?a-b:a+b;a=b;b=c;}return b;}
</code>```

ungolfed:

```<code>int f(int n)
{
    int c, i = 0, a = 1, b = 1;
    for (; i < n;)
    {
        c = i++ % 2 > 0 ? a - b : a + b;
        a = b;
        b = c;
    }
    return b;
}
</code>```

Try it online

Title: Alternating Fibonacci

Body:
In the alternating Fibonacci sequence, you first start with 1 and 1 as usual.

However, instead of always adding the last two values to get the next number, you alternate starting with adding, and every other time you subtract instead.

The sequence starts like this:

```<code>1
1
2    # 1 + 1
-1   # 1 - 2
1    # 2 + -1
-2   # -1 - 1
-1   # 1 + -2
-1   # -2 - -1
-2   # -1 + -1
1    # -1 - -2
-1   # -2 + 1
2    # 1 - -1
1    # -1 + 2
1    # 2 - 1
</code>```

etc.

Notice that after it starts over once it gets to 1 and 1 again.

Given a number N, print the Nth term of the alternating fibonacci sequence.

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

Body:
Java 7, <s>88</s> <s>82</s> 79 bytes

golfed:

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

ungolfed:

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

Try it online


问:
I deserve a castle for it only being Tuesday
It is only Tuesday, ugh. I deserve a treat. Golf me a Castle. The Least amount of bytes wins!

Taken no input and output this image exactly:

```<code> /\           /\
/  \         /  \
----         ----
|  |^^^^^^^^^|  |
-----------------
|       _       |
|   |  | |  |   |
|      | |      |
</code>```

Edit

Build me a brick wall!
36 votes versus my -9. Okay.

Body:
JavaScript (ES6), 120 bytes

_=>` /\\44/\\
/8\\36/8\\
173617
|8|38|8|
69
|28_28|
|12|8| |8|12|
|24| |24|`.replace(/\d\d?/g,n=>' -^'[n&3].repeat(n/4))

Demo

let f =

_=>` /\\44/\\
/8\\36/8\\
173617
|8|38|8|
69
|28_28|
|12|8| |8|12|
|24| |24|`.replace(/\d\d?/g,n=>' -^'[n&3].repeat(n/4))

console.log(f())


问:
Create another empty string in .NET?
I apologize if this isn't fit for this site but it is a puzzle, not all that practical, so I thought it would fit.

Take this code:

```<code>string s = "";
Console.WriteLine(ReferenceEquals(s, string.Empty));
</code>```

This will print out true because "" is interned by the JITter at some early point and literals are reused from the interning cache.

The question and puzzle is this:

How can you initialize s such that

  1. s.Length == 0

  2. ReferenceEquals(s, string.Empty) == false

I've tried the following:

```<code>string s = "test".Substring(0, 0); // any arbitrary legal start offset tried
string s = new string(' ', 0);
string s = new string(new char[0]);
string s = CallSomeMethodThatWontBeInlined() + CallSomeMethodThatWontBeInlined();
</code>```

These three all end up being equal to string.Empty.

Bonus if you can explain the above behavior with regards to new string(...). I have my thoughts about it but no solid evidence one way or another.

I can understand that all methods that concatenate or take substrings of existing strings special-case the result that will end up with length zero, but how new string(...) actually doesn't create a new object I don't know.

Note! I'm asking for legal C#. I'm not asking for a p/invoke or assembly code call that just manually constructs the bytes of an empty string object in memory and stuffs a pointer to it into a string variable.

Any method or path through existing classes in .NET or using operators of strings or whatnot that would end up with the required results are legal. As such, take the Substring example above, if that returned a new empty string that isn't the same as the existing one, then that would be a/the answer to this puzzle.

Reflection is boundary, at the very least it has to be reflection that can run in untrusted scenarios.

My own "conclusion" is that this may indeed be impossible because the actual C# code that would end up constructing such a string would end up with one of the new string(...) overloads, or using one of the operators which all seem to handle this cases. As such, the end-point of any such code may be the one that handles this case and since it does, it may not be possible.

答:
So, I'll take the easy way:

```<code>string s = "";
</code>```

So, s.Length is now 0, so far so good. But how can we get ReferenceEquals(s, string.Empty) to false.

Piece of cake, just put that into your class:

```<code>public static new bool ReferenceEquals(object a, object b) => false;
</code>```

and the above call will result in false.

I will look for some more sneaky methods, so.

Title: Create another empty string in .NET?

Body:
So, I'll take the easy way:

string s = "";

So, s.Length is now 0, so far so good. But how can we get ReferenceEquals(s, string.Empty) to false.

Piece of cake, just put that into your class:

public static new bool ReferenceEquals(object a, object b) => false;

and the above call will result in false.

I will look for some more sneaky methods, so.


答:
C#, <s>73</s> 71 bytes

This uses 0-indexed values of n.

```<code>n=>{int a=1,b=1,i=0,r;for(;++i<n;){r=i%2>0?a+b:a-b;a=b;b=r;}return b;};
</code>```

Formatted version:

```<code>Func<int, int> f = n =>
{
    int a = 1, b = 1, i = 0, r;

    for(; ++i < n;)
    {
        r = i % 2 > 0 ? a + b : a - b;
        a = b;
        b = r;
    }

    return b;
};
</code>```

Title: Alternating Fibonacci

Body:
C#, <s>73</s> 71 bytes

This uses 0-indexed values of n.

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

Formatted version:

Func<int, int> f = n =>
{
    int a = 1, b = 1, i = 0, r;

    for(; ++i < n;)
    {
        r = i % 2 > 0 ? a + b : a - b;
        a = b;
        b = r;
    }

    return b;
};


答:
1st try: Reflection

```<code>String s = "abc";
PropertyInfo pi = s.GetType().GetProperty("Length");
pi.SetValue(s, 0, null);
</code>```

Yields error, there is no set property

Loophole

```<code>var s = new { Length = 0 };
</code>```

Now the ReferenceEquals will return false and s.Length == 0. Just sticking to your rules =)

Title: Create another empty string in .NET?

Body:
I apologize if this isn't fit for this site but it is a puzzle, not all that practical, so I thought it would fit.

Take this code:

```<code>string s = "";
Console.WriteLine(ReferenceEquals(s, string.Empty));
</code>```

This will print out true because "" is interned by the JITter at some early point and literals are reused from the interning cache.

The question and puzzle is this:

How can you initialize s such that

  1. s.Length == 0

  2. ReferenceEquals(s, string.Empty) == false

I've tried the following:

```<code>string s = "test".Substring(0, 0); // any arbitrary legal start offset tried
string s = new string(' ', 0);
string s = new string(new char[0]);
string s = CallSomeMethodThatWontBeInlined() + CallSomeMethodThatWontBeInlined();
</code>```

These three all end up being equal to string.Empty.

Bonus if you can explain the above behavior with regards to new string(...). I have my thoughts about it but no solid evidence one way or another.

I can understand that all methods that concatenate or take substrings of existing strings special-case the result that will end up with length zero, but how new string(...) actually doesn't create a new object I don't know.

Note! I'm asking for legal C#. I'm not asking for a p/invoke or assembly code call that just manually constructs the bytes of an empty string object in memory and stuffs a pointer to it into a string variable.

Any method or path through existing classes in .NET or using operators of strings or whatnot that would end up with the required results are legal. As such, take the Substring example above, if that returned a new empty string that isn't the same as the existing one, then that would be a/the answer to this puzzle.

Reflection is boundary, at the very least it has to be reflection that can run in untrusted scenarios.

My own "conclusion" is that this may indeed be impossible because the actual C# code that would end up constructing such a string would end up with one of the new string(...) overloads, or using one of the operators which all seem to handle this cases. As such, the end-point of any such code may be the one that handles this case and since it does, it may not be possible.

Body:
1st try: Reflection

String s = "abc";
PropertyInfo pi = s.GetType().GetProperty("Length");
pi.SetValue(s, 0, null);

Yields error, there is no set property

Loophole

var s = new { Length = 0 };

Now the ReferenceEquals will return false and s.Length == 0. Just sticking to your rules =)


问:
Count up folks!

Introduction

It may sound strange, but we haven't got ONE challenge for counting from 1 to n, inclusive.

This is not the same thing. That one is a (closed) not well-explained challenge.

This is not the same thing. That one is about counting up indefinitely.

Challenge

Write a program or function that prints every integer from 1 to n inclusive.

Rules

You can get n any way.

You can assume that n will always be a positive integer.

You can get n in any base, but you should always output in decimal.

Output must be separated by any character (or pattern) not in 0123456789. Non-decimal leading or trailing characters are allowed (for example when using arrays such as [1, 2, 3, 4, 5, 6]).

Standard loopholes are denied.

We want to find the shortest approach in each language, not the shortest language, so I will not accept any answer.

You must update your answer(s) after this edit, answers posted before the last edit must comply with the change rule about standard loopholes (I didn't want to deny them, but I didn't want to make the community roar, so I denied them).

You can use any post-dating language version (or language). You cannot use any language or language version made just for this challenge.

Bonuses

20%

Your program must be able to count at least up to 18446744073709551615 (2^64-1). For example, if a new datatype is the only way to support big integers, you must construct it. If your language does not have any way to support huge integers up to 2^64-1, the upper limit of that particular language must be supported instead.

EDIT: I've changed the limit from 2^64 to 2^64-1 to allow more answers.

EDIT: I made the 2^64-1 rule a bonus, since there has not been much interest in this challenge. If your answer supports 2^64-1, you can now edit it to include the bonus. Also, you can post an answer not supporting it, if it is shorter.

答:
Excel VBA, <s>48</s> <s>47</s> <s>46</s> <s>22</s> 21 Bytes

Immediates Window Function

Anonymous VBE Immediates Windows Function that takes input of the expected type Variant\Integer and from cell [A1] outputs to the VBE immediates window

For I=1To[A1]:?I:Next
```
<p><strong>Old <code>Sub</code>routine Version</strong></p>
<p>Code:</p>
<pre class="lang-vba prettyprint-override"><code>Sub F(N):For I=1To N:Cells(I, 1)=I:Next:End Sub
</code>```

Usage:

Sub Test(): F 100: End Sub
```
<p>Changes:</p>
<p>-24 Bytes for converting to Immediates Window Function</p>
<p>-1 Byte for condensing <code>I=1 To</code> to <code>I=1To</code></p>
<p>-1 Byte thanks to Engineer Toast for Changing <code>Cells(I,1)</code> to <code>Debug.?</code></p>
<p>-1 Byte for removing whitespace</p>
<hr />
<h2>Output to ActiveSheet, <sub><s>30</s></sub> 28 Bytes</h2>
<p>Anonymous VBE immediate window function that takes input from range <code>[A1]</code> and outputs to the range <code>[1:1]</code></p>
<pre class="lang-vba prettyprint-override"><code>[A1].Resize([A1],1)="=Row()"
</code>```

-2 Bytes for removing A1 from Row(A1)

Title: Count up folks!

Body:
Excel VBA, <s>48</s> <s>47</s> <s>46</s> <s>22</s> 21 Bytes

Immediates Window Function

Anonymous VBE Immediates Windows Function that takes input of the expected type Variant\Integer and from cell [A1] outputs to the VBE immediates window

For I=1To[A1]:?I:Next

Old Subroutine Version

Code:

Sub F(N):For I=1To N:Cells(I, 1)=I:Next:End Sub

Usage:

Sub Test(): F 100: End Sub

Changes:

-24 Bytes for converting to Immediates Window Function

-1 Byte for condensing I=1 To to I=1To

-1 Byte thanks to Engineer Toast for Changing Cells(I,1) to Debug.?

-1 Byte for removing whitespace

Output to ActiveSheet, <s>30</s> 28 Bytes

Anonymous VBE immediate window function that takes input from range [A1] and outputs to the range [1:1]

[A1].Resize([A1],1)="=Row()"

-2 Bytes for removing A1 from Row(A1)


答:
Hexagony, 13 bytes, Adnan, A002378

```<code>?"&\>=})\*!@<
</code>```

Try it online!

Unfolded:

```<code>  ? " &
 \ > = }
) \ * ! @
 < . . .
  . . .
</code>```

Not 100% whether this is the original, because the top left \ is unused.

The <\> are just mirrors, so the program is actually entirely linear:

```<code>?"&)}=*!@

?          Read input.
 "         Move back and left.
  &        Copy input.
   )       Increment copy.
    }=     Move forward and right and turn around (to face the n and n+1 edges).
      *    Multiply.
       !   Print.
        @  Terminate.
</code>```

Title: Polyglot Anagrams Robbers' Thread

Body:
This is the robbers' thread of this challenge

The cops will choose an OEIS sequence and write two full programs in two different languages that produces that nth item in the sequence when given an n via STDIN.  The two programs must be anagrams of each other, meaning each can be rearranged from the other's letters.

They will present the OEIS number, the source code for and the name of one language it is in.

You must find an anagram of the original cop's submission that runs in a language other than the one used by the cop.  To crack an answer you must only find any language and program which produces the sequence and is an anagram of the original, not necessarily the answer the cop was thinking about.

You may output by character code or include STDERR in your solution, but only if the cop has indicated their hidden solution does so.  Decimal output to STDOUT is always a valid crack.

Thus cops are incentivized to make it as hard as possible to find any language that does the task using their list of symbols.

Scoring

The person with the most cracks will be the winner of this section.  Only the first crack for each solution will count towards one's score.

Leader Board

Big thanks to every one that took place in this challenge.

Here is the leader board as it stands

```<code>Place  User             Score
-----------------------------
1      Adnan            3
1      Kritixi Lithos   3
1      Emigna           3
1      milk             3
5      Steven H.        2
5      Wheat Wizard     2
5      jimmy23013       2
8      ETH Productions  1
8      Dennis           1
8      alleks           1
8      Martin Ender     1
8      Oliver           1
8      Conor O'Brien    1
</code>```

Body:
Hexagony, 13 bytes, Adnan, A002378

?"&\>=})\*!@<

Try it online!

Unfolded:

  ? " &
 \ > = }
) \ * ! @
 < . . .
  . . .

Not 100% whether this is the original, because the top left \ is unused.

The <\> are just mirrors, so the program is actually entirely linear:

?"&)}=*!@

?          Read input.
 "         Move back and left.
  &        Copy input.
   )       Increment copy.
    }=     Move forward and right and turn around (to face the n and n+1 edges).
      *    Multiply.
       !   Print.
        @  Terminate.


答:
Java 8, <s>101</s> 119 bytes

18 for the import: java.util.stream.*;

Lambda that returns the wall. We generate an infinite Stream of brick pieces ('_|__'), limit it to 175, and collect them into a string. We then use replaceAll to swap in a newline every 70 characters.

```<code>()->Stream.generate(()->"_|__").limit(175).collect(Collectors.joining()).replaceAll("(.{70})","$1\n")
</code>```

Title: Build me a brick wall!

Body:
Challenge

I need help building a brick wall! Throw together some code for me
 using no input and produce the following output wall shown below:

```<code>_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
</code>```

Now, this wall is exactly 10 characters high and 70 characters
 wide.

As stated above, no inputs, only code. Least amount of bytes, we have
 to efficiently build this brick wall. Obviously, this program has to
 function to get the wall built..? or it obviously won't build itself!
 Good luck!

Winner

The winner goes to Marinus using the APL language, requiring a whole 12 bytes!
https://codegolf.stackexchange.com/a/99028/61857

Thank you everyone for participating!

Body:
Java 8, <s>101</s> 119 bytes

18 for the import: java.util.stream.*;

Lambda that returns the wall. We generate an infinite Stream of brick pieces ('_|__'), limit it to 175, and collect them into a string. We then use replaceAll to swap in a newline every 70 characters.

()->Stream.generate(()->"_|__").limit(175).collect(Collectors.joining()).replaceAll("(.{70})","$1\n")


答:
SAS, 68

```<code>option linesize=70;data;length w$700;w=repeat('_|__',174);put w;run;
</code>```

The 174 is not a typo - in SAS the repeat function rather pedantically returns the original string plus n repeats.

Title: Build me a brick wall!

Body:
SAS, 68

option linesize=70;data;length w$700;w=repeat('_|__',174);put w;run;

The 174 is not a typo - in SAS the repeat function rather pedantically returns the original string plus n repeats.


问:
Shrinking numbers
The input is an array of (at least 3, maximum 20) different integers. Each integer is greater than -1000 and smaller than 1000.

Your task is to shrink the numbers by "linearly mapping" them from 0.0 to 1.0. This means the smallest number in the array will be mapped to 0.0, the largest to 1.0.

You get the array as a parameter (inside a function) or stdin/program arguments (you can choose). Print out the result in the format double1;double2;double3;.... The output has to have the same order as the input.

If you want, you can round the output to 2 digits after the decimal point. There must be atleast 1 digit after the decimal point.

The usage of built-in functions (functions which scale down the numbers for you, such as mathematicas Rescale) is disallowed.

Examples:

```<code>Input              Output
[5,-20,30]         0.5;0.0;1.0
[1,2,3,4,5]        0.0;0.25;0.5;0.75;1.0
[0,5,100,400]      0.0;0.01;0.25;1.0
</code>```

(The last output is rounded, otherwise it would be 0.0;0.0125;0.25;1.0)

答:
R, 60 bytes

```<code>m=min(x<-scan());cat(sprintf("%f",(x-m)/(max(x)-m)),sep=";")
</code>```

Formatting eats up a lot of bytes due to 0 and 1 by default are trimmed to display nothing past the integer part.

Title: Shrinking numbers

Body:
R, 60 bytes

m=min(x<-scan());cat(sprintf("%f",(x-m)/(max(x)-m)),sep=";")

Formatting eats up a lot of bytes due to 0 and 1 by default are trimmed to display nothing past the integer part.


问:
GO OUT AND VOTE
Today is November 8th, 2016, Election Day in the United States of America.

If you are a U.S. citizen eligible to vote, then go out and vote if you haven't already before answering this challenge. Do not discuss who you voted for. It only matters that you voted.

If you are not a U.S. citizen or not eligible to vote, then, before answering this challenge, do the U.S. a favor by telling anyone you know who is an eligible citizen to go out and vote if they haven't already.

Challenge

Write a program that indicates that you voted, like a digital "I Voted" sticker.

It should take no input and must output in a reasonable way the phrase I Voted where the I, o, and e are red (#FF0000) and the V, t, and d are blue (#0000FF). The background must be white (#FFFFFF).

For example:

These colors are of course representative of the American flag (though not the official colors). Red comes first simply because it comes first in the common idiom "red white and blue".

To be valid, an answer must:

Use the colors specified in the arrangement specified.

Use a single legible font and font size. The example uses 72pt Times New Roman bold but any common font above 6pt is probably fine.

Have just the phrase I Voted on a single line, capitalized correctly, with a clear space between the two words. It shouldn't look like IVoted.

Not indicate who the answerer voted for or supports for president or any down-ballot races. Let's not start any internet debates. This is about celebrating voting, not candidates.

Any reasonable way of displaying or producing the output is valid, such as:

Drawing the text to an image that is then displayed, saved, or output raw.

Writing the text to a console using color formatting. In this case you may approximate pure red and blue if necessary, and it's ok if only the area directly behind the text can be made white.

Displaying the text on a WPF/Windows form.

Outputting an HTML/RTF/PDF file with the text.

Please post an image of your output.

The shortest answer in bytes wins.

答:
C#, <s>262</s> <s>201</s> <s>180</s> <s>170</s> 166 bytes

```<code>using c=System.Console;using o=System.ConsoleColor;static void M(){c.BackgroundColor=(o)15;foreach(var a in "I Voted"){c.ForegroundColor=(o)(a%2<1?9:12);c.Write(a);}}
</code>```

Saved 46 bytes thanks to Link Ng

Outputs the following to console:

Title: GO OUT AND VOTE

Body:
C#, <s>262</s> <s>201</s> <s>180</s> <s>170</s> 166 bytes

using c=System.Console;using o=System.ConsoleColor;static void M(){c.BackgroundColor=(o)15;foreach(var a in "I Voted"){c.ForegroundColor=(o)(a%2<1?9:12);c.Write(a);}}

Saved 46 bytes thanks to Link Ng

Outputs the following to console:


答:
Ruby  17Byte

```<code>1.upto(n){|i|p i}
</code>```

Title: Count up folks!

Body:
Introduction

It may sound strange, but we haven't got ONE challenge for counting from 1 to n, inclusive.

This is not the same thing. That one is a (closed) not well-explained challenge.

This is not the same thing. That one is about counting up indefinitely.

Challenge

Write a program or function that prints every integer from 1 to n inclusive.

Rules

You can get n any way.

You can assume that n will always be a positive integer.

You can get n in any base, but you should always output in decimal.

Output must be separated by any character (or pattern) not in 0123456789. Non-decimal leading or trailing characters are allowed (for example when using arrays such as [1, 2, 3, 4, 5, 6]).

Standard loopholes are denied.

We want to find the shortest approach in each language, not the shortest language, so I will not accept any answer.

You must update your answer(s) after this edit, answers posted before the last edit must comply with the change rule about standard loopholes (I didn't want to deny them, but I didn't want to make the community roar, so I denied them).

You can use any post-dating language version (or language). You cannot use any language or language version made just for this challenge.

Bonuses

20%

Your program must be able to count at least up to 18446744073709551615 (2^64-1). For example, if a new datatype is the only way to support big integers, you must construct it. If your language does not have any way to support huge integers up to 2^64-1, the upper limit of that particular language must be supported instead.

EDIT: I've changed the limit from 2^64 to 2^64-1 to allow more answers.

EDIT: I made the 2^64-1 rule a bonus, since there has not been much interest in this challenge. If your answer supports 2^64-1, you can now edit it to include the bonus. Also, you can post an answer not supporting it, if it is shorter.

Body:
Ruby  17Byte

1.upto(n){|i|p i}


Title: Build me a brick wall!

Body:
Gema, 45 characters

\A=@subst{<U70>=\$1\\n;@repeat{175;_|__}}@end

Sample run:

bash-4.3$ gema '\A=@subst{<U70>=\$1\\n;@repeat{175;_|__}}@end'
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__


问:
Find the Emirps!

An emirp is a non-palindromic prime which, when reversed, is also prime.

The list of base 10 emirps can be found on OEIS. The first six are:

```<code>13, 17, 31, 37, 71, 73
</code>```

However, due to the reversal rule, emirps are different in each base. For example, the first six binary emirps are:

```<code>Bin  | 1011, 1101, 10111, 11101, 101001, 100101
Dec  | (11 , 13  , 23   , 29   , 37    , 41   )
</code>```

...and in hexadecimal, they are:

```<code>Hex |  17, 1F, 35, 3B, 3D, 53
Dec | (23, 31, 53, 59, 61, 83)
</code>```

Fun Fact: there are no emirps in unary as every number is a palindrome.

The Challenge

Your task is to create a function (or full program) which takes two parameters,
\$ n \$ and \$ b \$, and generates a list of the first \$ n \$ emirps in base \$ b \$.

Rules/Details:

\$ n \$ and \$ b \$ are both positive integers larger than \$ 0 \$.

You can assume \$ 2 ≤ b ≤ 16 \$: that is to say, the base will be between binary and hexidecimal.

You should be able to compute for values of \$ n \$ up to \$ ~100 \$.

The generated list can be in base \$ b \$, or your language's standard integer base, as long as you specify this in your answer.

Builtin emirp checks are not permitted (builtin primality tests are fine)

You cannot hard-code the emirps, or read from any external files.

Standard loopholes are banned, as always.

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

Test Cases

For each test case, I've included the list in base b and its base 10 equivalents.

```<code>B = 2, N = 10

BIN: [1011, 1101, 10111, 11101, 100101, 101001, 101011, 101111, 110101, 111101]
DEC: [11, 13, 23, 29, 37, 41, 43, 47, 53, 61]

B = 3, N = 5

BASE3: [12, 21, 102, 201, 1011]
DEC:   [5, 7, 11, 19, 31]

B = 12, N = 7

BASE12: [15, 51, 57, 5B, 75, B5, 107]
DEC: [17, 61, 67, 71, 89, 137, 151]

B = 16, N = 4

HEX: [17, 1F, 35, 3B]
DEC: [23, 31, 53, 59]
</code>```

You can test your program further against my (ungolfed) Python example on repl.it

答:
JavaScript (ES6), <s>149</s> <s>148</s> <s>141</s> 140 bytes

Returns a space-separated list of emirps in base b. (Could be 2 bytes shorter by returning a decimal list instead.)

f=(b,n,i=2)=>n?((p=(n,k=n)=>--k<2?k:n%k&&p(n,k))(i)&p(k=parseInt([...j=i.toString(b)].reverse().join``,b))&&k-i&&n--?j+' ':'')+f(b,n,i+1):''
```

<h3>Test cases</h3>

<p><div class="snippet" data-lang="js" data-hide="true" data-console="true" data-babel="false">
<div class="snippet-code snippet-currently-hidden">
<pre class="snippet-code-js lang-js prettyprint-override"><code>f=(b,n,i=2)=>n?((p=(n,k=n)=>--k<2?k:n%k&&p(n,k))(i)&p(k=parseInt([...j=i.toString(b)].reverse().join``,b))&&k-i&&n--?j+' ':'')+f(b,n,i+1):''

console.log(f(2,10));
console.log(f(3,5));
console.log(f(12,7));
console.log(f(16,4));</code>```

ContentLicense: CC BY-SA 4.0

Title: Find the Emirps!

Body:
JavaScript (ES6), <s>149</s> <s>148</s> <s>141</s> 140 bytes

Returns a space-separated list of emirps in base b. (Could be 2 bytes shorter by returning a decimal list instead.)

f=(b,n,i=2)=>n?((p=(n,k=n)=>--k<2?k:n%k&&p(n,k))(i)&p(k=parseInt([...j=i.toString(b)].reverse().join``,b))&&k-i&&n--?j+' ':'')+f(b,n,i+1):''

Test cases

f=(b,n,i=2)=>n?((p=(n,k=n)=>--k<2?k:n%k&&p(n,k))(i)&p(k=parseInt([...j=i.toString(b)].reverse().join``,b))&&k-i&&n--?j+' ':'')+f(b,n,i+1):''

console.log(f(2,10));
console.log(f(3,5));
console.log(f(12,7));
console.log(f(16,4));


答:
Javascript, 232 bytes

```<code>brick = ["_","_","_","|"];
brickIndex = 2;
output = "";
for(var y=0;y<10;y++){
    for(var x=0;x<70;x++){
      brickIndex = brickIndex % 4;
      output += brick[brickIndex++];
    }
    output += "\n";
}
console.log(output)
</code>```

Title: Build me a brick wall!

Body:
Javascript, 232 bytes

brick = ["_","_","_","|"];
brickIndex = 2;
output = "";
for(var y=0;y<10;y++){
    for(var x=0;x<70;x++){
      brickIndex = brickIndex % 4;
      output += brick[brickIndex++];
    }
    output += "\n";
}
console.log(output)


Title: Build me a brick wall!

Body:
jq, 37 characters

(33 characters code + 4 characters command line options)

range(10)|.*2|("_|__"*70)[.:.+70]

range(10)|("_|__"*70)[.*2:.*2+70]

range(0;20;2)|("_|__"*70)[.:.+70]

Sample run:

bash-4.3$ jq -nr 'range(10)|.*2|("_|__"*70)[.:.+70]'
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__

On-line test code 1, code 2 and code 3 (Passing -r through URL is not supported – check Raw Output yourself.)


问:
Increment every number in a string
Given a string containing decimal numbers:

teststring134this 123test string54 100

increment every number in this string by one to give the new string

teststring135this 124test string55 101.

The string can be provided as:

a command line argument

STDIN

a hard-coded variable or function argument

Cover all possible positions for a number:

as a prefix for a word; 123test ► 124test

as a suffix for a word; test123 ► test124

inside a word; te123st ► te124st

alone test 123 test ► test 124 test

Here's a non-golfed solution in Python:

```<code>NUMBERS = '0123456789'

def increment(s):
    out = ''

    number = ''
    for c in s:
        if c in NUMBERS:
            number += c
        else:
            if number != '':
                out += str(int(number) + 1)
                number = ''
            out += c

    if number != '':
        out += str(int(number) + 1)
        number = ''

    return out

print "\"%s\"" % (increment('teststring134this 123test string54 100'))
</code>```

This is a code-golf question, shortest code wins.

答:
Java 7, 119 bytes

```<code>void c(String s){for(String x:s.split("(?=[^\\d]+)|(?<=[^\\d]+)"))System.out.print(x.matches("\\d+")?new Long(x)+1:x);}
</code>```

If the requirement is a program instead of just a function, then it's 149 bytes:

```<code>class M{public static void main(String[]a){for(String x:a[0].split("(?=[^\\d]+)|(?<=[^\\d]+)"))System.out.print(x.matches("\\d+")?new Long(x)+1:x);}}
</code>```

Ungolfed & test code:

Try it here.

```<code>class M{
  static void c(String s){
    for(String x : s.split("(?=[^\\d]+)|(?<=[^\\d]+)")){
      System.out.print(x.matches("\\d+")
                        ? new Long(x) + 1
                        : x);
    }
  }

  public static void main(String[] a){
    c("123test");
    System.out.println();
    c("test123");
    System.out.println();
    c("te123st");
    System.out.println();
    c("test 123 test");
    System.out.println();
    c("7teststring134this 123test string59 100");
  }
}
</code>```

Output:

```<code>124test
test124
te124st
test 124 test
8teststring135this 124test string60 101
</code>```

Title: Increment every number in a string

Body:
Java 7, 119 bytes

void c(String s){for(String x:s.split("(?=[^\\d]+)|(?<=[^\\d]+)"))System.out.print(x.matches("\\d+")?new Long(x)+1:x);}

If the requirement is a program instead of just a function, then it's 149 bytes:

class M{public static void main(String[]a){for(String x:a[0].split("(?=[^\\d]+)|(?<=[^\\d]+)"))System.out.print(x.matches("\\d+")?new Long(x)+1:x);}}

Ungolfed & test code:

Try it here.

class M{
  static void c(String s){
    for(String x : s.split("(?=[^\\d]+)|(?<=[^\\d]+)")){
      System.out.print(x.matches("\\d+")
                        ? new Long(x) + 1
                        : x);
    }
  }

  public static void main(String[] a){
    c("123test");
    System.out.println();
    c("test123");
    System.out.println();
    c("te123st");
    System.out.println();
    c("test 123 test");
    System.out.println();
    c("7teststring134this 123test string59 100");
  }
}

Output:

124test
test124
te124st
test 124 test
8teststring135this 124test string60 101


答:
Quake 3/Live Colour Codes (19 characters)

```<code>^1I ^4V^1o^4t^1e^4d
</code>```

Title: GO OUT AND VOTE

Body:
Today is November 8th, 2016, Election Day in the United States of America.

If you are a U.S. citizen eligible to vote, then go out and vote if you haven't already before answering this challenge. Do not discuss who you voted for. It only matters that you voted.

If you are not a U.S. citizen or not eligible to vote, then, before answering this challenge, do the U.S. a favor by telling anyone you know who is an eligible citizen to go out and vote if they haven't already.

Challenge

Write a program that indicates that you voted, like a digital "I Voted" sticker.

It should take no input and must output in a reasonable way the phrase I Voted where the I, o, and e are red (#FF0000) and the V, t, and d are blue (#0000FF). The background must be white (#FFFFFF).

For example:

These colors are of course representative of the American flag (though not the official colors). Red comes first simply because it comes first in the common idiom "red white and blue".

To be valid, an answer must:

Use the colors specified in the arrangement specified.

Use a single legible font and font size. The example uses 72pt Times New Roman bold but any common font above 6pt is probably fine.

Have just the phrase I Voted on a single line, capitalized correctly, with a clear space between the two words. It shouldn't look like IVoted.

Not indicate who the answerer voted for or supports for president or any down-ballot races. Let's not start any internet debates. This is about celebrating voting, not candidates.

Any reasonable way of displaying or producing the output is valid, such as:

Drawing the text to an image that is then displayed, saved, or output raw.

Writing the text to a console using color formatting. In this case you may approximate pure red and blue if necessary, and it's ok if only the area directly behind the text can be made white.

Displaying the text on a WPF/Windows form.

Outputting an HTML/RTF/PDF file with the text.

Please post an image of your output.

The shortest answer in bytes wins.

Body:
Quake 3/Live Colour Codes (19 characters)

^1I ^4V^1o^4t^1e^4d


答:
<s>05AB1E, 9 bytes, A000042</s> Cracked!

```<code>1×,1*-^$)
</code>```

This is the Unary representation of natural numbers (OEIS). So if the input was 3, for example, then output would be 111.

Explanation:

```<code>                    # implicit input
1                   # pushes 1 to the stack
 ×                  # pushes "1" × (the input)
  ,                 # outputs the stack
   1*-^$)           # irrelevant
</code>```

Try it online!

Original Solution, Carrot

```<code>1^*$-1×^)
</code>```

Explanation

```<code>1^             Push "1" to the stack
  *            Multiply the string by
   $-1         ...the input (as an integer) minus 1 times
      ×,)      Ignored by the interpreter
</code>```

The * multiplies the string by (n+1) times, so that a^*3 results in aaaa and not aaa. So that is why I subtracted 1 from the input.

Only now I realise that the ) has been irrelevant in both the languages :D

Try it online!

Title: Polyglot Anagrams Cops' Thread

Body:
This challenge has two threads.  This is the cops' thread. The robbers' thread is located here.

Your challenge is to choose an OEIS sequence and write two full programs in two different languages that produces that nth item in the sequence when given an n via STDIN, or an other forms of standard input, where n is any positive number.  However your two programs must be anagrams, meaning each can be rearranged from the other's letters.

Programs must output the decimal of the number followed by optional whitespace to STDOUT.  Programs may output to STDERR however it should be ignored and if the hidden case does so it must be clearly stated that this is the case.

If you wish you may also output by character code.  However if you do so in your hidden solution you must state such in the body of your submission.

You will then present the OEIS number, the source code for and the name of one language it is in.

Robbers will crack your submission if they find an anagram of the original  submission that runs in a language other than the one you already presented.  To crack an answer they must only find any language and program which produces the sequence and is an anagram of the original, not necessarily the answer the you were thinking about.

Thus you are incentivized to make it as hard as possible to find any language that does the task using their list of symbols.

Scoring

This is code-golf so the shortest un-cracked program is the winner.

Languages

Languages will be considered different if the two proposed solutions do not complete the task in both languages.  This will include different versions of the same language as long as neither the cop's solution or the robber's solution produce the correct output in the other's language.

i.e. If the there are two solutions 1 and 2 that are in language A and B respectively solution 2 must not produce the correct output in language A and solution 1 must not produce the correct output in language B.

Safety

Once your submission has been uncracked for a week you may post your solution and declare your post safe.  If after a week you choose not to post a solution your answer may still be cracked.

Body:
<s>05AB1E, 9 bytes, A000042</s> Cracked!

1×,1*-^$)

This is the Unary representation of natural numbers (OEIS). So if the input was 3, for example, then output would be 111.

Explanation:

                    # implicit input
1                   # pushes 1 to the stack
 ×                  # pushes "1" × (the input)
  ,                 # outputs the stack
   1*-^$)           # irrelevant

Try it online!

Original Solution, Carrot

1^*$-1×^)

Explanation

1^             Push "1" to the stack
  *            Multiply the string by
   $-1         ...the input (as an integer) minus 1 times
      ×,)      Ignored by the interpreter

The * multiplies the string by (n+1) times, so that a^*3 results in aaaa and not aaa. So that is why I subtracted 1 from the input.

Only now I realise that the ) has been irrelevant in both the languages :D

Try it online!


问:
Koch Snowflake - codegolf
The Koch snowflake (also known as the Koch star and Koch island) is a mathematical curve and one of the earliest fractal curves to have been described. It is based on the Koch curve, which appeared in a 1904 paper titled "On a continuous curve without tangents, constructible from elementary geometry" (original French title: "Sur une courbe continue sans tangente, obtenue par une construction géométrique élémentaire") by the Swedish mathematician Helge von Koch.

Here are some ascii representations of various iterations:

```<code>n=1
__
\/

n=2
__/\__
\    /
/_  _\
  \/

n=3
      __/\__
      \    /
__/\__/    \__/\__
\                /
/_              _\
  \            /
__/            \__
\                /
/_  __      __  _\
  \/  \    /  \/
      /_  _\
        \/
</code>```

Since there is obviously a limit to the resolution of the ascii representation, we must enlarge the size of the snowflake by a factor of 3 for each iteration to show the extra detail.

Write the shortest code to output the snowflake in the same style for n=4

Your program should not take any input.

Your program should write the snowflake to the console.

答:
MS-DOS 16 bit machine code: 199 bytes

Decode using this site, save as 'koch.com' file and execute from WinXP command prompt.

```<code>sCAAxo7ajsKLz/OquF9fulwvvUoBM9u+BADoiQDodgDocwDogADobQDoagDodwCK8TLSs0+I98cHDQrGRwIktAnNIf7GOO5+7MNWAVwBYwFsAXoBgwGJB4DDAsOIN/7D6QQA/suIF/7P6R0A/suAPyB1AogH/suIB8OBw/8AiDfpBgD+x4gX/sM4734Ciu84z30Cis/Dg8UIg8UCgf1WAXLzg+0Mw07/dgB0GV/o9v/o5v/o8P/o3f/o2v/o5//o1//o4f9Gww==
</code>```

Update

Here's an easy-to-read assembler version:

```<code>  ; L-System Description
  ;
  ; Alphabet : F
  ; Constants : +, -
  ; Axiom : F++F++F
  ; Production rules: F -> F-F++F-F
  ;
  ; Register usage:
  ;                             _        _
  ; bp = direction: 0 = ->, 1 = /|, 2 = |\, 3 = <-, 4 = |/_, 5 = _\|
  ; cl = min y, ch = max y
  ; bl = x (unsigned)
  ; bh = y (signed)
  ; si = max level

  ; clear data
  mov al,20h
  add dh,al
  mov ds,dx
  mov es,dx
  mov cx,di
  rep stosb
  mov ax,'__'
  mov dx,'/\'

  ; initialise variables
  mov bp,Direction0
  xor bx,bx
  mov si,4

  call MoveForward
  call TurnRight
  call TurnRight
  call MoveForward
  call TurnRight
  call TurnRight
  call MoveForward

  mov dh,cl
  xor dl,dl
  mov bl,79
OutputLoop:
  mov bh,dh
  mov w [bx],0a0dh
  mov b [bx+2],24h
  mov ah,9
  int 21h
  inc dh
  cmp dh,ch
  jle OutputLoop
  ret

Direction0:
  dw MoveRight
  dw MoveUpRight
  dw MoveUpLeft
  dw MoveLeft
  dw MoveDownLeft
  dw MoveDownRight
Direction6:

MoveRight:
  mov w [bx],ax
  add bl,2
  ret

MoveUpRight:
  mov b [bx],dh
  inc bl
  jmp DecBHCheckY

MoveUpLeft:
  dec bl
  mov b [bx],dl
DecBHCheckY:
  dec bh
  jmp CheckY

MoveLeft:
  dec bl
  cmp b [bx],20h
  jne MoveLeftAgain
  mov [bx],al
MoveLeftAgain:
  dec bl
  mov [bx],al
  ret

MoveDownLeft:
  add bx,255
  mov b [bx],dh
  jmp CheckY

MoveDownRight:
  inc bh
  mov b [bx],dl
  inc bl

CheckY:
  cmp bh,ch
  jle NoMaxChange
  mov ch,bh
NoMaxChange:
  cmp bh,cl
  jge NoMinChange
  mov cl,bh
NoMinChange:
  ret

TurnRight:
  add bp,8

TurnLeft:
  add bp,2

  cmp bp,Direction6
  jb ret
  sub bp,12
  ret

MoveForward:
  dec si
  push [bp]
  jz DontRecurse
  pop di
  call MoveForward
  call TurnLeft
  call MoveForward
  call TurnRight
  call TurnRight
  call MoveForward
  call TurnLeft
  call MoveForward
DontRecurse:
  inc si
  ret
</code>```

ContentLicense: CC BY-SA 2.5

Title: Koch Snowflake - codegolf

Body:
MS-DOS 16 bit machine code: 199 bytes

Decode using this site, save as 'koch.com' file and execute from WinXP command prompt.

sCAAxo7ajsKLz/OquF9fulwvvUoBM9u+BADoiQDodgDocwDogADobQDoagDodwCK8TLSs0+I98cHDQrGRwIktAnNIf7GOO5+7MNWAVwBYwFsAXoBgwGJB4DDAsOIN/7D6QQA/suIF/7P6R0A/suAPyB1AogH/suIB8OBw/8AiDfpBgD+x4gX/sM4734Ciu84z30Cis/Dg8UIg8UCgf1WAXLzg+0Mw07/dgB0GV/o9v/o5v/o8P/o3f/o2v/o5//o1//o4f9Gww==

Update

Here's an easy-to-read assembler version:

  ; L-System Description
  ;
  ; Alphabet : F
  ; Constants : +, -
  ; Axiom : F++F++F
  ; Production rules: F -> F-F++F-F
  ;
  ; Register usage:
  ;                             _        _
  ; bp = direction: 0 = ->, 1 = /|, 2 = |\, 3 = <-, 4 = |/_, 5 = _\|
  ; cl = min y, ch = max y
  ; bl = x (unsigned)
  ; bh = y (signed)
  ; si = max level

  ; clear data
  mov al,20h
  add dh,al
  mov ds,dx
  mov es,dx
  mov cx,di
  rep stosb
  mov ax,'__'
  mov dx,'/\'

  ; initialise variables
  mov bp,Direction0
  xor bx,bx
  mov si,4

  call MoveForward
  call TurnRight
  call TurnRight
  call MoveForward
  call TurnRight
  call TurnRight
  call MoveForward

  mov dh,cl
  xor dl,dl
  mov bl,79
OutputLoop:
  mov bh,dh
  mov w [bx],0a0dh
  mov b [bx+2],24h
  mov ah,9
  int 21h
  inc dh
  cmp dh,ch
  jle OutputLoop
  ret

Direction0:
  dw MoveRight
  dw MoveUpRight
  dw MoveUpLeft
  dw MoveLeft
  dw MoveDownLeft
  dw MoveDownRight
Direction6:

MoveRight:
  mov w [bx],ax
  add bl,2
  ret

MoveUpRight:
  mov b [bx],dh
  inc bl
  jmp DecBHCheckY

MoveUpLeft:
  dec bl
  mov b [bx],dl
DecBHCheckY:
  dec bh
  jmp CheckY

MoveLeft:
  dec bl
  cmp b [bx],20h
  jne MoveLeftAgain
  mov [bx],al
MoveLeftAgain:
  dec bl
  mov [bx],al
  ret

MoveDownLeft:
  add bx,255
  mov b [bx],dh
  jmp CheckY

MoveDownRight:
  inc bh
  mov b [bx],dl
  inc bl

CheckY:
  cmp bh,ch
  jle NoMaxChange
  mov ch,bh
NoMaxChange:
  cmp bh,cl
  jge NoMinChange
  mov cl,bh
NoMinChange:
  ret

TurnRight:
  add bp,8

TurnLeft:
  add bp,2

  cmp bp,Direction6
  jb ret
  sub bp,12
  ret

MoveForward:
  dec si
  push [bp]
  jz DontRecurse
  pop di
  call MoveForward
  call TurnLeft
  call MoveForward
  call TurnRight
  call TurnRight
  call MoveForward
  call TurnLeft
  call MoveForward
DontRecurse:
  inc si
  ret


答:
DASH, 16 bytes

```<code>rstr[R"\d+""g"+1
</code>```

This returns a function/partial application.

Usage:

```<code>rstr[R"\d+""g"+1]"test 123 234t"
</code>```

Explanation

```<code>rstr[          #. replace any parts of the input
  R "\d+" "g"  #. matching /\d+/g
  +1           #. with its incremented form
]
</code>```

Title: Increment every number in a string

Body:
Given a string containing decimal numbers:

teststring134this 123test string54 100

increment every number in this string by one to give the new string

teststring135this 124test string55 101.

The string can be provided as:

a command line argument

STDIN

a hard-coded variable or function argument

Cover all possible positions for a number:

as a prefix for a word; 123test ► 124test

as a suffix for a word; test123 ► test124

inside a word; te123st ► te124st

alone test 123 test ► test 124 test

Here's a non-golfed solution in Python:

```<code>NUMBERS = '0123456789'

def increment(s):
    out = ''

    number = ''
    for c in s:
        if c in NUMBERS:
            number += c
        else:
            if number != '':
                out += str(int(number) + 1)
                number = ''
            out += c

    if number != '':
        out += str(int(number) + 1)
        number = ''

    return out

print "\"%s\"" % (increment('teststring134this 123test string54 100'))
</code>```

This is a code-golf question, shortest code wins.

Body:
DASH, 16 bytes

rstr[R"\d+""g"+1

This returns a function/partial application.

Usage:

rstr[R"\d+""g"+1]"test 123 234t"

Explanation

rstr[          #. replace any parts of the input
  R "\d+" "g"  #. matching /\d+/g
  +1           #. with its incremented form
]


答:
Gema, 14 characters

```<code><D>=@add{$1;1}
</code>```

Sample run:

```<code>bash-4.3$ gema '<D>=@add{$1;1}' <<< 'teststring134this 123test string54 100'
teststring135this 124test string55 101
</code>```

Title: Increment every number in a string

Body:
Gema, 14 characters

<D>=@add{$1;1}

Sample run:

bash-4.3$ gema '<D>=@add{$1;1}' <<< 'teststring134this 123test string54 100'
teststring135this 124test string55 101


Title: Polyglot Anagrams Cops' Thread

Body:
Fuzzy Octo Guacamole, 26 bytes, A070627 [Safe]

49++*5^pm#]%:"?:.=:#,|"1:@

Test cases:

1 -> 1
3 -> 23
5 -> 1

Solution:

^::::|*?1=#@]","%.#49++5pm

Works in Magistack.


问:
It's my Birthday :D

Introduction

Last year was my birthday (really!) and sadly I had to organise my own party. Well, now you know, couldn't you at least make the cake?

Challenge

Given an integer n as input, write a full program to output a birthday cake with n candles on.

Output

A piece of cake with one candle on is:

```<code> $
 |
---
~~~
---
</code>```

And a piece of cake with three candles on is:

```<code> $ $ $
 | | |
-------
~~~~~~~
-------
</code>```

I'm sure you can work it out from that

However, for input 0, you must output the following:

```<code>Congratulations on your new baby! :D
</code>```

For input less than 0, you should output a candleless cake:

```<code>---
~~~
---
</code>```

Nothing is allowed to be output to STDERR.

Trailing newlines and spaces are allowed.

Winning

Shortest code in bytes wins.

Leaderboard

var QUESTION_ID=57277;OVERRIDE_USER=30525;function answersUrl(e){return"http://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"http://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

```

答:
JavaScript (ES6), 128 bytes

n=>n?[...n<0?(n=1,'  -~-'):'$|-~-'].map((c,i)=>(i<2?' '+c:c).repeat(i<2?n:n*2+1)).join`
`:'Congratulations on your new baby! :D'
```

<h3>Demo</h3>

<p><div class="snippet" data-lang="js" data-hide="true" data-console="true" data-babel="false">
<div class="snippet-code snippet-currently-hidden">
<pre class="snippet-code-js lang-js prettyprint-override"><code>let f =

n=>n?[...n<0?(n=1,'  -~-'):'$|-~-'].map((c,i)=>(i<2?' '+c:c).repeat(i<2?n:n*2+1)).join`
`:'Congratulations on your new baby! :D'

console.log(f(-1));
console.log(f(0));
console.log(f(1));
console.log(f(2));</code>```

OwnerDisplayName: anon

LastEditorDisplayName: anon

Title: It's my Birthday :D

Body:
JavaScript (ES6), 128 bytes

n=>n?[...n<0?(n=1,'  -~-'):'$|-~-'].map((c,i)=>(i<2?' '+c:c).repeat(i<2?n:n*2+1)).join`
`:'Congratulations on your new baby! :D'

Demo

let f =

n=>n?[...n<0?(n=1,'  -~-'):'$|-~-'].map((c,i)=>(i<2?' '+c:c).repeat(i<2?n:n*2+1)).join`
`:'Congratulations on your new baby! :D'

console.log(f(-1));
console.log(f(0));
console.log(f(1));
console.log(f(2));


问:
Find the "unwrapped size" of a list
Let's define the "unwrapped size" function u of a nested list l (containing only lists) by the following rules:

If l is empty, then u(l) is 1.

If l is non-empty, u(l) is equal to the sum of the unwrapped sizes of every element in l, plus one.

Your task is to write a program (or function) that takes a list as input and outputs (or returns) the unwrapped size of the list.

Test Cases:

```<code>[]                                           ->  1
[[[]],[]]                                    ->  4
[[[]],[[[[]],[]]],[[[]],[[[[]],[[],[[]]]]]]] -> 19
[[[[]]]]                                     ->  4
</code>```

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

答:
Python <s>3</s> 2, <s>36</s> 23 bytes

```<code>lambda x:`x`.count("[")
</code>```

I noticed that u(l) is equal to the number of [ in the string representation of l, so this program tries to do that. It could probably be golfed further by finding another way to do this, though...

Title: Find the "unwrapped size" of a list

Body:
Python <s>3</s> 2, <s>36</s> 23 bytes

lambda x:`x`.count("[")

I noticed that u(l) is equal to the number of [ in the string representation of l, so this program tries to do that. It could probably be golfed further by finding another way to do this, though...


答:
Perl, <s>9</s> <s>8</s> 7 + 1 = 8 bytes

Requires the -p flag

```<code>$_=y;[;
</code>```

Thanks to @Dada for two byte saves (I'm loving this semicolon exploit btw)

Title: Find the "unwrapped size" of a list

Body:
Let's define the "unwrapped size" function u of a nested list l (containing only lists) by the following rules:

If l is empty, then u(l) is 1.

If l is non-empty, u(l) is equal to the sum of the unwrapped sizes of every element in l, plus one.

Your task is to write a program (or function) that takes a list as input and outputs (or returns) the unwrapped size of the list.

Test Cases:

```<code>[]                                           ->  1
[[[]],[]]                                    ->  4
[[[]],[[[[]],[]]],[[[]],[[[[]],[[],[[]]]]]]] -> 19
[[[[]]]]                                     ->  4
</code>```

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

Body:
Perl, <s>9</s> <s>8</s> 7 + 1 = 8 bytes

Requires the -p flag

$_=y;[;

Thanks to @Dada for two byte saves (I'm loving this semicolon exploit btw)


答:
Retina, 1 byte

```<code>]
</code>```

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

By default, Retina counts the number of matches of the given regex in the input. The unwrapped size is simply equal to the number of [] pairs in the input and therefore to the number of ].

Title: Find the "unwrapped size" of a list

Body:
Retina, 1 byte

]

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

By default, Retina counts the number of matches of the given regex in the input. The unwrapped size is simply equal to the number of [] pairs in the input and therefore to the number of ].


答:
05AB1E, 4 bytes

```<code>I'[¢

I    Get input as a string
 '[¢ Count the opening square brackets and implicitly print them
</code>```

Try it online!

I think it can be golfed more but that 'I' is mandatory, otherwise the input is considered an actual array instead of a string

Title: Find the "unwrapped size" of a list

Body:
05AB1E, 4 bytes

I'[¢

I    Get input as a string
 '[¢ Count the opening square brackets and implicitly print them

Try it online!

I think it can be golfed more but that 'I' is mandatory, otherwise the input is considered an actual array instead of a string


问:
Code Golf Christmas Edition: How to print out a Christmas tree of height N
Given a number N, how can I print out a Christmas tree of height N using the least number of code characters?  N is assumed constrained to a minimum value of 3, and a maximum value of 30 (bounds and error checking are not necessary). N is given as the one and only command line argument to your program or script.

All languages appreciated, if you see a language already implemented and you can make it shorter, edit if possible - comment otherwise and hope someone cleans up the mess.  Include newlines and White Spaces for clarity, but don't include them in the character count.

A Christmas tree is generated as such, with its "trunk" consisting of only a centered "*"

N = 3:

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

N = 4:

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

N = 5:

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

N defines the height of the branches not including the one line trunk.

Merry Christmas PPCG!

答:
JavaScript (ES6), 58 bytes

f=(n,s=`*
`,l)=>n?(k=' '.repeat(--n)+s)+f(n,'**'+s,l||k):l
```

<h3>Demo</h3>

<p><div class="snippet" data-lang="js" data-hide="true" data-console="true" data-babel="false">
<div class="snippet-code snippet-currently-hidden">
<pre class="snippet-code-js lang-js prettyprint-override"><code>f=(n,s=`*
`,l)=>n?(k=' '.repeat(--n)+s)+f(n,'**'+s,l||k):l

console.log(f(7))</code>```

OwnerDisplayName: TheSoftwareJedi

Body:
JavaScript (ES6), 58 bytes

f=(n,s=`*
`,l)=>n?(k=' '.repeat(--n)+s)+f(n,'**'+s,l||k):l

Demo

f=(n,s=`*
`,l)=>n?(k=' '.repeat(--n)+s)+f(n,'**'+s,l||k):l

console.log(f(7))


答:
Mathematica, 9 bytes

```<code>LeafCount
</code>```

Turns out there's a built-in for that...

Note that this wouldn't work if the lists actually contained non-list elements. What LeafCount really does is count the number of atomic subexpressions. For input {{}, {{}}}, the expression actually reads:

```<code>List[List[], List[List[]]]
</code>```

Here the atomic subexpressions are actually the heads List.

Title: Find the "unwrapped size" of a list

Body:
Mathematica, 9 bytes

LeafCount

Turns out there's a built-in for that...

Note that this wouldn't work if the lists actually contained non-list elements. What LeafCount really does is count the number of atomic subexpressions. For input {{}, {{}}}, the expression actually reads:

List[List[], List[List[]]]

Here the atomic subexpressions are actually the heads List.


答:
JavaScript (ES6), <s>29</s> 27 bytes

```<code>f=([x,...a])=>x?f(x)+f(a):1
</code>```

i love it when a recursion turns out this cleanly. This is basically a depth-first search of the input, adding 1 whenever the end of an array is reached.

If an empty array were falsy in JS, this could be 24 bytes:

```<code>f=a=>a?f(a.pop())+f(a):1
</code>```

But alas, it's not. Other attempts:

```<code>f=a=>a.reduce((n,x)=>n+f(x),1) // Works, but 3 bytes longer
f=a=>a.map(x=>n+=f(x),n=1)&&n  // Works, but 2 bytes longer
f=a=>(x=a.pop())?f(x)+f(a):1   // Works, but 1 byte longer
f=a=>a[0]?f(a.pop())+f(a):1    // Works, but same byte count
f=a=>a+a?f(a.pop())+f(a):1     // Doesn't work on any array containing 1 sub-array
f=a=>a-1?f(a.pop())+f(a):1     // Same
</code>```

Title: Find the "unwrapped size" of a list

Body:
JavaScript (ES6), <s>29</s> 27 bytes

f=([x,...a])=>x?f(x)+f(a):1

i love it when a recursion turns out this cleanly. This is basically a depth-first search of the input, adding 1 whenever the end of an array is reached.

If an empty array were falsy in JS, this could be 24 bytes:

f=a=>a?f(a.pop())+f(a):1

But alas, it's not. Other attempts:

f=a=>a.reduce((n,x)=>n+f(x),1) // Works, but 3 bytes longer
f=a=>a.map(x=>n+=f(x),n=1)&&n  // Works, but 2 bytes longer
f=a=>(x=a.pop())?f(x)+f(a):1   // Works, but 1 byte longer
f=a=>a[0]?f(a.pop())+f(a):1    // Works, but same byte count
f=a=>a+a?f(a.pop())+f(a):1     // Doesn't work on any array containing 1 sub-array
f=a=>a-1?f(a.pop())+f(a):1     // Same


答:
Python, 26 bytes

```<code>f=lambda a:sum(map(f,a))+1
</code>```

Simple recursive formula.

Title: Find the "unwrapped size" of a list

Body:
Python, 26 bytes

f=lambda a:sum(map(f,a))+1

Simple recursive formula.


答:
///, 13 bytes

```<code>/[/0//]///,//
</code>```

Output in unary.

Try it online!

Explanation:

```<code>/[/0/          Replace every [ with 0
     /]///,//  Remove every ] and ,
</code>```

Title: Find the "unwrapped size" of a list

Body:
///, 13 bytes

/[/0//]///,//

Output in unary.

Try it online!

Explanation:

/[/0/          Replace every [ with 0
     /]///,//  Remove every ] and ,


答:
PHP, 35 bytes

```<code><?=preg_match_all('/\[/',$argv[1]);
</code>```

preg_match_all finds all of the matching instances of the regular expression and returns a number, which is why the short echo tags are needed.

Like most answers, it counts the number of [ in the input and outputs that number

Title: Find the "unwrapped size" of a list

Body:
PHP, 35 bytes

<?=preg_match_all('/\[/',$argv[1]);

preg_match_all finds all of the matching instances of the regular expression and returns a number, which is why the short echo tags are needed.

Like most answers, it counts the number of [ in the input and outputs that number


答:
Python 2, 124 bytes, A144945, [Safe]

Cracking this would have earned you a 500 rep bounty! Too late!

Number of ways to place 2 queens on an n X n chessboard so that they attack each other.

I hope it's not too easy. I arranged my code so the whitespace is clearly visible. Those are spaces and newlines only.

Note: intended solution outputs via character code

n=input();print((3+2)*n*n+~0*6*n+1)*n/3;            +6;

+7+7+7+7+7+7+7+7+7;+++++++++++++++9+9*9*9
```
<p><strong>Try it online</strong></p>
<h3>Intended Solution, Headsecks:</h3>
```r2=ni***p**
(

p((0 ;3+++3;+;/

)

i+++nn
 +)7
n

n+++

17+~
 +)7;97++++7

69+9n+ ++7+n 69
 +7+ ++7

**7+++tut
```
<p>This is equivalent to the following BF program:</p>
```>>,[->>>+>>>+>>>+++++<<<<<<<<<]>>>->>>>>>-<<<[[>+<-]>[>>[<<<+>>+>-]<[>+<-]<-]<<<<]>>+++>[-<-[<+<<]<[+[->+<]<+<<]>>>>>]<<<.,.
```

Title: Polyglot Anagrams Cops' Thread

Body:
This challenge has two threads.  This is the cops' thread. The robbers' thread is located here.

Your challenge is to choose an OEIS sequence and write two full programs in two different languages that produces that nth item in the sequence when given an n via STDIN, or an other forms of standard input, where n is any positive number.  However your two programs must be anagrams, meaning each can be rearranged from the other's letters.

Programs must output the decimal of the number followed by optional whitespace to STDOUT.  Programs may output to STDERR however it should be ignored and if the hidden case does so it must be clearly stated that this is the case.

If you wish you may also output by character code.  However if you do so in your hidden solution you must state such in the body of your submission.

You will then present the OEIS number, the source code for and the name of one language it is in.

Robbers will crack your submission if they find an anagram of the original  submission that runs in a language other than the one you already presented.  To crack an answer they must only find any language and program which produces the sequence and is an anagram of the original, not necessarily the answer the you were thinking about.

Thus you are incentivized to make it as hard as possible to find any language that does the task using their list of symbols.

Scoring

This is code-golf so the shortest un-cracked program is the winner.

Languages

Languages will be considered different if the two proposed solutions do not complete the task in both languages.  This will include different versions of the same language as long as neither the cop's solution or the robber's solution produce the correct output in the other's language.

i.e. If the there are two solutions 1 and 2 that are in language A and B respectively solution 2 must not produce the correct output in language A and solution 1 must not produce the correct output in language B.

Safety

Once your submission has been uncracked for a week you may post your solution and declare your post safe.  If after a week you choose not to post a solution your answer may still be cracked.

Body:
Python 2, 124 bytes, A144945, [Safe]

Cracking this would have earned you a 500 rep bounty! Too late!

Number of ways to place 2 queens on an n X n chessboard so that they attack each other.

I hope it's not too easy. I arranged my code so the whitespace is clearly visible. Those are spaces and newlines only.

Note: intended solution outputs via character code

n=input();print((3+2)*n*n+~0*6*n+1)*n/3;            +6;

+7+7+7+7+7+7+7+7+7;+++++++++++++++9+9*9*9

Try it online

Intended Solution, Headsecks:

r2=ni***p**
(

p((0 ;3+++3;+;/

)

i+++nn
 +)7
n

n+++

17+~
 +)7;97++++7

69+9n+ ++7+n 69
 +7+ ++7

**7+++tut

This is equivalent to the following BF program:

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


答:
CJam, <s>7</s> 5 bytes

Thanks to Peter Taylor for removing 2 bytes! (e= instead of f=:+)

```<code>r'[e=
</code>```

Try it online!

```<code>r         e# Read input
 '[       e# Push open bracket char
   e=     e# Count occurrences. Implicit display
</code>```

Title: Find the "unwrapped size" of a list

Body:
CJam, <s>7</s> 5 bytes

Thanks to Peter Taylor for removing 2 bytes! (e= instead of f=:+)

r'[e=

Try it online!

r         e# Read input
 '[       e# Push open bracket char
   e=     e# Count occurrences. Implicit display


答:
Groovy, 38 bytes

```<code>{it.replaceAll(/\d+/,{(it as int)+1})}
</code>```

Uggghhh... I absolutely hate the words replace and all, they ruin all regex golfs for me.

Title: Increment every number in a string

Body:
Given a string containing decimal numbers:

teststring134this 123test string54 100

increment every number in this string by one to give the new string

teststring135this 124test string55 101.

The string can be provided as:

a command line argument

STDIN

a hard-coded variable or function argument

Cover all possible positions for a number:

as a prefix for a word; 123test ► 124test

as a suffix for a word; test123 ► test124

inside a word; te123st ► te124st

alone test 123 test ► test 124 test

Here's a non-golfed solution in Python:

```<code>NUMBERS = '0123456789'

def increment(s):
    out = ''

    number = ''
    for c in s:
        if c in NUMBERS:
            number += c
        else:
            if number != '':
                out += str(int(number) + 1)
                number = ''
            out += c

    if number != '':
        out += str(int(number) + 1)
        number = ''

    return out

print "\"%s\"" % (increment('teststring134this 123test string54 100'))
</code>```

This is a code-golf question, shortest code wins.

Body:
Groovy, 38 bytes

{it.replaceAll(/\d+/,{(it as int)+1})}

Uggghhh... I absolutely hate the words replace and all, they ruin all regex golfs for me.


答:
Ruby, 13 (+1) bytes

```<code>p $_.count ?[
</code>```

Called with -n argument:

```<code>ruby -ne 'p $_.count ?['
</code>```

EDIT: Changed to actually print out the answer

Title: Find the "unwrapped size" of a list

Body:
Ruby, 13 (+1) bytes

p $_.count ?[

Called with -n argument:

ruby -ne 'p $_.count ?['

EDIT: Changed to actually print out the answer


问:
Convert to camelCase

The Challenge

I was reading Google's Java Style Guide the other day and stumbled over their algorithm to convert any arbitrary string into camelCase notation. In this challenge you have to implement this algorithm since you don't want to do all this stuff in your head when you are writing your super competitive Java submissions to code-golf challenges.

Note: I made some small adjustments to the algorithm. You need to use the one specified below.

The algorithm

You start with an arbitrary input string and apply the following operations to it:

Remove all apostrophes `'

Split the result into words by splitting at

characters that are not alphanumerical and not a digit [^a-zA-Z0-9]

Uppercase letters which are surrounded by lowercase letters on both sides. abcDefGhI jk for example yields abc Def Ghi jk

Lowercase every word.

Uppercase the first character of every but the first word.

Join all words back together.

Additional notes

The input will only contain printable ASCII.

If a digit is the first letter in a word, leave it as it is and don't capitalize something else in this word.

The input will always have at least one character.

Rules

Function or full program allowed.

Default rules for input/output.

Standard loopholes apply.

This is code-golf, so lowest byte-count wins. Tiebreaker is earlier submission.

Test cases

```
"Programming Puzzles & Code Golf" -> "programmingPuzzlesCodeGolf"
"XML HTTP request" -> "xmlHttpRequest"
"supports IPv6 on iOS?" -> "supportsIpv6OnIos"
"SomeThing w1th, apo'strophe's and' punc]tuation" -> "someThingW1thApostrophesAndPuncTuation"
"nothing special" -> "nothingSpecial"
"5pecial ca5e" -> "5pecialCa5e"
"1337" -> "1337"
"1337-spEAk" -> "1337Speak"
"whatA mess" -> "whataMess"
"abcD" -> "abcd"
"a" -> "a"
"B" -> "b"
```

Happy Coding!

答:
PHP, <s>145</s> <s>122</s> 133 bytes

```<code><?=join(split(" ",lcfirst(ucwords(strtolower(preg_replace(["#`|'#","#\W|_#","#([a-z])([A-Z][a-z])#"],[""," ","$1 $2"],$argv[1]))))));
</code>```

Save to file, call from CLI.

Takes input from a single command line argument; escape quotes and whitespace where necessary.

breakdown

```<code><?=                 // 9. print result
join(split(" ",     // 8. remove spaces
    lcfirst(        // 7. lowercase first character
    ucwords(        // 6. uppercase first character in every word
    strtolower(     // 5. lowercase everything
    preg_replace(
        ["#`|'#",   "#\W|_#",   "#([a-z])([A-Z][a-z])#"],
        ["",        " ",        "$1 $2"],
        // 2. replace apostrophes with empty string (remove them)
                    // 3. replace non-word characters with space
                                // 4. insert space before solitude uppercase
        $argv[1]    // 1. take input from command line
    ))))
));
</code>```

lcfirst allowed to reduce this to a single command, saving 23 bytes.

Fixing the apostrophes cost 11 bytes for the additional replace case.

Title: Convert to camelCase

Body:
PHP, <s>145</s> <s>122</s> 133 bytes

<?=join(split(" ",lcfirst(ucwords(strtolower(preg_replace(["#`|'#","#\W|_#","#([a-z])([A-Z][a-z])#"],[""," ","$1 $2"],$argv[1]))))));

Save to file, call from CLI.

Takes input from a single command line argument; escape quotes and whitespace where necessary.

breakdown

<?=                 // 9. print result
join(split(" ",     // 8. remove spaces
    lcfirst(        // 7. lowercase first character
    ucwords(        // 6. uppercase first character in every word
    strtolower(     // 5. lowercase everything
    preg_replace(
        ["#`|'#",   "#\W|_#",   "#([a-z])([A-Z][a-z])#"],
        ["",        " ",        "$1 $2"],
        // 2. replace apostrophes with empty string (remove them)
                    // 3. replace non-word characters with space
                                // 4. insert space before solitude uppercase
        $argv[1]    // 1. take input from command line
    ))))
));

lcfirst allowed to reduce this to a single command, saving 23 bytes.

Fixing the apostrophes cost 11 bytes for the additional replace case.


答:
Brainfuck, <s>71</s> <s>61</s> 59 bytes

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

Takes input from STDIN in the format given in the question, and outputs the character whose ASCII code is the list's "unwrapped size."

I'm still a complete amateur at Brainfuck, so there are most likely many optimizations that can still be made.

Try it online!

Ungolfed:

```<code>read input to tape
>>+[>,]<
current tape: (0 0 1 a b *c)
where abc represents input and * is IP

now we loop over each character (from the end)
this loops assumes we are starting on the (current) last char
and it zeroes the entire string by the time it finishes
[

  subtract 91 from this character
  technically we only subtract 85 here and correct the answer
  with the 6 minus signs below
  >-[<->---]
  current tape: (0 0 1 a b cminus91 *0)

  invert the result and put that in the next cell
  +<------[->[-]<]>
  current tape: (0 0 1 a b 0 *c==91)

  move that result back to the original cell
  [-<+>]<
  current tape: (0 0 1 a b *c==91)

  if the result is true we found a brace
  increment the very first cell if so
  [-<[<]<+>>[>]]<
  current tape: (count 0 1 a *b)

]
current tape: (count *0)

<.
</code>```

Title: Find the "unwrapped size" of a list

Body:
Let's define the "unwrapped size" function u of a nested list l (containing only lists) by the following rules:

If l is empty, then u(l) is 1.

If l is non-empty, u(l) is equal to the sum of the unwrapped sizes of every element in l, plus one.

Your task is to write a program (or function) that takes a list as input and outputs (or returns) the unwrapped size of the list.

Test Cases:

```<code>[]                                           ->  1
[[[]],[]]                                    ->  4
[[[]],[[[[]],[]]],[[[]],[[[[]],[[],[[]]]]]]] -> 19
[[[[]]]]                                     ->  4
</code>```

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

Body:
Brainfuck, <s>71</s> <s>61</s> 59 bytes

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

Takes input from STDIN in the format given in the question, and outputs the character whose ASCII code is the list's "unwrapped size."

I'm still a complete amateur at Brainfuck, so there are most likely many optimizations that can still be made.

Try it online!

Ungolfed:

read input to tape
>>+[>,]<
current tape: (0 0 1 a b *c)
where abc represents input and * is IP

now we loop over each character (from the end)
this loops assumes we are starting on the (current) last char
and it zeroes the entire string by the time it finishes
[

  subtract 91 from this character
  technically we only subtract 85 here and correct the answer
  with the 6 minus signs below
  >-[<->---]
  current tape: (0 0 1 a b cminus91 *0)

  invert the result and put that in the next cell
  +<------[->[-]<]>
  current tape: (0 0 1 a b 0 *c==91)

  move that result back to the original cell
  [-<+>]<
  current tape: (0 0 1 a b *c==91)

  if the result is true we found a brace
  increment the very first cell if so
  [-<[<]<+>>[>]]<
  current tape: (count 0 1 a *b)

]
current tape: (count *0)

<.


Title: Find the "unwrapped size" of a list

Body:
Racket 82 bytes

(define n 0)(let p((l l))(if(null? l)(set! n(+ 1 n))(begin(p(car l))(p(cdr l)))))n

Ungolfed:

(define (f l)
  (define n 0)
  (let loop ((l l))
    (if (null? l)
        (set! n (add1 n))
        (begin (loop (first l))
               (loop (rest l)))))
  n)

Testing:

(f '[])
(f '[[[]] []])
(f '[[[]] [[[[]] []]] [[[]] [[[[]] [[] [[]]]]]]])
(f '[[[[]]]])

Output:

1
4
19
4


Title: Find the "unwrapped size" of a list

Body:
C, <s>48</s> 46 Bytes

Saved two bytes thanks to kirbyfan64sos

i;f(char*v){for(i=0;*v;i+=*v++==91);return i;}

i;f(char*v){for(i=0;*v;*v++^91?0:i++);return i;}

Test code

main()
{
    printf("%d\n", f("[]"));
    printf("%d\n", f("[[[]] []]"));
    printf("%d\n", f("[[[]] [[[[]] []]] [[[]] [[[[]] [[] [[]]]]]]]"));
}

Test cases

a.exe
1
4
19


答:
Brain-Flak, <s>63</s>, 61 bytes

```<code>{({}[(((()()()){}){}()){({}[()])}{}]){{}(<>{}())(<>)}{}}<>
</code>```

Try it online!
58 bytes of code, and +3 for the -a flag enabling ASCII input.

Readable version/explanation:

```<code>#While non-empty:
{

    #subtract
    ({}[

    #91
    (((()()()){}){}()){({}[()])}{}

    ])

    #if non-zero
    {

        # Remove the difference
        {}

        #Increment the counter on the other stack
        (<>{}())

        #Push a zero onto the main stack
        (<>)
    }

    #pop the left-over zero
    {}

#endwhile
}

#Move back to the stack with the counter, implicitly display
<>
</code>```

Title: Find the "unwrapped size" of a list

Body:
Brain-Flak, <s>63</s>, 61 bytes

{({}[(((()()()){}){}()){({}[()])}{}]){{}(<>{}())(<>)}{}}<>

Try it online!
58 bytes of code, and +3 for the -a flag enabling ASCII input.

Readable version/explanation:

#While non-empty:
{

    #subtract
    ({}[

    #91
    (((()()()){}){}()){({}[()])}{}

    ])

    #if non-zero
    {

        # Remove the difference
        {}

        #Increment the counter on the other stack
        (<>{}())

        #Push a zero onto the main stack
        (<>)
    }

    #pop the left-over zero
    {}

#endwhile
}

#Move back to the stack with the counter, implicitly display
<>


答:
V, 10 bytes

```<code>ÓÛ
ÒC0@"
</code>```

Try it online!

This contains some unprintable characters, here is the readable version:

```<code>ÓÛ
Ò<C-a>C0<esc>@"
</code>```

<C-a> represents "ctrl-a" (ASCII 0x01) and <esc> represents the escape key (ASCII 0x1b).

```<code>ÓÛ              " Remove all '['s
                "
Ò<C-a>          " Replace what's left with '<C-a>' (the increment command)
      C         " Delete this line
       0<esc>   " And replace it with a '0'
             @" " Run what we just deleted as V code (A bunch of increment commands
</code>```

More fun, less golfy version:

```<code>o0kòf]m`jòd
</code>```

Try it online!

```<code>o0<esc>                     " Put a '0' on the line below us
       k                    " Move back up a line
        ò               ò   " Recursively:
         f]                 "   Move to a right-bracket
           m`               "   Add this location to our jumplist
             j              "   Move down a line
              <C-a>         "   Increment this number
                   <C-o>    "   Move to the previous location
                         d  " Delete the bracket line
                            " Implicitly display
</code>```

Title: Find the "unwrapped size" of a list

Body:
V, 10 bytes

ÓÛ
ÒC0@"

Try it online!

This contains some unprintable characters, here is the readable version:

ÓÛ
Ò<C-a>C0<esc>@"

<C-a> represents "ctrl-a" (ASCII 0x01) and <esc> represents the escape key (ASCII 0x1b).

ÓÛ              " Remove all '['s
                "
Ò<C-a>          " Replace what's left with '<C-a>' (the increment command)
      C         " Delete this line
       0<esc>   " And replace it with a '0'
             @" " Run what we just deleted as V code (A bunch of increment commands

More fun, less golfy version:

o0kòf]m`jòd

Try it online!

o0<esc>                     " Put a '0' on the line below us
       k                    " Move back up a line
        ò               ò   " Recursively:
         f]                 "   Move to a right-bracket
           m`               "   Add this location to our jumplist
             j              "   Move down a line
              <C-a>         "   Increment this number
                   <C-o>    "   Move to the previous location
                         d  " Delete the bracket line
                            " Implicitly display


问:
The meta-polyglot quine
In my time on PPCG, I've noticed that quine problems and polyglot problems are quite popular. Also, meta-solutions to problems, that is, scripts which generate a program which is the solution to a problem, tend to get a lot of positive feedback from the community. Therefore, I have created this challenge, which implements these three ideas.

Your task then, reader and code-golf enthusiast, is to create as short as possible a script which can run in two languages A and B to generate quines for A and B. When your program is run in language A, it should generate a program that is a quine in language B but not in language A and vice versa. The languages A and B can be different version of the same language, provided you keep in mind that the generated quines should only work in one of the versions.

Keep in mind that the standard loopholes should be considered closed and only proper quines are allowed.

Good luck, fewest characters wins!

答:
Python / Retina, <s>70</s> <s>65</s> <s>64</s> 66 bytes

I used the same strategy I used in my previous Python / Retina polyglot.

```<code>#
print"\nS`((.+))"*2+"\n\n"
#?
#_='_=%r;%_\n';_
#?;
#;print _%
#

</code>```

Try in Python | Try in Retina

# is a comment in Python, so it simply prints the Retina quine in Python. In Retina, the first stage (2 lines) does nothing, because no # will be found in the input. The next stage replaces nothing with the basis of the Python quine. The third stage replaces each semicolon with the #print _% piece. The last stage removes all #'s.

Quine in Retina:

```<code>
S`((.+))
S`((.+))

</code>```

Quine in Python:

_='_=%r;print _%%_\n';print _%_

```

The quines used may be seen in this challenge. The Retina quine is an error in Python, and the Python quine has no output in Retina.

Title: The meta-polyglot quine

Body:
Python / Retina, <s>70</s> <s>65</s> <s>64</s> 66 bytes

I used the same strategy I used in my previous Python / Retina polyglot.

#
print"\nS`((.+))"*2+"\n\n"
#?
#_='_=%r;%_\n';_
#?;
#;print _%
#

Try in Python | Try in Retina

# is a comment in Python, so it simply prints the Retina quine in Python. In Retina, the first stage (2 lines) does nothing, because no # will be found in the input. The next stage replaces nothing with the basis of the Python quine. The third stage replaces each semicolon with the #print _% piece. The last stage removes all #'s.

Quine in Retina:

S`((.+))
S`((.+))

Quine in Python:

_='_=%r;print _%%_\n';print _%_

The quines used may be seen in this challenge. The Retina quine is an error in Python, and the Python quine has no output in Retina.


答:
Dip, 9 bytes, Kritixi Lithos

Definitely not the intended answer.

```<code>1^,-$)×1*
</code>```

Explanation:

```<code>1$^,-)×   # Basically does nothing
       1* # Repeat "1" n times
</code>```

Title: Polyglot Anagrams Robbers' Thread

Body:
This is the robbers' thread of this challenge

The cops will choose an OEIS sequence and write two full programs in two different languages that produces that nth item in the sequence when given an n via STDIN.  The two programs must be anagrams of each other, meaning each can be rearranged from the other's letters.

They will present the OEIS number, the source code for and the name of one language it is in.

You must find an anagram of the original cop's submission that runs in a language other than the one used by the cop.  To crack an answer you must only find any language and program which produces the sequence and is an anagram of the original, not necessarily the answer the cop was thinking about.

You may output by character code or include STDERR in your solution, but only if the cop has indicated their hidden solution does so.  Decimal output to STDOUT is always a valid crack.

Thus cops are incentivized to make it as hard as possible to find any language that does the task using their list of symbols.

Scoring

The person with the most cracks will be the winner of this section.  Only the first crack for each solution will count towards one's score.

Leader Board

Big thanks to every one that took place in this challenge.

Here is the leader board as it stands

```<code>Place  User             Score
-----------------------------
1      Adnan            3
1      Kritixi Lithos   3
1      Emigna           3
1      milk             3
5      Steven H.        2
5      Wheat Wizard     2
5      jimmy23013       2
8      ETH Productions  1
8      Dennis           1
8      alleks           1
8      Martin Ender     1
8      Oliver           1
8      Conor O'Brien    1
</code>```

Body:
Dip, 9 bytes, Kritixi Lithos

Definitely not the intended answer.

1^,-$)×1*

Explanation:

1$^,-)×   # Basically does nothing
       1* # Repeat "1" n times


答:
Labyrinth, 8 bytes

```<code>&-
#,(/!
</code>```

Try it online!

Explanation

This counts the opening brackets via a bit of bitwise magic. If we consider the results of the character codes of the bitwise AND of [, , and ] with 2, we get:

```<code>[ , ]
2 0 0
</code>```

So if we just sum up the result of this operation for each character, we get twice the value we want.

As for the code itself, the 2x2 block at the beginning is a small loop. On the first iteration &- don't really do anything except that they put an explicit zero on top of the implicit ones at the bottom of the stack. This will be the running total (and it will actually be negative to save a byte later). Then the loop goes as follows:

```<code>,   Read character. At EOF this gives -1 which causes the instruction pointer to
    leave the loop. Otherwise, the loop continues.
#   Push the stack depth, 2.
&   Bitwise AND.
-   Subtract from running total.
</code>```

Once we leave the loop, the following linear bit is executed:

```<code>(   Decrement to turn the -1 into a -2.
/   Divide negative running total by -2 to get desired result.
!   Print.
</code>```

The IP then hits a dead and turns around. When it tries to executed / again, the program terminates due to the attempted division by zero.

Title: Find the "unwrapped size" of a list

Body:
Labyrinth, 8 bytes

&-
#,(/!

Try it online!

Explanation

This counts the opening brackets via a bit of bitwise magic. If we consider the results of the character codes of the bitwise AND of [, , and ] with 2, we get:

[ , ]
2 0 0

So if we just sum up the result of this operation for each character, we get twice the value we want.

As for the code itself, the 2x2 block at the beginning is a small loop. On the first iteration &- don't really do anything except that they put an explicit zero on top of the implicit ones at the bottom of the stack. This will be the running total (and it will actually be negative to save a byte later). Then the loop goes as follows:

,   Read character. At EOF this gives -1 which causes the instruction pointer to
    leave the loop. Otherwise, the loop continues.
#   Push the stack depth, 2.
&   Bitwise AND.
-   Subtract from running total.

Once we leave the loop, the following linear bit is executed:

(   Decrement to turn the -1 into a -2.
/   Divide negative running total by -2 to get desired result.
!   Print.

The IP then hits a dead and turns around. When it tries to executed / again, the program terminates due to the attempted division by zero.