答:
Jellyfish, <s>37</s> 33 bytes

Thanks to Zgarb for saving 4 bytes.

```<code>p
*%
# S
`
=E   S
`/
1+r#>>i
   3
</code>```

Try it online!

Like my Mathematica and Peter's CJam answers, this generates a set of candidate tuples and then selects only those that sum to 1. I'm not entirely happy with the layout yet, and I wonder whether I can save some bytes with hooks or forks, but I'll have to look into that later.

Title: My triangle needs more nodes

Body:
Jellyfish, <s>37</s> 33 bytes

Thanks to Zgarb for saving 4 bytes.

p
*%
# S
`
=E   S
`/
1+r#>>i
   3

Try it online!

Like my Mathematica and Peter's CJam answers, this generates a set of candidate tuples and then selects only those that sum to 1. I'm not entirely happy with the layout yet, and I wonder whether I can save some bytes with hooks or forks, but I'll have to look into that later.


问:
Text animation format Code Golf
Working with old files from DOS, I found an ancient text animation format, that specify how much time each frame must be shown in the screen. It's very simple:

F1W5F2W3

This example above indicates that Frame 1 must be shown for 5 units of time, and frame 2 for 3 units more. Now I want to convert it to:

1, 1, 1, 1, 1, 2, 2, 2

In the converted example below, frame 1 is repeated 5 times, and frame 2 three times.

Rules: The only allowed letters are F and W (and the lowercase counterparts, f and w). Numbers can go up to 255. Total input String with no more than 255 chars.

Other examples:

Input: F10W3F11W3F10W3F12W3

Output: 10, 10, 10, 11, 11, 11, 10, 10, 10, 12, 12, 12

Input: f1w0f2w10

Output: 2, 2, 2, 2, 2, 2, 2, 2, 2, 2

Short code wins.

Edited - Accepted formats:
Any answer containing the output and ignoring spaces. Ex: 1, 1, 2, 2 or [1,1,2,2] or (1,1,2,2). But NOT 1 1 2 2 or [1; 1; 2; 2] or [1 1 2 2].

答:
VBA, <s>162 bytes</s> 147 bytes

Okay, this is only for fun since it's kinda hard to beat esoteric programming languages but I don't care too much about winning the challenge. I do enjoy solving the challenge, though. Here is my stab for this challenge:

```<code>Function F(a):b=Split(Replace(a,"F","W"),"W"):For i=1To Ubound(b)/2:c="":For j=1To b(2*i):c=c & b(2*i-1) & ",":Next:d=d & c:Next:F=Left(d,Len(d)-1)
</code>```

Ungolfed the code:

```<code>Function F(a)

b = Split(Replace(a, "F", "W"), "W")

    For i = 1 To UBound(b) / 2
        c = ""
        For j = 1 To b(2 * i)
            c = c & b(2 * i - 1) & ","
        Next
        d = d & c
    Next

F = Left(d, Len(d) - 1)

End Function
</code>```

Explanation:

Substitute the letter F in the string input with W using VBA function Replace.

Split the string result with delimited letter W into a 1D array.

Looping through each element array where every odd element is replicated as many as its next element value (the nearest even element).

Concatenate each of looping output.

Truncate the output so that the trailing , is excluded.

Thanks Kevin Cruijssen for the advice.

ContentLicense: CC BY-SA 3.0

Title: Text animation format Code Golf

Body:
VBA, <s>162 bytes</s> 147 bytes

Okay, this is only for fun since it's kinda hard to beat esoteric programming languages but I don't care too much about winning the challenge. I do enjoy solving the challenge, though. Here is my stab for this challenge:

Function F(a):b=Split(Replace(a,"F","W"),"W"):For i=1To Ubound(b)/2:c="":For j=1To b(2*i):c=c & b(2*i-1) & ",":Next:d=d & c:Next:F=Left(d,Len(d)-1)

Ungolfed the code:

Function F(a)

b = Split(Replace(a, "F", "W"), "W")

    For i = 1 To UBound(b) / 2
        c = ""
        For j = 1 To b(2 * i)
            c = c & b(2 * i - 1) & ","
        Next
        d = d & c
    Next

F = Left(d, Len(d) - 1)

End Function

Explanation:

Substitute the letter F in the string input with W using VBA function Replace.

Split the string result with delimited letter W into a 1D array.

Looping through each element array where every odd element is replicated as many as its next element value (the nearest even element).

Concatenate each of looping output.

Truncate the output so that the trailing , is excluded.

Thanks Kevin Cruijssen for the advice.


问:
My triangle needs more nodes
Consider the standard equilateral triangle, with nodes labeled using barycentric coordinates:

We can turn this 3 node triangle into a 6 node triangle by adding a new line of 3 vertices (one more than was present on a side of the original 3 node triangle), remove any internal edges (but not internal nodes) and re-normalize the coordinates:

Repeating the process to go from a 6 node triangle to a 10 node triangle, add a line of 4 vertices (again, one more than was present on a side of the original 6 node triangle), remove any internal edges (but not internal nodes) and re-normalize the coordinates:

This process can be repeated indefinitely. The goal of this challenge is given an integer N representing how many times this process has been performed, output all the nodes for the associated triangle in barycentric coordinates.

Input

Your program/function should take as input a single non-negative integer N representing how many times this process has been applied. Note that for N=0, you should output the original triangle with 3 nodes.

The input may come from any source (function parameter, stdio, etc.).

Output

Your program/function should output all the nodes in normalized barycentric coordinates. The order of the nodes does not matter.
A number can be specified as a fraction (fraction reduction not required) or a floating point number. You may also output "scaled" vectors to specify a node. For example, all 3 of the following outputs are equivalent and allowed:

```<code>0.5,0.5,0

1/2,2/4,0

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

If using floating point output, your output should be accurate to within 1%. The output may be to any sink desired (stdio, return value, return parameter, etc.). Note that even though the barycentric coordinates are uniquely determined by only 2 numbers per node, you should output all 3 numbers per node.

Examples

Example cases are formatted as:

```<code>N
x0,y0,z0
x1,y1,z1
x2,y2,z2
...
</code>```

where the first line is the input N, and all following lines form a node x,y,z which should be in the output exactly once. All numbers are given as approximate floating point numbers.

```<code>0
1,0,0
0,1,0
0,0,1

1
1,0,0
0,1,0
0,0,1
0.5,0,0.5
0.5,0.5,0
0,0.5,0.5

2
1,0,0
0,1,0
0,0,1
0.667,0,0.333
0.667,0.333,0
0.333,0,0.667
0.333,0.333,0.333
0.333,0.667,0
0,0.333,0.667
0,0.667,0.333

3
1,0,0
0.75,0,0.25
0.75,0.25,0
0.5,0,0.5
0.5,0.25,0.25
0.5,0.5,0
0.25,0,0.75
0.25,0.25,0.5
0.25,0.5,0.25
0.25,0.75,0
0,0,1
0,0.25,0.75
0,0.5,0.5
0,0.75,0.25
0,1,0
</code>```

Scoring

This is code golf; shortest code in bytes wins. Standard loopholes apply. You may use any built-ins desired.

答:
Perl 6: <s>50</s> 40 bytes

```<code>{grep *.sum==1,[X] (0,1/($_+1)...1)xx 3}
</code>```

Returns a sequence of 3-element lists of (exact) rational numbers.

Explanation:

$_

Implicitly declared parameter of the lambda.

0, 1/($_ + 1) ... 1

Uses the sequence operator ... to construct the arithmetic sequence
that corresponds to the possible coordinate values.

[X] EXPR xx 3

Takes the Cartesian product of three copies of EXPR, i.e. generates all possible 3-tuples.

grep *.sum == 1, EXPR

Filter tuples with a sum of 1.

Title: My triangle needs more nodes

Body:
Perl 6: <s>50</s> 40 bytes

{grep *.sum==1,[X] (0,1/($_+1)...1)xx 3}

Returns a sequence of 3-element lists of (exact) rational numbers.

Explanation:

$_

Implicitly declared parameter of the lambda.

0, 1/($_ + 1) ... 1

Uses the sequence operator ... to construct the arithmetic sequence
that corresponds to the possible coordinate values.

[X] EXPR xx 3

Takes the Cartesian product of three copies of EXPR, i.e. generates all possible 3-tuples.

grep *.sum == 1, EXPR

Filter tuples with a sum of 1.


答:
Jelly, 18 (strict), 8 (relaxed) bytes

Strict input (any upper or lower) & strict output form of a flat list

```<code>Œl“wẋ”yṣ”fj“ð;ø”VḊ
</code>```

How?

```<code>Œl“wẋ”yṣ”fj“ð;ø”VḊ - takes an input, example: F11w7f13W5F17w3f19W2
Œl                 - to lower case            f11w7f13w5f17w3f19w2
  “wẋ”             - make string "wẋ"
      y            - map "w":"ẋ"              f11ẋ7f13ẋ5f17ẋ3f19ẋ2
        ”f         - make string "f"
       s           - split on "f"             [,11ẋ7,13ẋ5,17ẋ3,19ẋ2]
           “ð;ø”   - make string "ð;ø"
          j        - join with "ð;ø"s         ð;ø11ẋ7ð;ø13ẋ5ð;ø17ẋ3ð;ø19ẋ2
                V  - eval Jelly code...
each ẋ will repeat left right times, e.g. 17ẋ3 yields [17,17,17]
; will concatenate,
ð will treat the last chain as a dyadic link (the first will yield 0 as there is no link)
ø will treat the last chain as a niladic link
- so the example evaluates to:
[0, 11, 11, 11, 11, 11, 11, 11, 13, 13, 13, 13, 13, 17, 17, 17, 19, 19]
                 Ḋ - dequeue
[11, 11, 11, 11, 11, 11, 11, 13, 13, 13, 13, 13, 17, 17, 17, 19, 19]
</code>```

Test it at TryItOnline

Non-strict version: only lower input, returns smashed lists [a,a,...][b,b,..][...

```<code>“wẋfø”yv
</code>```

How?

```<code>“wẋfø”yv - takes an input, example: f11w7f13w5f17w3f19w2
“wẋfø”   - make the string "wẋfø"
      y  - map "w":"ẋ";"f":"ø"      ø11ẋ7ø13ẋ5ø17ẋ3ø19ẋ2
       v - eval Jelly code left with input right (empty)
           this is a hack as V should work (I think)
           but by forcing no input the leading ø evaluates to nothing
evaluation is as above, but simply yields the ẋ lists in turn
- so the example evaluates to:
[11, 11, 11, 11, 11, 11, 11][13, 13, 13, 13, 13][17, 17, 17][19, 19]
</code>```

Test it at TryItOnline

Title: Text animation format Code Golf

Body:
Working with old files from DOS, I found an ancient text animation format, that specify how much time each frame must be shown in the screen. It's very simple:

F1W5F2W3

This example above indicates that Frame 1 must be shown for 5 units of time, and frame 2 for 3 units more. Now I want to convert it to:

1, 1, 1, 1, 1, 2, 2, 2

In the converted example below, frame 1 is repeated 5 times, and frame 2 three times.

Rules: The only allowed letters are F and W (and the lowercase counterparts, f and w). Numbers can go up to 255. Total input String with no more than 255 chars.

Other examples:

Input: F10W3F11W3F10W3F12W3

Output: 10, 10, 10, 11, 11, 11, 10, 10, 10, 12, 12, 12

Input: f1w0f2w10

Output: 2, 2, 2, 2, 2, 2, 2, 2, 2, 2

Short code wins.

Edited - Accepted formats:
Any answer containing the output and ignoring spaces. Ex: 1, 1, 2, 2 or [1,1,2,2] or (1,1,2,2). But NOT 1 1 2 2 or [1; 1; 2; 2] or [1 1 2 2].

Body:
Jelly, 18 (strict), 8 (relaxed) bytes

Strict input (any upper or lower) & strict output form of a flat list

Œl“wẋ”yṣ”fj“ð;ø”VḊ

How?

Œl“wẋ”yṣ”fj“ð;ø”VḊ - takes an input, example: F11w7f13W5F17w3f19W2
Œl                 - to lower case            f11w7f13w5f17w3f19w2
  “wẋ”             - make string "wẋ"
      y            - map "w":"ẋ"              f11ẋ7f13ẋ5f17ẋ3f19ẋ2
        ”f         - make string "f"
       s           - split on "f"             [,11ẋ7,13ẋ5,17ẋ3,19ẋ2]
           “ð;ø”   - make string "ð;ø"
          j        - join with "ð;ø"s         ð;ø11ẋ7ð;ø13ẋ5ð;ø17ẋ3ð;ø19ẋ2
                V  - eval Jelly code...
each ẋ will repeat left right times, e.g. 17ẋ3 yields [17,17,17]
; will concatenate,
ð will treat the last chain as a dyadic link (the first will yield 0 as there is no link)
ø will treat the last chain as a niladic link
- so the example evaluates to:
[0, 11, 11, 11, 11, 11, 11, 11, 13, 13, 13, 13, 13, 17, 17, 17, 19, 19]
                 Ḋ - dequeue
[11, 11, 11, 11, 11, 11, 11, 13, 13, 13, 13, 13, 17, 17, 17, 19, 19]

Test it at TryItOnline

Non-strict version: only lower input, returns smashed lists [a,a,...][b,b,..][...

“wẋfø”yv

How?

“wẋfø”yv - takes an input, example: f11w7f13w5f17w3f19w2
“wẋfø”   - make the string "wẋfø"
      y  - map "w":"ẋ";"f":"ø"      ø11ẋ7ø13ẋ5ø17ẋ3ø19ẋ2
       v - eval Jelly code left with input right (empty)
           this is a hack as V should work (I think)
           but by forcing no input the leading ø evaluates to nothing
evaluation is as above, but simply yields the ẋ lists in turn
- so the example evaluates to:
[11, 11, 11, 11, 11, 11, 11][13, 13, 13, 13, 13][17, 17, 17][19, 19]

Test it at TryItOnline


问:
What base is this number in?
Here's a nice easy challenge:

Given a string that represents a number in an unknown base, determine the lowest possible base that number might be in. The string will only contain 0-9, a-z. If you like, you may choose to take uppercase letters instead of lowercase, but please specify this. You must output this lowest possible base in decimal.

Here is a more concrete example. If the input string was "01234", it is impossible for this number to be in binary, since 2, 3, and 4 are all undefined in binary. Similarly, this number cannot be in base 3, or base 4. Therefore, this number must be in base-5, or a higher base, so you should output '5'.

Your code must work for any base between base 1 (unary, all '0's) and base 36 ('0-9' and 'a-z').

You may take input and provide output in any reasonable format. Base-conversion builtins are allowed. As usual, standard loopholes apply, and the shortest answer in bytes is the winner!

Test IO:

```<code>#Input          #Output
00000       --> 1
123456      --> 7
ff          --> 16
4815162342  --> 9
42          --> 5
codegolf    --> 25
0123456789abcdefghijklmnopqrstuvwxyz    --> 36
</code>```

答:
R, <s>62</s> 54 bytes

```<code>max(match(strsplit(scan(,''),"")[[1]],c(0:9,letters)))
</code>```

Ungolfed:

```<code>max(
  match( # 2: Finds the respective positions of these characters
    strsplit(scan(,''),"")[[1]], # 1: Breaks the input into characters
                                c(0:9,letters)) # 3: In the vector "0123...yz"
                                                )
</code>```

Update: shaved off 8 bytes due to the redundancy of na.rm=T under the assumption of input validity.

A 39% improvement in size compared to Frédéric's answer. Besides that, it runs a wee bit faster: 0.86 seconds for 100000 replications versus 1.09 seconds for the competing answer. So the one of mine is both smaller and more efficient.

Title: What base is this number in?

Body:
R, <s>62</s> 54 bytes

max(match(strsplit(scan(,''),"")[[1]],c(0:9,letters)))

Ungolfed:

max(
  match( # 2: Finds the respective positions of these characters
    strsplit(scan(,''),"")[[1]], # 1: Breaks the input into characters
                                c(0:9,letters)) # 3: In the vector "0123...yz"
                                                )

Update: shaved off 8 bytes due to the redundancy of na.rm=T under the assumption of input validity.

A 39% improvement in size compared to Frédéric's answer. Besides that, it runs a wee bit faster: 0.86 seconds for 100000 replications versus 1.09 seconds for the competing answer. So the one of mine is both smaller and more efficient.


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

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

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

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

Sample input:

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

Corresponding output:

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

答:
Shakespeare Programming Language, 406 bytes

```<code>.
Ajax,.
Ford,.
Act I:.
Scene I:.
[Enter Ajax and Ford]
Scene II:.
Ford:
Open your mind.Is sky nicer than you?If so, let us return to scene IV.
Ajax:
Open your mind.You is sum you and sum big big big big big big pig and big big big big cat!
Scene III:.
Ford:
Speak thy mind.
Ajax:
You is sum you and pig!Is you as big as zero?If so, let us return to scene II.Let us return to scene III.
Scene IV:.
[Exeunt]
</code>```

Ungolfed version:

```<code>The Decoding of the Lengths of Veronan Runs - A Drama of PPCG.

Romeo, quite a character.
Juliet, Romeo's lover and multiplicand.

Act I: In which the lengths of runs are decoded.

Scene I: A silent entrance.

[Enter Romeo and Juliet]

Scene II: In which neither Romeo nor Juliet believes the other open-minded.

Juliet:
  Open your mind. Is my mother jollier than thou? If so,
  we must proceed to scene IV.

Romeo:
  Open your mind. Thou art the sum of thyself and the sum of my good aunt and
  the difference between nothing and the quotient of the square of twice the sum
  of thy foul fat-kidneyed goat and thy death and thy evil variable!

Scene III: In which Romeo snaps and brutally insults Juliet.

Juliet:
  Speak thy mind.

Romeo:
  Thou art the sum of thyself and a hog! Art thou as rotten as nothing? If so,
  let us return to scene II. Let us return to scene III.

Scene IV: Finale.

[Exeunt]
</code>```

I'm using drsam94's Python SPL compiler, which has a few bugs (which is why, for instance, I use Open your mind instead of Open thy mind in the golfed version).

To run this program, use:

```<code>$ python splc.py rld.spl > rld.c
$ gcc rld.c -o rld.exe
$ echo -n ":144,1'1" | ./rld
:4444,'
</code>```

How it works

SPL is an esoteric programming language designed to make programs look like Shakespeare plays. It does this by using characters as variables, and processing is performed by having the characters say things to one another.

```<code>The Decoding of the Lengths of Veronan Runs - A Drama of PPCG.
</code>```

This is the title of the play; it's ignored by the compiler.

```<code>Romeo, quite a character.
Juliet, Romeo's lover and multiplicand.
</code>```

Here we're declaring the variables used in the rest of the program. Everything betwen , and . is ignored by the compiler. In this case, we declare Romeo, used to hold the character being decoded, and Juliet, used to hold the run length of the character.

```<code>Act I: In which the lengths of runs are decoded.
</code>```

Here we declare the first and only act in the program. Acts and scenes are like labels; they can be jumped to at any time by using let us return to scene II or some variant of that. We only use one act, because it's sufficient for our needs. Again, anything between : and . is ignored by the compiler.

```<code>Scene I: A silent entrance.
</code>```

Here we declare the first scene. Scenes are numbered in Roman numerals: the first is Scene I, the second Scene II, and so on.

```<code>[Enter Romeo and Juliet]
</code>```

This is a stage direction; in it, we tell the Romeo and Juliet variables to come onto the "stage". Only two variables can be on the "stage" at once; the stage is used so that the compiler can figure out which variable is addressing which when they speak. Because we have only two variables, Romeo and Juliet will stay onstage for the length of the program.

```<code>Scene II: In which neither Romeo nor Juliet believes the other open-minded.
</code>```

Another scene declaration. Scene II will be jumped to in order to decode another run-length.

```<code>Juliet:
</code>```

This form of declaration means that Juliet is going to start speaking. Everything until the next Romeo:, stage direction, or scene/act declaration will be a line spoken by Juliet, and thus "me" will refer to Juliet, "you"/"thou" to Romeo, etc.

```<code>The Decoding of the Lengths of Veronan Runs - A Drama of PPCG.

Romeo, quite a character.
Juliet, Romeo's lover and multiplicand.

Act I: In which the lengths of runs are decoded.

Scene I: A silent entrance.

[Enter Romeo and Juliet]

Scene II: In which neither Romeo nor Juliet believes the other open-minded.

Juliet:
  Open your mind. Is my mother jollier than thou? If so,
  we must proceed to scene IV.

Romeo:
  Open your mind. Thou art the sum of thyself and the sum of my good aunt and
  the difference between nothing and the quotient of the square of twice the sum
  of thy foul fat-kidneyed goat and thy death and thy evil variable!

Scene III: In which Romeo snaps and brutally insults Juliet.

Juliet:
  Speak thy mind.

Romeo:
  Thou art the sum of thyself and a hog! Art thou as rotten as nothing? If so,
  let us return to scene II. Let us return to scene III.

Scene IV: Finale.

[Exeunt]
</code>```0

This command stores the ordinal value of single character from STDIN in Romeo.

```<code>The Decoding of the Lengths of Veronan Runs - A Drama of PPCG.

Romeo, quite a character.
Juliet, Romeo's lover and multiplicand.

Act I: In which the lengths of runs are decoded.

Scene I: A silent entrance.

[Enter Romeo and Juliet]

Scene II: In which neither Romeo nor Juliet believes the other open-minded.

Juliet:
  Open your mind. Is my mother jollier than thou? If so,
  we must proceed to scene IV.

Romeo:
  Open your mind. Thou art the sum of thyself and the sum of my good aunt and
  the difference between nothing and the quotient of the square of twice the sum
  of thy foul fat-kidneyed goat and thy death and thy evil variable!

Scene III: In which Romeo snaps and brutally insults Juliet.

Juliet:
  Speak thy mind.

Romeo:
  Thou art the sum of thyself and a hog! Art thou as rotten as nothing? If so,
  let us return to scene II. Let us return to scene III.

Scene IV: Finale.

[Exeunt]
</code>```1

In SPL, nouns translate to either 1 or -1 depending on whether they are positive or negative. In this case, my mother translates to 1. Adjectives (positive or negative) multiply their noun by 2.

This is a question; in it, Juliet asks if my mother (AKA 1) is "jollier" than Romeo. Comparatives either translate to less than (if they are negative, like worse) or greater than (if they are positive, like jollier). Therefore, this question boils down to Is 1 greater than you?.

The reason we ask this question is to detect the end of the input. Since the value of EOF varies by platform, but is usually less than 1, we use this to detect it.

```<code>The Decoding of the Lengths of Veronan Runs - A Drama of PPCG.

Romeo, quite a character.
Juliet, Romeo's lover and multiplicand.

Act I: In which the lengths of runs are decoded.

Scene I: A silent entrance.

[Enter Romeo and Juliet]

Scene II: In which neither Romeo nor Juliet believes the other open-minded.

Juliet:
  Open your mind. Is my mother jollier than thou? If so,
  we must proceed to scene IV.

Romeo:
  Open your mind. Thou art the sum of thyself and the sum of my good aunt and
  the difference between nothing and the quotient of the square of twice the sum
  of thy foul fat-kidneyed goat and thy death and thy evil variable!

Scene III: In which Romeo snaps and brutally insults Juliet.

Juliet:
  Speak thy mind.

Romeo:
  Thou art the sum of thyself and a hog! Art thou as rotten as nothing? If so,
  let us return to scene II. Let us return to scene III.

Scene IV: Finale.

[Exeunt]
</code>```2

If the preceding question evaluated to true, we jump to scene IV—which is simply the end of the program. In short, if we detect an EOF, we end the program.

```<code>Romeo:
</code>```

It's now Romeo's line: "me" and "you" refer to Romeo and Juliet, respectively.

```<code>Open your mind.
</code>```

Again, this statement puts the ordinal value of a single character from STDIN into Juliet, which in this case is the run-length of the character stored in Romeo.

```<code>Thou art the sum of thyself and the sum of my good aunt and the difference
between nothing and the quotient of the square of twice the sum of thy foul
fat-kidneyed goat and thy death and thy evil variable!
</code>```

This one's too long to go over in great detail, but just trust me in that it translates to Juliet -= 48. We do this because Juliet holds the ASCII value of a numeral, and ord('0') == 48; in subtracting 48, we translate from the ASCII value of a number to the number itself.

```<code>Scene III: In which Romeo snaps and brutally insults Juliet.
</code>```

Another scene declaration. This one is for the loop in which we repeatedly print the character value of Romeo, Juliet times.

```<code>Juliet:
  Speak thy mind.
</code>```

This statement causes Romeo to print his value as a character; that is, whatever character value was previously stored in Romeo is now output.

```<code>Romeo:
  Thou art the sum of thyself and a hog!
</code>```

A hog is a negative noun, so a hog translates to -1; therefore, this statement evaluates to Juliet -= 1.

```<code>Art thou as rotten as nothing?
</code>```

Romeo here asks if Juliet is "as rotten as", or equal to, 0.

```<code>$ python splc.py rld.spl > rld.c
$ gcc rld.c -o rld.exe
$ echo -n ":144,1'1" | ./rld
:4444,'
</code>```0

If Juliet's value is 0, we loop back to scene II to decode another character's run-length.

```<code>$ python splc.py rld.spl > rld.c
$ gcc rld.c -o rld.exe
$ echo -n ":144,1'1" | ./rld
:4444,'
</code>```1

Else, we loop back to scene III to output Romeo's character again.

```<code>$ python splc.py rld.spl > rld.c
$ gcc rld.c -o rld.exe
$ echo -n ":144,1'1" | ./rld
:4444,'
</code>```2

This final scene declaration is just a marker for the end of the program. The [Exeunt] stage direction is necessary to get the compiler to actually generate the final scene.

Title: Run Length Decoding

Body:
Shakespeare Programming Language, 406 bytes

.
Ajax,.
Ford,.
Act I:.
Scene I:.
[Enter Ajax and Ford]
Scene II:.
Ford:
Open your mind.Is sky nicer than you?If so, let us return to scene IV.
Ajax:
Open your mind.You is sum you and sum big big big big big big pig and big big big big cat!
Scene III:.
Ford:
Speak thy mind.
Ajax:
You is sum you and pig!Is you as big as zero?If so, let us return to scene II.Let us return to scene III.
Scene IV:.
[Exeunt]

Ungolfed version:

The Decoding of the Lengths of Veronan Runs - A Drama of PPCG.

Romeo, quite a character.
Juliet, Romeo's lover and multiplicand.

Act I: In which the lengths of runs are decoded.

Scene I: A silent entrance.

[Enter Romeo and Juliet]

Scene II: In which neither Romeo nor Juliet believes the other open-minded.

Juliet:
  Open your mind. Is my mother jollier than thou? If so,
  we must proceed to scene IV.

Romeo:
  Open your mind. Thou art the sum of thyself and the sum of my good aunt and
  the difference between nothing and the quotient of the square of twice the sum
  of thy foul fat-kidneyed goat and thy death and thy evil variable!

Scene III: In which Romeo snaps and brutally insults Juliet.

Juliet:
  Speak thy mind.

Romeo:
  Thou art the sum of thyself and a hog! Art thou as rotten as nothing? If so,
  let us return to scene II. Let us return to scene III.

Scene IV: Finale.

[Exeunt]

I'm using drsam94's Python SPL compiler, which has a few bugs (which is why, for instance, I use Open your mind instead of Open thy mind in the golfed version).

To run this program, use:

$ python splc.py rld.spl > rld.c
$ gcc rld.c -o rld.exe
$ echo -n ":144,1'1" | ./rld
:4444,'

How it works

SPL is an esoteric programming language designed to make programs look like Shakespeare plays. It does this by using characters as variables, and processing is performed by having the characters say things to one another.

The Decoding of the Lengths of Veronan Runs - A Drama of PPCG.

This is the title of the play; it's ignored by the compiler.

Romeo, quite a character.
Juliet, Romeo's lover and multiplicand.

Here we're declaring the variables used in the rest of the program. Everything betwen , and . is ignored by the compiler. In this case, we declare Romeo, used to hold the character being decoded, and Juliet, used to hold the run length of the character.

Act I: In which the lengths of runs are decoded.

Here we declare the first and only act in the program. Acts and scenes are like labels; they can be jumped to at any time by using let us return to scene II or some variant of that. We only use one act, because it's sufficient for our needs. Again, anything between : and . is ignored by the compiler.

Scene I: A silent entrance.

Here we declare the first scene. Scenes are numbered in Roman numerals: the first is Scene I, the second Scene II, and so on.

[Enter Romeo and Juliet]

This is a stage direction; in it, we tell the Romeo and Juliet variables to come onto the "stage". Only two variables can be on the "stage" at once; the stage is used so that the compiler can figure out which variable is addressing which when they speak. Because we have only two variables, Romeo and Juliet will stay onstage for the length of the program.

Scene II: In which neither Romeo nor Juliet believes the other open-minded.

Another scene declaration. Scene II will be jumped to in order to decode another run-length.

Juliet:

This form of declaration means that Juliet is going to start speaking. Everything until the next Romeo:, stage direction, or scene/act declaration will be a line spoken by Juliet, and thus "me" will refer to Juliet, "you"/"thou" to Romeo, etc.

Open your mind.

This command stores the ordinal value of single character from STDIN in Romeo.

Is my mother jollier than thou?

In SPL, nouns translate to either 1 or -1 depending on whether they are positive or negative. In this case, my mother translates to 1. Adjectives (positive or negative) multiply their noun by 2.

This is a question; in it, Juliet asks if my mother (AKA 1) is "jollier" than Romeo. Comparatives either translate to less than (if they are negative, like worse) or greater than (if they are positive, like jollier). Therefore, this question boils down to Is 1 greater than you?.

The reason we ask this question is to detect the end of the input. Since the value of EOF varies by platform, but is usually less than 1, we use this to detect it.

If so, we must proceed to scene IV.

If the preceding question evaluated to true, we jump to scene IV—which is simply the end of the program. In short, if we detect an EOF, we end the program.

Romeo:

It's now Romeo's line: "me" and "you" refer to Romeo and Juliet, respectively.

Open your mind.

Again, this statement puts the ordinal value of a single character from STDIN into Juliet, which in this case is the run-length of the character stored in Romeo.

Thou art the sum of thyself and the sum of my good aunt and the difference
between nothing and the quotient of the square of twice the sum of thy foul
fat-kidneyed goat and thy death and thy evil variable!

This one's too long to go over in great detail, but just trust me in that it translates to Juliet -= 48. We do this because Juliet holds the ASCII value of a numeral, and ord('0') == 48; in subtracting 48, we translate from the ASCII value of a number to the number itself.

Scene III: In which Romeo snaps and brutally insults Juliet.

Another scene declaration. This one is for the loop in which we repeatedly print the character value of Romeo, Juliet times.

Juliet:
  Speak thy mind.

This statement causes Romeo to print his value as a character; that is, whatever character value was previously stored in Romeo is now output.

Romeo:
  Thou art the sum of thyself and a hog!

A hog is a negative noun, so a hog translates to -1; therefore, this statement evaluates to Juliet -= 1.

Art thou as rotten as nothing?

Romeo here asks if Juliet is "as rotten as", or equal to, 0.

If so, let us return to scene II.

If Juliet's value is 0, we loop back to scene II to decode another character's run-length.

Let us return to scene III.

Else, we loop back to scene III to output Romeo's character again.

Scene IV: Finale.

[Exeunt]

This final scene declaration is just a marker for the end of the program. The [Exeunt] stage direction is necessary to get the compiler to actually generate the final scene.


问:
No strings (or numbers) attached
If you like this, consider participating in:

The Official Dyalog APL 2016 Year Game

The monthly Dyalog APL 2017 Code Golf Challenge

Make 12 snippets/expressions, in the same language, that result in the numbers 0 through 10, and 42 respectively, but without writing any literal numeric, string, or character data.

Build-in data, like PI() and ALPHABET(), are fine, and so are e.g. CJam's U, X, Y, Z, and A constants, and Processing's BLEND, CHORD, CENTER, BREAK, and  LINES.

Every snippet must be able to stand on its own, i.e. they may not be interdependent. However, inside a single snippet, you may assign a variable and use it freely, as long as you refer to it directly by name, and not through a string containing its name.

All the snippets must be valid on the submitter’s computer at the time of submission (as reported by SE), but may not rely on unusual local conditions like number of files in a directory, the exact date or time, or specific input from the user.

Examples of valid snippets

3: INT(LOG10(YEAR(TODAY())))   because it remains true in the foreseeable future

4: CUBICROOT(LEN(CHARACTERSET()))   because a 256 letter character set is very common

8: SQRT(SYSTEMTYPE())   because 64-bit systems are very common

Examples of invalid snippets

5: LEN(USERNAME())   because most people do not use “Admin” as login :-)

9: LOG10(SYSTEMMEMORY())   because it only works on systems with exactly 1 GB of memory

42: CODE("*")   because it contains a string/character literal

The result of each snippet must result in an actual number (value, int, float, etc.) that can be used for further calculations using the same language as the snippet, i.e not a text string representing that number.

Only character based languages allowed.

Score is total byte count of all the 12 snippets combined. Newlines separating the snippets are not counted in.

Note that the above rules may prevent some languages from participating, even if they are Turing complete.

FAQ

Q Can the programs accept any input?

A Yes, but you may not just ask for input and enter the relevant number.

Q Are physical digits (non-data) digits allowed?

A Yes, e.g. LOG10().

Q Do Symbols in Ruby count as literals?

A Yes.

Q Does score include newlines between each snippet?

A No.

Q Is TI-BASIC "character based" enough to be valid?

A Yes.

Q Do false and true count as number literals?

A No, they are acceptable.

Q Can we use a number literal to call a function if that's the only way and the number doesn't influence the output of the function?

A Yes, if that is the normal way to write code in your language.

Q My language assumes there is a [something] at the start of each program/expression. Must I include it, or should my snippets just work if placed in the middle of a program/expression?

A They should just work in the middle of a program/expression.

Q What about regex literals?

A Forbidden, except for languages that only do regexes.

Q Is one piece of code that could print all the specified numbers acceptable?

A No, they have to be separate and mutually independent.

Q May I assume a boilerplate like int main() {}... or equivalent?

A Yes.

Q What output datatypes are allowed?

A Any numeric datatype, like int, float, etc.

Q Do I need to print the result of each snippet?

A No, making the result available for subsequent use is enough.

Q Are pre-set variables allowed?

A Yes, and they become reset (if changed) for every snippet.

Q Are π and e considered number literals?

A No, you may use them.

Q May I return 4 and 2 in different cells for 42?

A No, they must be connected as one number.

Q Bytes or characters?

A Bytes, but you may choose any desired codepage.

Q May constant functions and preset variables like J's 9:, Actually's 9, and Pretzel's 9 be used?

A Yes, if the vocabulary is finite (19 for J, 10 for Actually and Pretzel).

答:
Hexagony, 13 bytes

```

1
2
3
4
5
6
7
8
9
10
42
```

Try it online!

In Hexagony, 0 through 9 are functions that multiply the current memory by 10, and then add the number represented by the function name. Therefore, the first snippet is empty as memories start off as 0.

For example, if the current memory is 65, executing the function 3 will make the current memory 653.

(To downvoters: downvote all you want; I am ready.)

Title: No strings (or numbers) attached

Body:
Hexagony, 13 bytes

1
2
3
4
5
6
7
8
9
10
42

Try it online!

In Hexagony, 0 through 9 are functions that multiply the current memory by 10, and then add the number represented by the function name. Therefore, the first snippet is empty as memories start off as 0.

For example, if the current memory is 65, executing the function 3 will make the current memory 653.

(To downvoters: downvote all you want; I am ready.)


答:
05AB1E, 10 bytes

```<code>ÌL<¤/3ãDOÏ
</code>```

Explanation

```<code>ÌL<          # range(1,n+2)-1
   ¤/        # divide all by last element (n+1)
     3ã      # cartesian product repeat (generate all possible triples)
       DO    # make a copy and sum the triples
         Ï   # keep triples with sum 1
</code>```

Try it online

Title: My triangle needs more nodes

Body:
Consider the standard equilateral triangle, with nodes labeled using barycentric coordinates:

We can turn this 3 node triangle into a 6 node triangle by adding a new line of 3 vertices (one more than was present on a side of the original 3 node triangle), remove any internal edges (but not internal nodes) and re-normalize the coordinates:

Repeating the process to go from a 6 node triangle to a 10 node triangle, add a line of 4 vertices (again, one more than was present on a side of the original 6 node triangle), remove any internal edges (but not internal nodes) and re-normalize the coordinates:

This process can be repeated indefinitely. The goal of this challenge is given an integer N representing how many times this process has been performed, output all the nodes for the associated triangle in barycentric coordinates.

Input

Your program/function should take as input a single non-negative integer N representing how many times this process has been applied. Note that for N=0, you should output the original triangle with 3 nodes.

The input may come from any source (function parameter, stdio, etc.).

Output

Your program/function should output all the nodes in normalized barycentric coordinates. The order of the nodes does not matter.
A number can be specified as a fraction (fraction reduction not required) or a floating point number. You may also output "scaled" vectors to specify a node. For example, all 3 of the following outputs are equivalent and allowed:

```<code>0.5,0.5,0

1/2,2/4,0

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

If using floating point output, your output should be accurate to within 1%. The output may be to any sink desired (stdio, return value, return parameter, etc.). Note that even though the barycentric coordinates are uniquely determined by only 2 numbers per node, you should output all 3 numbers per node.

Examples

Example cases are formatted as:

```<code>N
x0,y0,z0
x1,y1,z1
x2,y2,z2
...
</code>```

where the first line is the input N, and all following lines form a node x,y,z which should be in the output exactly once. All numbers are given as approximate floating point numbers.

```<code>0
1,0,0
0,1,0
0,0,1

1
1,0,0
0,1,0
0,0,1
0.5,0,0.5
0.5,0.5,0
0,0.5,0.5

2
1,0,0
0,1,0
0,0,1
0.667,0,0.333
0.667,0.333,0
0.333,0,0.667
0.333,0.333,0.333
0.333,0.667,0
0,0.333,0.667
0,0.667,0.333

3
1,0,0
0.75,0,0.25
0.75,0.25,0
0.5,0,0.5
0.5,0.25,0.25
0.5,0.5,0
0.25,0,0.75
0.25,0.25,0.5
0.25,0.5,0.25
0.25,0.75,0
0,0,1
0,0.25,0.75
0,0.5,0.5
0,0.75,0.25
0,1,0
</code>```

Scoring

This is code golf; shortest code in bytes wins. Standard loopholes apply. You may use any built-ins desired.

Body:
05AB1E, 10 bytes

ÌL<¤/3ãDOÏ

Explanation

ÌL<          # range(1,n+2)-1
   ¤/        # divide all by last element (n+1)
     3ã      # cartesian product repeat (generate all possible triples)
       DO    # make a copy and sum the triples
         Ï   # keep triples with sum 1

Try it online


答:
CJam, 10 bytes

Thanks to Martin Ender for saving me a few bytes!

Uses Dennis's formula

```<code>q:e>8-i39%
</code>```

Try it online

CJam, <s>18</s> 16 btyes

Alternative solution:

```<code>A,s'{,97>+q:e>#)
</code>```

Try it online

```<code>A,s'{,97>+       e# Push the string "0123456789abcdefghijklmnopqrstuvwxyz"
          q      e# Get the input
           :e>   e# Find the highest character in the input
              #  e# Find the index of that character in the string
               ) e# Increment
</code>```

Title: What base is this number in?

Body:
Here's a nice easy challenge:

Given a string that represents a number in an unknown base, determine the lowest possible base that number might be in. The string will only contain 0-9, a-z. If you like, you may choose to take uppercase letters instead of lowercase, but please specify this. You must output this lowest possible base in decimal.

Here is a more concrete example. If the input string was "01234", it is impossible for this number to be in binary, since 2, 3, and 4 are all undefined in binary. Similarly, this number cannot be in base 3, or base 4. Therefore, this number must be in base-5, or a higher base, so you should output '5'.

Your code must work for any base between base 1 (unary, all '0's) and base 36 ('0-9' and 'a-z').

You may take input and provide output in any reasonable format. Base-conversion builtins are allowed. As usual, standard loopholes apply, and the shortest answer in bytes is the winner!

Test IO:

```<code>#Input          #Output
00000       --> 1
123456      --> 7
ff          --> 16
4815162342  --> 9
42          --> 5
codegolf    --> 25
0123456789abcdefghijklmnopqrstuvwxyz    --> 36
</code>```

Body:
CJam, 10 bytes

Thanks to Martin Ender for saving me a few bytes!

Uses Dennis's formula

q:e>8-i39%

Try it online

CJam, <s>18</s> 16 btyes

Alternative solution:

A,s'{,97>+q:e>#)

<a href="http://cjam.aditsu.net/#code=A%2Cs'%7B%2C97%3E%2B%20%20%20%20%20%20%20e%23%20Push%20the%20string%20%220123456789abcdefghijklmnopqrstuvwxyz%22%0A%20%20%20%20%20%20%20%20%20%20q%20%20%20%20%20%20e%23%20Get%20the%20input%0A%20%20%20%20%20%20%20%20%20%20%20%3Ae%3E%20%20%20e%23%20Find%20the%20highest%20character%20in%20the%20input%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%23%20%20e%23%20Find%20the%20index%20of%20that%20character%20in%20the%20string%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20)%20e%23%20Increment&input=543a" rel="nofollow noreferrer">Try it online

A,s'{,97>+       e# Push the string "0123456789abcdefghijklmnopqrstuvwxyz"
          q      e# Get the input
           :e>   e# Find the highest character in the input
              #  e# Find the index of that character in the string
               ) e# Increment


问:
Alphabet triangle strikes again

Task

Your task is to print this exact text:

```<code>A
BCD
EFGHI
JKLMNOP
QRSTUVWXY
ZABCDEFGHIJ
KLMNOPQRSTUVW
XYZABCDEFGHIJKL
MNOPQRSTUVWXYZABC
DEFGHIJKLMNOPQRSTUV
WXYZABCDEFGHIJKLMNOPQ
RSTUVWXYZABCDEFGHIJKLMN
OPQRSTUVWXYZABCDEFGHIJKLM
NOPQRSTUVWXYZABCDEFGHIJKLMN
OPQRSTUVWXYZABCDEFGHIJKLMNOPQ
RSTUVWXYZABCDEFGHIJKLMNOPQRSTUV
WXYZABCDEFGHIJKLMNOPQRSTUVWXYZABC
DEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKL
MNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVW
XYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJ
KLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXY
ZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOP
QRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHI
JKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCD
EFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZA
BCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ
</code>```

Specs

You may do it in all-lowercase instead of all-uppercase.

Trailing newlines at the end of the triangle is allowed.

Trailing spaces after each line is allowed.

You must print to STDOUT instead of outputting an array of strings.

Scoring

This is code-golf. Program with lowest byte-count wins.

答:
Perl, <s>42</s> <s>41</s> 39 bytes

```<code>perl -E '@b=(A..Z)x26;say splice@b,0,$#a+=2for@b'
</code>```

Just the code:

```<code>@b=(A..Z)x26;say splice@b,0,$#a+=2for@b
</code>```

An obvious shorter version unfortunately triggers an internal perl problem (Use of freed value in iteration):

```<code>say splice@b,0,$#a+=2for@b=(A..Z)x26
</code>```

Title: Alphabet triangle strikes again

Body:
Perl, <s>42</s> <s>41</s> 39 bytes

perl -E '@b=(A..Z)x26;say splice@b,0,$#a+=2for@b'

Just the code:

@b=(A..Z)x26;say splice@b,0,$#a+=2for@b

An obvious shorter version unfortunately triggers an internal perl problem (Use of freed value in iteration):

say splice@b,0,$#a+=2for@b=(A..Z)x26


问:
Shortest power set implementation

Problem definition

Print out the powerset of a given set. For example:

```<code>[1, 2, 3] => [[], [1], [2], [3], [1, 2], [1, 3], [2, 3], [1, 2, 3]]
</code>```

Each element is to be printed on a separate line, so the above example would be printed as:

```<code>[]
[1]
[2]
...
[1, 2, 3]
</code>```

Example code (in D, python example here):

```<code>import std.stdio;

string[][] powerset(string[] set) {
    if (set.length == 1) {
        return [set, []];
    }

    string[][] ret;
    foreach (item; powerset(set[1 .. $])) {
        ret ~= set[0]~item;
        ret ~= item;
    }

    return ret;
}

void main(string[] argv) {
    foreach (set; powerset(argv[1 .. $]))
        writeln(set);
}
</code>```

Input

Elements will be passed as arguments. For example, the example provided above would be passed to a program called powerset as:

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

Arguments will be alphanumeric.

Rules

No libraries besides io

Output does not have to be ordered

Powerset does not have to be stored, only printed

Elements in the set must be delimited (e.g. 1,2,3, [1,2,3] and ['1','2','3'] are acceptable, but 123 is not

Trailing delimiters are fine (e.g. 1,2,3, == 1,2,3)

Best is determined based on number of bytes

The best solution will be decided no less than 10 days after the first submission.

Title: Shortest power set implementation

Body:
Python (74 70 chars)

def p(a,v):
 if a:i,*a=a;p(a,v);p(a,v+[i])
 else:print v
p(input(),[])

for input as 1,2,3 or [1,2,3], output is:

[]
[3]
[2]
[2, 3]
[1]
[1, 3]
[1, 2]
[1, 2, 3]


问:
The Letter A without A
Your task is to display the letter "A" alone, without anything else, except any form of trailing newlines if you cannot avoid them, doing so in a program and/or snippet. Code that returns (instead of printing) is allowed.

Both the lowercase and uppercase versions of the letter "A" are acceptable (that is, unicode U+0061 or unicode U+0041. Other character encodings that aren't Unicode are allowed, but either way, the resulting output of your code must be the latin letter "A", and not any lookalikes or homoglyphs)

You must not use any of the below characters in your code, regardless of the character encoding that you pick:

"A", whether uppercase or lowercase.

"U", whether lowercase or uppercase.

X, whether uppercase or lowercase.

+

&

#

0

1

4

5

6

7

9

Cheating, loopholes, etc, are not allowed.

Since this is code-golf, the shortest solution, in bytes, that follows all the rules, is the winner.

Validity Checker

This Stack Snippet checks to make sure your code doesn't use the restricted characters. It might not work properly for some character encodings.

var t = prompt("Input your code.");

if (/[AaUuXx+&#0145679]/.test(t)) {
  alert("Contains a disallowed character!");
} else {
  alert("No disallowed characters");
}```
</div>
</div>
</p>

<p><em>This Stack Snippet that makes sure you don't have a disallowed character is also available on JSFiddle.</em></p>

<h3>Leaderboard</h3>

<p><div class="snippet" data-lang="js" data-hide="true" data-console="false" data-babel="false">
<div class="snippet-code snippet-currently-hidden">
<pre class="snippet-code-js lang-js prettyprint-override"><code>var QUESTION_ID=90349,OVERRIDE_USER=58717;function answersUrl(e){return"https://api.stackexchange.com/2.2/questions/"+QUESTION_ID+"/answers?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+ANSWER_FILTER}function commentUrl(e,s){return"https://api.stackexchange.com/2.2/answers/"+s.join(";")+"/comments?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+COMMENT_FILTER}function getAnswers(){jQuery.ajax({url:answersUrl(answer_page++),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){answers.push.apply(answers,e.items),answers_hash=[],answer_ids=[],e.items.forEach(function(e){e.comments=[];var s=+e.share_link.match(/\d+/);answer_ids.push(s),answers_hash[s]=e}),e.has_more||(more_answers=!1),comment_page=1,getComments()}})}function getComments(){jQuery.ajax({url:commentUrl(comment_page++,answer_ids),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){e.items.forEach(function(e){e.owner.user_id===OVERRIDE_USER&&answers_hash[e.post_id].comments.push(e)}),e.has_more?getComments():more_answers?getAnswers():process()}})}function getAuthorName(e){return e.owner.display_name}function process(){var e=[];answers.forEach(function(s){var r=s.body;s.comments.forEach(function(e){OVERRIDE_REG.test(e.body)&&(r="<h1>"+e.body.replace(OVERRIDE_REG,"")+"</h1>")});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;/<a/.test(o)&&(o=jQuery(o).text()),s[o]=s[o]||{lang:e.language,user:e.user,size:e.size,link:e.link}});var t=[];for(var o in s)s.hasOwnProperty(o)&&t.push(s[o]);t.sort(function(e,s){return e.lang>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;</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}```
<pre class="snippet-code-html lang-html prettyprint-override"><code><script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <link rel="stylesheet" type="text/css" href="//cdn.sstatic.net/codegolf/all.css?v=83c949450c8b"> <div id="answer-list"> <h2>Leaderboard</h2> <table class="answer-list"> <thead> <tr><td></td><td>Author</td><td>Language</td><td>Size</td></tr></thead> <tbody id="answers"> </tbody> </table> </div><div id="language-list"> <h2>Winners by Language</h2> <table class="language-list"> <thead> <tr><td>Language</td><td>User</td><td>Score</td></tr></thead> <tbody id="languages"> </tbody> </table> </div><table style="display: none"> <tbody id="answer-template"> <tr><td>{{PLACE}}</td><td>{{NAME}}</td><td>{{LANGUAGE}}</td><td>{{SIZE}}</td><td>Link</td></tr></tbody> </table> <table style="display: none"> <tbody id="language-template"> <tr><td>{{LANGUAGE}}</td><td>{{NAME}}</td><td>{{SIZE}}</td><td>Link</td></tr></tbody> </table></code>```

答:
3d, 7 bytes

Don't know if competing, but still, here it is.

Program:

```<code>>'b.-!;
</code>```

Output:

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

Explanation:

```<code>>        Set direction of the IP
 'b      Push Unicode ordinal of character 'b'
   .     Push digit 1
    -    Push difference
     !   Print as Unicode character
      ;  End of program
</code>```

Title: The Letter A without A

Body:
3d, 7 bytes

Don't know if competing, but still, here it is.

Program:

>'b.-!;

Output:

a

Explanation:

>        Set direction of the IP
 'b      Push Unicode ordinal of character 'b'
   .     Push digit 1
    -    Push difference
     !   Print as Unicode character
      ;  End of program


答:
C89, <s>55</s> <s>53</s> <s>52</s> 50 bytes

```<code>f(s,b)char*s;{return*s?f(s+1,*s>b?*s:b):(b-8)%39;}
</code>```

-8%39 shamelessly stolen from Dennis

Test

```<code>test(const char* input)
{
    printf("%36s -> %u\n", input, f((char*)input,0));
}

main()
{
    test("00000");
    test("123456");
    test("ff");
    test("4815162342");
    test("42");
    test("codegolf");
    test("0123456789abcdefghijklmnopqrstuvwxyz");
}
</code>```

Output

```<code>                               00000 -> 1
                              123456 -> 7
                                  ff -> 16
                          4815162342 -> 9
                                  42 -> 5
                            codegolf -> 25
0123456789abcdefghijklmnopqrstuvwxyz -> 36
</code>```

Saved 2 bytes thanks to Toby Speight

Saved 2 bytes thanks to Kevin Cruijssen

Title: What base is this number in?

Body:
C89, <s>55</s> <s>53</s> <s>52</s> 50 bytes

f(s,b)char*s;{return*s?f(s+1,*s>b?*s:b):(b-8)%39;}

-8%39 shamelessly stolen from Dennis

Test

test(const char* input)
{
    printf("%36s -> %u\n", input, f((char*)input,0));
}

main()
{
    test("00000");
    test("123456");
    test("ff");
    test("4815162342");
    test("42");
    test("codegolf");
    test("0123456789abcdefghijklmnopqrstuvwxyz");
}

Output

                               00000 -> 1
                              123456 -> 7
                                  ff -> 16
                          4815162342 -> 9
                                  42 -> 5
                            codegolf -> 25
0123456789abcdefghijklmnopqrstuvwxyz -> 36

Saved 2 bytes thanks to Toby Speight

Saved 2 bytes thanks to Kevin Cruijssen


答:
PowerShell v2+, 67 bytes

```<code>($args[0]-replace'F','+,'-replace'W','*').trim('+')+'-join", "'|iex
</code>```

Takes input $args[0] as a string, pumps it through two -replace statements to swap the F for a +, and the W for a *. Then .trims the errant initial + before concatenating -join with a ,<space>, and piping to iex to evaluate the resulting string into a new string. That's left on the pipeline, and output is implicit.

As an example, with input F1W5F2W3, after the -replaces, our string will be +,1*5+,2*3. After the .trim, it'll be ,1*5+,2*3. That's concatenated with the -join statement, like ,1*5+,2*3-join", ". The iex then evaluates that string by forming an array of 5 1s via the comma-operator, using array concatenation to add on an array of 3 2s, so we have an array like (1,1,1,1,1,2,2,2), which is then fed into -join to put the comma-space between the elements.

Since -replace is by default case-insensitive, it handles lowercase as well.

Test cases

```<code>PS C:\Tools\Scripts\golfing> .\text-animation-format.ps1 'F1W5F2W3'
1, 1, 1, 1, 1, 2, 2, 2

PS C:\Tools\Scripts\golfing> .\text-animation-format.ps1 'F10W3F11W3F10W3F12W3'
10, 10, 10, 11, 11, 11, 10, 10, 10, 12, 12, 12

PS C:\Tools\Scripts\golfing> .\text-animation-format.ps1 'f1w0f2w10'
2, 2, 2, 2, 2, 2, 2, 2, 2, 2
</code>```

Title: Text animation format Code Golf

Body:
PowerShell v2+, 67 bytes

($args[0]-replace'F','+,'-replace'W','*').trim('+')+'-join", "'|iex

Takes input $args[0] as a string, pumps it through two -replace statements to swap the F for a +, and the W for a *. Then .trims the errant initial + before concatenating -join with a ,<space>, and piping to iex to evaluate the resulting string into a new string. That's left on the pipeline, and output is implicit.

As an example, with input F1W5F2W3, after the -replaces, our string will be +,1*5+,2*3. After the .trim, it'll be ,1*5+,2*3. That's concatenated with the -join statement, like ,1*5+,2*3-join", ". The iex then evaluates that string by forming an array of 5 1s via the comma-operator, using array concatenation to add on an array of 3 2s, so we have an array like (1,1,1,1,1,2,2,2), which is then fed into -join to put the comma-space between the elements.

Since -replace is by default case-insensitive, it handles lowercase as well.

Test cases

PS C:\Tools\Scripts\golfing> .\text-animation-format.ps1 'F1W5F2W3'
1, 1, 1, 1, 1, 2, 2, 2

PS C:\Tools\Scripts\golfing> .\text-animation-format.ps1 'F10W3F11W3F10W3F12W3'
10, 10, 10, 11, 11, 11, 10, 10, 10, 12, 12, 12

PS C:\Tools\Scripts\golfing> .\text-animation-format.ps1 'f1w0f2w10'
2, 2, 2, 2, 2, 2, 2, 2, 2, 2


问:
Implement this key cipher

Implement this key cipher

Goal

Use the algorithm (explained in the Algorithm section) to implement a certain cipher.

The program must read input from STDIN or the closest available equivalent, use the algorithm to generate the ciphertext and a key.

The ciphertext and the key will be written to STDOUT or the closest available equivalent. Any format is allowed, as long as it outputs the ciphertext and the key.

Algorithm

Convert the characters in the string into the respective ASCII values. For example:

Hello -> 72 101 108 108 111

Next, you will need to generate a key as long as the string with random numbers in the range of 0-9.

Hello -> 62841

Add the integers in the random number sequence to the ASCII values of the string. In the above examples, 72 would become 78, and 101 would become 104.

72 + 6 = 78, 101 + 2 = 103, 108 + 8 = 116, etc

Next, convert the new values back to characters. In the above examples, the text Hello has become Ngtpp.

Examples

(These are simply examples of what the output might look like. The output can and will vary.)

```<code>Hello World

Lfrlu)_supg
41606984343
</code>```

```<code>This will be encoded

Zhjs$~koo gj$iuhofgj
60104723305544750226
</code>```

Rules

You can assume that the input will only contain characters in the range a-z, A-Z, and spaces.

Submissions must be full programs or functions.

Submissions will be scored in bytes.

Standard loopholes are forbidden.

This is code-golf, so the shortest code wins.

(This is one of my first challenges, if there's something wrong with it, feel free to tell me how I could improve it.)

答:
Perl, 34 bytes

Includes +1 for -p

```<code>#!/usr/bin/perl -p
s%.%$\.=$==rand 10;chr$=+ord$&%eg
</code>```

Title: Implement this key cipher

Body:
Perl, 34 bytes

Includes +1 for -p

#!/usr/bin/perl -p
s%.%$\.=$==rand 10;chr$=+ord$&%eg


答:
BASH 70

```<code>grep -o .|sort -r|head -c1|od -An -tuC|sed s/$/-86/|bc|sed s/-/39-/|bc
</code>```

Input letters are lowercase.

Title: What base is this number in?

Body:
BASH 70

grep -o .|sort -r|head -c1|od -An -tuC|sed s/$/-86/|bc|sed s/-/39-/|bc

Input letters are lowercase.


答:
R, 59 57 bytes

Thanks to @Andreï-Kostyrka for two bytes.

```<code>max(which(c(0:9,letters)%in%strsplit(scan(,""),"")[[1]]))
</code>```

scan(,'') takes the input and coerces it to a string. Then strsplit divides it into its individual characters. [[1]] is because that returns a list. %in% then checks which of the vector 0,1,2,...,8,9,a,b,c,...,x,y,z is in the input. which tells us the place in that vector of items in the input -- and max finds the biggest place -- which corresponds to the base.

Title: What base is this number in?

Body:
R, 59 57 bytes

Thanks to @Andreï-Kostyrka for two bytes.

max(which(c(0:9,letters)%in%strsplit(scan(,""),"")[[1]]))

scan(,'') takes the input and coerces it to a string. Then strsplit divides it into its individual characters. [[1]] is because that returns a list. %in% then checks which of the vector 0,1,2,...,8,9,a,b,c,...,x,y,z is in the input. which tells us the place in that vector of items in the input -- and max finds the biggest place -- which corresponds to the base.


问:
The Great Pyramid of ASCII

Introduction

It's 2600 BC and people are building pyramids now. They already made the basis of the pyramid but don't know how to continue. So, they called you for help.

The rules of making a pyramid is quite simple. For the layer above the previous layer, all you need to do is follow this step-by-step hand guide:

Cut the edges off the previous layer.

Above the / character, there must be a \ character and vice versa. This applies to every character except the edges.

The leftmost character is always a / and the rightmost character is always \.

Let's take an example of a basis for a pyramid:

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

We cut off the edges, leaving:

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

We change the forward slashes with backward slashes and vice versa:

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

The leftmost character is always a / and the rightmost character is always a \, so we change that:

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

We place this layer on the previous layer:

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

We continue until the top is reached (which looks like /\). So, eventually we get:

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

This is what you need to output.

The task

Given the basis of a pyramid (with a length greater than 3), output the full pyramid. You can safely assume that the leftmost character is / and the rightmost character is a \. You can also assume that the length of the basis is always even. The use of trailing spaces is allowed. The use of leading spaces is also allowed, as long as the pyramid stays in place. The use of 1 trailing and 1 leading newlines is allowed.

Test cases

```<code>Input: /\\\
Output:
 /\
/\\\

Input: //\\///\/\
Output:
    /\
   /\\\
  /\///\
 ///\\\/\
//\\///\/\

Input: /////////////\
Output:
      /\
     /\\\
    /////\
   /\\\\\\\
  /////////\
 /\\\\\\\\\\\
/////////////\
</code>```

This is code-golf, so the submission with the least amount of bytes wins!

Title: The Great Pyramid of ASCII

Body:
Powershell, 142 bytes

function s($s){if($s.Trim()-eq'/\'){return $s}
$n=$s-replace'\\','#'-replace'/','\'-replace'#','/'-replace'\\.(.*)./',' /$1\'
(s($n))+"`n$s"
}


答:
Haskell, 68 bytes

```<code>p""=[]
p(_:b)|[(c,_:d)]<-reads b,[(e,f)]<-reads d=(c+0<$[1..e])++p f
</code>```

Usage example: p "F1W5F2W3" -> [1,1,1,1,1,2,2,2].

reads takes a string and reads something from the front of it and returns a singleton list with a pair of the something and the rest of the string. The type system knows from the usage c+0 and [1..e] that the somethings must be numbers, so reads consumes all digits from the beginning of the string. The _ in the patterns match the letters F and W that we don't need otherwise.

Title: Text animation format Code Golf

Body:
Working with old files from DOS, I found an ancient text animation format, that specify how much time each frame must be shown in the screen. It's very simple:

F1W5F2W3

This example above indicates that Frame 1 must be shown for 5 units of time, and frame 2 for 3 units more. Now I want to convert it to:

1, 1, 1, 1, 1, 2, 2, 2

In the converted example below, frame 1 is repeated 5 times, and frame 2 three times.

Rules: The only allowed letters are F and W (and the lowercase counterparts, f and w). Numbers can go up to 255. Total input String with no more than 255 chars.

Other examples:

Input: F10W3F11W3F10W3F12W3

Output: 10, 10, 10, 11, 11, 11, 10, 10, 10, 12, 12, 12

Input: f1w0f2w10

Output: 2, 2, 2, 2, 2, 2, 2, 2, 2, 2

Short code wins.

Edited - Accepted formats:
Any answer containing the output and ignoring spaces. Ex: 1, 1, 2, 2 or [1,1,2,2] or (1,1,2,2). But NOT 1 1 2 2 or [1; 1; 2; 2] or [1 1 2 2].

Body:
Haskell, 68 bytes

p""=[]
p(_:b)|[(c,_:d)]<-reads b,[(e,f)]<-reads d=(c+0<$[1..e])++p f

Usage example: p "F1W5F2W3" -> [1,1,1,1,1,2,2,2].

reads takes a string and reads something from the front of it and returns a singleton list with a pair of the something and the rest of the string. The type system knows from the usage c+0 and [1..e] that the somethings must be numbers, so reads consumes all digits from the beginning of the string. The _ in the patterns match the letters F and W that we don't need otherwise.


答:
JavaScript (Firefox 30-57), <s>88</s> 81 bytes

```<code>n=>[for(x of a=[...Array(++n+1).keys()])for(y of a)if(x+y<=n)[x/n,y/n,(n-x-y)/n]]
</code>```

Returns an array of arrays of floating-point numbers. Edit: Saved 7 bytes by computing the third coordinate directly. I tried eliminating the if by calculating the range of y directly but it cost an extra byte:

```<code>n=>[for(x of a=[...Array(++n+1).keys()])for(y of a.slice(x))[x/n,(y-x)/n,(n-y)/n]]
</code>```

Title: My triangle needs more nodes

Body:
JavaScript (Firefox 30-57), <s>88</s> 81 bytes

n=>[for(x of a=[...Array(++n+1).keys()])for(y of a)if(x+y<=n)[x/n,y/n,(n-x-y)/n]]

Returns an array of arrays of floating-point numbers. Edit: Saved 7 bytes by computing the third coordinate directly. I tried eliminating the if by calculating the range of y directly but it cost an extra byte:

n=>[for(x of a=[...Array(++n+1).keys()])for(y of a.slice(x))[x/n,(y-x)/n,(n-y)/n]]


问:
The Luhn algorithm for verifying credit card numbers, etc

Challenge

Write the shortest program or function to calculate the Luhn Algorithm for verifying (credit card) numbers.

Luhn algorithm explained

From RosettaCode, this algorithm for the purposes of this challenge is specified as such, with the example input of 49927398716:

```<code>Reverse the digits, make an array:
    6, 1, 7, 8, 9, 3, 7, 2, 9, 9, 4
Double the numbers in odd indexes:
    6, 2, 7, 16, 9, 6, 7, 4, 9, 18, 4
Sum the digits in each number:
    6, 2, 7, 7, 9, 6, 7, 4, 9, 9, 4
Sum all of the numbers:
    6 + 2 + 7 + 7 + 9 + 6 + 7 + 4 + 9 + 9 + 4 = 70
If the sum modulo 10 is 0, then the number is valid:
    70 % 10 = 0 => valid
</code>```

IO Rules

Input: A string or number (your choice), in your language's input/output format of choice

Output: A truthy or falsy value, respectively, indicating whether or not the input is valid according to the test above.

Notes / Tips

Try not to accidentally post your own credit card or account numbers, if you use them to test :)

If the input is invalid and impossible to process with the specified algorithm (i.e, too short to work with), you can do whatever you want, including blow up my computer.

However, the previous bullet does not mean that your language can do whatever it wants with Numbers that are too large for it to handle. If your language isn't capable of handling a test case, then consider taking a string as input.

Examples

The following examples were validated with this Python script; if you think one is wrong or have a question, just ping @cat.

```<code>49927398716      True
49927398717      False
1234567812345670 True
1234567812345678 False
79927398710      False
79927398711      False
79927398712      False
79927398713      True
79927398714      False
79927398715      False
79927398716      False
79927398717      False
79927398718      False
79927398719      False
374652346956782346957823694857692364857368475368 True
374652346956782346957823694857692364857387456834 False
8 False **
0 True  **
</code>```

** according to the Python implementation, but you may do anything because these are too short to be eligible by a strict adherence to the specification.

If any of the above invalidates existing answers (though I believe that should not be possible), then those answers are stil valid. However, new answers, in order to be valid, should follow the specification above.

Leaderboard

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

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

Leaderboard

	Author	Language	Size

Winners by Language

Language	User	Score

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

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

```

Body:
PowerShell 123

filter L($x){$l=$x.Length-1;$l..0|%{$d=$x[$_]-48;if($_%2-eq$l%2){$s+=$d}elseif($d-le4){$s+=$d*2}else{$s+=$d*2-9}};!($s%10)}

ContentLicense: CC BY-SA 2.5


答:
Powershell, 62 bytes

```<code>function t($s){(($s[0..$s.Length]|measure -Max).Maximum-8)%39}
</code>```

%39 @Dennis, of course :)

Title: What base is this number in?

Body:
Powershell, 62 bytes

function t($s){(($s[0..$s.Length]|measure -Max).Maximum-8)%39}

%39 @Dennis, of course :)


答:
Python 3, 106 bytes

```<code>def f(n):r=range(n+2);print([x for x in[[i/-~n,j/-~n,k/-~n]for i in r for j in r for k in r]if sum(x)==1])
</code>```

A function they takes input via argument and prints a list of lists of floats to STDOUT.

Python is not good at Cartesian products...

How it works

```<code>def f(n):                         Function with input iteration number n
r=range(n+2)                      Define r as the range [0, n+1]
for i in r for j in r for k in r  Length 3 Cartesian product of r
[i/-~n,j/-~n,k/-~n]               Divide each element of each list in the product
                                  by n+1
[x for x in ... if sum(x)==1]     Filter by summation to 1
print(...)                           Print to STDOUT
</code>```

Try it on Ideone

Title: My triangle needs more nodes

Body:
Consider the standard equilateral triangle, with nodes labeled using barycentric coordinates:

We can turn this 3 node triangle into a 6 node triangle by adding a new line of 3 vertices (one more than was present on a side of the original 3 node triangle), remove any internal edges (but not internal nodes) and re-normalize the coordinates:

Repeating the process to go from a 6 node triangle to a 10 node triangle, add a line of 4 vertices (again, one more than was present on a side of the original 6 node triangle), remove any internal edges (but not internal nodes) and re-normalize the coordinates:

This process can be repeated indefinitely. The goal of this challenge is given an integer N representing how many times this process has been performed, output all the nodes for the associated triangle in barycentric coordinates.

Input

Your program/function should take as input a single non-negative integer N representing how many times this process has been applied. Note that for N=0, you should output the original triangle with 3 nodes.

The input may come from any source (function parameter, stdio, etc.).

Output

Your program/function should output all the nodes in normalized barycentric coordinates. The order of the nodes does not matter.
A number can be specified as a fraction (fraction reduction not required) or a floating point number. You may also output "scaled" vectors to specify a node. For example, all 3 of the following outputs are equivalent and allowed:

```<code>0.5,0.5,0

1/2,2/4,0

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

If using floating point output, your output should be accurate to within 1%. The output may be to any sink desired (stdio, return value, return parameter, etc.). Note that even though the barycentric coordinates are uniquely determined by only 2 numbers per node, you should output all 3 numbers per node.

Examples

Example cases are formatted as:

```<code>N
x0,y0,z0
x1,y1,z1
x2,y2,z2
...
</code>```

where the first line is the input N, and all following lines form a node x,y,z which should be in the output exactly once. All numbers are given as approximate floating point numbers.

```<code>0
1,0,0
0,1,0
0,0,1

1
1,0,0
0,1,0
0,0,1
0.5,0,0.5
0.5,0.5,0
0,0.5,0.5

2
1,0,0
0,1,0
0,0,1
0.667,0,0.333
0.667,0.333,0
0.333,0,0.667
0.333,0.333,0.333
0.333,0.667,0
0,0.333,0.667
0,0.667,0.333

3
1,0,0
0.75,0,0.25
0.75,0.25,0
0.5,0,0.5
0.5,0.25,0.25
0.5,0.5,0
0.25,0,0.75
0.25,0.25,0.5
0.25,0.5,0.25
0.25,0.75,0
0,0,1
0,0.25,0.75
0,0.5,0.5
0,0.75,0.25
0,1,0
</code>```

Scoring

This is code golf; shortest code in bytes wins. Standard loopholes apply. You may use any built-ins desired.

Body:
Python 3, 106 bytes

def f(n):r=range(n+2);print([x for x in[[i/-~n,j/-~n,k/-~n]for i in r for j in r for k in r]if sum(x)==1])

A function they takes input via argument and prints a list of lists of floats to STDOUT.

Python is not good at Cartesian products...

How it works

def f(n):                         Function with input iteration number n
r=range(n+2)                      Define r as the range [0, n+1]
for i in r for j in r for k in r  Length 3 Cartesian product of r
[i/-~n,j/-~n,k/-~n]               Divide each element of each list in the product
                                  by n+1
[x for x in ... if sum(x)==1]     Filter by summation to 1
print(...)                           Print to STDOUT

Try it on Ideone


答:
Perl 6, 30 bytes

```<code>{m:g/\d+/.map:{|(+$^f xx$^w)}}
</code>```

Anonymous function (aka: lambda) which uses a regex match to pull out all the numbers.

I then map over this list, pulling out 2 items at a time using self-declared positional variables $^f and $^w. Self-declared positional variables are assigned alphabetically, so f and w works nicely.

The regex match actually produces a list of Match objects, so I use the + prefix operator to coerce f to an Int.

The map creates a list of f, w times. This would normally create a List-of-Lists, so I use the Slip prefix operator |. A Slip is a List sub-type that flattens into an outer list, ie. It slips a list into the surrounding list, so in the end we get a flat list.

Usage example: {m:g/\d+/.map:{|(+$^f xx $^w)}}('F1W5F2W3') returns (1, 1, 1, 1, 1, 2, 2, 2).

Here is the same function written as a full-blown named subroutine, with a more explicit definition.

sub f(Str $s) {
    ($s ~~ m:g/\d+/).map(-> $f, $w {
        slip( $f.Int xx $w )
    });
}
```

Title: Text animation format Code Golf

Body:
Perl 6, 30 bytes

{m:g/\d+/.map:{|(+$^f xx$^w)}}

Anonymous function (aka: lambda) which uses a regex match to pull out all the numbers.

I then map over this list, pulling out 2 items at a time using self-declared positional variables $^f and $^w. Self-declared positional variables are assigned alphabetically, so f and w works nicely.

The regex match actually produces a list of Match objects, so I use the + prefix operator to coerce f to an Int.

The map creates a list of f, w times. This would normally create a List-of-Lists, so I use the Slip prefix operator |. A Slip is a List sub-type that flattens into an outer list, ie. It slips a list into the surrounding list, so in the end we get a flat list.

Usage example: {m:g/\d+/.map:{|(+$^f xx $^w)}}('F1W5F2W3') returns (1, 1, 1, 1, 1, 2, 2, 2).

Here is the same function written as a full-blown named subroutine, with a more explicit definition.

sub f(Str $s) {
    ($s ~~ m:g/\d+/).map(-> $f, $w {
        slip( $f.Int xx $w )
    });
}


答:
C, 55 bytes

This answer assumes that the input is in ASCII (or identical in the numbers and letters, e.g. ISO-8859 or UTF-8):

```<code>m;f(char*s){for(m=0;*s;++s)m=m>*s?m:*s;return(m-8)%39;}
</code>```

We simply iterate along the string, remembering the largest value seen, then use the well-known modulo-39 conversion from base-{11..36}.

Test program

```<code>int printf(char*,...);
int main(int c,char **v){while(*++v)printf("%s -> ",*v),printf("%d\n",f(*v));}
</code>```

Test results

```<code>00000 -> 1
123456 -> 7
ff -> 16
4815162342 -> 9
42 -> 5
codegolf -> 25
0123456789abcdefghijklmnopqrstuvwxyz -> 36
</code>```

Title: What base is this number in?

Body:
Here's a nice easy challenge:

Given a string that represents a number in an unknown base, determine the lowest possible base that number might be in. The string will only contain 0-9, a-z. If you like, you may choose to take uppercase letters instead of lowercase, but please specify this. You must output this lowest possible base in decimal.

Here is a more concrete example. If the input string was "01234", it is impossible for this number to be in binary, since 2, 3, and 4 are all undefined in binary. Similarly, this number cannot be in base 3, or base 4. Therefore, this number must be in base-5, or a higher base, so you should output '5'.

Your code must work for any base between base 1 (unary, all '0's) and base 36 ('0-9' and 'a-z').

You may take input and provide output in any reasonable format. Base-conversion builtins are allowed. As usual, standard loopholes apply, and the shortest answer in bytes is the winner!

Test IO:

```<code>#Input          #Output
00000       --> 1
123456      --> 7
ff          --> 16
4815162342  --> 9
42          --> 5
codegolf    --> 25
0123456789abcdefghijklmnopqrstuvwxyz    --> 36
</code>```

Body:
C, 55 bytes

This answer assumes that the input is in ASCII (or identical in the numbers and letters, e.g. ISO-8859 or UTF-8):

m;f(char*s){for(m=0;*s;++s)m=m>*s?m:*s;return(m-8)%39;}

We simply iterate along the string, remembering the largest value seen, then use the well-known modulo-39 conversion from base-{11..36}.

Test program

int printf(char*,...);
int main(int c,char **v){while(*++v)printf("%s -> ",*v),printf("%d\n",f(*v));}

Test results

00000 -> 1
123456 -> 7
ff -> 16
4815162342 -> 9
42 -> 5
codegolf -> 25
0123456789abcdefghijklmnopqrstuvwxyz -> 36


Title: Alphabet triangle strikes again

Body:
Task

Your task is to print this exact text:

```<code>A
BCD
EFGHI
JKLMNOP
QRSTUVWXY
ZABCDEFGHIJ
KLMNOPQRSTUVW
XYZABCDEFGHIJKL
MNOPQRSTUVWXYZABC
DEFGHIJKLMNOPQRSTUV
WXYZABCDEFGHIJKLMNOPQ
RSTUVWXYZABCDEFGHIJKLMN
OPQRSTUVWXYZABCDEFGHIJKLM
NOPQRSTUVWXYZABCDEFGHIJKLMN
OPQRSTUVWXYZABCDEFGHIJKLMNOPQ
RSTUVWXYZABCDEFGHIJKLMNOPQRSTUV
WXYZABCDEFGHIJKLMNOPQRSTUVWXYZABC
DEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKL
MNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVW
XYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJ
KLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXY
ZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOP
QRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHI
JKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCD
EFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZA
BCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ
</code>```

Specs

You may do it in all-lowercase instead of all-uppercase.

Trailing newlines at the end of the triangle is allowed.

Trailing spaces after each line is allowed.

You must print to STDOUT instead of outputting an array of strings.

Scoring

This is code-golf. Program with lowest byte-count wins.

Body:
Perl 6: 51 bytes

say .join for (|("A".."Z")xx*).rotor(1,3...51)[^26]


问:
The Permutation Pigeon-hole Principle
In the game of sudoku, many players like to "pencil in" possible numbers that can go in each square:

The above row can be represented as an array:

```<code>[[1,2,9], [6], [5], [7], [1,2,9], [1,2,9], [3], [1,2,4], [8]]
</code>```

Now, notice that there is only 1 place where a 4 can go.  This effectively lets us simplify the above list to:

```<code>[[1,2,9], [6], [5], [7], [1,2,9], [1,2,9], [3], [4], [8]]
</code>```

The goal of this challenge is to take a list of possible numbers in a permutation, and deduce which possibilities can be eliminated.

As another example, lets say you have the following array of possibilities:

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

The last two places must be filled with 1 and 2.  Therefore, we can remove those possibilities from the first two elements in the array:

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

As another example:

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

Its impossible to construct a permutation from the above possibilities, as there's only 1 location for both 1 and 3, and you would want to return an empty array.

You need to input a list of possibilities and output the remaining possibilities after the maximum number of possibilities have been eliminated.

If a particular array is impossible, you either need to return an empty array, or an array where one of the subarrays is empty.

You may assume that the array will be well-formed, and have at least 1 element.

Given an array of size N, you can assume the numbers in the subarray will always be in the range [0:N), and that N <= 10

You may not assume that every number from 0 to N-1 will be present

You may assume that numbers within a single subarray are unique.

If a subarray contains only a single possibility, you can either represent the possibility in an array or by itself.  [[1],[2],[0]], [1,2,0], [[1,2],0,[1,2]] are all valid.

You may accept the array either in a reasonable string format or in list/array format.

Subarrays can be in any order.

Instead of dealing with ragged arrays, you can pad empty places with -1.

Test cases

```<code>[[0]]                                         -> [[0]]
[[1],[0]]                                     -> [[1],[0]]
[[1],[1]]                                     -> []
[[1],[0,1]]                                   -> [[1],[0]]
[[0,1,2],[1,2],[1,2]]                         -> [[0],[1,2],[1,2]]
[[0,1],[1,2],[0,2]]                           -> [[0,1],[1,2],[0,2]]
[[2,1],[1,2],[1,2]]                           -> []
[[0,3],[2,1],[3,0],[3,2]]                     -> [[0,3],[1],[0,3],[2]]
[[0,1],[0,1],[2,3],[2,3,0]]                   -> [[0,1],[0,1],[2,3],[2,3]]
[[0,1],[0,3],[3,2],[0]]                       -> [[1],[3],[2],[0]]
[[3,5,2],[0,2,4],[4,0],[0,1,3,5],[2,1],[2,4]] -> [[3,5],[0,2,4],[4,0],[3,5],[1],[2,4]]
[[6,9,8,4],[4,5],[5,3,6],[3,8,6,1,4],[3,1,9,6],[3,7,0,2,4,5],[9,5,6,8],[6,5,8,1,3,7],[8],[8,0,6,2,5,6,3]] -> [[6,9,4],[4,5],[5,3,6],[3,6,1,4],[3,1,9,6],[0,2],[9,5,6],[7],[8],[0,2]]
[[3,5,0],[5,7],[5,1,2],[1,3,0],[5,3],[5,0],[5,3,7,8,0,6],[7,5,0,1,8],[1,0,8],[0,6]] -> []
[[9,0,2,3,7],[0,7,6,5],[6,9,4,7],[9,1,2,3,0,5],[2,8,5,7,4,6],[6,5,7,1],[5,9,4],[5,9,3,8,1],[5,0,6,4],[0,7,2,1,3,4,8]] -> [[9,0,2,3,7],[0,7,6,5],[6,9,4,7],[9,1,2,3,0,5],[2,8,5,7,4,6],[6,5,7,1],[5,9,4],[5,9,3,8,1],[5,0,6,4],[0,7,2,1,3,4,8]]
[[2,6,0],[0,4,3],[0,6,2],[0,7],[0,9,2,3,6,1,4],[1,7,2],[2,7,8],[8,6,7],[6,5,2,8,0],[5,8,1,4]] -> [[2,6,0],[3],[0,6,2],[0,7],[9],[1],[2,7,8],[8,6,7],[5],[4]]
[[8],[8,0,6,5,7,2,4,1],[8,6,9,3,5,0,7],[3,9,1,0],[9],[9,2,6],[2,8,3],[3,1,6,8,2],[6],[6,4,5,3,0,7]] -> [[8],[5,7,4],[5,7],[0],[9],[2],[3],[1],[6],[4,5,7]]
[[8,1,0],[5,8,7,6,2,0],[6,8,2],[2,4,0,9],[4,1,7,3,6,8],[8,1],[8,0,3],[0,8,2],[0,8,3],[1,8,0]] -> []
</code>```

This is a code-golf so make your answers as short as possible!

答:
Brachylog, 21 bytes

```<code>:1fz:da|,[]
:2a#d
:Am
</code>```

Try it online!

Try it online!

Predicate 0 (main predicate)

```<code>:1fz:da|,[]
:1f            Find all solutions of Predicate 1 using Input as Input.
   z           Transpose
    :da        Deduplicate each.
       |,[]    If there is no solution, return [] instead.
</code>```

Predicate 1 (auxiliary predicate 1)

```<code>:2a#d
:2a     Each element of Output satisfies Predicate 2 with each element of Input as Input
   #d   Each element is different
</code>```

Predicate 2 (auxiliary predicate 2)

```<code>:Am     Output is member of Input
</code>```

Title: The Permutation Pigeon-hole Principle

Body:
Brachylog, 21 bytes

:1fz:da|,[]
:2a#d
:Am

Try it online!

Try it online!

Predicate 0 (main predicate)

:1fz:da|,[]
:1f            Find all solutions of Predicate 1 using Input as Input.
   z           Transpose
    :da        Deduplicate each.
       |,[]    If there is no solution, return [] instead.

Predicate 1 (auxiliary predicate 1)

:2a#d
:2a     Each element of Output satisfies Predicate 2 with each element of Input as Input
   #d   Each element is different

Predicate 2 (auxiliary predicate 2)

:Am     Output is member of Input


问:
The Alphabet Chromosome

Introduction

Alphabet challenges are in our DNA, so let's show it.

Challenge

Print the following the text exactly:

```<code>AaBbCc        cCbBaA
BbCcDd        dDcCbB
EeFfGg        gGfFeE
HhIiJj        jJiIhH
KkLlMm        mMlLkK
NnOoPp        pPoOnN
QqRrSs        sSrRqQ
TtUuVv        vVuUtT
   WwXx      xXwW
       Yy  yY
         ZZ
         zz
         ZZ
       Yy  yY
   WwXx      xXwW
TtUuVv        vVuUtT
QqRrSs        sSrRqQ
NnOoPp        pPoOnN
KkLlMm        mMlLkK
HhIiJj        jJiIhH
EeFfGg        gGfFeE
BbCcDd        dDcCbB
AaBbCc        cCbBaA
</code>```

Rules

You must match the case of each letter

Trailing and/or leading newlines and/or spaces are allowed

Winning

Shortest code in bytes wins.

答:
PowerShell v2+, <s>175</s> <s>169</s> <s>163</s> 154 bytes

($x=(-join(65..67+66..86|%{$_;32+$_}|%{[char]$_})-split'(.{6})'-ne'')+'   WwXx'+'       Yy'+(' '*9+'Z')|% *ht 10|%{$_+-join$_[9..0]})
' '*9+'zz'
$x[10..0]
```

<p>Try it online!</p>

<p>Abuses the fact that default <code>Write-Output</code> at the end of execution inserts a newline between elements.</p>

<p>The first line constructs the branches. We loop over two ranges corresponding to the ASCII values for the capital letters, each iteration output a <code>char</code> array of that letter and that letter <code>+32</code> (which is the lowercase ASCII point). That's <code>-join</code>ed together into one long string, then <code>-split</code> on every six elements (encapsulated in parens so they're preserved), followed by a <code>-ne''</code> to pull out the empty elements as a result of the split, thus forming an array of strings.</p>

<p>These strings in an array get array-concatenation to add on the <code>WwXx</code>, <code>Yy</code>, and <code>Z</code> elements, then a PadRig<code>ht 10</code> to make them all the appropriate width. At this point we have an array of strings like the following (one element per line).</p>

<pre class="lang-powershell prettyprint-override"><code>AaBbCc
BbCcDd
EeFfGg
HhIiJj
KkLlMm
NnOoPp
QqRrSs
TtUuVv
   WwXx
       Yy
         Z
</code>```

That whole array is piped to another loop to construct the mirrored strings with -join and array-reversing [9..0].

AaBbCc        cCbBaA
BbCcDd        dDcCbB
EeFfGg        gGfFeE
HhIiJj        jJiIhH
KkLlMm        mMlLkK
NnOoPp        pPoOnN
QqRrSs        sSrRqQ
TtUuVv        vVuUtT
   WwXx      xXwW
       Yy  yY
         ZZ
```

<p>We save the resulting strings into <code>$x</code> and enclose in parens to also place a copy on the pipeline.</p>

<p>The next line places the <code>zz</code> string on the pipeline, then the <code>$x</code> array in reverse order. All of those are left on the pipeline and output is implicit.</p>

<pre class="lang-powershell prettyprint-override"><code>PS C:\Tools\Scripts\golfing> .\alphabet-chromosome.ps1
AaBbCc        cCbBaA
BbCcDd        dDcCbB
EeFfGg        gGfFeE
HhIiJj        jJiIhH
KkLlMm        mMlLkK
NnOoPp        pPoOnN
QqRrSs        sSrRqQ
TtUuVv        vVuUtT
   WwXx      xXwW
       Yy  yY
         ZZ
         zz
         ZZ
       Yy  yY
   WwXx      xXwW
TtUuVv        vVuUtT
QqRrSs        sSrRqQ
NnOoPp        pPoOnN
KkLlMm        mMlLkK
HhIiJj        jJiIhH
EeFfGg        gGfFeE
BbCcDd        dDcCbB
AaBbCc        cCbBaA
</code>```

-9 bytes thanks to mazzy.

Title: The Alphabet Chromosome

Body:
PowerShell v2+, <s>175</s> <s>169</s> <s>163</s> 154 bytes

($x=(-join(65..67+66..86|%{$_;32+$_}|%{[char]$_})-split'(.{6})'-ne'')+'   WwXx'+'       Yy'+(' '*9+'Z')|% *ht 10|%{$_+-join$_[9..0]})
' '*9+'zz'
$x[10..0]

Try it online!

Abuses the fact that default Write-Output at the end of execution inserts a newline between elements.

The first line constructs the branches. We loop over two ranges corresponding to the ASCII values for the capital letters, each iteration output a char array of that letter and that letter +32 (which is the lowercase ASCII point). That's -joined together into one long string, then -split on every six elements (encapsulated in parens so they're preserved), followed by a -ne'' to pull out the empty elements as a result of the split, thus forming an array of strings.

These strings in an array get array-concatenation to add on the WwXx, Yy, and Z elements, then a PadRight 10 to make them all the appropriate width. At this point we have an array of strings like the following (one element per line).

AaBbCc
BbCcDd
EeFfGg
HhIiJj
KkLlMm
NnOoPp
QqRrSs
TtUuVv
   WwXx
       Yy
         Z

That whole array is piped to another loop to construct the mirrored strings with -join and array-reversing [9..0].

AaBbCc        cCbBaA
BbCcDd        dDcCbB
EeFfGg        gGfFeE
HhIiJj        jJiIhH
KkLlMm        mMlLkK
NnOoPp        pPoOnN
QqRrSs        sSrRqQ
TtUuVv        vVuUtT
   WwXx      xXwW
       Yy  yY
         ZZ

We save the resulting strings into $x and enclose in parens to also place a copy on the pipeline.

The next line places the zz string on the pipeline, then the $x array in reverse order. All of those are left on the pipeline and output is implicit.

PS C:\Tools\Scripts\golfing> .\alphabet-chromosome.ps1
AaBbCc        cCbBaA
BbCcDd        dDcCbB
EeFfGg        gGfFeE
HhIiJj        jJiIhH
KkLlMm        mMlLkK
NnOoPp        pPoOnN
QqRrSs        sSrRqQ
TtUuVv        vVuUtT
   WwXx      xXwW
       Yy  yY
         ZZ
         zz
         ZZ
       Yy  yY
   WwXx      xXwW
TtUuVv        vVuUtT
QqRrSs        sSrRqQ
NnOoPp        pPoOnN
KkLlMm        mMlLkK
HhIiJj        jJiIhH
EeFfGg        gGfFeE
BbCcDd        dDcCbB
AaBbCc        cCbBaA

-9 bytes thanks to mazzy.

ContentLicense: CC BY-SA 4.0


答:
UNBABTIZED, 18 bytes

```<code>!0,88.(°0,23.:°0
</code>```

!0,88. put 88 in cell 0

(°0.23. subtract 23 from cell 0

:°0 print cell 0 as character

Title: The Letter A without A

Body:
Your task is to display the letter "A" alone, without anything else, except any form of trailing newlines if you cannot avoid them, doing so in a program and/or snippet. Code that returns (instead of printing) is allowed.

Both the lowercase and uppercase versions of the letter "A" are acceptable (that is, unicode U+0061 or unicode U+0041. Other character encodings that aren't Unicode are allowed, but either way, the resulting output of your code must be the latin letter "A", and not any lookalikes or homoglyphs)

You must not use any of the below characters in your code, regardless of the character encoding that you pick:

"A", whether uppercase or lowercase.

"U", whether lowercase or uppercase.

X, whether uppercase or lowercase.

+

&

#

0

1

4

5

6

7

9

Cheating, loopholes, etc, are not allowed.

Since this is code-golf, the shortest solution, in bytes, that follows all the rules, is the winner.

Validity Checker

This Stack Snippet checks to make sure your code doesn't use the restricted characters. It might not work properly for some character encodings.

var t = prompt("Input your code.");

if (/[AaUuXx+&#0145679]/.test(t)) {
  alert("Contains a disallowed character!");
} else {
  alert("No disallowed characters");
}```
</div>
</div>
</p>

<p><em>This Stack Snippet that makes sure you don't have a disallowed character is also available on JSFiddle.</em></p>

<h3>Leaderboard</h3>

<p><div class="snippet" data-lang="js" data-hide="true" data-console="false" data-babel="false">
<div class="snippet-code snippet-currently-hidden">
<pre class="snippet-code-js lang-js prettyprint-override"><code>var QUESTION_ID=90349,OVERRIDE_USER=58717;function answersUrl(e){return"https://api.stackexchange.com/2.2/questions/"+QUESTION_ID+"/answers?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+ANSWER_FILTER}function commentUrl(e,s){return"https://api.stackexchange.com/2.2/answers/"+s.join(";")+"/comments?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+COMMENT_FILTER}function getAnswers(){jQuery.ajax({url:answersUrl(answer_page++),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){answers.push.apply(answers,e.items),answers_hash=[],answer_ids=[],e.items.forEach(function(e){e.comments=[];var s=+e.share_link.match(/\d+/);answer_ids.push(s),answers_hash[s]=e}),e.has_more||(more_answers=!1),comment_page=1,getComments()}})}function getComments(){jQuery.ajax({url:commentUrl(comment_page++,answer_ids),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){e.items.forEach(function(e){e.owner.user_id===OVERRIDE_USER&&answers_hash[e.post_id].comments.push(e)}),e.has_more?getComments():more_answers?getAnswers():process()}})}function getAuthorName(e){return e.owner.display_name}function process(){var e=[];answers.forEach(function(s){var r=s.body;s.comments.forEach(function(e){OVERRIDE_REG.test(e.body)&&(r="<h1>"+e.body.replace(OVERRIDE_REG,"")+"</h1>")});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;/<a/.test(o)&&(o=jQuery(o).text()),s[o]=s[o]||{lang:e.language,user:e.user,size:e.size,link:e.link}});var t=[];for(var o in s)s.hasOwnProperty(o)&&t.push(s[o]);t.sort(function(e,s){return e.lang>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;</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}```
<pre class="snippet-code-html lang-html prettyprint-override"><code><script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <link rel="stylesheet" type="text/css" href="//cdn.sstatic.net/codegolf/all.css?v=83c949450c8b"> <div id="answer-list"> <h2>Leaderboard</h2> <table class="answer-list"> <thead> <tr><td></td><td>Author</td><td>Language</td><td>Size</td></tr></thead> <tbody id="answers"> </tbody> </table> </div><div id="language-list"> <h2>Winners by Language</h2> <table class="language-list"> <thead> <tr><td>Language</td><td>User</td><td>Score</td></tr></thead> <tbody id="languages"> </tbody> </table> </div><table style="display: none"> <tbody id="answer-template"> <tr><td>{{PLACE}}</td><td>{{NAME}}</td><td>{{LANGUAGE}}</td><td>{{SIZE}}</td><td>Link</td></tr></tbody> </table> <table style="display: none"> <tbody id="language-template"> <tr><td>{{LANGUAGE}}</td><td>{{NAME}}</td><td>{{SIZE}}</td><td>Link</td></tr></tbody> </table></code>```

Body:
UNBABTIZED, 18 bytes

!0,88.(°0,23.:°0

!0,88. put 88 in cell 0

(°0.23. subtract 23 from cell 0

:°0 print cell 0 as character


答:
Whitespace, 15 bytes

It's easy to avoid characters with a language that doesn't use any of them!

Try it online!

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

The .'s are unneccessary, and are just to make the codeblock work.

For a more readable format: s = space, t = tab, newline placement matters

```<code>ssstssssst
t
ss
</code>```

First line pushes (ss) positive (s) 65 (tssssst, binary 1000001) onto the stack)

Second and third lines print top of stack as char.

Title: The Letter A without A

Body:
Whitespace, 15 bytes

It's easy to avoid characters with a language that doesn't use any of them!

Try it online!

.
.
.

The .'s are unneccessary, and are just to make the codeblock work.

For a more readable format: s = space, t = tab, newline placement matters

ssstssssst
t
ss

First line pushes (ss) positive (s) 65 (tssssst, binary 1000001) onto the stack)

Second and third lines print top of stack as char.


问:
Calculate e^x and ln(x)
Given a floating point x (x<100), return e^x and ln(x). The first 6 decimal places of the number have to be right, but any others after do not have to be correct.

You cannot have any "magic" constants explicitly stated (e.x. a=1.35914 since 1.35914*2 ~= e), but you can calculate them. Only use +, -, *, and / for arithmetic operators.

If x is less than or equal to 0, output ERROR instead of the intended value of ln(x).

Test Cases:

```<code>input: 2
output: 7.389056 0.693147
input: 0.25
output: 1.284025 -1.386294
input: 2.718281828
output: 15.154262 0.999999  (for this to output correctly, don't round to 6 places)
input: -0.1
output: 0.904837 ERROR
</code>```

Shortest code wins.

答:
Python 2 (168 char)

basic implementation of power series

I need to learn a golfing language =/

I increased the bound to 1e-14 (twice from 1e-7) since some values were off a bit in 6 decimal places, works well for input from 1e-5 to 100 (slows down at input approaches 0)

```<code>x=input();t,r,i=1,0,1.
while abs(t)>=1e-14:t,r,i=t*x/i,r+t,i+1
if x<=0:s='Error'
else:z=(x-1.)/(x+1);t,s,i=2*z,0,1
while abs(t/i)>=1e-14:t,s,i=t*z*z,s+t/i,i+2
print r,s
</code>```

Title: Calculate e^x and ln(x)

Body:
Python 2 (168 char)

basic implementation of power series

I need to learn a golfing language =/

I increased the bound to 1e-14 (twice from 1e-7) since some values were off a bit in 6 decimal places, works well for input from 1e-5 to 100 (slows down at input approaches 0)

x=input();t,r,i=1,0,1.
while abs(t)>=1e-14:t,r,i=t*x/i,r+t,i+1
if x<=0:s='Error'
else:z=(x-1.)/(x+1);t,s,i=2*z,0,1
while abs(t/i)>=1e-14:t,s,i=t*z*z,s+t/i,i+2
print r,s


答:
Perl 6: 50 bytes

Regex based solution:

```<code>.put for (("A".."Z").join x 26)~~m:g/.**{1+2*$++}/
</code>```

Title: Alphabet triangle strikes again

Body:
Perl 6: 50 bytes

Regex based solution:

.put for (("A".."Z").join x 26)~~m:g/.**{1+2*$++}/