问:
Esolang-Comment-Template-Generator
Lots of people on this site use esoteric languages, and since these languages are unusual and hard to understand, they will frequently write an explanation in a certain format. For example, if the code was

```<code>abcdefghijklmnop
</code>```

And this languages uses # for comments, they would write an explanation like this:

```<code>a                #Explanation of what 'a' does
 bc              #Bc
   d             #d
    e            #Explanation of e
     fgh         #foobar
        ij       #hello world
          k      #etc.
           l     #so on
            mn   #and
              op #so forth
</code>```

I frequently do this too, but every time I do this, I feel like creating the layout of text is really obnoxious and time-consuming. So I want you to create a "Esolang-Comment-Template-Generator" for me. For example, if we ignore the comments, the previous code has this template:

```<code>a                #
 bc              #
   d             #
    e            #
     fgh         #
        ij       #
          k      #
           l     #
            mn   #
              op #
</code>```

The Challenge:

You must write a program or function that takes two strings as input, and outputs this "Esolang-Comment-Template". The first input will be the code, but with bars (|) inserted where the newlines go. The second input is what we will use for comments. So our last example would have this for input:

```<code>"a|bc|d|e|fgh|ij|k|l|mn|op", "#"
</code>```

Unfortunately this excludes bars from being part of the code input, but that's OK. You can assume that the comment input will be a single character. For simplicity's sake, the comment char will not be a bar. The code input will only contain printable ASCII, and it will not contain any newlines.

Hopefully you can infer what to do from the testcases, but I'll try to clarify some things.

You must split the code input up into "code-sections" on every bar. Then, each section of code is output on its own line and left-padded with the length of all the previous code (not including the bars). Then, each line is right-padded with enough spaces so that the last two characters on every line are "One additional space" + "The comment character".

One trailing newline is allowed.

Here is another example. For the input

```<code>"Hello|World", "/"
</code>```

The first section of code is "Hello" and the second is "World". So it should give the output:

```<code>Hello      /
     World /
</code>```

Here are some more samples:

```<code>Input:
"a|b|c|d|e|f|g", ","

Output:
a       ,
 b      ,
  c     ,
   d    ,
    e   ,
     f  ,
      g ,

Input:
"abcdefg", ":"

Output:
abcdefg :

Input:
"4|8|15|16|23|42", "%"

Output:
4          %
 8         %
  15       %
    16     %
      23   %
        42 %

Input:
"E|ac|h s|ecti|on is| one c|haracte|r longer| than the| last!", "!"

Output:
E                                                   !
 ac                                                 !
   h s                                              !
      ecti                                          !
          on is                                     !
                one c                               !
                     haracte                        !
                            r longer                !
                                     than the       !
                                              last! !

Input:
"This|Code|has||empty||sections", "@"

Output:
This                     @
    Code                 @
        has              @
                         @
           empty         @
                         @
                sections @
</code>```

Rules:

You may take these inputs and outputs in any reasonable format. For example, reading/writing a file, STDIN/STOUT, function arguments/return value, etc. As usual, this is code-golf, so try to make your code as short as possible and you win if you can get the shortest solution in your language! I will also select the shortest solution as the overall winner. Standard loopholes are banned.

答:
Python 2, <s>125 124</s> 132 bytes

-1 byte thanks to @TuukkaX (missed golfing the space from i, v)

def g(s,c):x=s.split('|');print((' '+c+'\n').join(' '*len(''.join(x[:i]))+v+' '*len(''.join(x[i+1:]))for i,v in enumerate(x))+' '+c)
```

All test cases on ideone

Title: Esolang-Comment-Template-Generator

Body:
Python 2, <s>125 124</s> 132 bytes

-1 byte thanks to @TuukkaX (missed golfing the space from i, v)

def g(s,c):x=s.split('|');print((' '+c+'\n').join(' '*len(''.join(x[:i]))+v+' '*len(''.join(x[i+1:]))for i,v in enumerate(x))+' '+c)

All test cases on ideone


问:
Emulate a 7-segment display

Task

The task is to display any of the 128 possible states of a
7-segment display.

Your program should accept a string of 7 characters ("bits") that are either 0 or 1.
First bit of input corresponds to segment A of the following illustration, the
second to B, etc (ignore dp):

How you represent the display is up to you -- a single Unicode or ASCII symbol,
ASCII art, grafically, or whatever you can come up with. However, each
input must have it's own distinct output. If you come up with something fancy I'm sure you can harvest upvotes by showing off some examples.

All 128 possible states of the display are:

Rules

Codegolf

As I said, any kind of output is allowed, but it would be nice if you specified it.

Input can be stdin or command line argument.

Examples

Input

```<code>1101101
</code>```

Output

As ASCII/Unicode:

```<code>2
</code>```

Different kinds of ASCII art (I'm not too good at this)

```<code> _   ╺┓  ╒╗   ---
 _|  ┏┛  ╔╝     |
|_   ┗╸  ╚╛   ---
              |
              ---
</code>```

答:
Postscript 121 107

```<code>1 12 moveto{}5 0{0 -5 rmoveto}0 5 0 5 -5 0 0 -5 0 -5 5 0
n{49 eq{rlineto}{rmoveto}ifelse exec}forall stroke
</code>```

requires n to be defined as the string to process so invoke like

```<code>gs -g7x14 -sn=1101101 lcd.ps
</code>```

to get

the complete set is

ContentLicense: CC BY-SA 3.0

Title: Emulate a 7-segment display

Body:
Postscript 121 107

1 12 moveto{}5 0{0 -5 rmoveto}0 5 0 5 -5 0 0 -5 0 -5 5 0
n{49 eq{rlineto}{rmoveto}ifelse exec}forall stroke

requires n to be defined as the string to process so invoke like

gs -g7x14 -sn=1101101 lcd.ps

to get

the complete set is


问:
Bubble sorting in progress
Create a function or program that takes two inputs:

A list of integers that shall be sorted (less than 20 elements)

A positive integer, N, saying how many comparisons you should take

The function shall stop, and output the resulting list of integers after N comparisons. If the list is fully sorted before N comparisons are made, then the sorted list should be outputted.

The Bubble sort algorithm is well known, and I guess most people know it. The following Pseudo-code and animation (both from the linked Wikipedia-article) should provide the necessary details:

```<code>procedure bubbleSort( A : list of sortable items )
   n = length(A)
   repeat
     swapped = false
     for i = 1 to n-1 inclusive do
       /* if this pair is out of order */
       if A[i-1] > A[i] then
         /* swap them and remember something changed */
         swap( A[i-1], A[i] )
         swapped = true
       end if
     end for
   until not swapped
end procedure
</code>```

The animation below shows the progress:

An example (taken directly from the linked Wikipedia article) shows the steps when sorting the list: ( 5 1 4 2 8 ):

First Pass

```<code>1: ( 5 1 4 2 8 ) ->  ( 1 5 4 2 8 ) // Here, algorithm compares the first two elements,
                                   // and swaps since 5 > 1.
2: ( 1 5 4 2 8 ) ->  ( 1 4 5 2 8 ) // Swap since 5 > 4
3: ( 1 4 5 2 8 ) ->  ( 1 4 2 5 8 ) // Swap since 5 > 2
4: ( 1 4 2 5 8 ) ->  ( 1 4 2 5 8 ) // Now, since these elements are already in order
                                   // (8 > 5), algorithm does not swap them.
</code>```

Second Pass

```<code>5: ( 1 4 2 5 8 ) ->  ( 1 4 2 5 8 )
6: ( 1 4 2 5 8 ) ->  ( 1 2 4 5 8 ) // Swap since 4 > 2
7: ( 1 2 4 5 8 ) ->  ( 1 2 4 5 8 )
8: ( 1 2 4 5 8 ) ->  ( 1 2 4 5 8 )
</code>```

Now, the array is already sorted, but the algorithm does not know if it is completed. The algorithm needs one whole pass without any swap to know it is sorted.

Third Pass

```<code>9: ( 1 2 4 5 8 ) ->  ( 1 2 4 5 8 )
10:( 1 2 4 5 8 ) ->  ( 1 2 4 5 8 )
11:( 1 2 4 5 8 ) ->  ( 1 2 4 5 8 )
12:( 1 2 4 5 8 ) ->  ( 1 2 4 5 8 )
</code>```

Test cases:

Format: Number of comparisons (N): List after N comparisons

```<code>Input list:
5  1  4  2  8
Test cases:
1: 1  5  4  2  8
2: 1  4  5  2  8
3: 1  4  2  5  8
4: 1  4  2  5  8
5: 1  4  2  5  8
6: 1  2  4  5  8
10: 1  2  4  5  8
14: 1  2  4  5  8

Input list:
0: 15  18  -6  18   9  -7  -1   7  19  19  -5  20  19   5  15  -5   3  18  14  19
Test cases:
1: 15  18  -6  18   9  -7  -1   7  19  19  -5  20  19   5  15  -5   3  18  14  19
21: -6  15  18   9  -7  -1   7  18  19  -5  19  19   5  15  -5   3  18  14  19  20
41: -6   9  -7  15  -1   7  18  18  -5  19  19   5  15  -5   3  18  14  19  19  20
60: -6  -7  -1   9   7  15  18  -5  18  19   5  15  -5   3  18  14  19  19  19  20
61: -6  -7  -1   7   9  15  18  -5  18  19   5  15  -5   3  18  14  19  19  19  20
81: -7  -6  -1   7   9  15  -5  18  18   5  15  -5   3  18  14  19  19  19  19  20
119: -7  -6  -1  -5   7   9  15   5  15  -5   3  18  14  18  18  19  19  19  19  20
120: -7  -6  -1  -5   7   9  15   5  15  -5   3  18  14  18  18  19  19  19  19  20
121: -7  -6  -1  -5   7   9   5  15  15  -5   3  18  14  18  18  19  19  19  19  20
122: -7  -6  -1  -5   7   9   5  15  15  -5   3  18  14  18  18  19  19  19  19  20
123: -7  -6  -1  -5   7   9   5  15  -5  15   3  18  14  18  18  19  19  19  19  20
201: -7  -6  -5  -1  -5   3   5   7   9  14  15  15  18  18  18  19  19  19  19  20
221: -7  -6  -5  -5  -1   3   5   7   9  14  15  15  18  18  18  19  19  19  19  20
</code>```

Yes, built-in Bubble sort algorithms are permitted.

No, you can not assume only positive integers, or unique integers.

The sorting must be in the order described above. You can't start at the end of the list

答:
Matlab, <s>93</s> 91 bytes

```<code>function l=f(l,m)
n=numel(l)-1;i=0;while n&m;i=mod(i,n)+1;m=m-1;l(i:i+1)=sort(l(i:i+1));end
</code>```

Saves 11 bytes by omitting if l(i)>l(i+1);l(i:i+1)=l([i+1,i]), and instead just sort the two elements every time. Works for lists of length 1. Could save a byte or two using Octave's m-- operator, but that's not much.

Saves two more bytes by setting n=numel(l)-1;, because then I can just do while n instead of while n>1, and i=mod(i,n)+1 instead of i=mod(i,n-1)+1.

For the record, this answer was written many hours after the challenge was created.

Title: Bubble sorting in progress

Body:
Matlab, <s>93</s> 91 bytes

function l=f(l,m)
n=numel(l)-1;i=0;while n&m;i=mod(i,n)+1;m=m-1;l(i:i+1)=sort(l(i:i+1));end

Saves 11 bytes by omitting if l(i)>l(i+1);l(i:i+1)=l([i+1,i]), and instead just sort the two elements every time. Works for lists of length 1. Could save a byte or two using Octave's m-- operator, but that's not much.

Saves two more bytes by setting n=numel(l)-1;, because then I can just do while n instead of while n>1, and i=mod(i,n)+1 instead of i=mod(i,n-1)+1.

For the record, this answer was written many hours after the challenge was created.


问:
Can you outgolf me? (Cops section)

Cops section

The robbers section can be found here.

Thanks to FryAmTheEggman, Peter Taylor, Nathan Merrill, xnor, Dennis, Laikoni and Mego for their contributions.

Challenge

Your task is to write 2 different programs (full programs/functions/etc.) in the same language and the same version (e.g. Python 3.5 ≠ Python 3.4, so that is not allowed), and when given n (using STDIN/function arguments/etc.), compute a(n) where a is an OEIS sequence of your choice. One of those programs is shorter than the other. You only need to submit the longer program of the two. The other one needs to be saved in case of not being cracked after 7 days. Your submission is cracked when your program has been outgolfed (whether it is by 1 byte or more).

For example, if the task you chose was to perform 2 × n, this could be a valid submission (in Python 2):

Python 2, 16 bytes, score = 15 / 16 = 0.9375

```<code>print(2*input())
</code>```

Computes A005843, (offset = 0).

If your submission has been cracked, then you need to state that in your header like so:

Python 2, 16 bytes, score = 15 / 16 = 0.9375, [cracked] + link

```<code>print(2*input())
</code>```

Computes A005843, (offset = 0).

Offset

This can be found on every OEIS page. For example, for A005843, the offset is 0,2. We only need to use the first one, which is 0. This means that the function is defined for all numbers ≥ 0.

In other words, the function OEIS(n) starts with n = 0. Your program needs to work for all cases given by OEIS.

More information can be found here.

Scoring

The score you get for your submission is equal to the following formula:

Score = Length (in bytes) of secret code ÷ Length (in bytes) of public code

The example above has the score 15 ÷ 16 = 0.9375.

The submission with the lowest score wins. Only submissions that have posted their solution will be eligible for winning.

Rules

The task you need to do is an OEIS sequence of your choice.

Given n, output OEIS(n). Deviation is not allowed, so you need to produce the exact same sequence (when given n, you need to output OEIS(n)).

Submissions that are not cracked within a period of 7 days are considered safe after the solution has been posted (submissions older than 7 days that do not have their solution posted are still vulnerable in being cracked).

In your submission, you need to post the following things: language name, byte count, full code, so no pastebin links etc. (to prevent answers like Unary), OEIS sequence, score with lengths of both programs and additionally, the encoding that is used.

Note: the same sequence cannot be posted twice in the same language. (For example, if the sequence A005843 has been done in Pyth, you cannot use Pyth again for that same sequence.)

Input and output are both in decimal (base 10)

Leaderboard

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

Uncracked submissions

 Language	 Score	 User

Sort by: score creation

Safe submissions

 Language	 Score	 User

```

Note

This challenge is finished. The final winner is feersum with his Seed answer. Congratulations! :).

You can still submit new cops, but be aware that they are no longer competing.

Title: Can you outgolf me? (Cops section)

Body:
J, 12 bytes, score = 0.9167 (11/12) (cracked)

(#++/)@I.@#:

Computes A230877.


ContentLicense: CC BY-SA 4.0

Title: Esolang-Comment-Template-Generator

Body:
Lots of people on this site use esoteric languages, and since these languages are unusual and hard to understand, they will frequently write an explanation in a certain format. For example, if the code was

```<code>abcdefghijklmnop
</code>```

And this languages uses # for comments, they would write an explanation like this:

```<code>a                #Explanation of what 'a' does
 bc              #Bc
   d             #d
    e            #Explanation of e
     fgh         #foobar
        ij       #hello world
          k      #etc.
           l     #so on
            mn   #and
              op #so forth
</code>```

I frequently do this too, but every time I do this, I feel like creating the layout of text is really obnoxious and time-consuming. So I want you to create a "Esolang-Comment-Template-Generator" for me. For example, if we ignore the comments, the previous code has this template:

```<code>a                #
 bc              #
   d             #
    e            #
     fgh         #
        ij       #
          k      #
           l     #
            mn   #
              op #
</code>```

The Challenge:

You must write a program or function that takes two strings as input, and outputs this "Esolang-Comment-Template". The first input will be the code, but with bars (|) inserted where the newlines go. The second input is what we will use for comments. So our last example would have this for input:

```<code>"a|bc|d|e|fgh|ij|k|l|mn|op", "#"
</code>```

Unfortunately this excludes bars from being part of the code input, but that's OK. You can assume that the comment input will be a single character. For simplicity's sake, the comment char will not be a bar. The code input will only contain printable ASCII, and it will not contain any newlines.

Hopefully you can infer what to do from the testcases, but I'll try to clarify some things.

You must split the code input up into "code-sections" on every bar. Then, each section of code is output on its own line and left-padded with the length of all the previous code (not including the bars). Then, each line is right-padded with enough spaces so that the last two characters on every line are "One additional space" + "The comment character".

One trailing newline is allowed.

Here is another example. For the input

```<code>"Hello|World", "/"
</code>```

The first section of code is "Hello" and the second is "World". So it should give the output:

```<code>Hello      /
     World /
</code>```

Here are some more samples:

```<code>Input:
"a|b|c|d|e|f|g", ","

Output:
a       ,
 b      ,
  c     ,
   d    ,
    e   ,
     f  ,
      g ,

Input:
"abcdefg", ":"

Output:
abcdefg :

Input:
"4|8|15|16|23|42", "%"

Output:
4          %
 8         %
  15       %
    16     %
      23   %
        42 %

Input:
"E|ac|h s|ecti|on is| one c|haracte|r longer| than the| last!", "!"

Output:
E                                                   !
 ac                                                 !
   h s                                              !
      ecti                                          !
          on is                                     !
                one c                               !
                     haracte                        !
                            r longer                !
                                     than the       !
                                              last! !

Input:
"This|Code|has||empty||sections", "@"

Output:
This                     @
    Code                 @
        has              @
                         @
           empty         @
                         @
                sections @
</code>```

Rules:

You may take these inputs and outputs in any reasonable format. For example, reading/writing a file, STDIN/STOUT, function arguments/return value, etc. As usual, this is code-golf, so try to make your code as short as possible and you win if you can get the shortest solution in your language! I will also select the shortest solution as the overall winner. Standard loopholes are banned.

Body:
Ruby, <s>96</s> 80 bytes

->s,c{s.gsub(/(^|\|)([^|]*)/){" "*$`.count(t="^|")+$2+" "*(1+$'.count(t))+c+$/}}

See it on eval.in: https://eval.in/639012

I really ought to just learn Retina.


答:
Java 10, <s>189</s> 159 bytes

s->c->{var r="";int p=0,i;for(var a:s.split("\\|")){for(i=p;i-->0;r+=" ");r+=a;for(p+=a.length();i++<s.replace("|","").length()-p;r+=" ");r+=c+"\n";}return r;}
```
<p>-30 bytes converting Java 7 to Java 10 and optimizing the loops.</p>
<p>Try it online.</p>
<p><strong>Explanation:</strong></p>
<pre class="lang-java prettyprint-override"><code>s->c->{                     // Method with String & char parameters and String return-type
  var r="";                 //  Result-String, starting empty
  int p=0,                  //  Position-integer, starting at 0
      i;                    //  Index integer
  for(var a:s.split("\\|")){//  Loop over the parts split by "|"
    for(i=p;i-->0;r+=" ");  //   Add `p` amount of spaces to the result-String
    r+=a;                   //   Add the current part to the result-String
    for(p+=a.length();      //   Add the length of the current part to the position-integer
        i++<s.replace("|","").length()-p;r+=" ");
                            //   Add the row's trailing spaces to the result-String
    r+=c+"\n";}             //   Add the character and a new-line to the result-String
  return r;}                //  Return the result-String
</code>```

Title: Esolang-Comment-Template-Generator

Body:
Java 10, <s>189</s> 159 bytes

s->c->{var r="";int p=0,i;for(var a:s.split("\\|")){for(i=p;i-->0;r+=" ");r+=a;for(p+=a.length();i++<s.replace("|","").length()-p;r+=" ");r+=c+"\n";}return r;}

-30 bytes converting Java 7 to Java 10 and optimizing the loops.

<a href="https://tio.run/##jZLBbtswDIbveQpWw1AbsbW264ahqo0BxYZdduqAHpYdFFm2lSqSIMkBgjDPnilNUPe0@SIJJL@f1A@u@IaXq@b5IDQPAX5yZXYzgBB5VAJWKUuHqDRtByOisoZ@Pz/uH6NXpiv@WfPQc89FlL6AU3ldQwvVIZS1KOvdhnvwFSFMmQiuuioUa63PjmF@F2hwWsWMLBZI8nx3zKjKMVWW9RXz84oAyY83f4FcelAtTRf7LGdqPr8P1EunuZAZQVIQkr@mS/eWF3OyMITtvYyDN@DZ/sBmyQM3LHXy4GzFxqoG1sme7PST33@A50erAB63Ico1tUOkLqWiNllLuXN6mxGOS4ENSmy7HtUKn1Hj2qB1aZxTyeW7yzxn/xX6IbW2@GS9bkb0wyQ0zYDnIbAb4WIavBSNbN9gd5OwW/yC15/w@jPefMTbmxF/Pwn/hlxgDwFlWiS0BlRAsEZCip5WCj1oazrpEWLPTTokQtrheDH2upjU61efxB9sI5N0QJRrF7eIQb6scBjVvp7V9rP94S8" rel="noreferrer">Try it online.

Explanation:

s->c->{                     // Method with String & char parameters and String return-type
  var r="";                 //  Result-String, starting empty
  int p=0,                  //  Position-integer, starting at 0
      i;                    //  Index integer
  for(var a:s.split("\\|")){//  Loop over the parts split by "|"
    for(i=p;i-->0;r+=" ");  //   Add `p` amount of spaces to the result-String
    r+=a;                   //   Add the current part to the result-String
    for(p+=a.length();      //   Add the length of the current part to the position-integer
        i++<s.replace("|","").length()-p;r+=" ");
                            //   Add the row's trailing spaces to the result-String
    r+=c+"\n";}             //   Add the character and a new-line to the result-String
  return r;}                //  Return the result-String


答:
JavaScript (ES6), <s>82</s> <s>80</s> 79 bytes

```<code>f=(a,m,n=0,_,b=a[n+1])=>1/b?m?f(a,m-1,n+1,a[n]>b?a[a[n+1]=a[n],n]=b:0):a:f(a,m)
</code>```

Based on @ETHproduction's original answer. Edit: Saved 2 bytes thanks to @JonathanAllan. Saved 1 byte thanks to @edc65.

Title: Bubble sorting in progress

Body:
Create a function or program that takes two inputs:

A list of integers that shall be sorted (less than 20 elements)

A positive integer, N, saying how many comparisons you should take

The function shall stop, and output the resulting list of integers after N comparisons. If the list is fully sorted before N comparisons are made, then the sorted list should be outputted.

The Bubble sort algorithm is well known, and I guess most people know it. The following Pseudo-code and animation (both from the linked Wikipedia-article) should provide the necessary details:

```<code>procedure bubbleSort( A : list of sortable items )
   n = length(A)
   repeat
     swapped = false
     for i = 1 to n-1 inclusive do
       /* if this pair is out of order */
       if A[i-1] > A[i] then
         /* swap them and remember something changed */
         swap( A[i-1], A[i] )
         swapped = true
       end if
     end for
   until not swapped
end procedure
</code>```

The animation below shows the progress:

An example (taken directly from the linked Wikipedia article) shows the steps when sorting the list: ( 5 1 4 2 8 ):

First Pass

```<code>1: ( 5 1 4 2 8 ) ->  ( 1 5 4 2 8 ) // Here, algorithm compares the first two elements,
                                   // and swaps since 5 > 1.
2: ( 1 5 4 2 8 ) ->  ( 1 4 5 2 8 ) // Swap since 5 > 4
3: ( 1 4 5 2 8 ) ->  ( 1 4 2 5 8 ) // Swap since 5 > 2
4: ( 1 4 2 5 8 ) ->  ( 1 4 2 5 8 ) // Now, since these elements are already in order
                                   // (8 > 5), algorithm does not swap them.
</code>```

Second Pass

```<code>5: ( 1 4 2 5 8 ) ->  ( 1 4 2 5 8 )
6: ( 1 4 2 5 8 ) ->  ( 1 2 4 5 8 ) // Swap since 4 > 2
7: ( 1 2 4 5 8 ) ->  ( 1 2 4 5 8 )
8: ( 1 2 4 5 8 ) ->  ( 1 2 4 5 8 )
</code>```

Now, the array is already sorted, but the algorithm does not know if it is completed. The algorithm needs one whole pass without any swap to know it is sorted.

Third Pass

```<code>9: ( 1 2 4 5 8 ) ->  ( 1 2 4 5 8 )
10:( 1 2 4 5 8 ) ->  ( 1 2 4 5 8 )
11:( 1 2 4 5 8 ) ->  ( 1 2 4 5 8 )
12:( 1 2 4 5 8 ) ->  ( 1 2 4 5 8 )
</code>```

Test cases:

Format: Number of comparisons (N): List after N comparisons

```<code>Input list:
5  1  4  2  8
Test cases:
1: 1  5  4  2  8
2: 1  4  5  2  8
3: 1  4  2  5  8
4: 1  4  2  5  8
5: 1  4  2  5  8
6: 1  2  4  5  8
10: 1  2  4  5  8
14: 1  2  4  5  8

Input list:
0: 15  18  -6  18   9  -7  -1   7  19  19  -5  20  19   5  15  -5   3  18  14  19
Test cases:
1: 15  18  -6  18   9  -7  -1   7  19  19  -5  20  19   5  15  -5   3  18  14  19
21: -6  15  18   9  -7  -1   7  18  19  -5  19  19   5  15  -5   3  18  14  19  20
41: -6   9  -7  15  -1   7  18  18  -5  19  19   5  15  -5   3  18  14  19  19  20
60: -6  -7  -1   9   7  15  18  -5  18  19   5  15  -5   3  18  14  19  19  19  20
61: -6  -7  -1   7   9  15  18  -5  18  19   5  15  -5   3  18  14  19  19  19  20
81: -7  -6  -1   7   9  15  -5  18  18   5  15  -5   3  18  14  19  19  19  19  20
119: -7  -6  -1  -5   7   9  15   5  15  -5   3  18  14  18  18  19  19  19  19  20
120: -7  -6  -1  -5   7   9  15   5  15  -5   3  18  14  18  18  19  19  19  19  20
121: -7  -6  -1  -5   7   9   5  15  15  -5   3  18  14  18  18  19  19  19  19  20
122: -7  -6  -1  -5   7   9   5  15  15  -5   3  18  14  18  18  19  19  19  19  20
123: -7  -6  -1  -5   7   9   5  15  -5  15   3  18  14  18  18  19  19  19  19  20
201: -7  -6  -5  -1  -5   3   5   7   9  14  15  15  18  18  18  19  19  19  19  20
221: -7  -6  -5  -5  -1   3   5   7   9  14  15  15  18  18  18  19  19  19  19  20
</code>```

Yes, built-in Bubble sort algorithms are permitted.

No, you can not assume only positive integers, or unique integers.

The sorting must be in the order described above. You can't start at the end of the list

Body:
JavaScript (ES6), <s>82</s> <s>80</s> 79 bytes

f=(a,m,n=0,_,b=a[n+1])=>1/b?m?f(a,m-1,n+1,a[n]>b?a[a[n+1]=a[n],n]=b:0):a:f(a,m)

Based on @ETHproduction's original answer. Edit: Saved 2 bytes thanks to @JonathanAllan. Saved 1 byte thanks to @edc65.


问:
Snakes all around

Challenge

The challenge is simple: print a snake.

You will get the length of the snake as input.

A snake of length 2 looks like this:

```<code>==(:)-
</code>```

A snake of length 7 looks like this:

```<code>=======(:)-
</code>```

In other words, the length of a snake is how many equal signs are before the head.

Usage

Let's say I made a C++ implementation and compiled it to ./getsnake.

I could run it like so:

```<code>$ ./getsnake 10
==========(:)-
</code>```

Clarifications

Standard loopholes are disallowed.

You can get input and output in any acceptable way.

You can assume all inputs given are positive integers.

You may write a function instead of a regular program.

答:
GNU sed, 16 bytes

y/0/=/;s/$/(:)-/
```

<p>Since sed has no native support for numbers, the input is given in unary based on this consensus.</p>

<p><strong>Run:</strong></p>

<pre class="lang-sh prettyprint-override"><code>sed -f snake.sed <<< "000"
</code>```

Output:

===(:)-
```

Title: Snakes all around

Body:
GNU sed, 16 bytes

y/0/=/;s/$/(:)-/

Since sed has no native support for numbers, the input is given in unary based on this consensus.

Run:

sed -f snake.sed <<< "000"

Output:

===(:)-


答:
Haskell, <s>139</s> 135 bytes

```<code>s#p=j$foldl g("",0)s where g(a,n)c|c=='|'=(j(a,n)++"\n"++q n,n)|1>0=(a++[c],n+1);q m=' '<$[1..m];j(a,n)=a++q(sum[1|c<-s,c/='|']-n+1)++p
</code>```

Saved 4 bytes by inlining a definition.

Ungolfed:

```<code>template :: String -> String -> String
template code comment = format $ foldl g ("", 0) code
    where g (acc, n) c
            | c == '|' = (format (acc, n) ++ "\n" ++ spaces n, n)
            | otherwise = (acc ++ [c], n+1)
          l = length $ filter (/= '|') code
          spaces n = replicate n ' '
          format (acc, n) = acc ++ spaces (l-n+1) ++ comment
</code>```

Title: Esolang-Comment-Template-Generator

Body:
Haskell, <s>139</s> 135 bytes

s#p=j$foldl g("",0)s where g(a,n)c|c=='|'=(j(a,n)++"\n"++q n,n)|1>0=(a++[c],n+1);q m=' '<$[1..m];j(a,n)=a++q(sum[1|c<-s,c/='|']-n+1)++p

Saved 4 bytes by inlining a definition.

Ungolfed:

template :: String -> String -> String
template code comment = format $ foldl g ("", 0) code
    where g (acc, n) c
            | c == '|' = (format (acc, n) ++ "\n" ++ spaces n, n)
            | otherwise = (acc ++ [c], n+1)
          l = length $ filter (/= '|') code
          spaces n = replicate n ' '
          format (acc, n) = acc ++ spaces (l-n+1) ++ comment


答:
Groovy, <s>120</s> <s>113</s> 111 Bytes

```<code>def m(s,c){s.split(/\|/).inject(0,{e,t->println((' '*e+t).padRight(s.replace('|','').size()+1)+c);e+t.size()})}
</code>```

ungolfed*

```<code>def m(s,c){
  s.split(/\|/).inject(0, { e, t ->
    println((' '*e+t).padRight(s.replace('|','').size())+' '+c)
    e+t.size()
  })
}
</code>```

(First Draft with 120 Bytes)

```<code>def m(s,c){def l=0;s.split(/\|/).collect{l+=it.size();it.padLeft(l).padRight(s.replace('|','').size())+' '+c}.join('\n')}
</code>```

ungolfed*

```<code>def m(s,c){
  def l=0 // minimized version needs a semicolon here
  s.split(/\|/).collect{
    l+=it.size() // minimized version needs a semicolon here
    it.padLeft(l).padRight(s.replace('|','').size())+' '+c
  }.join('\n')
}
</code>```

Tests

```<code>%> m('a|bc|d|e|fgh|ij|k|l|mn|op', '#')
a                #
 bc              #
   d             #
    e            #
     fgh         #
        ij       #
          k      #
           l     #
            mn   #
              op #

%> m('Hello|World', '/')
Hello      /
     World /

%> m('a|b|c|d|e|f|g', ',')
a       ,
 b      ,
  c     ,
   d    ,
    e   ,
     f  ,
      g ,

%> m('abcdefg', ':')
abcdefg :

%> m('4|8|15|16|23|42', '%')
4          %
 8         %
  15       %
    16     %
      23   %
        42 %

%> m('E|ac|h s|ecti|on is| one c|haracte|r longer| than the| last!', '!')
E                                                   !
 ac                                                 !
   h s                                              !
      ecti                                          !
          on is                                     !
                one c                               !
                     haracte                        !
                            r longer                !
                                     than the       !
                                              last! !

%> m('This|Code|has||empty||sections', '@')
This                     @
    Code                 @
        has              @
                         @
           empty         @
                         @
                sections @
</code>```

Title: Esolang-Comment-Template-Generator

Body:
Groovy, <s>120</s> <s>113</s> 111 Bytes

def m(s,c){s.split(/\|/).inject(0,{e,t->println((' '*e+t).padRight(s.replace('|','').size()+1)+c);e+t.size()})}

ungolfed*

def m(s,c){
  s.split(/\|/).inject(0, { e, t ->
    println((' '*e+t).padRight(s.replace('|','').size())+' '+c)
    e+t.size()
  })
}

(First Draft with 120 Bytes)

def m(s,c){def l=0;s.split(/\|/).collect{l+=it.size();it.padLeft(l).padRight(s.replace('|','').size())+' '+c}.join('\n')}

ungolfed*

def m(s,c){
  def l=0 // minimized version needs a semicolon here
  s.split(/\|/).collect{
    l+=it.size() // minimized version needs a semicolon here
    it.padLeft(l).padRight(s.replace('|','').size())+' '+c
  }.join('\n')
}

Tests

%> m('a|bc|d|e|fgh|ij|k|l|mn|op', '#')
a                #
 bc              #
   d             #
    e            #
     fgh         #
        ij       #
          k      #
           l     #
            mn   #
              op #

%> m('Hello|World', '/')
Hello      /
     World /

%> m('a|b|c|d|e|f|g', ',')
a       ,
 b      ,
  c     ,
   d    ,
    e   ,
     f  ,
      g ,

%> m('abcdefg', ':')
abcdefg :

%> m('4|8|15|16|23|42', '%')
4          %
 8         %
  15       %
    16     %
      23   %
        42 %

%> m('E|ac|h s|ecti|on is| one c|haracte|r longer| than the| last!', '!')
E                                                   !
 ac                                                 !
   h s                                              !
      ecti                                          !
          on is                                     !
                one c                               !
                     haracte                        !
                            r longer                !
                                     than the       !
                                              last! !

%> m('This|Code|has||empty||sections', '@')
This                     @
    Code                 @
        has              @
                         @
           empty         @
                         @
                sections @


问:
Sort a list of numbers
About Code-Bowling:

In golf, you try to get the lowest score (smallest application, most elegant, etc). In Bowling, you try to get the highest score. So if you follow, the goal of a Code-Bowling challenge is to make the biggest, most bastardized, hardest to maintain piece of code that still meets the requirements of the challenge. However, there's no point in making source longer just for the sake of it. It needs to seem like that added length was from design and not just padding.

The Challenge:

Create a program that sorts a list of numbers in ascending order.

Example:

Input: 1, 4, 7, 2, 5

Output: 1, 2, 4, 5, 7

Code: Obviously this wouldn't be a good answer, since there aren't many WTFs in there

```<code>function doSort(array $input) {
    sort($input);
    return $input;
}
</code>```

Rules:

There are no real rules.  As long as the program functions, have at it!

Remember: This is code-bowling, not golf.  The objective is to make the worst, most bastardized code that you can!  Bonus points for code that looks good, but is actually deceptively evil...

答:
Generic, multithreaded bogosort in Java

46 seconds to sort 4 numbers

I thought it would be elegant with support for generics.
Also, multithreading is always nice, so I use that instead of randomization: This program generates one thread for each number to be sorted. Each thread tries to insert its element into an array object, and when all elements have been inserted, the program will check if the array is sorted. If not, try again. Off course this insertion needs to be synchronized.

ElementInserter

This will be the class that we use for the threads.
This class holds one element and tries to insert it into its sortedArray:

class ElementInserter<E extends Comparable<? super E>> implements Runnable {
    E element;
    SortedArray<? super E> target;

    ElementInserter(E e, SortedArray<? super E> a) {
        element = e;
        target = a;
    }

    @Override
    public void run() {
        target.insert(element);
    }
}
```

<h3>sortedArray</h3>

<p>Sports a straight-forward insert method. When last element has been inserted, it checks if the array is sorted.</p>

<pre class="lang-java prettyprint-override"><code>class SortedArray<E extends Comparable<? super E>> {
    boolean sorted; int i = 0; E[] a;

    SortedArray(E[] e) { a = e; }

    synchronized public void insert(E e) {
        while (!sorted) {
            a[i++] = e;

            if (i == a.length) {
                sorted = true;

                for (int j = 1; j < i; ++j)
                    if (a[j-1].compareTo(a[j]) > 0) {
                        sorted = false;
                        i = 0;
                        notifyAll();
                    }

                if (sorted) {
                    for (int j = 0; j < a.length; ++j) System.out.print(a[j]+" ");
                    System.out.println();
                    notifyAll(); // allow all threads to terminate
                }

            } else
                try { wait(); }
                catch(InterruptedException x) { }
        }
    }
}
</code>```

Main method

Parses command line arguments as Integers, creates a new array and a new thread for each Integer:

    public static void main (String[] args) {
        Integer[] i = new Integer[args.length];
        SortedArray<Integer> c = new SortedArray<Integer>(i);

        for (String s : args)
            new Thread(new ElementInserter<Integer>(Integer.parseInt(s), c)).start();
    }
```

<h3>Test run</h3>

<p>Execution time will depend on the original order of the elements and your scheduler implementation. This is on a dual-core 2.9 GHz Intel i7 MacBook Pro:</p>

<pre class="lang-java prettyprint-override"><code>$ time java Main 3 1 2 4
1 2 3 4

real    0m46.307s
user    0m14.629s
sys     0m26.207s
</code>```

ContentLicense: CC BY-SA 2.5

Title: Sort a list of numbers

Body:
Generic, multithreaded bogosort in Java

46 seconds to sort 4 numbers

I thought it would be elegant with support for generics.
Also, multithreading is always nice, so I use that instead of randomization: This program generates one thread for each number to be sorted. Each thread tries to insert its element into an array object, and when all elements have been inserted, the program will check if the array is sorted. If not, try again. Off course this insertion needs to be synchronized.

ElementInserter

This will be the class that we use for the threads.
This class holds one element and tries to insert it into its sortedArray:

class ElementInserter<E extends Comparable<? super E>> implements Runnable {
    E element;
    SortedArray<? super E> target;

    ElementInserter(E e, SortedArray<? super E> a) {
        element = e;
        target = a;
    }

    @Override
    public void run() {
        target.insert(element);
    }
}

sortedArray

Sports a straight-forward insert method. When last element has been inserted, it checks if the array is sorted.

class SortedArray<E extends Comparable<? super E>> {
    boolean sorted; int i = 0; E[] a;

    SortedArray(E[] e) { a = e; }

    synchronized public void insert(E e) {
        while (!sorted) {
            a[i++] = e;

            if (i == a.length) {
                sorted = true;

                for (int j = 1; j < i; ++j)
                    if (a[j-1].compareTo(a[j]) > 0) {
                        sorted = false;
                        i = 0;
                        notifyAll();
                    }

                if (sorted) {
                    for (int j = 0; j < a.length; ++j) System.out.print(a[j]+" ");
                    System.out.println();
                    notifyAll(); // allow all threads to terminate
                }

            } else
                try { wait(); }
                catch(InterruptedException x) { }
        }
    }
}

Main method

Parses command line arguments as Integers, creates a new array and a new thread for each Integer:

    public static void main (String[] args) {
        Integer[] i = new Integer[args.length];
        SortedArray<Integer> c = new SortedArray<Integer>(i);

        for (String s : args)
            new Thread(new ElementInserter<Integer>(Integer.parseInt(s), c)).start();
    }

Test run

Execution time will depend on the original order of the elements and your scheduler implementation. This is on a dual-core 2.9 GHz Intel i7 MacBook Pro:

$ time java Main 3 1 2 4
1 2 3 4

real    0m46.307s
user    0m14.629s
sys     0m26.207s


答:
Retina, <s>35</s> 34 bytes

Byte count assumes ISO 8859-1 encoding.

```<code>\|
·$'¶$`±
T0-2`·±|p`___ `.+±.|·.+
</code>```

The two input strings are separated by a space (which is unambiguous since we know that the comment delimiter is always a single character).

Try it online!

Title: Esolang-Comment-Template-Generator

Body:
Retina, <s>35</s> 34 bytes

Byte count assumes ISO 8859-1 encoding.

\|
·$'¶$`±
T0-2`·±|p`___ `.+±.|·.+

The two input strings are separated by a space (which is unambiguous since we know that the comment delimiter is always a single character).

Try it online!


答:
JavaScript (ES6), 92 bytes

f=
(s,c)=>s.split`|`.map((_,i,a)=>a.map((e,j)=>i-j?e.replace(/./g,` `):e).join``+` `+c).join`
`
;```
<pre class="snippet-code-html lang-html prettyprint-override"><code><div oninput=o.textContent=f(s.value,c.value)><input id=s placeholder=Code><input id=c size=1 maxlength=1 value=#><pre id=o></code>```

Title: Esolang-Comment-Template-Generator

Body:
JavaScript (ES6), 92 bytes

f=
(s,c)=>s.split`|`.map((_,i,a)=>a.map((e,j)=>i-j?e.replace(/./g,` `):e).join``+` `+c).join`
`
;

<div oninput=o.textContent=f(s.value,c.value)><input id=s placeholder=Code><input id=c size=1 maxlength=1 value=#><pre id=o>


Title: Esolang-Comment-Template-Generator

Body:
PHP, <s>120</s> <s>117</s> <s>116</s> <s>110</s> 109 bytes

foreach($a=split('\|',$argv[1])as$i=>$t){$c=preg_replace('#.#',' ',$a);$c[$i]=$t;echo join($c)," $argv[2]
";}

or

foreach($a=split('\|',$argv[1])as$t){$c=preg_replace('#.#',' ',$a);$c[$i++|0]=$t;echo join($c)," $argv[2]
";}


问:
Count to 100 in Danish
Print all the numbers from 0-100 in the right order using the Danish way of counting

How they count

Like English, they have dedicated words for 0-20, 30, 40 and 100

Instead of saying twenty-one and twenty-two, they say one and twenty and two and twenty

Starting with fifty they say multiples of 10 as n*20

```<code>50 = half third times twenty = half way to the 3rd multiple of 20
60 = three times twenty
70 = half fourth times twenty
80 = four times twenty
90 = half fifth times twenty
</code>```

So for instance, 55 would be five and half third times twenty.

Expected output

```<code>zero
one
two
three
four
five
six
seven
eight
nine
ten
eleven
twelve
thirteen
fourteen
fifteen
sixteen
seventeen
eighteen
nineteen
twenty
one and twenty
two and twenty
three and twenty
four and twenty
five and twenty
six and twenty
seven and twenty
eight and twenty
nine and twenty
thirty
one and thirty
two and thirty
three and thirty
four and thirty
five and thirty
six and thirty
seven and thirty
eight and thirty
nine and thirty
forty
one and forty
two and forty
three and forty
four and forty
five and forty
six and forty
seven and forty
eight and forty
nine and forty
half third times twenty
one and half third times twenty
two and half third times twenty
three and half third times twenty
four and half third times twenty
five and half third times twenty
six and half third times twenty
seven and half third times twenty
eight and half third times twenty
nine and half third times twenty
three times twenty
one and three times twenty
two and three times twenty
three and three times twenty
four and three times twenty
five and three times twenty
six and three times twenty
seven and three times twenty
eight and three times twenty
nine and three times twenty
half fourth times twenty
one and half fourth times twenty
two and half fourth times twenty
three and half fourth times twenty
four and half fourth times twenty
five and half fourth times twenty
six and half fourth times twenty
seven and half fourth times twenty
eight and half fourth times twenty
nine and half fourth times twenty
four times twenty
one and four times twenty
two and four times twenty
three and four times twenty
four and four times twenty
five and four times twenty
six and four times twenty
seven and four times twenty
eight and four times twenty
nine and four times twenty
half fifth times twenty
one and half fifth times twenty
two and half fifth times twenty
three and half fifth times twenty
four and half fifth times twenty
five and half fifth times twenty
six and half fifth times twenty
seven and half fifth times twenty
eight and half fifth times twenty
nine and half fifth times twenty
one hundred
</code>```

Rules

You may use any separator to separate the numbers

Due to a typo in the original specification, you may use forth instead of fourth.

You may write a function or write to std-out

Standard loopholes apply

This is codegolf; shortest code in bytes win!

答:
Bash (using rev and sed), 299 276  bytes

I'm using bash's curly braces-expansion. However the braces are expanded in the wrong order, so I print all the words in reverted order and then fix the order of the letters using rev. After that, I still need some adjustments using sed:

```<code>printf '%s\n' orez {,{neet,yt{newt,riht,rof},ytnewt\ semit\ {drihtX,eerht,htruofX,ruof,htfifX}}Y}{,eno,owt,eerht,ruof,evif,xis,neves,thgie,enin} derdnuh\ eno |rev |sed -r 's,^Yte,t,;s,^Y,,;12s,.*,eleven,;13s,o.*,elve,;1,20{s,reeY,ir,;s,veY,f,;s,(t|)Y,,};s,Y, and ,;s,X,half ,'
</code>```

A bit less unreadable:

```<code>printf '%s\n' orez {,{neet,yt{newt,riht,rof},\
ytnewt\ semit\ {drihtX,eerht,htruofX,ruof,htfifX}}Y}\
{,eno,owt,eerht,ruof,evif,xis,neves,thgie,enin} \
    derdnuh\ eno \
    |rev \
    |sed -r 's,^Yte,t,;
            s,^Y,,;
            12s,.*,eleven,;
            13s,o.*,elve,;
            1,20{s,reeY,ir,;s,veY,f,;s,(t|)Y,,};
            s,Y, and ,;
            s,X,half ,'
</code>```

Title: Count to 100 in Danish

Body:
Bash (using rev and sed), 299 276  bytes

I'm using bash's curly braces-expansion. However the braces are expanded in the wrong order, so I print all the words in reverted order and then fix the order of the letters using rev. After that, I still need some adjustments using sed:

printf '%s\n' orez {,{neet,yt{newt,riht,rof},ytnewt\ semit\ {drihtX,eerht,htruofX,ruof,htfifX}}Y}{,eno,owt,eerht,ruof,evif,xis,neves,thgie,enin} derdnuh\ eno |rev |sed -r 's,^Yte,t,;s,^Y,,;12s,.*,eleven,;13s,o.*,elve,;1,20{s,reeY,ir,;s,veY,f,;s,(t|)Y,,};s,Y, and ,;s,X,half ,'

A bit less unreadable:

printf '%s\n' orez {,{neet,yt{newt,riht,rof},\
ytnewt\ semit\ {drihtX,eerht,htruofX,ruof,htfifX}}Y}\
{,eno,owt,eerht,ruof,evif,xis,neves,thgie,enin} \
    derdnuh\ eno \
    |rev \
    |sed -r 's,^Yte,t,;
            s,^Y,,;
            12s,.*,eleven,;
            13s,o.*,elve,;
            1,20{s,reeY,ir,;s,veY,f,;s,(t|)Y,,};
            s,Y, and ,;
            s,X,half ,'


答:
Python 2, <s>107</s> <s>105</s> <s>102</s> 99 bytes

Tested with all test cases above

EDIT Golfed off 2 bytes by changing d=a.split("|");i=0 to d,i=a.split("|"),0
Not sure how I missed that one. Thanks @Oliver Ni

Another 3 bytes gone. Thanks again.

Suggestion from @Jonathan actually saves 3 bytes and takes it down to the magic 99. Thanks.

```<code>def c(a,b):
 d,i=a.split("|"),0
 for e in d:j=i+len(e);print" "*i+e+" "*(len("".join(d))-j+1)+b;i=j
</code>```

Title: Esolang-Comment-Template-Generator

Body:
Python 2, <s>107</s> <s>105</s> <s>102</s> 99 bytes

Tested with all test cases above

EDIT Golfed off 2 bytes by changing d=a.split("|");i=0 to d,i=a.split("|"),0
Not sure how I missed that one. Thanks @Oliver Ni

Another 3 bytes gone. Thanks again.

Suggestion from @Jonathan actually saves 3 bytes and takes it down to the magic 99. Thanks.

def c(a,b):
 d,i=a.split("|"),0
 for e in d:j=i+len(e);print" "*i+e+" "*(len("".join(d))-j+1)+b;i=j


问:
Hexagolf: Validagons

Challenge

Given an ASCII art shape, you must find out whether the shape is a regular hexagon or not.

Hexagons

A regular hexagon is defined using two rules:

It has six sides

Each side has equal numbers of characters

For example, the following shape is regular but it doesn't have six sides and so is not a regular hexagon:

```<code>B a a h
s a i d
y o u r
g a o t
</code>```

Similarly, the following shape has six sides but has sides of different lengths and so is not a regular hexagon:

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

However, the following shape has six sides and all of the sides have the same number of characters, so it is a regular hexagon:

```<code>  T h e
 h e x a
g o n s a
 r e c o
  m i n
</code>```

Rules

Output should be a truthy or a falsey value (truthy if the shape is a regular hexagon, falsey if not).

The shapes will only ever contain printable ASCII characters.

The border of the shape will never contain spaces. If it does, you can return falsey.

There can be arbitrary amounts of whitespace before and/or after the shape.

All angles in the shape may not be equal for example, the following shape is valid input:

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

It will return a falsey value.

All shape inputs will be on a space separated grid. Hexagonal input will be on a staggered grid (each line is offset from the next).

Examples

Truthy

The following shapes should return truthy values:

```<code> # _
+ + +
 9 :
</code>```

```<code>  5 6 7
 8 9 0 1
2 3 4 5 6
 7 8 9 0
  1 2 3
</code>```

```<code>    t h i s
   i       s
  a         h
 e           x
  a         g
   o       n
    ! ! ! !
</code>```

```<code>    5 6 7
   8 9 0 1
  2 3 4 5 6
   7 8 9 0
    1 2 3
</code>```

Falsey

The following should return falsey values

```<code>r e c t a
n g l e s
</code>```

```<code>  h e l l o
 w o r l d s
t h i s i s b
 e t a d e c
  a y n o w
</code>```

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

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

This shape is not on a space separated grid and is not staggered.

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

```<code>5 6 7
8 9 0 1
2 3 4 5 6
7 8 9 0
1 2 3
</code>```

For single character inputs, your program may output either truthy or falsey:

```<code>&
</code>```

Winning

The shortest program in bytes wins.

答:
JavaScript (ES6), 214 bytes

```<code>(s,a=s.split`\n`,n=a[l=a.length>>1].match(r=/(?=\S).*\S/),i=n.index)=>!/\S(  )*\S/.test(s)&&!a.some((s,j)=>(m=r.exec(s))&&(k=m.index)<i+(j<l?j=l-j:j-=l)|k+(m=m[0].length)+j>i+n[0].length|k+i+j&1|j%l<1&m+j+j!=l*4+1)
</code>```

Where \n represents a literal newline character. Ungolfed:

```<code>function validhex(s) {
    if (/S(  )*/S/.test(s)) return false;
    var a = s.split("\n");
    var l = Math.floor(a.length / 2);
    var n = a[l].match(/(?=\S).*\S/);
    for (var j = -l; j <= l; j++) {
        var m = a[j+l].match(/(?=\S).*\S/);
        if (!m) continue;
        if (m.index < n.index + Math.abs(j)) return false;
        if (m.index + m[0].length + Math.abs(j) > n.index + n[0].length) return false;
        if ((m.index + n.index + j) % 2) return false;
        if (j % l) continue;
        if (m[0].length != l * 4 + 1 - 2 * Math.abs(j)) return false;
    }
    return true;
}
</code>```

Title: Hexagolf: Validagons

Body:
JavaScript (ES6), 214 bytes

(s,a=s.split`\n`,n=a[l=a.length>>1].match(r=/(?=\S).*\S/),i=n.index)=>!/\S(  )*\S/.test(s)&&!a.some((s,j)=>(m=r.exec(s))&&(k=m.index)<i+(j<l?j=l-j:j-=l)|k+(m=m[0].length)+j>i+n[0].length|k+i+j&1|j%l<1&m+j+j!=l*4+1)

Where \n represents a literal newline character. Ungolfed:

function validhex(s) {
    if (/S(  )*/S/.test(s)) return false;
    var a = s.split("\n");
    var l = Math.floor(a.length / 2);
    var n = a[l].match(/(?=\S).*\S/);
    for (var j = -l; j <= l; j++) {
        var m = a[j+l].match(/(?=\S).*\S/);
        if (!m) continue;
        if (m.index < n.index + Math.abs(j)) return false;
        if (m.index + m[0].length + Math.abs(j) > n.index + n[0].length) return false;
        if ((m.index + n.index + j) % 2) return false;
        if (j % l) continue;
        if (m[0].length != l * 4 + 1 - 2 * Math.abs(j)) return false;
    }
    return true;
}


问:
Power modulo golf.
Write a function f(a,b,c) that calculates a^b (mod c) in less than 10 seconds.

a, b < 10^100

c < 10000.

examples:

```<code>f(10^50, 10^50, 54123) = 46555
f(5^99, 10^99, 777) = 1
</code>```

答:
Java 56 chars

My humble attempt with Java.

```<code>Object a(BigInteger...a){return a[0].modPow(a[1],a[2]);}
</code>```

How to use :

```<code>a(new BigInteger("95"), new BigInteger("56"), new BigInteger("67"));
</code>```

Title: Power modulo golf.

Body:
Java 56 chars

My humble attempt with Java.

Object a(BigInteger...a){return a[0].modPow(a[1],a[2]);}

How to use :

a(new BigInteger("95"), new BigInteger("56"), new BigInteger("67"));


答:
Python (634)

If the list is sorted, print it.  Otherwise, swap two elements that are in the wrong order, then generate a python script that handles the new order.  After running that, delete the created script.

```<code>list_to_sort = input()
n = 0
n += 1
import sys, os
for i in range(len(list_to_sort)-1):
    if list_to_sort[i]>list_to_sort[i+1]:
        (list_to_sort[i],list_to_sort[i+1]) = (list_to_sort[i+1],list_to_sort[i])
        source_file = open(sys.argv[0],'r')
        temp_filename = 'temp'+repr(n)+'.py'
        temp_file = open(temp_filename,'w')
        temp_file.write('list_to_sort = ' + repr(list_to_sort) + '\n')
        temp_file.write('n = ' + repr(n) + '\n')
        for line in source_file.readlines()[2:]:
            temp_file.write(line)
        source_file.close()
        temp_file.close()
        os.system('python ' + temp_filename)
        os.remove(temp_filename)
        sys.exit(0)
print list_to_sort
</code>```

Title: Sort a list of numbers

Body:
About Code-Bowling:

In golf, you try to get the lowest score (smallest application, most elegant, etc). In Bowling, you try to get the highest score. So if you follow, the goal of a Code-Bowling challenge is to make the biggest, most bastardized, hardest to maintain piece of code that still meets the requirements of the challenge. However, there's no point in making source longer just for the sake of it. It needs to seem like that added length was from design and not just padding.

The Challenge:

Create a program that sorts a list of numbers in ascending order.

Example:

Input: 1, 4, 7, 2, 5

Output: 1, 2, 4, 5, 7

Code: Obviously this wouldn't be a good answer, since there aren't many WTFs in there

```<code>function doSort(array $input) {
    sort($input);
    return $input;
}
</code>```

Rules:

There are no real rules.  As long as the program functions, have at it!

Remember: This is code-bowling, not golf.  The objective is to make the worst, most bastardized code that you can!  Bonus points for code that looks good, but is actually deceptively evil...

Body:
Python (634)

If the list is sorted, print it.  Otherwise, swap two elements that are in the wrong order, then generate a python script that handles the new order.  After running that, delete the created script.

list_to_sort = input()
n = 0
n += 1
import sys, os
for i in range(len(list_to_sort)-1):
    if list_to_sort[i]>list_to_sort[i+1]:
        (list_to_sort[i],list_to_sort[i+1]) = (list_to_sort[i+1],list_to_sort[i])
        source_file = open(sys.argv[0],'r')
        temp_filename = 'temp'+repr(n)+'.py'
        temp_file = open(temp_filename,'w')
        temp_file.write('list_to_sort = ' + repr(list_to_sort) + '\n')
        temp_file.write('n = ' + repr(n) + '\n')
        for line in source_file.readlines()[2:]:
            temp_file.write(line)
        source_file.close()
        temp_file.close()
        os.system('python ' + temp_filename)
        os.remove(temp_filename)
        sys.exit(0)
print list_to_sort


答:
Scala, 123 bytes

```<code>def?(i:String,c:String)={var b=0
i.split('|').map{s=>println(" "*b+s+" "*(i.replace("|","").size-b-s.size+1)+c)
b+=s.size}}
</code>```

Test code + Output:

```<code>?("a|b|c|d|e|f|g", ",")
a       ,
 b      ,
  c     ,
   d    ,
    e   ,
     f  ,
      g ,

?("abcdefg", ":")
abcdefg :

?("4|8|15|16|23|42", "%")
4          %
 8         %
  15       %
    16     %
      23   %
        42 %

?("E|ac|h s|ecti|on is| one c|haracte|r longer| than the| last!", "!")
E                                                   !
 ac                                                 !
   h s                                              !
      ecti                                          !
          on is                                     !
                one c                               !
                     haracte                        !
                            r longer                !
                                     than the       !
                                              last! !

?("This|Code|has||empty||sections", "@")
This                     @
    Code                 @
        has              @
                         @
           empty         @
                         @
                sections @
</code>```

Title: Esolang-Comment-Template-Generator

Body:
Lots of people on this site use esoteric languages, and since these languages are unusual and hard to understand, they will frequently write an explanation in a certain format. For example, if the code was

```<code>abcdefghijklmnop
</code>```

And this languages uses # for comments, they would write an explanation like this:

```<code>a                #Explanation of what 'a' does
 bc              #Bc
   d             #d
    e            #Explanation of e
     fgh         #foobar
        ij       #hello world
          k      #etc.
           l     #so on
            mn   #and
              op #so forth
</code>```

I frequently do this too, but every time I do this, I feel like creating the layout of text is really obnoxious and time-consuming. So I want you to create a "Esolang-Comment-Template-Generator" for me. For example, if we ignore the comments, the previous code has this template:

```<code>a                #
 bc              #
   d             #
    e            #
     fgh         #
        ij       #
          k      #
           l     #
            mn   #
              op #
</code>```

The Challenge:

You must write a program or function that takes two strings as input, and outputs this "Esolang-Comment-Template". The first input will be the code, but with bars (|) inserted where the newlines go. The second input is what we will use for comments. So our last example would have this for input:

```<code>"a|bc|d|e|fgh|ij|k|l|mn|op", "#"
</code>```

Unfortunately this excludes bars from being part of the code input, but that's OK. You can assume that the comment input will be a single character. For simplicity's sake, the comment char will not be a bar. The code input will only contain printable ASCII, and it will not contain any newlines.

Hopefully you can infer what to do from the testcases, but I'll try to clarify some things.

You must split the code input up into "code-sections" on every bar. Then, each section of code is output on its own line and left-padded with the length of all the previous code (not including the bars). Then, each line is right-padded with enough spaces so that the last two characters on every line are "One additional space" + "The comment character".

One trailing newline is allowed.

Here is another example. For the input

```<code>"Hello|World", "/"
</code>```

The first section of code is "Hello" and the second is "World". So it should give the output:

```<code>Hello      /
     World /
</code>```

Here are some more samples:

```<code>Input:
"a|b|c|d|e|f|g", ","

Output:
a       ,
 b      ,
  c     ,
   d    ,
    e   ,
     f  ,
      g ,

Input:
"abcdefg", ":"

Output:
abcdefg :

Input:
"4|8|15|16|23|42", "%"

Output:
4          %
 8         %
  15       %
    16     %
      23   %
        42 %

Input:
"E|ac|h s|ecti|on is| one c|haracte|r longer| than the| last!", "!"

Output:
E                                                   !
 ac                                                 !
   h s                                              !
      ecti                                          !
          on is                                     !
                one c                               !
                     haracte                        !
                            r longer                !
                                     than the       !
                                              last! !

Input:
"This|Code|has||empty||sections", "@"

Output:
This                     @
    Code                 @
        has              @
                         @
           empty         @
                         @
                sections @
</code>```

Rules:

You may take these inputs and outputs in any reasonable format. For example, reading/writing a file, STDIN/STOUT, function arguments/return value, etc. As usual, this is code-golf, so try to make your code as short as possible and you win if you can get the shortest solution in your language! I will also select the shortest solution as the overall winner. Standard loopholes are banned.

Body:
Scala, 123 bytes

def?(i:String,c:String)={var b=0
i.split('|').map{s=>println(" "*b+s+" "*(i.replace("|","").size-b-s.size+1)+c)
b+=s.size}}

Test code + Output:

?("a|b|c|d|e|f|g", ",")
a       ,
 b      ,
  c     ,
   d    ,
    e   ,
     f  ,
      g ,

?("abcdefg", ":")
abcdefg :

?("4|8|15|16|23|42", "%")
4          %
 8         %
  15       %
    16     %
      23   %
        42 %

?("E|ac|h s|ecti|on is| one c|haracte|r longer| than the| last!", "!")
E                                                   !
 ac                                                 !
   h s                                              !
      ecti                                          !
          on is                                     !
                one c                               !
                     haracte                        !
                            r longer                !
                                     than the       !
                                              last! !

?("This|Code|has||empty||sections", "@")
This                     @
    Code                 @
        has              @
                         @
           empty         @
                         @
                sections @


问:
RGB Gradients Generation
The Challenge

Given the two uppercase hexadecimal strings (both 6 characters long, XXXXXX and YYYYYY) representing RGB values (ranging from 000000 to FFFFFF inclusive), and a positive non-zero integer N, display a linear transition of the N+2 colors generated from XXXXXX to YYYYYY that would result in a color gradient.

Example

Input

```<code>FF3762
F08800
9
</code>```

Output

Please note in our example, I've requested 9 interim steps between the two colors, therefore 11 lines will be displayed from initial color to the final color

```<code>FF3762
FD3F58
FC474E
FA4F44
F9573A
F75F31
F66727
F46F1D
F37713
F17F09
F08800
</code>```

Caveats

While I've gone with a simple linear process of deriving the integer values for the interim colors before converting them back into hexadecimal, your methods may vary. Please consider the various ways one could round up/down your numbers accordingly.

Testing

To make this interesting, I've provided a snippet to allow testing of your code, inclusive of a button to provide you with two random colors to test your code against. Displaying your results is optional, but it's encouraged!

c1=()=>('00000'+(Math.random()*(1<<24)|0).toString(16)).slice(-6);

$("#col").click(function(){
  alert("Your two colors are: "+c1()+" and "+c1()+".");
});

$("#colors").blur(function(){
  $("#test").empty();
 var colArr = $("#colors").val().split("\n");
 for(c in colArr){
   $("#test").append('
'+colArr[c]+'
')
  }

});```
<pre class="snippet-code-css lang-css prettyprint-override"><code>.tester{height: 20px;
width: 60px;padding: 4px;border: 1px solid black;}</code>```

<button id="col">Your two colors</button>

<textarea id="colors"></textarea>

```

1) You can access two random colors for your test by clicking on the "Your two colors" button.
2) The number of interim steps will be the same as the number of characters in your PPCG username inclusive of spaces, in the case of "WallyWest" it would be 9 (as per my example above).
3) Run your code with the two colors and the number and once you have your generated list, you have the option of pasting your output into the textarea and tabbing away from it to get your generated color gradient.

My example is shown here:

I must admit, that looks pretty awesome!

Please note: As I mentioned, showing your testing of your output using the snippet is optional, but it's encouraged! :)

Output

The list output must be in the form of N+2 sets of 6 digit hex numbers separated by line feeds (\n) as shown in my example above. Output can be in the form of separate lines, space/comma separated list, an array or whatever is best suited for your language... (Thanks @nimi for the heads up) Please remember, that if you plan on testing your code with the snippet, however you separate each "color" is up to you.

Rules

This is code-golf, so the shortest solution in bytes will be crowned the winner. No loopholes, naturally. Input must accept the two strings and a number (which as I said will be equivalent to the number of letters in your username on PPCG, thus your resulting output will always be a minimum of three lines long.

Title: RGB Gradients Generation

Body:
C, 175 169 168 bytes

i;j;x[6];f(a,b,n)char*a,*b;{char*f="%2x%2x%02x";for(n++;i<=n;i++,puts(""))for(j=sscanf(a,f,x,x+1,x+2)-sscanf(b,f,x+3,x+4,x+5);j++<printf(f+6,x[j]+(x[j+3]-x[j])*i/n););}

Ungolfed:

int i, j;
int x[3], y[3];

f(char *a, char *b, int n) {
  sscanf(a, "%2x%2x%2x", &x[0], &x[1], &x[2]);
  sscanf(b, "%2x%2x%2x", &y[0], &y[1], &y[2]);

  for(i = 0, n++; i <= n; i++) {
    for(j = 0; j < 3; j++)
      printf("%02x", x[j] + (y[j] - x[j]) * i / n);
    puts("");
  }
}

Thanks to @h-walters for shaving off 5 bytes!


问:
Spell out the Revu'a
Actually not inspired neither by Atbash Self Palindromes nor by Generalized Gematria Calculator.

Given a string s of length n, output the Revu'a sequence, which is the first character of s, the first two characters of s, ... the first n–2 characters of s, the first n–1 characters of s, the entire s.

The string will only consist of Unicode (any encoding you want) characters that have strong directionality and are found in the range 0x0000 through 0xFFFF. However, no directionality control characters will occur. All characters in any given string will have the same directionality.

You may return in array notation ["t","te","tes","test"], as a space-separated string "t te tes test", as multi-line text
t
te
tes
test
, a pre-formatted array```t
te
tes
test```, or anything similar. Amounts of leading, separating, and trailing spacing is not important, and neither are trailing newline. Ask if in doubt.

Right-to-Left input must result in Right-to-Left output in proper order:

Input: "נחמן"

Output: "נ  נח  נחמ  נחמן" or```נ
נח
נחמ
נחמן
```, or ["נ","נח","נחמ","נחמן"]. Among invalid results are "נחמן  נחמ  נח  נ" ,"ן  מן  חמן  נחמן", and "נחמן  חמן  מן  ן".

答:
Java 8, <s>95</s> <s>92</s> 58 bytes

s->{for(int i=0;;)System.out.println(s.substring(0,++i));}
```
<p>Try it online.</p>
<p><strong>Explanation:</strong></p>
<pre class="lang-java prettyprint-override"><code>s->{                        // Method with String parameter and no return-type
  for(int i=0;              //  Index-integer, starting at 0
      ;)                    //  Loop indefinitely:
    System.out.println(     //   Print with trailing newline:
      s.substring(0,++i     //    Increase the index by 1 first with `++i`
                       ));} //    And print an input-substring in the range [0,i)
</code>```

Stops the infinite loop with a StringIndexOutOfBoundsException after everything has been printed to STDOUT already, which is allowed according to the meta.

Title: Spell out the Revu'a

Body:
Java 8, <s>95</s> <s>92</s> 58 bytes

s->{for(int i=0;;)System.out.println(s.substring(0,++i));}

Try it online.

Explanation:

s->{                        // Method with String parameter and no return-type
  for(int i=0;              //  Index-integer, starting at 0
      ;)                    //  Loop indefinitely:
    System.out.println(     //   Print with trailing newline:
      s.substring(0,++i     //    Increase the index by 1 first with `++i`
                       ));} //    And print an input-substring in the range [0,i)

Stops the infinite loop with a StringIndexOutOfBoundsException after everything has been printed to STDOUT already, which is allowed according to the meta.


问:
Output "Lorem ipsum" with minimal number of characters
I remember people saying that code size should be measured in bytes, and not in characters, because it's possible to store information with weird Unicode characters, which have no visual meaning.

How bad can it be?

In this challenge, you should output the following Lorem Ipsum text, taken from Wikipedia:

```<code>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</code>```

Please specify the number of characters (not bytes) in your code. Code with the minimal number of characters wins.

Your code should only contain valid Unicode characters, as described here, that is:

Code points up to U+10FFFF

No surrogates (the range D800–DBFF is forbidden)

No characters FFFE and FFFF

No null characters (code 0)

If your code cannot be displayed, provide a version with offending characters redacted, and a hexdump.

Some notes:

The output must be one long line (445 characters). If your system cannot do that (e.g. you're printing it on paper), output a closest approximation. Trailing linebreaks don't matter.

Built-in functions that generate Lorem Ipsum text are not allowed

Please specify a valid text encoding for your code, if relevant

Body:
Dyalog APL, 123 characters

All but the final period are packed into 111 32-bit characters (UTF-32).

'.',⍨80⎕DR''

'.',⍨ period appended to

80⎕DR the 8-bit (8) character (0) Data Representation of

'...' the 111 Unicode characters U+26F4C 9206D D7573 C6F64 32072 12074 C7465 E6F63 46365 27574 96461 37369 10676E 4696C 57320 F6420 56965 46F6D D6574 10726F 9636E 56469 52074 16C20 5726F 107465 F6C6F D2065 16E67 96C61 E6175 107455 D696E 106461 96E69 57620 D6169 57120 E2073 27473 52064 37265 46174 106E6F 16C6C 106F63 F6261 107369 97369 107475 1696C 107069 52078 F6320 46F6D F6320 16573 E7461 97544 56120 92065 57275 C6F64 92072 57220 86572 5646E 107469 6206E 10756C 57461 C6576 52074 106573 C6C69 4206D 26F6C 56520 77566 107461 C6C75 17020 46169 102E72 56378 56574 97320 F2074 56163 107461 97075 17461 F6E20 27020 56469 102C74 46E75 106E69 106C75 57120 66F20 96369 56420 57265 D2074 96C6C E6120 9206D 36520 16C20 5726F, which all fall in the range 12074–10756C and thus inside the OP's all-permitted range 10000–10FFFF.


答:
MATL, <s>33</s> 31 bytes

```<code>'\|'0'|'hYXo8M&YbY:&YdtaZ)0ihYc
</code>```

Try it online!

Explanation

The builtin function Yd (blkdiag), which builds a block-diagonal matrix from its inputs, does most of the work. The fill values in the matrix are 0, and char 0 is treated as a space for displaying purposes. The code would simply split on |, build a matrix from the resulting blocks, convert to char, and append two columns with space and comment symbol.

However, the possibility of empty sections in the input string <s>complicates</s> makes the problem more interesting: the resulting block would be empty and thus wouldn't show in the resulting matrix.

To solve this, we introduce a char 0 before each |, so no block will be empty; and then in the resulting char matrix we remove columns that are formed by char 0 only. A non-empty code section will have some printable ASCII char, and thus the columns it spans will survive. An empty section will contribute a row, but won't introduce an extra column.

```<code>'\|'    % Push this string: source for regexp matching. It's just | escaped
0'|'h   % Push a string formed by char 0 followed by | (no escaping needed)
YX      % Input string implicitly. Replace first of the above string by the second
o       % Convert from chars to code points. Gives a numeric vector
8M      % Push '|' again
&Yb     % Split numeric vector at occurences of | (the latter is automatically
        % converted  to its code point). This gives a cell array of numeric vectors
Y:      % Unbox cell array: pushes the numeric vectors it contains
&Yd     % Form a block-diagonal matrix from those vectors
ta      % Duplicate. Compute vector that equals true for columns that have some
        % nonzero value
Z)      % Used that as a logical index (mask) for the columns of the matrix.
        % This removes columns that contain only zeros
0ih     % Input comment symbol and prepend char 0 (which will be displayed as space)
Yc      % Append that to each row of the matrix. The matrix is automatically
        % converted from code points to chars
        % Display implicitly
</code>```

Title: Esolang-Comment-Template-Generator

Body:
MATL, <s>33</s> 31 bytes

'\|'0'|'hYXo8M&YbY:&YdtaZ)0ihYc

Try it online!

Explanation

The builtin function Yd (blkdiag), which builds a block-diagonal matrix from its inputs, does most of the work. The fill values in the matrix are 0, and char 0 is treated as a space for displaying purposes. The code would simply split on |, build a matrix from the resulting blocks, convert to char, and append two columns with space and comment symbol.

However, the possibility of empty sections in the input string <s>complicates</s> makes the problem more interesting: the resulting block would be empty and thus wouldn't show in the resulting matrix.

To solve this, we introduce a char 0 before each |, so no block will be empty; and then in the resulting char matrix we remove columns that are formed by char 0 only. A non-empty code section will have some printable ASCII char, and thus the columns it spans will survive. An empty section will contribute a row, but won't introduce an extra column.

'\|'    % Push this string: source for regexp matching. It's just | escaped
0'|'h   % Push a string formed by char 0 followed by | (no escaping needed)
YX      % Input string implicitly. Replace first of the above string by the second
o       % Convert from chars to code points. Gives a numeric vector
8M      % Push '|' again
&Yb     % Split numeric vector at occurences of | (the latter is automatically
        % converted  to its code point). This gives a cell array of numeric vectors
Y:      % Unbox cell array: pushes the numeric vectors it contains
&Yd     % Form a block-diagonal matrix from those vectors
ta      % Duplicate. Compute vector that equals true for columns that have some
        % nonzero value
Z)      % Used that as a logical index (mask) for the columns of the matrix.
        % This removes columns that contain only zeros
0ih     % Input comment symbol and prepend char 0 (which will be displayed as space)
Yc      % Append that to each row of the matrix. The matrix is automatically
        % converted from code points to chars
        % Display implicitly


问:
Simulate a Rubik's cube
A Rubik's cube has 6 colors: red, orange, yellow, white, blue, and green. Red and orange, yellow and white, and blue and green faces are on opposite sides.

Net of a solved Rubik's cube looks like this:

```<code> Y
BRGO
 W
</code>```

And the tiles look like this:

```<code>      Y Y Y
      Y Y Y
      Y Y Y
B B B R R R G G G O O O
B B B R R R G G G O O O
B B B R R R G G G O O O
      W W W
      W W W
      W W W
</code>```

Challenge

Given rotations, reversed rotations, or double rotations output what a solved cube will transform to, as ASCII art or as an image (whitespaces aren't necessary, may or may not exist, trailing whitespaces are allowed.).

Input will be rotation (and optional modifier). Rotation notation goes like: U(p), L(eft), F(ront), R(ight), B(ack), D(own); 2 (double), ' or i (inverse).

All normal rotations will be 90° clockwise, inverse ones will be counterclockwise.

Explanation about clockwiseness: Imagine the cube as you're looking at the red face, and the yellow face is at the top. Then rotate the cube so that the face that the program will rotate will face you. This is the way clockwiseness will work. (Except back face, you will rotate the cube horizontally in that case.)

Input

Input will be a list of moves.

Output

An ASCII art that represents the cube or an image of the net of the cube.

Examples

Input:  (empty)

Output:

```<code>      Y Y Y
      Y Y Y
      Y Y Y
B B B R R R G G G O O O
B B B R R R G G G O O O
B B B R R R G G G O O O
      W W W
      W W W
      W W W
</code>```

Input: U (up)

Output:

```<code>      Y Y Y
      Y Y Y
      Y Y Y
R R R G G G O O O B B B
B B B R R R G G G O O O
B B B R R R G G G O O O
      W W W
      W W W
      W W W
</code>```

Input: U' or Ui (inverse up)

Output:

```<code>      Y Y Y
      Y Y Y
      Y Y Y
O O O B B B R R R G G G
B B B R R R G G G O O O
B B B R R R G G G O O O
      W W W
      W W W
      W W W
</code>```

Input: U2 (double up)

Output:

```<code>      Y Y Y
      Y Y Y
      Y Y Y
G G G O O O B B B R R R
B B B R R R G G G O O O
B B B R R R G G G O O O
      W W W
      W W W
      W W W
</code>```

Input: L' (inversed left)

Output:

```<code>      R Y Y
      R Y Y
      R Y Y
B B B W R R G G G O O Y
B B B W R R G G G O O Y
B B B W R R G G G O O Y
      O W W
      O W W
      O W W
</code>```

Input: R (right)

Output:

```<code>      Y Y R
      Y Y R
      Y Y R
B B B R R W G G G Y O O
B B B R R W G G G Y O O
B B B R R W G G G Y O O
      W W O
      W W O
      W W O
</code>```

Input: U2 L' D (double up, inverse left, down)

Output:

```<code>      O Y Y
      R Y Y
      R Y Y
G B B W O O B B B R R Y
G B B W R R G G G O O Y
O O Y G B B W R R G G G
      R O O
      W W W
      W W W
</code>```

Rules

No loopholes allowed.

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

答:
Python 3, 528 bytes

-7 bytes thanks to my colleague rhsmits (really nice d,*c form & removal of redundant parentheses)

This is a full program.

import re
d,*c=[[f]*9for f in' YBRGOW']
r=lambda f:[f[int(v)]for v in'630741852']
U=lambda c:[r(c[0])]+[c[j%4+1][:3]+c[j][3:]for j in(1,2,3,4)]+[c[5]]
y=lambda c:[r(c[0])]+c[2:5]+[c[1],r(r(r(c[5])))]
z=lambda c:[c[2],r(r(r(c[1]))),c[5],r(c[3]),c[0][::-1],c[4][::-1]]
exec("c="+"(c);c=".join("".join("zzzUz U zzUzz yyyzUzzzy zUzzz yzUzzzyyy".split()[ord(t)%11%7]*(ord(n or'a')%6)for t,n in re.findall("([B-U])(['2i]?)",input())))+"(c)")
k=' '.join
for q in[d,c[0]],c[1:5],[d,c[5]]:
 for w in 0,3,6:print(k(k(f[w:w+3])for f in q))
```
<p>Superflip and all tests are available at <strong>ideone</strong> or <strong>Try it online!</strong></p>
<p>The program:</p>
<ul>
<li>creates the six faces <code>YBRGOW</code> of stickers.</li>
<li>creates a function, <code>r</code>, which <em>only</em> rotates the stickers on a face, clockwise a quarter-turn</li>
<li>creates a function, <code>U</code>, which rotates the <code>U</code> face clockwise a quarter-turn by applying <code>r</code> and rotating the stickers on the top-band of <code>LFRB</code> clockwise a quarter-turn</li>
<li>creates a function, <code>y</code>, which performs <code>r</code> on the <code>U</code> and <code>D</code> faces and slices <code>LFRB</code><br />
- this performs a rotation of the whole cube in the <code>y</code> axis (which runs through <code>U</code> and <code>D</code>)<br />
- the rotation is clockwise if looking from above</li>
<li>creates a function <code>z</code>, which performs a rotation of the whole cube in the <code>z</code> axis clockwise a quarter turn looking at <code>R</code> (the axis runs through <code>R</code> and <code>L</code>) - this time because the way the faces are oriented in our net (same as given in the OP) we have to flip the <code>B</code> and <code>U</code> faces over (they switch from the horizontal to vertical parts of the net and vice-versa)</li>
<li>Performs a regex on the input, <code>input()</code>, (the moves to be performed) matching a character from <code>BUDLRF</code> (actually <code>B-U</code>) possibly followed by a character <code>'i2</code></li>
<li>Performs a mapping from the <code>'i2</code> to the number of clockwise turns (the ordinals of these mod <code>6</code> does the job, with a dummy <code>a</code> to yield <code>1</code> when none is present)</li>
<li>Performs a lookup to map each of these single clockwise turn instructions to a setup of calls to <code>y</code> and <code>z</code>, a quarter-turn of <code>U</code> (which will now be the face instructed), and then the calls to inverse the sequence of the setup performed. Taking the ordinal of the face character modulo by <code>11</code> then by <code>7</code> maps <code>B:0 U:1 D:2 L:3 F:4 R:5</code>, allowing a simple indexing into a string of the function name sequences split by spaces.</li>
<li>executes the string to actually perform the manoeuvre</li>
<li>creates a dummy face <code>d</code> to shorten the printing</li>
<li>prints the result by stepping through the rows in the net and the faces in the row (including a dummy face to the left of each of <code>U</code> and <code>D</code></li>
</ul>
<p>Here is the superflip:</p>
```D:\Python Scripts>python rubiksAscii.py
U R2 F B R B2 R U2 L B2 R U' D' R2 F R' L B2 U2 F2
      Y O Y
      B Y G
      Y R Y
B Y B R Y R G Y G O Y O
O B R B R G R G O G O B
B W B R W R G W G O W O
      W R W
      B W G
      W O W
```

Title: Simulate a Rubik's cube

Body:
Python 3, 528 bytes

-7 bytes thanks to my colleague rhsmits (really nice d,*c form & removal of redundant parentheses)

This is a full program.

import re
d,*c=[[f]*9for f in' YBRGOW']
r=lambda f:[f[int(v)]for v in'630741852']
U=lambda c:[r(c[0])]+[c[j%4+1][:3]+c[j][3:]for j in(1,2,3,4)]+[c[5]]
y=lambda c:[r(c[0])]+c[2:5]+[c[1],r(r(r(c[5])))]
z=lambda c:[c[2],r(r(r(c[1]))),c[5],r(c[3]),c[0][::-1],c[4][::-1]]
exec("c="+"(c);c=".join("".join("zzzUz U zzUzz yyyzUzzzy zUzzz yzUzzzyyy".split()[ord(t)%11%7]*(ord(n or'a')%6)for t,n in re.findall("([B-U])(['2i]?)",input())))+"(c)")
k=' '.join
for q in[d,c[0]],c[1:5],[d,c[5]]:
 for w in 0,3,6:print(k(k(f[w:w+3])for f in q))

Superflip and all tests are available at ideone or <a href="https://tio.run/##bVJfa9swEH/3p7gJgqREDbGdpJuGGYTSMQgMDKYMTQ@ZHTOnie3ablN77LOnd0rC@jAJ3elOv/uvuu9@V2V4SqtsG3HOf56KQ101HTRbL1PjNDImt@NPedVADkXJ4ccq/vr9gVuvifabw69sA7k2uSnKTrxIS7gXwi3D2e3c/7gIEJlckak2jUjNzEo7ManZjeYT3xod2gkK1oTa2e/QXvgqUKGan4ELa73@f05SE@iFg/hWNYI2oaWU1hveGSDu37tP74pwisTQkjDDPPQNeknN/HK13vZ1mwqWRmzCRCo/42W6qzA5duXDMCQDJEBsgL7viQ89OAYXqe/ZtK33RSekqZpMdHLk@6NbOxYklVA1fMPlaCmp@E6VWD52f5oXZbbZ7wUTZnWTWCkMDwr7RTJVlPUzOsPl8mLSe4w4cJeTR06e0IXJXFVUkI89Uk7GRmoPCHKkKDNs8VLXDQ3vEXdujvo4wYZcxw1PUp7wV3iei9lCBIa1z/W2yfcfag1JHNyv4lUQJ8GaKL/jqIk5CklwHzAFjE7iSOGoU6450fisgDWHO2Zd5i0FPcfCRHG5@2WSGlqnOyfMv9GTZn/@Mj5F28OmE62UDuEGR19avjOQpzc" rel="nofollow noreferrer" title="Python 3 – Try It Online">Try it online!

The program:

creates the six faces YBRGOW of stickers.

creates a function, r, which only rotates the stickers on a face, clockwise a quarter-turn

creates a function, U, which rotates the U face clockwise a quarter-turn by applying r and rotating the stickers on the top-band of LFRB clockwise a quarter-turn

creates a function, y, which performs r on the U and D faces and slices LFRB

- this performs a rotation of the whole cube in the y axis (which runs through U and D)

- the rotation is clockwise if looking from above

creates a function z, which performs a rotation of the whole cube in the z axis clockwise a quarter turn looking at R (the axis runs through R and L) - this time because the way the faces are oriented in our net (same as given in the OP) we have to flip the B and U faces over (they switch from the horizontal to vertical parts of the net and vice-versa)

Performs a regex on the input, input(), (the moves to be performed) matching a character from BUDLRF (actually B-U) possibly followed by a character 'i2

Performs a mapping from the 'i2 to the number of clockwise turns (the ordinals of these mod 6 does the job, with a dummy a to yield 1 when none is present)

Performs a lookup to map each of these single clockwise turn instructions to a setup of calls to y and z, a quarter-turn of U (which will now be the face instructed), and then the calls to inverse the sequence of the setup performed. Taking the ordinal of the face character modulo by 11 then by 7 maps B:0 U:1 D:2 L:3 F:4 R:5, allowing a simple indexing into a string of the function name sequences split by spaces.

executes the string to actually perform the manoeuvre

creates a dummy face d to shorten the printing

prints the result by stepping through the rows in the net and the faces in the row (including a dummy face to the left of each of U and D

Here is the superflip:

D:\Python Scripts>python rubiksAscii.py
U R2 F B R B2 R U2 L B2 R U' D' R2 F R' L B2 U2 F2
      Y O Y
      B Y G
      Y R Y
B Y B R Y R G Y G O Y O
O B R B R G R G O G O B
B W B R W R G W G O W O
      W R W
      B W G
      W O W


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

Examples:

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

Explanation:

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

2 Number of vertical characters.

+ The character that should display at the edges.

| The character that should display vertically between the edges.

- The character that should display horizontally.

Output of the above example:

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

Other examples:

Input: 7,2,@,|,-

Output:

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

Input: 7,2,+,|,#

Output:

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

Input: 8,3,+,|,#

Output:

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

Input: 8,3,+,@,#

Output:

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

Input: 9,4,^,$,!

Output:

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

Cheating and standard loopholes are not allowed.

Your code must not print anything to STDERR.

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

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

Leaderboard

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

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

Leaderboard

	Author	Language	Size

Winners by Language

Language	User	Score

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

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

```

Title: The Letter E with E

Body:
C, 130 bytes

#define p putchar
#define E for(o=0;o++<O;p(10))p(S);
#define W for(p(P),D=0;D++<C-2;)p(_);p(P);p(10);
f(C,O,P,S,_,D,o){W E W E W}

Usage:

main(){f(7,2,'+','|','-');}

Output

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


答:
Pyke, <s>31</s> <s>28</s> 24 bytes

```<code>\|cDslF2l-hd*Q+Zi:il?+ZK
</code>```

Try it here!

Title: Esolang-Comment-Template-Generator

Body:
Pyke, <s>31</s> <s>28</s> 24 bytes

\|cDslF2l-hd*Q+Zi:il?+ZK

Try it here!


答:
APL (Dyalog Unicode), 28 bytes

Full program. Prompts for code, then for comment character.

⍞,⍤1⍨⎕FMT⎕TC[2]@('|'∘=)⍞,' '
```

Try it online!

⍞,' ' append a space the to prompted-for code

⎕TC[2]@(…) place the 2nd Terminal Control character (Line Feed) at the positions indicated by:

 '|'∘= the mask indicating where the pipe symbol is equal to the characters

⎕FMT ForMaT as a character matrix, evaluating terminal control characters (Line Feed moves the "cursor" down one line)

⍞,⍤1⍨ prompt for comment character and append it to each line (lit. to each 1D sub-array)

Title: Esolang-Comment-Template-Generator

Body:
APL (Dyalog Unicode), 28 bytes

Full program. Prompts for code, then for comment character.

⍞,⍤1⍨⎕FMT⎕TC[2]@('|'∘=)⍞,' '

Try it online!

⍞,' ' append a space the to prompted-for code

⎕TC[2]@(…) place the 2nd Terminal Control character (Line Feed) at the positions indicated by:

 '|'∘= the mask indicating where the pipe symbol is equal to the characters

⎕FMT ForMaT as a character matrix, evaluating terminal control characters (Line Feed moves the "cursor" down one line)

⍞,⍤1⍨ prompt for comment character and append it to each line (lit. to each 1D sub-array)


问:
Naming ionic compounds
An ionic compound is named like so: (metal name) (non-metal suffixed with -ide). Here is a list of all the suffixes that need to be replaced with -ide:

```<code>-on -ogen -ygen -ine -orus -ur -ic -ium
</code>```

The number of atoms of each element in the compound is not used in naming ionic compounds. Ignore the multivalent metal naming rules.

```<code>NaCl -> sodium + chlorine -> sodium chloride.
K2S -> potassium + sulphur -> potassium sulphide (or sulfide).
Yb2P3 -> ytterbium + phosphorus -> ytterbium phosphide.
PbTe2 -> lead + tellurium -> lead telluride.
</code>```

A string containing an ionic compound (NaCl, K2S, Yb2P3) will be given as input. No polyatomic ions will be given. The program has to output the name of this compound.

Since nobody wants to compile the periodic table data themselves, here is a paste that has the names, symbols, and whether or not it is a metal of each element, in this order: (name) (symbol) (is metal?). You can save this to an external file (the length of the file will not be counted), or you can store the data within your program (just discount the length of that string from there.) You may not need all the information provided. Every element is seperated by a newline.

As always with code golf challenges, shortest code wins.

答:
Python, 134 Characters.

```<code>#T is a string containing the provided information on the elements
from re import*
print sub('(orus|[oy]ge|i?..)$','ide',' '.join(split(r'(\w+) %s '%e,T)[1]for e in findall('[A-Z][a-z]?',raw_input())))

T = """Hydrogen H 0
Helium He 0
Lithium Li 1
Beryllium Be 1
Boron B 0
Carbon C 0
Nitrogen N 0
Oxygen O 0
Fluorine F 0
Neon Ne 0
Sodium Na 1
Magnesium Mg 1
Aluminium Al 1
Silicon Si 0
Phosphorus P 0
Sulfur S 0
Chlorine Cl 0
Argon Ar 0
Potassium K 1
Calcium Ca 1
Scandium Sc 1
Titanium Ti 1
Vanadium V 1
Chromium Cr 1
Manganese Mn 1
Iron Fe 1
Cobalt Co 1
Nickel Ni 1
Copper Cu 1
Zinc Zn 1
Gallium Ga 1
Germanium Ge 1
Arsenic As 0
Selenium Se 0
Bromine Br 0
Krypton Kr 0
Rubidium Rb 1
Strontium Sr 1
Yttrium Y 1
Zirconium Zr 1
Niobium Nb  1
Molybdenum Mo 1
Technetium Tc 1
Ruthenium Ru 1
Rhodium Rh 1
Palladium Pd 1
Silver Ag 1
Cadmium Cd 1
Indium In 1
Tin Sn 1
Antimony Sb 1
Tellurium Te 0
Iodine I 0
Xenon Xe 0
Cesium Cs 1
Barium Ba 1
Lanthanum La 1
Cerium Ce 1
Praseodymium Pr 1
Neodymium Nd 1
Promethium Pm 1
Samarium Sm 1
Europium Eu 1
Gadolinium Gd 1
Terbium Tb 1
Dysprosium Dy 1
Holmium Ho 1
Erbium Er 1
Thulium Tm 1
Ytterbium Yb 1
Lutetium Lu 1
Hafnium Hf 1
Tantalum Ta 1
Tungsten W 1
Rhenium Re 1
Osmium Os 1
Iridium Ir 1
Platinum Pt 1
Gold Au 1
Mercury Hg 1
Thallium Tl 1
Lead Pb 1
Bismuth Bi 1
Polonium Po 1
Astatine At 0
Radon Rn 0
Francium Fr 1
Radium Ra 1
Actinium Ac 1
Thorium Th 1
Protactinium Pa 1
Uranium U 1
Neptunium Np 1
Plutonium Pu 1
Americium Am 1
Curium Cm 1
Berkelium Bk 1
Californium Cf 1
Einsteinium Es 1
Fermium Fm 1
Mendelevium Md 1
Nobelium No 1
Lawrencium Lr 1
Rutherfordium Rf 1
Dubnium Db 1
Seaborgium Sg 1
Bohrium Bh 1
Hassium Hs 1
Meitnerium Mt 1
Darmstadtium Ds 1
Roentgenium Rg 1
Copernicium Cp 1
Ununtrium Uut 0
Flerovium Fl 0
Ununpentium Uup 0
Livermorium Lv 0
Ununseptium Uus 0
Ununoctium Uuo 0"""
</code>```

Title: Naming ionic compounds

Body:
Python, 134 Characters.

#T is a string containing the provided information on the elements
from re import*
print sub('(orus|[oy]ge|i?..)$','ide',' '.join(split(r'(\w+) %s '%e,T)[1]for e in findall('[A-Z][a-z]?',raw_input())))

T = """Hydrogen H 0
Helium He 0
Lithium Li 1
Beryllium Be 1
Boron B 0
Carbon C 0
Nitrogen N 0
Oxygen O 0
Fluorine F 0
Neon Ne 0
Sodium Na 1
Magnesium Mg 1
Aluminium Al 1
Silicon Si 0
Phosphorus P 0
Sulfur S 0
Chlorine Cl 0
Argon Ar 0
Potassium K 1
Calcium Ca 1
Scandium Sc 1
Titanium Ti 1
Vanadium V 1
Chromium Cr 1
Manganese Mn 1
Iron Fe 1
Cobalt Co 1
Nickel Ni 1
Copper Cu 1
Zinc Zn 1
Gallium Ga 1
Germanium Ge 1
Arsenic As 0
Selenium Se 0
Bromine Br 0
Krypton Kr 0
Rubidium Rb 1
Strontium Sr 1
Yttrium Y 1
Zirconium Zr 1
Niobium Nb  1
Molybdenum Mo 1
Technetium Tc 1
Ruthenium Ru 1
Rhodium Rh 1
Palladium Pd 1
Silver Ag 1
Cadmium Cd 1
Indium In 1
Tin Sn 1
Antimony Sb 1
Tellurium Te 0
Iodine I 0
Xenon Xe 0
Cesium Cs 1
Barium Ba 1
Lanthanum La 1
Cerium Ce 1
Praseodymium Pr 1
Neodymium Nd 1
Promethium Pm 1
Samarium Sm 1
Europium Eu 1
Gadolinium Gd 1
Terbium Tb 1
Dysprosium Dy 1
Holmium Ho 1
Erbium Er 1
Thulium Tm 1
Ytterbium Yb 1
Lutetium Lu 1
Hafnium Hf 1
Tantalum Ta 1
Tungsten W 1
Rhenium Re 1
Osmium Os 1
Iridium Ir 1
Platinum Pt 1
Gold Au 1
Mercury Hg 1
Thallium Tl 1
Lead Pb 1
Bismuth Bi 1
Polonium Po 1
Astatine At 0
Radon Rn 0
Francium Fr 1
Radium Ra 1
Actinium Ac 1
Thorium Th 1
Protactinium Pa 1
Uranium U 1
Neptunium Np 1
Plutonium Pu 1
Americium Am 1
Curium Cm 1
Berkelium Bk 1
Californium Cf 1
Einsteinium Es 1
Fermium Fm 1
Mendelevium Md 1
Nobelium No 1
Lawrencium Lr 1
Rutherfordium Rf 1
Dubnium Db 1
Seaborgium Sg 1
Bohrium Bh 1
Hassium Hs 1
Meitnerium Mt 1
Darmstadtium Ds 1
Roentgenium Rg 1
Copernicium Cp 1
Ununtrium Uut 0
Flerovium Fl 0
Ununpentium Uup 0
Livermorium Lv 0
Ununseptium Uus 0
Ununoctium Uuo 0"""