问:
Hyper about quines
Inspired by Hyperprogramming: N+N, N×N, N^N all in one.

Thanks to @MartinEnder and @trichoplax for their help in the sandbox.

Definitions

Hyperquines

Define a hyperquine of order n as a quine-like full program or function P  that satisfies all rules that apply to proper quines and, in addition, has the following structure.

P is the concatenation of character‡ groups that consist of n copies of the same character. When P is executed, the output is the concatenation of the same groups, augmented by one more copy of the character.

Examples

In a hypothetical programming language where the source code aabbcc generates the output aaabbbccc, this program constitutes a hyperquine of order 2.

The definition does not require the characters of different groups to be different.

If the source code aabbcc generates the output aaaabbbbcccc, the program is a hyperquine of order 1; the source code consists of six single-character groups, the output of six character pairs.

In GS2, the empty program prints \n, and the program \n prints \n\n. However, neither \n nor \n\n are hyperquines, since they they do not satisfy all properties of proper quines; no part of the source code encodes a different part of the output.

Hyperquine chains

Define a hyperquine chain of length n as a finite sequence of n full programs or n functions

(P1, …, Pn) that satisfies the following constraints.

The outputs of P1, …, Pn-1 are P2, …, Pn, respectively.

P1, …, Pn are hyperquines.

The orders of P1, …, Pn form a strictly increasing sequence of adjacent integers.

Finally, define an infinite hyperquine chain as an infinite sequence of full programs or functions (P1, P2, …) such that each initial interval (P1, …, Pn) constitutes a hyperquine chain of length n.

Examples

In a hypothetical programming language where the source code aabbcc generates the output aaabbbccc, which, in turn, generates the output aaaabbbbcccc, the pair (aabbcc, aaabbbccc) constitutes a hyperquine chain of length 2.

Note that aaaabbbbcccc – the output of the last hyperquine in the chain – doesn't have to produce a specific output; it doesn't even have to be valid source code.

Continuing the previous example, if aaaabbbbcccc generates the output aaaaabbbbbccccc, the triplet (aabbcc, aaabbbccc, aaaabbbbcccc) constitutes a hyperquine chain of length 3.

If this pattern continues forever, the sequence (aabbcc, aaabbbccc, aaaabbbbcccc, …) constitutes an infinite hyperquine chain.

The pair of programs (abc, aabbcc) with outputs (aabbcc, aaaabbbbcccc) is not a hyperquine chain, since the orders of the hyperquines are both 1, so they do not form a strictly increasing sequence.

The pair of programs (aabbcc, aaaabbbbcccc) with outputs (aaaabbbbcccc, aaaaabbbbbccccc) is not a hyperquine chain, since the orders of the hyperquines are 1 and 4, so they do not form a sequence of adjacent integers.

Rules

Task

In a programming language of your choice, write a non-trivial hyperquine chain, i.e., a chain that consists of at least 2 hyperquines.

As usual, your programs may not take any input or access their own source code in any form.

If your interpreter prints an implicit newline, your hyperquines have to account for this.

All standard loopholes – especially those related to quines – apply.

Scoring

The longest hyperquine chain wins. If two or more submissions are tied, the submission among these that starts with the shortest hyperquine (measured in characters‡) wins. As usual, posting time is the final tiebreaker.

‡ You must use the same character encoding for source code, output, character count, and execution. For example, the Python program print 42 is not a 2-character UTF-32 submission, since the interpreter treats each byte as a single character. If your language of choice is not character-based, treat all individual bytes as characters.

答:
Befunge-98, infinite order, <s>54</s> <s>52</s> <s>38</s> 36 bytes

Second approach - infinite order, 36 bytes

This program would actually break at the 34th hyperquine since the ASCII value of " would disrupt the string interpretation (and at 59, ;), but we offset the storage of that value to a position that will never be executed (i.e. (0, 1) instead of (0, 0)).

```<code>1+::0*x01pn'!1+:#jr;,kg10@k!:kg10;#"
</code>```

Try it online: 1, 2, 10, 34, 42

Explanation

```<code>INSTRUCTIONS  STACK (PYTHON PSEUDOCODE)           EXPLANATION
1+            [n]                                 Push n many 1s onto the stack, then sum them up
::            [n]*(at least 3)                    Duplicate that sum at least twice
0*            [n]*(at least 2)+[0]                Push a whole lot of zeros, then multiply them all together
x             [n]*(at least 1)                    Pop a vector off the stack (n, 0) and set the IP delta to that; now the IP is only executing every nth character
01p           [n]*(at least 1)                    Place n in the program at coordinates (0, 1); this is just for storage
n             []                                  Clear the stack
'!1+          ['"']                               '!' is character 33; one less than 34, or '"'
:#jr          ['"']                               We duplicate the 34 (all we care is that it's a rather large number), then turn around and skip that many spaces
                                                  The IP, having jumped 34*n instructions to the left, is now way in the negatives
                                                  Execution resumes on the other side of the program (the following instructions have been reversed for readability
"             [the program of order 1]            The quote-at-the-end-of-the-program is a common trick for one-liner Befunge quines
#; ... ;                                          Jumps into a loop (when the IP hits one semicolon it skips to the next, restarting the loop)
01gk:         [(rest of string), char*(n+2)]      This duplicates the letter n+1 times*, leaving n+2 copies on the stack
!k@                                                If the number on the top of the stack is zero (i.e. we are printing), it will execute '@',
                                                  ending the program; otherwise, it will NOT execute '@' and will instead continue normally
                                                  Vague* 'k' instruction FTW
10gk,                                             If we aren't done yet, print the character n+1 times* (and restart the loop)

* 'k' is a very strange instruction. It pops a number off the stack; if the number is zero, it skips the command in front of it. If the number is greater than zero,
  it will execute the instruction that many times PLUS ONE. This is actually strangely advantageous in this program.
</code>```

First approach - order 34, 52 bytes (uses introspection, so technically not legal)

For the reason in the above post, this program would break at order 34 (though I haven't tested).

```<code>1+::0*x:00p'1\k:00gk,1#;:00g*0g00gk:$00gk,1+:'4-!k@;
</code>```

Try it online!

Title: Hyper about quines

Body:
Befunge-98, infinite order, <s>54</s> <s>52</s> <s>38</s> 36 bytes

Second approach - infinite order, 36 bytes

This program would actually break at the 34th hyperquine since the ASCII value of " would disrupt the string interpretation (and at 59, ;), but we offset the storage of that value to a position that will never be executed (i.e. (0, 1) instead of (0, 0)).

1+::0*x01pn'!1+:#jr;,kg10@k!:kg10;#"

Try it online: 1, 2, <a href="http://befunge-98.tryitonline.net/#code=MTExMTExMTExMSsrKysrKysrKys6Ojo6Ojo6Ojo6Ojo6Ojo6Ojo6OjAwMDAwMDAwMDAqKioqKioqKioqeHh4eHh4eHh4eDAwMDAwMDAwMDAxMTExMTExMTExcHBwcHBwcHBwcG5ubm5ubm5ubm4nJycnJycnJycnISEhISEhISEhITExMTExMTExMTErKysrKysrKysrOjo6Ojo6Ojo6OiMjIyMjIyMjIyNqampqampqampqcnJycnJycnJycjs7Ozs7Ozs7OzssLCwsLCwsLCwsa2tra2tra2tra2dnZ2dnZ2dnZ2cxMTExMTExMTExMDAwMDAwMDAwMEBAQEBAQEBAQEBra2tra2tra2trISEhISEhISEhITo6Ojo6Ojo6Ojpra2tra2tra2trZ2dnZ2dnZ2dnZzExMTExMTExMTEwMDAwMDAwMDAwOzs7Ozs7Ozs7OyMjIyMjIyMjIyMiIiIiIiIiIiIi&input=" rel="nofollow noreferrer">10, <a href="http://befunge-98.tryitonline.net/#code=MTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMSsrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKys6Ojo6Ojo6Ojo6Ojo6Ojo6Ojo6Ojo6Ojo6Ojo6Ojo6Ojo6Ojo6Ojo6Ojo6Ojo6Ojo6Ojo6Ojo6Ojo6Ojo6Ojo6Ojo6OjAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqeHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAxMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcG5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm4nJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnISEhISEhISEhISEhISEhISEhISEhISEhISEhISEhISEhITExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTErKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrOjo6Ojo6Ojo6Ojo6Ojo6Ojo6Ojo6Ojo6Ojo6Ojo6Ojo6OiMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyNqampqampqampqampqampqampqampqampqampqampqampqcnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycjs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OzssLCwsLCwsLCwsLCwsLCwsLCwsLCwsLCwsLCwsLCwsLCwsa2tra2tra2tra2tra2tra2tra2tra2tra2tra2tra2tra2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2cxMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBra2tra2tra2tra2tra2tra2tra2tra2tra2tra2tra2trISEhISEhISEhISEhISEhISEhISEhISEhISEhISEhISEhITo6Ojo6Ojo6Ojo6Ojo6Ojo6Ojo6Ojo6Ojo6Ojo6Ojo6Ojpra2tra2tra2tra2tra2tra2tra2tra2tra2tra2tra2trZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZzExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTEwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIi&input=" rel="nofollow noreferrer">34, <a href="http://befunge-98.tryitonline.net/#code=MTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrOjo6Ojo6Ojo6Ojo6Ojo6Ojo6Ojo6Ojo6Ojo6Ojo6Ojo6Ojo6Ojo6Ojo6Ojo6Ojo6Ojo6Ojo6Ojo6Ojo6Ojo6Ojo6Ojo6Ojo6Ojo6Ojo6Ojo6Ojo6MDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqeHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4MDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwbm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5uJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnISEhISEhISEhISEhISEhISEhISEhISEhISEhISEhISEhISEhISEhISEhMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrOjo6Ojo6Ojo6Ojo6Ojo6Ojo6Ojo6Ojo6Ojo6Ojo6Ojo6Ojo6Ojo6Ojo6IyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjampqampqampqampqampqampqampqampqampqampqampqampqampqampqcnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJycnJyOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7LCwsLCwsLCwsLCwsLCwsLCwsLCwsLCwsLCwsLCwsLCwsLCwsLCwsLCwsa2tra2tra2tra2tra2tra2tra2tra2tra2tra2tra2tra2tra2tra2trZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAa2tra2tra2tra2tra2tra2tra2tra2tra2tra2tra2tra2tra2tra2trISEhISEhISEhISEhISEhISEhISEhISEhISEhISEhISEhISEhISEhISEhOjo6Ojo6Ojo6Ojo6Ojo6Ojo6Ojo6Ojo6Ojo6Ojo6Ojo6Ojo6Ojo6Ojo6a2tra2tra2tra2tra2tra2tra2tra2tra2tra2tra2tra2tra2tra2trZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7IyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIi&input=" rel="nofollow noreferrer">42

Explanation

INSTRUCTIONS  STACK (PYTHON PSEUDOCODE)           EXPLANATION
1+            [n]                                 Push n many 1s onto the stack, then sum them up
::            [n]*(at least 3)                    Duplicate that sum at least twice
0*            [n]*(at least 2)+[0]                Push a whole lot of zeros, then multiply them all together
x             [n]*(at least 1)                    Pop a vector off the stack (n, 0) and set the IP delta to that; now the IP is only executing every nth character
01p           [n]*(at least 1)                    Place n in the program at coordinates (0, 1); this is just for storage
n             []                                  Clear the stack
'!1+          ['"']                               '!' is character 33; one less than 34, or '"'
:#jr          ['"']                               We duplicate the 34 (all we care is that it's a rather large number), then turn around and skip that many spaces
                                                  The IP, having jumped 34*n instructions to the left, is now way in the negatives
                                                  Execution resumes on the other side of the program (the following instructions have been reversed for readability
"             [the program of order 1]            The quote-at-the-end-of-the-program is a common trick for one-liner Befunge quines
#; ... ;                                          Jumps into a loop (when the IP hits one semicolon it skips to the next, restarting the loop)
01gk:         [(rest of string), char*(n+2)]      This duplicates the letter n+1 times*, leaving n+2 copies on the stack
!k@                                                If the number on the top of the stack is zero (i.e. we are printing), it will execute '@',
                                                  ending the program; otherwise, it will NOT execute '@' and will instead continue normally
                                                  Vague* 'k' instruction FTW
10gk,                                             If we aren't done yet, print the character n+1 times* (and restart the loop)

* 'k' is a very strange instruction. It pops a number off the stack; if the number is zero, it skips the command in front of it. If the number is greater than zero,
  it will execute the instruction that many times PLUS ONE. This is actually strangely advantageous in this program.

First approach - order 34, 52 bytes (uses introspection, so technically not legal)

For the reason in the above post, this program would break at order 34 (though I haven't tested).

1+::0*x:00p'1\k:00gk,1#;:00g*0g00gk:$00gk,1+:'4-!k@;

Try it online!


问:
Super Folding Numbers
We have already defined a folding number here.

But now we are going to define a Super Folding Number.  A Super Folding number is a number that if folded enough times it will eventually reach one less than a power of two.  The method of folding is slightly different than in the folding number question.

The folding algorithm goes as follows:

Take the binary representation

e.g. 5882

```<code>1011011111010
</code>```

Spilt it into three partitions.  First half, last half and middle digit (iff it has a odd number of digits)

```<code>101101 1 111010
</code>```

If the middle digit is zero this number cannot be folded

Reverse the second half and superimposed on the first half

```<code>010111
101101
</code>```

Add the digits in place

```<code>111212
</code>```

Iff there are any 2s in the result the number cannot be folded otherwise the new number is the result of the folding algorithm.

A number is a Super Folding number if it can be folded to a continuous string of ones. (All Folding numbers are also Super Folding Numbers)

Your task is to write code that takes in a number and outputs a truthy value if the number is a Super Folding number and falsy otherwise.  You will be scored on the size of your program.

Examples

5200

Convert to binary:

```<code>1010001010000
</code>```

Split in half:

```<code>101000 1 010000
</code>```

The middle is one so we continue
Superimpose the halves:

```<code>000010
101000
</code>```

Added them:

```<code>101010
</code>```

No twos so we continue
Split in half:

```<code>101 010
</code>```

Fold:

```<code>010
101

111
</code>```

The result is 111 (7 in decimal) so this is a Super Folding Number.

Test Cases

The first 100 Super Folding Numbers are:

```<code>101101 1 111010
</code>```0

答:
JavaScript, 149 bytes

```<code>f=(i,n=i.toString(2),l=n.length,m=l/2|0)=>/^1*$/.test(n)?1:/[^01]/.test(n)|!+n[m]&l?0:f(0,+n.slice(0,m)+ +n.slice(m+l%2).split``.reverse().join``+"")
</code>```

Defines a recursive function.

Explanation:

```<code>f=(i                       //Defines the function: i is input
,n=i.toString(2)           //n is the current number
,l=n.length                //l is the length of the number,
,m=l/2|0)=>                //m is the index of the center character
/^1*$/.test(n)?1:          //returns 1 if the number is all ones
/[^01]/.test(n)            //returns 0 if the number has any chars other than 0 or 1
|!+n[m]&l?0:               //or if the middle char is 0
f(0,+n.slice(0,m)+ +n.slice(m+l%2).split``.reverse().join``+"")
                           //otherwise recurses using the first half of the number plus the second half
</code>```

ContentLicense: CC BY-SA 3.0

Title: Super Folding Numbers

Body:
JavaScript, 149 bytes

f=(i,n=i.toString(2),l=n.length,m=l/2|0)=>/^1*$/.test(n)?1:/[^01]/.test(n)|!+n[m]&l?0:f(0,+n.slice(0,m)+ +n.slice(m+l%2).split``.reverse().join``+"")

Defines a recursive function.

Explanation:

f=(i                       //Defines the function: i is input
,n=i.toString(2)           //n is the current number
,l=n.length                //l is the length of the number,
,m=l/2|0)=>                //m is the index of the center character
/^1*$/.test(n)?1:          //returns 1 if the number is all ones
/[^01]/.test(n)            //returns 0 if the number has any chars other than 0 or 1
|!+n[m]&l?0:               //or if the middle char is 0
f(0,+n.slice(0,m)+ +n.slice(m+l%2).split``.reverse().join``+"")
                           //otherwise recurses using the first half of the number plus the second half


问:
Find the Swirling Words!
Don't ask me how or why but while coding on a project I noticed that the characters of a couple of words had a particular pattern referred to the alphabet, I connected each character of the words with the pencil on the alphabet and I obtained two spirals, then I noticed that the first spiral was clockwise and the other was counterclockwise, and other characteristics... so I named them Swirling Words!

A Swirling Word can be:

clockwise or counterclockwise

centripetal or centrifugal

Here there are some examples of Swirling Words:

Task 1:

Write a full program or function that will take a word from standard input and will output if is a Swirling Word and it's characteristics, in a readable format, extended text, 3 characters, flags, etc.

Test cases and example outputs for different words (but you can decide how to represent the results):

```<code>EARTH, GROUP            > NO        // NOT A SWIRLING WORD
OPERA, STAY, IRIS       > SW,CF,CW  // SWIRLING WORD, CENTRIFUGAL, CLOCKWISE
MINER, TAX, PLUG, META  > SW,CF,CC  // SWIRLING WORD, CENTRIFUGAL, COUNTERCLOCKWISE
AXIOM, AXIS, COOK       > SW,CP,CW  // SWIRLING WORD, CENTRIPETAL, CLOCKWISE
WATCH, YETI, PILL       > SW,CP,CC  // SWIRLING WORD, CENTRIPETAL, COUNTERCLOCKWISE

MORE EXAMPLES OF FALSE TEST CASES (NOT SWIRLING WORDS):
EARTH, GROUP, OUTPUT, WORD, CONNECTION, ODD, MOM, DAD,
CHARACTER, EXAMPLE, QUESTION, NEWSLETTER, OTHER
</code>```

Rules:

The connection between the first two characters must be up (like in the graphics), all the even connection must be down, all the odd connections must be up.

You can ignore upper/lowercase or consider/convert all to upper case or all to lower case.

The input words are only characters in the alphabet range of A-Z, no spaces, no punctuation, etc.

If a word has double characters, like "GROOVE", you must collapse the doubles to one character: "GROOVE" > "GROVE".

The input words will contain at least 3 distinct characters. Words like "MOM", "DAD", "LOL" are not valid words.

It's possible to pass multiple times in the same character, like "IRIS".

Shortest code wins.

Task 2:

To obtain more reputation, find the longest Swirling Words, and it's characteristics, that you can find in the english dictionary, following the above rules. You can take for example as reference the complete list of the english words here.

Happy coding!

答:
CJam, 39 bytes

```<code>r{2ew::-V}:D~-_:g_0=\D#)!@:zD-:g_0=\(-!
</code>```

Try it online!

The input can be uppercase or lowercase, but not mixed.

The program inadvertently points out words which are not necessarily centrifugal or centripetal, but otherwise meet the requirements of being spiral. These are described as "circular" in the chart below.

To interpret the output use this chart:

```<code>SPIRAL (output contains four 1s)
-11-11 : Clockwise Centrifugal
-1111  : Clockwise Centripetal
11-11  : Counter-clockwise Centrifugal
1111   : Counter-clockwise Centripetal

CIRCULAR (output contains two 1s)
-11    : Clockwise Circular
11     : Counter-clockwise Circular

NONSPIRAL (output contains a 0)
</code>```

Explanation:

The program actually evaluates whether the sequence of non-zero differences between characters starts off positive or negative, if it alternates in sign, if the magnitudes start off increasing or decreasing, and if it continues to do so. If the magnitudes don't increase or decrease then the program breaks by operating on an empty array. The major steps are shown below (this code will also show the progress of the stack):

```<code>r{2ew::-V}:D~-   e# take difference of overlapping pairs, removing 0s handles duplicates
               ede# store difference function plus 0 as D, it's multipurpose
_:g_0=\          e# compute signs differences, keep first to show starting direction
               ede# -1 = CLOCKWISE, 1 = COUNTERCLOCKWISE
D#)!@            e# difference of signs includes 0 if not alternating, keep in stack
               ede# 1 = ALTERNATING, 0 = NOT ALTERNATING
:zD-:g           e# signs of difference of absolute values, ignoring 0s (fixed magnitude)
_0=\             e# keep first sign in stack to indicate how the sequence starts
               ede# -1 = INCREASING, 1 = DECREASING
(-!              e# remove first item from entire list and see if nothing remains
               ede# 1 = EMPTY(MONOTONE), 0 = NONEMPTY
</code>```

Title: Find the Swirling Words!

Body:
CJam, 39 bytes

r{2ew::-V}:D~-_:g_0=\D#)!@:zD-:g_0=\(-!

Try it online!

The input can be uppercase or lowercase, but not mixed.

The program inadvertently points out words which are not necessarily centrifugal or centripetal, but otherwise meet the requirements of being spiral. These are described as "circular" in the chart below.

To interpret the output use this chart:

SPIRAL (output contains four 1s)
-11-11 : Clockwise Centrifugal
-1111  : Clockwise Centripetal
11-11  : Counter-clockwise Centrifugal
1111   : Counter-clockwise Centripetal

CIRCULAR (output contains two 1s)
-11    : Clockwise Circular
11     : Counter-clockwise Circular

NONSPIRAL (output contains a 0)

Explanation:

The program actually evaluates whether the sequence of non-zero differences between characters starts off positive or negative, if it alternates in sign, if the magnitudes start off increasing or decreasing, and if it continues to do so. If the magnitudes don't increase or decrease then the program breaks by operating on an empty array. The major steps are shown below (this code will also show the progress of the stack):

r{2ew::-V}:D~-   e# take difference of overlapping pairs, removing 0s handles duplicates
               ede# store difference function plus 0 as D, it's multipurpose
_:g_0=\          e# compute signs differences, keep first to show starting direction
               ede# -1 = CLOCKWISE, 1 = COUNTERCLOCKWISE
D#)!@            e# difference of signs includes 0 if not alternating, keep in stack
               ede# 1 = ALTERNATING, 0 = NOT ALTERNATING
:zD-:g           e# signs of difference of absolute values, ignoring 0s (fixed magnitude)
_0=\             e# keep first sign in stack to indicate how the sequence starts
               ede# -1 = INCREASING, 1 = DECREASING
(-!              e# remove first item from entire list and see if nothing remains
               ede# 1 = EMPTY(MONOTONE), 0 = NONEMPTY


问:
Simple cat program
One of the most common standard tasks (especially when showcasing esoteric programming languages) is to implement a "cat program": read all of STDIN and print it to STDOUT. While this is named after the Unix shell utility cat it is of course much less powerful than the real thing, which is normally used to print (and concatenate) several files read from disc.

Task

You should write a full program which reads the contents of the standard input stream and writes them verbatim to the standard output stream. If and only if your language does not support standard input and/or output streams (as understood in most languages), you may instead take these terms to mean their closest equivalent in your language (e.g. JavaScript's prompt and alert). These are the only admissible forms of I/O, as any other interface would largely change the nature of the task and make answers much less comparable.

The output should contain exactly the input and nothing else. The only exception to this rule is constant output of your language's interpreter that cannot be suppressed, such as a greeting, ANSI color codes or indentation. This also applies to trailing newlines. If the input does not contain a trailing newline, the output shouldn't include one either! (The only exception being if your language absolutely always prints a trailing newline after execution.)

Output to the standard error stream is ignored, so long as the standard output stream contains the expected output. In particular, this means your program can terminate with an error upon hitting the end of the stream (EOF), provided that doesn't pollute the standard output stream. If you do this, I encourage you to add an error-free version to your answer as well (for reference).

As this is intended as a challenge within each language and not between languages, there are a few language specific rules:

If it is at all possible in your language to distinguish null bytes in the standard input stream from the EOF, your program must support null bytes like any other bytes (that is, they have to be written to the standard output stream as well).

If it is at all possible in your language to support an arbitrary infinite input stream (i.e. if you can start printing bytes to the output before you hit EOF in the input), your program has to work correctly in this case. As an example yes | tr -d \\n | ./my_cat should print an infinite stream of ys. It is up to you how often you print and flush the standard output stream, but it must be guaranteed to happen after a finite amount of time, regardless of the stream (this means, in particular, that you cannot wait for a specific character like a linefeed before printing).

Please add a note to your answer about the exact behaviour regarding null-bytes, infinite streams, and extraneous output.

Additional rules

This is not about finding the language with the shortest solution for this (there are some where the empty program does the trick) - this is about finding the shortest solution in every language. Therefore, no answer will be marked as accepted.

Submissions in most languages will be scored in bytes in an appropriate preexisting encoding, usually (but not necessarily) UTF-8.

Some languages, like Folders, are a bit tricky to score. If in doubt, please ask on Meta.

Feel free to use a language (or language version) even if it's newer than this challenge. Languages specifically written to submit a 0-byte answer to this challenge are fair game but not particularly interesting.

Note that there must be an interpreter so the submission can be tested. It is allowed (and even encouraged) to write this interpreter yourself for a previously unimplemented language.

Also note that languages do have to fulfil our usual criteria for programming languages.

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

Unless they have been overruled earlier, all standard code-golf rules apply, including the http://meta.codegolf.stackexchange.com/q/1061.

As a side note, please don't downvote boring (but valid) answers in languages where there is not much to golf; these are still useful to this question as it tries to compile a catalogue as complete as possible. However, do primarily upvote answers in languages where the author actually had to put effort into golfing the code.

Catalogue

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

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

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

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

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

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

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

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

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

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

Shortest Solution by Language

Language	User	Score

Leaderboard

	Author	Language	Size

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

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

```

答:
Racket 35 bytes

```<code>(let l()(displayln(read-line))(l))
</code>```

Ungolfed:

```<code>(define (f)
    (let loop()
      (displayln
       (read-line))
      (loop)))
</code>```

To run:

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

Title: Simple cat program

Body:
Racket 35 bytes

(let l()(displayln(read-line))(l))

Ungolfed:

(define (f)
    (let loop()
      (displayln
       (read-line))
      (loop)))

To run:

(f)


答:
Here's my first ever shot at code golf:

Python 3, 167 bytes

167 bytes if tabs or single spaces are used for indentation

```<code>def f(n):
 B=bin(n)[2:];L=len(B);M=L//2
 if'1'*L==B:return 1
 S=str(int(B[:M])+int(B[:-M-1:-1]))
 return 0if(~L%2==0and'0'==B[M])or'2'in S else{S}=={'1'}or f(int(S,2))
</code>```

Edit: Thanks to everyone's help below, the code above has been reduced from an original size of 232 bytes!

Title: Super Folding Numbers

Body:
We have already defined a folding number here.

But now we are going to define a Super Folding Number.  A Super Folding number is a number that if folded enough times it will eventually reach one less than a power of two.  The method of folding is slightly different than in the folding number question.

The folding algorithm goes as follows:

Take the binary representation

e.g. 5882

```<code>1011011111010
</code>```

Spilt it into three partitions.  First half, last half and middle digit (iff it has a odd number of digits)

```<code>101101 1 111010
</code>```

If the middle digit is zero this number cannot be folded

Reverse the second half and superimposed on the first half

```<code>010111
101101
</code>```

Add the digits in place

```<code>111212
</code>```

Iff there are any 2s in the result the number cannot be folded otherwise the new number is the result of the folding algorithm.

A number is a Super Folding number if it can be folded to a continuous string of ones. (All Folding numbers are also Super Folding Numbers)

Your task is to write code that takes in a number and outputs a truthy value if the number is a Super Folding number and falsy otherwise.  You will be scored on the size of your program.

Examples

5200

Convert to binary:

```<code>1010001010000
</code>```

Split in half:

```<code>101000 1 010000
</code>```

The middle is one so we continue
Superimpose the halves:

```<code>000010
101000
</code>```

Added them:

```<code>101010
</code>```

No twos so we continue
Split in half:

```<code>101 010
</code>```

Fold:

```<code>010
101

111
</code>```

The result is 111 (7 in decimal) so this is a Super Folding Number.

Test Cases

The first 100 Super Folding Numbers are:

```<code>101101 1 111010
</code>```0

Body:
Here's my first ever shot at code golf:

Python 3, 167 bytes

167 bytes if tabs or single spaces are used for indentation

def f(n):
 B=bin(n)[2:];L=len(B);M=L//2
 if'1'*L==B:return 1
 S=str(int(B[:M])+int(B[:-M-1:-1]))
 return 0if(~L%2==0and'0'==B[M])or'2'in S else{S}=={'1'}or f(int(S,2))

Edit: Thanks to everyone's help below, the code above has been reduced from an original size of 232 bytes!


问:
KITT car ASCII art
The 80's TV series Knight Rider featured an intelligent, self-aware car called KITT. One distinctive aspect of the car was a front-mounted scanner bar that allowed KITT to "see" (and that looked suspiciously familiar to fans of another, earlier TV series).

The scanner had eight lights as seen in this picture:

The lights "moved" as shown in this animated image.

Your task, as you have guessed by now, it to recreate the scanner bar with the moving lights in ASCII art.

The challenge

Given an integer t, output the state of the scanner bar at that instant, defined as follows:

The scanner consists of eight lights.

At any instant one of the lights is active, and is shown as #. The lights that were active at times t-1 and t-2 are now dimmed, and are shown as +; unless they coincide with the current active one. The rest of the lights are off, and are shown as -.

The active light moves left to right, then right to left.

The exact output for each t is detailed below.

```<code>0  -->  #++-----   % The leftmost light is active, and it just came from the right.
                   % The two neighbouring lights are dimmed
1  -->  +#------   % The active light has bounced to the right, and it is covering
                   % one of the two lights that should be dimmed. So there is only
                   % one dimmed light
2  -->  ++#-----   % The active light has moved one more step to the right, and the
                   % two trailing dimmed lights are visible
3  -->  -++#----
7  -->  -----++#
8  -->  ------#+   % The active light has bounced to the left
9  -->  -----#++
10 -->  ----#++-
13 -->  -#++----
14 -->  #++-----   % Same as 0
15 -->  +#------   % Same as 1
</code>```

For negative values of t the cycle is simply extended:

```<code>-1 -->  -#++----   % Same as 13
-2 -->  --#++---   % Same as 12
</code>```

#Additional rules

You can write a program or function.

Output can contain trailing whitespace and a leading newline.

Shortest code in bytes wins.

答:
Pyth, <s>33</s> 28 bytes

Saved 5 bytes by calculating all the lights the same way.

```<code>X:*8\-@LJ+U7_S7,-Q2tQ\+@JQ\#
</code>```

Starts with the lights all off and turns them on one at a time.

Try it out online!

ContentLicense: CC BY-SA 4.0

Title: KITT car ASCII art

Body:
Pyth, <s>33</s> 28 bytes

Saved 5 bytes by calculating all the lights the same way.

X:*8\-@LJ+U7_S7,-Q2tQ\+@JQ\#

Starts with the lights all off and turns them on one at a time.

Try it out online!


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

Possible outputs could be:

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

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

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

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

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

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

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

The separator must not change at any point.

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

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

Scoring

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

Leaderboard

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

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

Leaderboard

	Author	Language	Size

Winners by Language

Language	User	Score

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

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

```

答:
RProgN, <s>22</s> 21 Bytes

```<code>►0p11¿]p]0\-p1+]}
</code>```

Note the trailing space IS required.

Saved a byte by replacing the -1 * n with a simple 0 - n, because defining -1 in ► form takes too many bytes.

Explination

```<code>►           # Read this word as a single-character based command.
0p          # Print the number 0
11          # Push two 1's to the stack.
¿           # While the top of the stack is truthy, pop the top of the stack.
    ]       # Clone the top of the stack, containing i.
    p       # Print it.
    ]       # Clone it again.
    0 \ - * # Push 0 to the stack, swap the 0 and the object underneith it, giving 0, n instead of n, 0. Subtract giving -n.
    p       # Print it.
    1+      # Add one to i
    ]       # Clone it for the next truthy check
}           # End the while statement
            # Required to interpret the while loop correctly.
</code>```

Output

```<code>0
1
-1
2
-2
3
-3
4
-4
5
...
</code>```

This language looks nothing like it's former self. ;(

Title: Print all integers

Body:
RProgN, <s>22</s> 21 Bytes

►0p11¿]p]0\-p1+]}

Note the trailing space IS required.

Saved a byte by replacing the -1 * n with a simple 0 - n, because defining -1 in ► form takes too many bytes.

Explination

►           # Read this word as a single-character based command.
0p          # Print the number 0
11          # Push two 1's to the stack.
¿           # While the top of the stack is truthy, pop the top of the stack.
    ]       # Clone the top of the stack, containing i.
    p       # Print it.
    ]       # Clone it again.
    0 \ - * # Push 0 to the stack, swap the 0 and the object underneith it, giving 0, n instead of n, 0. Subtract giving -n.
    p       # Print it.
    1+      # Add one to i
    ]       # Clone it for the next truthy check
}           # End the while statement
            # Required to interpret the while loop correctly.

Output

0
1
-1
2
-2
3
-3
4
-4
5
...

This language looks nothing like it's former self. ;(


答:
JavaScript (ES6), <s>113</s> <s>109</s> 108 bytes

f=(n,[h,...r]=n.toString(2),b='')=>++n&-n-n?h?f(2,r,r[0]?b+(h- -r.pop()):+h?b:2):!isNaN(n=+('0b'+b))&&f(n):1
```

<h3>Formatted and commented</h3>

<pre class="lang-js prettyprint-override"><code>f = (                               // given:
  n,                                // - n = integer to process
  [h, ...r] = n.toString(2),        // - h = highest bit, r = remaining low bits
  b = ''                            // - b = folded binary string
) =>                                //
  ++n & -n - n ?                    // if n is not of the form 2^N - 1:
    h ?                             //   if there's still at least one bit to process:
      f(                            //     do a recursive call with:
        2,                          //     - n = 2 to make the 2^N - 1 test fail
        r,                          //     - r = remaining bits
        r[0] ?                      //     - if there's at least one remaining low bit:
          b + (h - -r.pop())        //       append sum of highest bit + lowest bit to b
        : +h ? b : 2                //       else, h is the middle bit: let b unchanged
      )                             //       if it is set or force error if it's not
    : !isNaN(n = +('0b' + b)) &&    //   else, if b is a valid binary string:
      f(n)                          //     relaunch the entire process on it
  : 1                               // else: n is a super folding number -> success
</code>```

Demo

f=(n,[h,...r]=n.toString(2),b='')=>++n&-n-n?h?f(2,r,r[0]?b+(h- -r.pop()):+h?b:2):!isNaN(n=+('0b'+b))&&f(n):1

// testing integers in [1 .. 99]
for(var i = 1; i < 100; i++) {
  f(i) && console.log(i);
}

// testing integers in [1500 .. 1599]
for(var i = 1500; i < 1600; i++) {
  f(i) && console.log(i);
}```

Title: Super Folding Numbers

Body:
JavaScript (ES6), <s>113</s> <s>109</s> 108 bytes

f=(n,[h,...r]=n.toString(2),b='')=>++n&-n-n?h?f(2,r,r[0]?b+(h- -r.pop()):+h?b:2):!isNaN(n=+('0b'+b))&&f(n):1

Formatted and commented

f = (                               // given:
  n,                                // - n = integer to process
  [h, ...r] = n.toString(2),        // - h = highest bit, r = remaining low bits
  b = ''                            // - b = folded binary string
) =>                                //
  ++n & -n - n ?                    // if n is not of the form 2^N - 1:
    h ?                             //   if there's still at least one bit to process:
      f(                            //     do a recursive call with:
        2,                          //     - n = 2 to make the 2^N - 1 test fail
        r,                          //     - r = remaining bits
        r[0] ?                      //     - if there's at least one remaining low bit:
          b + (h - -r.pop())        //       append sum of highest bit + lowest bit to b
        : +h ? b : 2                //       else, h is the middle bit: let b unchanged
      )                             //       if it is set or force error if it's not
    : !isNaN(n = +('0b' + b)) &&    //   else, if b is a valid binary string:
      f(n)                          //     relaunch the entire process on it
  : 1                               // else: n is a super folding number -> success

Demo

f=(n,[h,...r]=n.toString(2),b='')=>++n&-n-n?h?f(2,r,r[0]?b+(h- -r.pop()):+h?b:2):!isNaN(n=+('0b'+b))&&f(n):1

// testing integers in [1 .. 99]
for(var i = 1; i < 100; i++) {
  f(i) && console.log(i);
}

// testing integers in [1500 .. 1599]
for(var i = 1500; i < 1600; i++) {
  f(i) && console.log(i);
}


问:
It's time to make a histogram
Your task is to make a histogram given a sample of arbitrary size.

Input

A float array or any other reasonable form of input with an arbitrary number of elements.

Output

The histogram; more to follow.

How to make a histogram

We'll use the sample: [1.1, 3, 5, 13, 15.5, 21, 29.7, 63, 16, 5, 5.1, 5.01, 51, 61, 13]

To make a histogram, you first separate your observations into classes. The ideal number of classes is the lowest k such that 2^k > n, where k is the number of classes, and n is the number of observations. In our case, k = 4. The number of bars is not final. This k value's purpose is only to find the width of each class.

The width of each class is the range of your data set divided by the number of classes. The range of our data set is 63 - 1.1 = 61.9, so the width of each class is 15.475. This means that the first class is [1.1, 16.575), the second is [16.575, 32.05) and so on. The last class is [63.0, 78.475). The second value of the last class (b in [a,b)) must be greater than the max value of the set.

Now we rearrange our data into the classes; for us:

```<code>[1.1, 16.575): [1.1, 3, 5, 5, 5.01, 5.1, 13, 13, 15.5, 16]
[16.575, 32.05): [21, 29.7]
[32.05, 47.525): []
[47.525, 63.0): [51, 61]
[63.0, 78.475): [63]
</code>```

And finally, we graph!

For our purposes, a bar will be a ▉ stacked for the number of observations in the class (because I think that looks good). You can count the ▉ as one byte in your source code. There should be no space between bars (unless there is an empty bar), nor do you need to label axes or any of that fancy stuff. There can be trailing whitespace at the end of your output. In our case, that would be:

```<code>▉
▉
▉
▉
▉
▉
▉▉
▉▉ ▉
▉▉ ▉▉
</code>```

This is code-golf, so shortest code in bytes wins!

答:
R, <s>105</s> 95 bytes (non-competing)

Takes input from stdin, prints to stdout. As a bonus, outputs an actual histogram as well as the ASCII art. Was able to golf away 10 bytes thanks to partial argument matching (c instead of counts) and reworking the output so as to avoid using apply.

```<code>cat(t(cbind(sapply(h<-hist(scan())$c,function(i)c(rep(" ",max(h)-i),rep("▉",i))),"\n")),sep="")
</code>```

Input:

```<code>1.1, 3, 5, 13, 15.5, 21, 29.7, 63, 16, 5, 5.1, 5.01, 51, 61, 1
</code>```

Output:

```<code>▉
▉
▉
▉
▉▉
▉▉▉   ▉
▉▉▉  ▉▉
</code>```

This version is non-competing because it just lets R decide what the best number of bins is, using Sturge's formula. (Sturges, H. A. (1926) The choice of a class interval. Journal of the American Statistical Association 21, 65–66.) The OP uses a specific method, which has the last bar reserved exclusively for the maximum value, which is bizarre. R makes it hard to do it this way (perhaps because it was built by statisticians), but it's still possible, in 165 bytes:

```<code>k=ceiling(log2(length(i<-scan())))
cat(t(cbind(sapply(h<-hist(i,br=min(i)+diff(range(i))/k*0:(k+1)-1e-5)$c,function(i)c(rep(" ",max(h)-i),rep("▉",i))),"\n")),sep="")
</code>```

Example output:

```<code>▉
▉
▉
▉
▉
▉
▉
▉
▉▉ ▉
▉▉ ▉▉
</code>```

Title: It's time to make a histogram

Body:
R, <s>105</s> 95 bytes (non-competing)

Takes input from stdin, prints to stdout. As a bonus, outputs an actual histogram as well as the ASCII art. Was able to golf away 10 bytes thanks to partial argument matching (c instead of counts) and reworking the output so as to avoid using apply.

cat(t(cbind(sapply(h<-hist(scan())$c,function(i)c(rep(" ",max(h)-i),rep("▉",i))),"\n")),sep="")

Input:

1.1, 3, 5, 13, 15.5, 21, 29.7, 63, 16, 5, 5.1, 5.01, 51, 61, 1

Output:

▉
▉
▉
▉
▉▉
▉▉▉   ▉
▉▉▉  ▉▉

This version is non-competing because it just lets R decide what the best number of bins is, using Sturge's formula. (Sturges, H. A. (1926) The choice of a class interval. Journal of the American Statistical Association 21, 65–66.) The OP uses a specific method, which has the last bar reserved exclusively for the maximum value, which is bizarre. R makes it hard to do it this way (perhaps because it was built by statisticians), but it's still possible, in 165 bytes:

k=ceiling(log2(length(i<-scan())))
cat(t(cbind(sapply(h<-hist(i,br=min(i)+diff(range(i))/k*0:(k+1)-1e-5)$c,function(i)c(rep(" ",max(h)-i),rep("▉",i))),"\n")),sep="")

Example output:

▉
▉
▉
▉
▉
▉
▉
▉
▉▉ ▉
▉▉ ▉▉


答:
><>, infinite order, 178 bytes

The program contains a trailing linefeed.

```<code>^
.
*
&
:
&
+
*
2
b
*
*
6
9
$
0
)
*
4
8
:
~
.
*
&
:
&
+
*
2
b
*
*
2
b
$
0
)
i
:
-
1
o
a
&
:
&
o
~
.
*
&
:
&
+
*
7
7
*
*
4
6
$
0
)
0
:
-
1
$
o
:
$
&
:
&
&
,
*
8
b
-
1
l
}
*
3
d
'
</code>```

Try it online: 1, 2, 3, 10 (That last one takes a while to run.)

Retina script to generate source from linear program.

Explanation

The main idea is to turn the quine vertical, so that the actual control flow isn't affected by the repetition. E.g. the second hyper quine begins like:

```<code>^^

..

**
</code>```

Since we're only moving through the first column, we don't have to worry about repeated characters. Also when we push the majority of the code as a string with ', this will push a space for each empty line, which gives us a way to determine the number of repetitions. That said, there are some limitations due to these empty lines:

We can't use " to push large numbers as character codes in the main part of the quine, because this would push additional 32s which we don't want.

We can't use ? or ! because they only skip the next character which would be a space in that case (so they wouldn't actually skip the next command).

Hence, all control flow is done with explicit jumps (2D goto, basically), whose actual offsets we need to calculate based on the number of repetitions.

So let's look at the actual code. We start with ^ so the code is executed bottom up. For easier reading, let's write out the actual code in execution order (and drop the ^ because it's never executed again):

```<code>'d3*}l1-b8*,&&:&$:o$1-:0)0$64**77*+&:&*.~o&:&ao1-:i)0$b2**b2*+&:&*.~:84*)0$96**b2*+&:&*.
</code>```

The ' is the standard quining technique for ><> (and Befunge, I guess). It switches to string mode which means that the encountered characters are pushed onto the stack until the next ' is encountered. Empty lines are implicitly padded with spaces which is why we get all the spaces in between. Empty lines at the end of the program are ignored. So after the IP wraps around and hits the ' again, we've got the first column of the program on the stack, except for the ' itself.

Let's look at how we use this to print the entire program.

```<code>d3*}    Put a 36 (the ') at the bottom of the stack. Now the stack holds
        a representation of the entire first column.
l1-     Push the depth of the stack, minus (so minus to ').
b8*,    Divide by 88. The original program has 89 lines. If we divide the
        depth of the stack (minus 1) by 88, we get the order of the current
        hyperquine (due to all the spaces we've pushed).
&       Store the order of the hyperquine in the register.
        Begin of main loop:
&:&       Push a copy of the register onto the stack. Call that N.
          Begin of line-printing loop:
$:o$        Print a copy of the top character on the stack.
1-          Decrement N.
:0)         Check whether it's still positive (gives 0 or 1).
0$          Put a 0 underneath. This will be the x-coordinate of a jump.
64**        Multiply the conditional by 24. This is the number of commands
            in this inner loop.
77*+        Add this to 49, the offset of the end of the loop.
            The result is line we want to jump to in the order-1 hyperquine.
&:&*        Multiply by the order of the quine (so that we jump further on
            higher quine orders).
.         Jump. If N isn't zero yet, this repeats the inner loop. Otherwise
          we continue right here.
~         Discard N (now 0).
o         Output one last copy of the top character on the stack.
&:&       Push a copy of the register onto the stack. Call that N.
          Begin of linefeed-printing loop:
ao          Print a linefeed.
1-          Decrement N.
:i)         Check whether it's still non-negative (gives 0 or 1).
            The next bit is essentially the same loop structure as above,
            but with loop length 22 and offset 22:
0$
b2**
b2*+
&:&*
.         Jump. If N isn't -1 yet, this repeats the inner loop. Otherwise
          we continue right here.
          Begin of space-clearing loop:
~           Discard the top of the stack. On the first iteration this is the
            -1 from the previous loop. Afterwards, it's one of the spaces
            representing an empty line.
:84*)       Check if the top of the stack is a space.
            And another loop conditional. This one works the other way round:
            the difference is 54, which is the distance between the beginning
            of this loop and the main loop. The offset is the beginning
            of this loop, at 22 as above.
0$
96**
b2*+
&:&*
.         Jump. If the top of the stack is still a space this repeats the
          inner loop. Otherwise we continue from the top of the main loop.
</code>```

The program terminates when the stack is empty and the first inner loop fails to print another character.

Title: Hyper about quines

Body:
Inspired by Hyperprogramming: N+N, N×N, N^N all in one.

Thanks to @MartinEnder and @trichoplax for their help in the sandbox.

Definitions

Hyperquines

Define a hyperquine of order n as a quine-like full program or function P  that satisfies all rules that apply to proper quines and, in addition, has the following structure.

P is the concatenation of character‡ groups that consist of n copies of the same character. When P is executed, the output is the concatenation of the same groups, augmented by one more copy of the character.

Examples

In a hypothetical programming language where the source code aabbcc generates the output aaabbbccc, this program constitutes a hyperquine of order 2.

The definition does not require the characters of different groups to be different.

If the source code aabbcc generates the output aaaabbbbcccc, the program is a hyperquine of order 1; the source code consists of six single-character groups, the output of six character pairs.

In GS2, the empty program prints \n, and the program \n prints \n\n. However, neither \n nor \n\n are hyperquines, since they they do not satisfy all properties of proper quines; no part of the source code encodes a different part of the output.

Hyperquine chains

Define a hyperquine chain of length n as a finite sequence of n full programs or n functions

(P1, …, Pn) that satisfies the following constraints.

The outputs of P1, …, Pn-1 are P2, …, Pn, respectively.

P1, …, Pn are hyperquines.

The orders of P1, …, Pn form a strictly increasing sequence of adjacent integers.

Finally, define an infinite hyperquine chain as an infinite sequence of full programs or functions (P1, P2, …) such that each initial interval (P1, …, Pn) constitutes a hyperquine chain of length n.

Examples

In a hypothetical programming language where the source code aabbcc generates the output aaabbbccc, which, in turn, generates the output aaaabbbbcccc, the pair (aabbcc, aaabbbccc) constitutes a hyperquine chain of length 2.

Note that aaaabbbbcccc – the output of the last hyperquine in the chain – doesn't have to produce a specific output; it doesn't even have to be valid source code.

Continuing the previous example, if aaaabbbbcccc generates the output aaaaabbbbbccccc, the triplet (aabbcc, aaabbbccc, aaaabbbbcccc) constitutes a hyperquine chain of length 3.

If this pattern continues forever, the sequence (aabbcc, aaabbbccc, aaaabbbbcccc, …) constitutes an infinite hyperquine chain.

The pair of programs (abc, aabbcc) with outputs (aabbcc, aaaabbbbcccc) is not a hyperquine chain, since the orders of the hyperquines are both 1, so they do not form a strictly increasing sequence.

The pair of programs (aabbcc, aaaabbbbcccc) with outputs (aaaabbbbcccc, aaaaabbbbbccccc) is not a hyperquine chain, since the orders of the hyperquines are 1 and 4, so they do not form a sequence of adjacent integers.

Rules

Task

In a programming language of your choice, write a non-trivial hyperquine chain, i.e., a chain that consists of at least 2 hyperquines.

As usual, your programs may not take any input or access their own source code in any form.

If your interpreter prints an implicit newline, your hyperquines have to account for this.

All standard loopholes – especially those related to quines – apply.

Scoring

The longest hyperquine chain wins. If two or more submissions are tied, the submission among these that starts with the shortest hyperquine (measured in characters‡) wins. As usual, posting time is the final tiebreaker.

‡ You must use the same character encoding for source code, output, character count, and execution. For example, the Python program print 42 is not a 2-character UTF-32 submission, since the interpreter treats each byte as a single character. If your language of choice is not character-based, treat all individual bytes as characters.

Body:
><>, infinite order, 178 bytes

The program contains a trailing linefeed.

^
.
*
&
:
&
+
*
2
b
*
*
6
9
$
0
)
*
4
8
:
~
.
*
&
:
&
+
*
2
b
*
*
2
b
$
0
)
i
:
-
1
o
a
&
:
&
o
~
.
*
&
:
&
+
*
7
7
*
*
4
6
$
0
)
0
:
-
1
$
o
:
$
&
:
&
&
,
*
8
b
-
1
l
}
*
3
d
'

Try it online: 1, <a href="http://fish.tryitonline.net/#code=Xl4KCi4uCgoqKgoKJiYKCjo6CgomJgoKKysKCioqCgoyMgoKYmIKCioqCgoqKgoKNjYKCjk5CgokJAoKMDAKCikpCgoqKgoKNDQKCjg4Cgo6OgoKfn4KCi4uCgoqKgoKJiYKCjo6CgomJgoKKysKCioqCgoyMgoKYmIKCioqCgoqKgoKMjIKCmJiCgokJAoKMDAKCikpCgppaQoKOjoKCi0tCgoxMQoKb28KCmFhCgomJgoKOjoKCiYmCgpvbwoKfn4KCi4uCgoqKgoKJiYKCjo6CgomJgoKKysKCioqCgo3NwoKNzcKCioqCgoqKgoKNDQKCjY2CgokJAoKMDAKCikpCgowMAoKOjoKCi0tCgoxMQoKJCQKCm9vCgo6OgoKJCQKCiYmCgo6OgoKJiYKCiYmCgosLAoKKioKCjg4CgpiYgoKLS0KCjExCgpsbAoKfX0KCioqCgozMwoKZGQKCicnCgo&input=">2, <a href="http://fish.tryitonline.net/#code=Xl5eCgoKLi4uCgoKKioqCgoKJiYmCgoKOjo6CgoKJiYmCgoKKysrCgoKKioqCgoKMjIyCgoKYmJiCgoKKioqCgoKKioqCgoKNjY2CgoKOTk5CgoKJCQkCgoKMDAwCgoKKSkpCgoKKioqCgoKNDQ0CgoKODg4CgoKOjo6CgoKfn5-CgoKLi4uCgoKKioqCgoKJiYmCgoKOjo6CgoKJiYmCgoKKysrCgoKKioqCgoKMjIyCgoKYmJiCgoKKioqCgoKKioqCgoKMjIyCgoKYmJiCgoKJCQkCgoKMDAwCgoKKSkpCgoKaWlpCgoKOjo6CgoKLS0tCgoKMTExCgoKb29vCgoKYWFhCgoKJiYmCgoKOjo6CgoKJiYmCgoKb29vCgoKfn5-CgoKLi4uCgoKKioqCgoKJiYmCgoKOjo6CgoKJiYmCgoKKysrCgoKKioqCgoKNzc3CgoKNzc3CgoKKioqCgoKKioqCgoKNDQ0CgoKNjY2CgoKJCQkCgoKMDAwCgoKKSkpCgoKMDAwCgoKOjo6CgoKLS0tCgoKMTExCgoKJCQkCgoKb29vCgoKOjo6CgoKJCQkCgoKJiYmCgoKOjo6CgoKJiYmCgoKJiYmCgoKLCwsCgoKKioqCgoKODg4CgoKYmJiCgoKLS0tCgoKMTExCgoKbGxsCgoKfX19CgoKKioqCgoKMzMzCgoKZGRkCgoKJycnCgoK&input=">3, <a href="http://fish.tryitonline.net/#code=Xl5eXl5eXl5eXgoKCgoKCgoKCgouLi4uLi4uLi4uCgoKCgoKCgoKCioqKioqKioqKioKCgoKCgoKCgoKJiYmJiYmJiYmJgoKCgoKCgoKCgo6Ojo6Ojo6Ojo6CgoKCgoKCgoKCiYmJiYmJiYmJiYKCgoKCgoKCgoKKysrKysrKysrKwoKCgoKCgoKCgoqKioqKioqKioqCgoKCgoKCgoKCjIyMjIyMjIyMjIKCgoKCgoKCgoKYmJiYmJiYmJiYgoKCgoKCgoKCgoqKioqKioqKioqCgoKCgoKCgoKCioqKioqKioqKioKCgoKCgoKCgoKNjY2NjY2NjY2NgoKCgoKCgoKCgo5OTk5OTk5OTk5CgoKCgoKCgoKCiQkJCQkJCQkJCQKCgoKCgoKCgoKMDAwMDAwMDAwMAoKCgoKCgoKCgopKSkpKSkpKSkpCgoKCgoKCgoKCioqKioqKioqKioKCgoKCgoKCgoKNDQ0NDQ0NDQ0NAoKCgoKCgoKCgo4ODg4ODg4ODg4CgoKCgoKCgoKCjo6Ojo6Ojo6OjoKCgoKCgoKCgoKfn5-fn5-fn5-fgoKCgoKCgoKCgouLi4uLi4uLi4uCgoKCgoKCgoKCioqKioqKioqKioKCgoKCgoKCgoKJiYmJiYmJiYmJgoKCgoKCgoKCgo6Ojo6Ojo6Ojo6CgoKCgoKCgoKCiYmJiYmJiYmJiYKCgoKCgoKCgoKKysrKysrKysrKwoKCgoKCgoKCgoqKioqKioqKioqCgoKCgoKCgoKCjIyMjIyMjIyMjIKCgoKCgoKCgoKYmJiYmJiYmJiYgoKCgoKCgoKCgoqKioqKioqKioqCgoKCgoKCgoKCioqKioqKioqKioKCgoKCgoKCgoKMjIyMjIyMjIyMgoKCgoKCgoKCgpiYmJiYmJiYmJiCgoKCgoKCgoKCiQkJCQkJCQkJCQKCgoKCgoKCgoKMDAwMDAwMDAwMAoKCgoKCgoKCgopKSkpKSkpKSkpCgoKCgoKCgoKCmlpaWlpaWlpaWkKCgoKCgoKCgoKOjo6Ojo6Ojo6OgoKCgoKCgoKCgotLS0tLS0tLS0tCgoKCgoKCgoKCjExMTExMTExMTEKCgoKCgoKCgoKb29vb29vb29vbwoKCgoKCgoKCgphYWFhYWFhYWFhCgoKCgoKCgoKCiYmJiYmJiYmJiYKCgoKCgoKCgoKOjo6Ojo6Ojo6OgoKCgoKCgoKCgomJiYmJiYmJiYmCgoKCgoKCgoKCm9vb29vb29vb28KCgoKCgoKCgoKfn5-fn5-fn5-fgoKCgoKCgoKCgouLi4uLi4uLi4uCgoKCgoKCgoKCioqKioqKioqKioKCgoKCgoKCgoKJiYmJiYmJiYmJgoKCgoKCgoKCgo6Ojo6Ojo6Ojo6CgoKCgoKCgoKCiYmJiYmJiYmJiYKCgoKCgoKCgoKKysrKysrKysrKwoKCgoKCgoKCgoqKioqKioqKioqCgoKCgoKCgoKCjc3Nzc3Nzc3NzcKCgoKCgoKCgoKNzc3Nzc3Nzc3NwoKCgoKCgoKCgoqKioqKioqKioqCgoKCgoKCgoKCioqKioqKioqKioKCgoKCgoKCgoKNDQ0NDQ0NDQ0NAoKCgoKCgoKCgo2NjY2NjY2NjY2CgoKCgoKCgoKCiQkJCQkJCQkJCQKCgoKCgoKCgoKMDAwMDAwMDAwMAoKCgoKCgoKCgopKSkpKSkpKSkpCgoKCgoKCgoKCjAwMDAwMDAwMDAKCgoKCgoKCgoKOjo6Ojo6Ojo6OgoKCgoKCgoKCgotLS0tLS0tLS0tCgoKCgoKCgoKCjExMTExMTExMTEKCgoKCgoKCgoKJCQkJCQkJCQkJAoKCgoKCgoKCgpvb29vb29vb29vCgoKCgoKCgoKCjo6Ojo6Ojo6OjoKCgoKCgoKCgoKJCQkJCQkJCQkJAoKCgoKCgoKCgomJiYmJiYmJiYmCgoKCgoKCgoKCjo6Ojo6Ojo6OjoKCgoKCgoKCgoKJiYmJiYmJiYmJgoKCgoKCgoKCgomJiYmJiYmJiYmCgoKCgoKCgoKCiwsLCwsLCwsLCwKCgoKCgoKCgoKKioqKioqKioqKgoKCgoKCgoKCgo4ODg4ODg4ODg4CgoKCgoKCgoKCmJiYmJiYmJiYmIKCgoKCgoKCgoKLS0tLS0tLS0tLQoKCgoKCgoKCgoxMTExMTExMTExCgoKCgoKCgoKCmxsbGxsbGxsbGwKCgoKCgoKCgoKfX19fX19fX19fQoKCgoKCgoKCgoqKioqKioqKioqCgoKCgoKCgoKCjMzMzMzMzMzMzMKCgoKCgoKCgoKZGRkZGRkZGRkZAoKCgoKCgoKCgonJycnJycnJycnCgoKCgoKCgoKCg&input=">10 (That last one takes a while to run.)

Retina script to generate source from linear program.

Explanation

The main idea is to turn the quine vertical, so that the actual control flow isn't affected by the repetition. E.g. the second hyper quine begins like:

^^

..

**

Since we're only moving through the first column, we don't have to worry about repeated characters. Also when we push the majority of the code as a string with ', this will push a space for each empty line, which gives us a way to determine the number of repetitions. That said, there are some limitations due to these empty lines:

We can't use " to push large numbers as character codes in the main part of the quine, because this would push additional 32s which we don't want.

We can't use ? or ! because they only skip the next character which would be a space in that case (so they wouldn't actually skip the next command).

Hence, all control flow is done with explicit jumps (2D goto, basically), whose actual offsets we need to calculate based on the number of repetitions.

So let's look at the actual code. We start with ^ so the code is executed bottom up. For easier reading, let's write out the actual code in execution order (and drop the ^ because it's never executed again):

'd3*}l1-b8*,&&:&$:o$1-:0)0$64**77*+&:&*.~o&:&ao1-:i)0$b2**b2*+&:&*.~:84*)0$96**b2*+&:&*.

The ' is the standard quining technique for ><> (and Befunge, I guess). It switches to string mode which means that the encountered characters are pushed onto the stack until the next ' is encountered. Empty lines are implicitly padded with spaces which is why we get all the spaces in between. Empty lines at the end of the program are ignored. So after the IP wraps around and hits the ' again, we've got the first column of the program on the stack, except for the ' itself.

Let's look at how we use this to print the entire program.

d3*}    Put a 36 (the ') at the bottom of the stack. Now the stack holds
        a representation of the entire first column.
l1-     Push the depth of the stack, minus (so minus to ').
b8*,    Divide by 88. The original program has 89 lines. If we divide the
        depth of the stack (minus 1) by 88, we get the order of the current
        hyperquine (due to all the spaces we've pushed).
&       Store the order of the hyperquine in the register.
        Begin of main loop:
&:&       Push a copy of the register onto the stack. Call that N.
          Begin of line-printing loop:
$:o$        Print a copy of the top character on the stack.
1-          Decrement N.
:0)         Check whether it's still positive (gives 0 or 1).
0$          Put a 0 underneath. This will be the x-coordinate of a jump.
64**        Multiply the conditional by 24. This is the number of commands
            in this inner loop.
77*+        Add this to 49, the offset of the end of the loop.
            The result is line we want to jump to in the order-1 hyperquine.
&:&*        Multiply by the order of the quine (so that we jump further on
            higher quine orders).
.         Jump. If N isn't zero yet, this repeats the inner loop. Otherwise
          we continue right here.
~         Discard N (now 0).
o         Output one last copy of the top character on the stack.
&:&       Push a copy of the register onto the stack. Call that N.
          Begin of linefeed-printing loop:
ao          Print a linefeed.
1-          Decrement N.
:i)         Check whether it's still non-negative (gives 0 or 1).
            The next bit is essentially the same loop structure as above,
            but with loop length 22 and offset 22:
0$
b2**
b2*+
&:&*
.         Jump. If N isn't -1 yet, this repeats the inner loop. Otherwise
          we continue right here.
          Begin of space-clearing loop:
~           Discard the top of the stack. On the first iteration this is the
            -1 from the previous loop. Afterwards, it's one of the spaces
            representing an empty line.
:84*)       Check if the top of the stack is a space.
            And another loop conditional. This one works the other way round:
            the difference is 54, which is the distance between the beginning
            of this loop and the main loop. The offset is the beginning
            of this loop, at 22 as above.
0$
96**
b2*+
&:&*
.         Jump. If the top of the stack is still a space this repeats the
          inner loop. Otherwise we continue from the top of the main loop.

The program terminates when the stack is empty and the first inner loop fails to print another character.


答:
CJam, <s>47</s> 44 bytes

```<code>ri2b{_W%.+__0e=)\_,1>\0-X+:*3<*&}{_,2/<}w2-!
</code>```

Try it online! or generate a list of super folding numbers up to a given number.

Golfing attempts can be seen here.

The code breaks down to the following phases:

```<code>ri2b                e# get input in binary
{                   e# While fold is legal
 _W%.+_             e#   "fold" the whole number onto itself
 _0e=)\             e#   count zeros and add 1 (I)
 _,1>\              e#   size check, leave 0 if singleton (II)*
 0-X+:*3<           e#   product of 2s, leave 0 if too many (III)
 *&                 e#   (II AND III) AND parity of I
}{                  e# Do
 _,2/<              e#   slice opposite to the actual fold**
}w                  e# End while
2-!                 e# return 1 if "fold" ended in all 2s
</code>```

EDIT: This version more or less takes a De Morgan's Law approach to the previous version.

*The problem with running on singletons is that we get stuck with an empty string after the slice.

** If a binary number is super folding, its mirror image (with leading 0s if needed) is. This saves a byte over taking the right half.

Title: Super Folding Numbers

Body:
CJam, <s>47</s> 44 bytes

ri2b{_W%.+__0e=)\_,1>\0-X+:*3<*&}{_,2/<}w2-!

Try it online! or generate a list of super folding numbers up to a given number.

Golfing attempts can be seen here.

The code breaks down to the following phases:

ri2b                e# get input in binary
{                   e# While fold is legal
 _W%.+_             e#   "fold" the whole number onto itself
 _0e=)\             e#   count zeros and add 1 (I)
 _,1>\              e#   size check, leave 0 if singleton (II)*
 0-X+:*3<           e#   product of 2s, leave 0 if too many (III)
 *&                 e#   (II AND III) AND parity of I
}{                  e# Do
 _,2/<              e#   slice opposite to the actual fold**
}w                  e# End while
2-!                 e# return 1 if "fold" ended in all 2s

EDIT: This version more or less takes a De Morgan's Law approach to the previous version.

*The problem with running on singletons is that we get stuck with an empty string after the slice.

** If a binary number is super folding, its mirror image (with leading 0s if needed) is. This saves a byte over taking the right half.


问:
Let's do the Wave!
Input:

A string (the wave-snippet) with a length >= 2.

A positive integer n >= 1.

Output:

We output a single-line wave. We do this by repeating the input string n times.

Challenge rules:

If the first and last character of the input string matches, we only output it once in the total output (i.e. ^_^ of length 2 becomes ^_^_^ and not ^_^^_^).

The input string won't contain any whitespaces/tabs/new-lines/etc.

If your language doesn't support non-ASCII characters, then that's fine. As long as it still complies to the challenge with ASCII-only wave-input.

General rules:

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

Don't let code-golf languages discourage you from posting answers with non-codegolfing languages. Try to come up with an as short as possible answer for 'any' programming language.

Standard rules apply for your answer, so you are allowed to use STDIN/STDOUT, functions/method with the proper parameters, full programs. Your call.

Default Loopholes are forbidden.

If possible, please add a link with a test for your code.

Also, please add an explanation if necessary.

Test cases:

```<code>_.~"(              length 12
_.~"(_.~"(_.~"(_.~"(_.~"(_.~"(_.~"(_.~"(_.~"(_.~"(_.~"(_.~"(

'°º¤o,¸¸,o¤º°'     length 3
'°º¤o,¸¸,o¤º°'°º¤o,¸¸,o¤º°'°º¤o,¸¸,o¤º°'

-__                length 1
-__

-__                length 8
-__-__-__-__-__-__-__-__

-__-               length 8
-__-__-__-__-__-__-__-__-

¯`·.¸¸.·´¯         length 24
¯`·.¸¸.·´¯`·.¸¸.·´¯`·.¸¸.·´¯`·.¸¸.·´¯`·.¸¸.·´¯`·.¸¸.·´¯`·.¸¸.·´¯`·.¸¸.·´¯`·.¸¸.·´¯`·.¸¸.·´¯`·.¸¸.·´¯`·.¸¸.·´¯`·.¸¸.·´¯`·.¸¸.·´¯`·.¸¸.·´¯`·.¸¸.·´¯`·.¸¸.·´¯`·.¸¸.·´¯`·.¸¸.·´¯`·.¸¸.·´¯`·.¸¸.·´¯`·.¸¸.·´¯`·.¸¸.·´¯`·.¸¸.·´¯

**                 length 6
*******

String & length of your own choice (be creative!)
</code>```

答:
Java 11, <s>123</s> <s>111</s> <s>109</s> <s>107</s> <s>102</s> <s>100</s> <s>79</s> 58 bytes

s->n->s+s.substring(s.matches("(.).*\\1")?1:0).repeat(n-1)
```
<p>Try it online.</p>
<p>I'll of course try to answer my own question. ;)<br />
-5 bytes thanks to <em>@dpa97</em>.<br />
-21 bytes converting from Java 7 to 10.<br />
-21 bytes converting from Java 10 to 11.</p>
<p><strong>Explanation:</strong></p>
<pre class="lang-java prettyprint-override"><code>s->n->             // Method with String & integer parameters and String return-type
  s                //  Return the input-String as result
   +               //  Appended with:
    s.subtring(    //   A substring of the input-String:
      s.matches("(.).*\\1")?
                   //    If the first and last characters are the same:
       1           //     Remove the first character in the substring-call
      :            //    Else:
       0)          //     Use the input-String as is
     .repeat(n-1)  //   Repeated the input-integer minus 1 amount of times
</code>```

Title: Let's do the Wave!

Body:
Java 11, <s>123</s> <s>111</s> <s>109</s> <s>107</s> <s>102</s> <s>100</s> <s>79</s> 58 bytes

s->n->s+s.substring(s.matches("(.).*\\1")?1:0).repeat(n-1)

Try it online.

I'll of course try to answer my own question. ;)

-5 bytes thanks to @dpa97.

-21 bytes converting from Java 7 to 10.

-21 bytes converting from Java 10 to 11.

Explanation:

s->n->             // Method with String & integer parameters and String return-type
  s                //  Return the input-String as result
   +               //  Appended with:
    s.subtring(    //   A substring of the input-String:
      s.matches("(.).*\\1")?
                   //    If the first and last characters are the same:
       1           //     Remove the first character in the substring-call
      :            //    Else:
       0)          //     Use the input-String as is
     .repeat(n-1)  //   Repeated the input-integer minus 1 amount of times


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

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

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

"A", whether uppercase or lowercase.

"U", whether lowercase or uppercase.

X, whether uppercase or lowercase.

+

&

#

0

1

4

5

6

7

9

Cheating, loopholes, etc, are not allowed.

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

Validity Checker

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

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

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

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

<h3>Leaderboard</h3>

<p><div class="snippet" data-lang="js" data-hide="true" data-console="false" data-babel="false">
<div class="snippet-code snippet-currently-hidden">
<pre class="snippet-code-js lang-js prettyprint-override"><code>var QUESTION_ID=90349,OVERRIDE_USER=58717;function answersUrl(e){return"https://api.stackexchange.com/2.2/questions/"+QUESTION_ID+"/answers?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+ANSWER_FILTER}function commentUrl(e,s){return"https://api.stackexchange.com/2.2/answers/"+s.join(";")+"/comments?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+COMMENT_FILTER}function getAnswers(){jQuery.ajax({url:answersUrl(answer_page++),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){answers.push.apply(answers,e.items),answers_hash=[],answer_ids=[],e.items.forEach(function(e){e.comments=[];var s=+e.share_link.match(/\d+/);answer_ids.push(s),answers_hash[s]=e}),e.has_more||(more_answers=!1),comment_page=1,getComments()}})}function getComments(){jQuery.ajax({url:commentUrl(comment_page++,answer_ids),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){e.items.forEach(function(e){e.owner.user_id===OVERRIDE_USER&&answers_hash[e.post_id].comments.push(e)}),e.has_more?getComments():more_answers?getAnswers():process()}})}function getAuthorName(e){return e.owner.display_name}function process(){var e=[];answers.forEach(function(s){var r=s.body;s.comments.forEach(function(e){OVERRIDE_REG.test(e.body)&&(r="<h1>"+e.body.replace(OVERRIDE_REG,"")+"</h1>")});var a=r.match(SCORE_REG);a&&e.push({user:getAuthorName(s),size:+a[2],language:a[1],link:s.share_link})}),e.sort(function(e,s){var r=e.size,a=s.size;return r-a});var s={},r=1,a=null,n=1;e.forEach(function(e){e.size!=a&&(n=r),a=e.size,++r;var t=jQuery("#answer-template").html();t=t.replace("{{PLACE}}",n+".").replace("{{NAME}}",e.user).replace("{{LANGUAGE}}",e.language).replace("{{SIZE}}",e.size).replace("{{LINK}}",e.link),t=jQuery(t),jQuery("#answers").append(t);var o=e.language;/<a/.test(o)&&(o=jQuery(o).text()),s[o]=s[o]||{lang:e.language,user:e.user,size:e.size,link:e.link}});var t=[];for(var o in s)s.hasOwnProperty(o)&&t.push(s[o]);t.sort(function(e,s){return e.lang>s.lang?1:e.lang<s.lang?-1:0});for(var c=0;c<t.length;++c){var i=jQuery("#language-template").html(),o=t[c];i=i.replace("{{LANGUAGE}}",o.lang).replace("{{NAME}}",o.user).replace("{{SIZE}}",o.size).replace("{{LINK}}",o.link),i=jQuery(i),jQuery("#languages").append(i)}}var ANSWER_FILTER="!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe",COMMENT_FILTER="!)Q2B_A2kjfAiU78X(md6BoYk",answers=[],answers_hash,answer_ids,answer_page=1,more_answers=!0,comment_page;getAnswers();var SCORE_REG=/<h\d>\s*([^\n,]*[^\s,]),.*?(\d+)(?=[^\n\d<>]*(?:<(?:s>[^\n<>]*<\/s>|[^\n<>]+>)[^\n\d<>]*)*<\/h\d>)/,OVERRIDE_REG=/^Override\s*header:\s*/i;</code>```

body{text-align:left!important}#answer-list,#language-list{padding:10px;width:290px;float:left}table thead{font-weight:700}table td{padding:5px}```
<pre class="snippet-code-html lang-html prettyprint-override"><code><script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <link rel="stylesheet" type="text/css" href="//cdn.sstatic.net/codegolf/all.css?v=83c949450c8b"> <div id="answer-list"> <h2>Leaderboard</h2> <table class="answer-list"> <thead> <tr><td></td><td>Author</td><td>Language</td><td>Size</td></tr></thead> <tbody id="answers"> </tbody> </table> </div><div id="language-list"> <h2>Winners by Language</h2> <table class="language-list"> <thead> <tr><td>Language</td><td>User</td><td>Score</td></tr></thead> <tbody id="languages"> </tbody> </table> </div><table style="display: none"> <tbody id="answer-template"> <tr><td>{{PLACE}}</td><td>{{NAME}}</td><td>{{LANGUAGE}}</td><td>{{SIZE}}</td><td>Link</td></tr></tbody> </table> <table style="display: none"> <tbody id="language-template"> <tr><td>{{LANGUAGE}}</td><td>{{NAME}}</td><td>{{SIZE}}</td><td>Link</td></tr></tbody> </table></code>```

答:
Elixir, 16 bytes

```<code>IO.write [88-23]
</code>```

Try it online on ElixirPlayground !

Elixir outputs the character(s) with the ASCII code specified in the list.

Using IO.puts would make it 1 byte shorter, but u is not allowed.

As expected, the interactive mode removes the need of explicitly calling IO functions for on-screen output.

Elixir Interactive, 7 bytes

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

Title: The Letter A without A

Body:
Elixir, 16 bytes

IO.write [88-23]

Try it online on ElixirPlayground !

Elixir outputs the character(s) with the ASCII code specified in the list.

Using IO.puts would make it 1 byte shorter, but u is not allowed.

As expected, the interactive mode removes the need of explicitly calling IO functions for on-screen output.

Elixir Interactive, 7 bytes

[88-23]


Title: Let's do the Wave!

Body:
Input:

A string (the wave-snippet) with a length >= 2.

A positive integer n >= 1.

Output:

We output a single-line wave. We do this by repeating the input string n times.

Challenge rules:

If the first and last character of the input string matches, we only output it once in the total output (i.e. ^_^ of length 2 becomes ^_^_^ and not ^_^^_^).

The input string won't contain any whitespaces/tabs/new-lines/etc.

If your language doesn't support non-ASCII characters, then that's fine. As long as it still complies to the challenge with ASCII-only wave-input.

General rules:

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

Don't let code-golf languages discourage you from posting answers with non-codegolfing languages. Try to come up with an as short as possible answer for 'any' programming language.

Standard rules apply for your answer, so you are allowed to use STDIN/STDOUT, functions/method with the proper parameters, full programs. Your call.

Default Loopholes are forbidden.

If possible, please add a link with a test for your code.

Also, please add an explanation if necessary.

Test cases:

```<code>_.~"(              length 12
_.~"(_.~"(_.~"(_.~"(_.~"(_.~"(_.~"(_.~"(_.~"(_.~"(_.~"(_.~"(

'°º¤o,¸¸,o¤º°'     length 3
'°º¤o,¸¸,o¤º°'°º¤o,¸¸,o¤º°'°º¤o,¸¸,o¤º°'

-__                length 1
-__

-__                length 8
-__-__-__-__-__-__-__-__

-__-               length 8
-__-__-__-__-__-__-__-__-

¯`·.¸¸.·´¯         length 24
¯`·.¸¸.·´¯`·.¸¸.·´¯`·.¸¸.·´¯`·.¸¸.·´¯`·.¸¸.·´¯`·.¸¸.·´¯`·.¸¸.·´¯`·.¸¸.·´¯`·.¸¸.·´¯`·.¸¸.·´¯`·.¸¸.·´¯`·.¸¸.·´¯`·.¸¸.·´¯`·.¸¸.·´¯`·.¸¸.·´¯`·.¸¸.·´¯`·.¸¸.·´¯`·.¸¸.·´¯`·.¸¸.·´¯`·.¸¸.·´¯`·.¸¸.·´¯`·.¸¸.·´¯`·.¸¸.·´¯`·.¸¸.·´¯

**                 length 6
*******

String & length of your own choice (be creative!)
</code>```

Body:
Pyke, <s>15</s> <s>14</s> 10 bytes

tQQhQeq>*+

Try it here!

  QhQeq    -    input_1[0] == input_1[-1]
 Q     >   -   input_1[^:]
        *  -  ^ * V
t          -   input_2 - 1
         + - input_1 + ^


答:
Perl, 29 bytes

28 bytes code + 1 for -p.

Thanks to @Dada for helping me shave off a few bytes!

s/^((.).*?)(\2?)$/$1x<>.$3/e
```

<h3>Usage</h3>

<pre class="lang-sh prettyprint-override"><code>perl -pe 's/^((.).*?)(\2?)$/$1x<>.$3/e' <<< "'°º¤o,¸¸,o¤º°'
3"
'°º¤o,¸¸,o¤º°'°º¤o,¸¸,o¤º°'°º¤o,¸¸,o¤º°'
perl -pe 's/^((.).*?)(\2?)$/$1x<>.$3/e' <<< '**
6'
*******
</code>```

Online example.

Title: Let's do the Wave!

Body:
Perl, 29 bytes

28 bytes code + 1 for -p.

Thanks to @Dada for helping me shave off a few bytes!

s/^((.).*?)(\2?)$/$1x<>.$3/e

Usage

perl -pe 's/^((.).*?)(\2?)$/$1x<>.$3/e' <<< "'°º¤o,¸¸,o¤º°'
3"
'°º¤o,¸¸,o¤º°'°º¤o,¸¸,o¤º°'°º¤o,¸¸,o¤º°'
perl -pe 's/^((.).*?)(\2?)$/$1x<>.$3/e' <<< '**
6'
*******

Online example.


答:
05AB1E, <s>50</s> <s>49</s> 52 bytes

```<code>g.²òD>Ýs¹ZsWs\©-s/*®+v¹y.S>_O})¥ZUv'▉y×ðXy-×«S})øRJ»
</code>```

Try it online!

Explanation

First we calculate k as the inclusive round up of log2 of the input length.

g.²ò

We then construct a list of upper bounds of the classes.

This is constructerd as range[0 .. k+1]*((max(input) - min(input))/k)+min(input)
using the code:

D>Ýs¹ZsWs\©-s/*®+

Now we loop over this list counting the numbers of the input under these upper bounds. As we only want the numbers between each lower and upper bound we reduce this list by subtraction. Unfortunately due to a bug when comparing floats this becomes longer than it should be.

v¹y.S>_O})¥

Now that we have a list of the observation within each class we loop over these creating a matrix of the special char and fill them out with spaces so that each row in the matrix will have equal length.

v'▉y×ðXy-×«S})

This matrix has the staples of the histogram horizontally and we want them vertically. To remedy this, we transpose the matrix. This is the reason we filled the rows with spaces (as transpose need equal length lists). This gives us vertical bars starting from the top running down, so we reverse the order of the rows in the matrix. Now that we have the data in the correct order we print the matrix by joining the rows and joining the columns on newlines.

øRJ»

Title: It's time to make a histogram

Body:
Your task is to make a histogram given a sample of arbitrary size.

Input

A float array or any other reasonable form of input with an arbitrary number of elements.

Output

The histogram; more to follow.

How to make a histogram

We'll use the sample: [1.1, 3, 5, 13, 15.5, 21, 29.7, 63, 16, 5, 5.1, 5.01, 51, 61, 13]

To make a histogram, you first separate your observations into classes. The ideal number of classes is the lowest k such that 2^k > n, where k is the number of classes, and n is the number of observations. In our case, k = 4. The number of bars is not final. This k value's purpose is only to find the width of each class.

The width of each class is the range of your data set divided by the number of classes. The range of our data set is 63 - 1.1 = 61.9, so the width of each class is 15.475. This means that the first class is [1.1, 16.575), the second is [16.575, 32.05) and so on. The last class is [63.0, 78.475). The second value of the last class (b in [a,b)) must be greater than the max value of the set.

Now we rearrange our data into the classes; for us:

```<code>[1.1, 16.575): [1.1, 3, 5, 5, 5.01, 5.1, 13, 13, 15.5, 16]
[16.575, 32.05): [21, 29.7]
[32.05, 47.525): []
[47.525, 63.0): [51, 61]
[63.0, 78.475): [63]
</code>```

And finally, we graph!

For our purposes, a bar will be a ▉ stacked for the number of observations in the class (because I think that looks good). You can count the ▉ as one byte in your source code. There should be no space between bars (unless there is an empty bar), nor do you need to label axes or any of that fancy stuff. There can be trailing whitespace at the end of your output. In our case, that would be:

```<code>▉
▉
▉
▉
▉
▉
▉▉
▉▉ ▉
▉▉ ▉▉
</code>```

This is code-golf, so shortest code in bytes wins!

Body:
05AB1E, <s>50</s> <s>49</s> 52 bytes

g.²òD>Ýs¹ZsWs\©-s/*®+v¹y.S>_O})¥ZUv'▉y×ðXy-×«S})øRJ»

Try it online!

Explanation

First we calculate k as the inclusive round up of log2 of the input length.

g.²ò

We then construct a list of upper bounds of the classes.

This is constructerd as range[0 .. k+1]*((max(input) - min(input))/k)+min(input)
using the code:

D>Ýs¹ZsWs\©-s/*®+

Now we loop over this list counting the numbers of the input under these upper bounds. As we only want the numbers between each lower and upper bound we reduce this list by subtraction. Unfortunately due to a bug when comparing floats this becomes longer than it should be.

v¹y.S>_O})¥

Now that we have a list of the observation within each class we loop over these creating a matrix of the special char and fill them out with spaces so that each row in the matrix will have equal length.

v'▉y×ðXy-×«S})

This matrix has the staples of the histogram horizontally and we want them vertically. To remedy this, we transpose the matrix. This is the reason we filled the rows with spaces (as transpose need equal length lists). This gives us vertical bars starting from the top running down, so we reverse the order of the rows in the matrix. Now that we have the data in the correct order we print the matrix by joining the rows and joining the columns on newlines.

øRJ»


答:
JavaScript (ES6), 47 bytes

f=
(s,n)=>s+s.slice(s[0]==s.slice(-1)).repeat(n-1)
;```
<pre class="snippet-code-html lang-html prettyprint-override"><code><div oninput=o.textContent=n.value&&f(s.value,n.value)><input id=s><input id=n type=number min=1><div id=o></code>```

Title: Let's do the Wave!

Body:
JavaScript (ES6), 47 bytes

f=
(s,n)=>s+s.slice(s[0]==s.slice(-1)).repeat(n-1)
;

<div oninput=o.textContent=n.value&&f(s.value,n.value)><input id=s><input id=n type=number min=1><div id=o>


答:
Retina, 29 bytes

Lines 2 and 5 have a trailing space.

```<code> .+
$*
 $

 $`
(.) +\1?
$1
</code>```

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

Title: Let's do the Wave!

Body:
Retina, 29 bytes

Lines 2 and 5 have a trailing space.

 .+
$*
 $

 $`
(.) +\1?
$1

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


答:
05AB1E, 13 bytes

Uses CP-1252 encoding.

```<code>D¬U¤XQi¦}I<×J
</code>```

Try it online!

Explanation

-___- and 3 used as input for example.

```<code>D              # duplicate input string
               # STACK: "-___-", "-___-"
 ¬U¤X          # push copies of the first and last element of the string
               # STACK: "-___-", "-___-", "-", "-"
     Q         # compare for equality
               # STACK: "-___-", "-___-", 1
      i¦}      # if true, remove the first char of the copy of the input string
               # STACK: "-___-", "___-"
         I<    # push input number and decrease by 1
               # STACK: "-___-", "___-", 2
           ×   # repeat the top string this many times
               # STACK: "-___-", "___-___-"
            J  # join with input string
               # STACK: "-___-___-___-"
               # implicitly output
</code>```

Title: Let's do the Wave!

Body:
05AB1E, 13 bytes

Uses CP-1252 encoding.

D¬U¤XQi¦}I<×J

Try it online!

Explanation

-___- and 3 used as input for example.

D              # duplicate input string
               # STACK: "-___-", "-___-"
 ¬U¤X          # push copies of the first and last element of the string
               # STACK: "-___-", "-___-", "-", "-"
     Q         # compare for equality
               # STACK: "-___-", "-___-", 1
      i¦}      # if true, remove the first char of the copy of the input string
               # STACK: "-___-", "___-"
         I<    # push input number and decrease by 1
               # STACK: "-___-", "___-", 2
           ×   # repeat the top string this many times
               # STACK: "-___-", "___-___-"
            J  # join with input string
               # STACK: "-___-___-___-"
               # implicitly output


答:
Python 3, 32 bytes

lambda s,n:s+s[s[0]==s[-1]:]*~-n
```

Concatenates n copies of the string, removing the first character from all copies but the first if the first character matches the last one.

Title: Let's do the Wave!

Body:
Python 3, 32 bytes

lambda s,n:s+s[s[0]==s[-1]:]*~-n

Concatenates n copies of the string, removing the first character from all copies but the first if the first character matches the last one.


问:
Determine whether strings are anagrams

Challenge

Given two strings, work out if they both have exactly the same characters in them.

Example

Input

word, wrdo

This returns true because they are the same but just scrambled.

Input

word, wwro

This returns false.

Input

boat, toba

This returns true

Rules

Here are the rules!

Assume input will be at least 1 char long, and no longer than 8 chars.

No special characters, only a–z

All inputs can be assumed to be lowercase

Test Cases

```<code>boat, boat = true
toab, boat = true
oabt, toab = true
a, aa = false
zzz, zzzzzzzz = false
zyyyzzzz, yyzzzzzy = true
sleepy, pyels = false
p,p = true
</code>```

答:
C 110 bytes

```<code>char*a,*b;l(i,j,k){y:if(!b[j]||!a[i])return i==k+1;if(a[i]==b[j]){b[j]=1;return l(i+1,0,j>k?j:k);}++j;goto y;}
</code>```

this is one recursive function that has one not common way to have its input and
write in one its argument... but not use library functions....

```<code>/*
l(i,j,k)
{y: if(!b[j]||!a[i])return i==k+1;
    if(a[i]==b[j]){b[j]=1;return l(i+1,0,j>k?j:k);}
    ++j;goto y;
}
//110
r=1 m1=12345  m2=?????
r=0 m3=a  m4=e
*/

main()
{char m1[]="12345", m2[]="54321", m3[]="a", m4[]="e";
 int  r;

 a=m1;b=m2;r=l(0,0,0);printf("r=%d m1=%s  m2=%s\n", r, m1, m2);
 a=m3;b=m4;r=l(0,0,0);printf("r=%d m3=%s  m4=%s\n", r, m3, m4);
}
</code>```

Title: Determine whether strings are anagrams

Body:
C 110 bytes

char*a,*b;l(i,j,k){y:if(!b[j]||!a[i])return i==k+1;if(a[i]==b[j]){b[j]=1;return l(i+1,0,j>k?j:k);}++j;goto y;}

this is one recursive function that has one not common way to have its input and
write in one its argument... but not use library functions....

/*
l(i,j,k)
{y: if(!b[j]||!a[i])return i==k+1;
    if(a[i]==b[j]){b[j]=1;return l(i+1,0,j>k?j:k);}
    ++j;goto y;
}
//110
r=1 m1=12345  m2=?????
r=0 m3=a  m4=e
*/

main()
{char m1[]="12345", m2[]="54321", m3[]="a", m4[]="e";
 int  r;

 a=m1;b=m2;r=l(0,0,0);printf("r=%d m1=%s  m2=%s\n", r, m1, m2);
 a=m3;b=m4;r=l(0,0,0);printf("r=%d m3=%s  m4=%s\n", r, m3, m4);
}


答:
Python 3, 139

Generates histogram with numpy, takes on account the strange last column rule and prints.

```<code>from numpy import*
def f(l):
 h,_=histogram(l,'fd');h[-1]-=1
 for i in zip(*((max(h)-i)*' '+i*'▉'for i in append(h,1))):print(''.join(i))
</code>```

Title: It's time to make a histogram

Body:
Python 3, 139

Generates histogram with numpy, takes on account the strange last column rule and prints.

from numpy import*
def f(l):
 h,_=histogram(l,'fd');h[-1]-=1
 for i in zip(*((max(h)-i)*' '+i*'▉'for i in append(h,1))):print(''.join(i))


答:
Batch, 117 bytes

```<code>@set/ps=
@set t=%s%
@if %s:~0,1%==%s:~1% set t=%s:~1%
@for /l %%i in (2,1,%1)do @call set s=%%s%%%%t%%
@echo %s%
</code>```

Takes the number of repetitions as a command-line parameter and reads the string from STDIN.

Title: Let's do the Wave!

Body:
Batch, 117 bytes

@set/ps=
@set t=%s%
@if %s:~0,1%==%s:~1% set t=%s:~1%
@for /l %%i in (2,1,%1)do @call set s=%%s%%%%t%%
@echo %s%

Takes the number of repetitions as a command-line parameter and reads the string from STDIN.


答:
C 87 bytes

```<code>char*a,*b,*c;d(i,k){return!a[i]||!(c=strchr(b,a[i]))?i==k+1:(*c=1,d(i+1,k<c-b?c-b:k));}
</code>```

this is one recursive function that has one not common way to have its input and write in one its argument...this use recursion + library function...

```<code>/*
char*a,*b,*c;
d(i,k)
{return !a[i]||!(c=strchr(b,a[i]))?i==k+1:(*c=1,d(i+1,k<c-b?c-b:k));}
87
*/

 main()
{char m1[]="12345", m2[]="54321", m3[]="a", m4[]="e";
 int  r;

 a=m1;b=m2;r=d(0,0);printf("r=%d m1=%s  m2=%s\n", r, m1, m2);
 a=m3;b=m4;r=d(0,0);printf("r=%d m3=%s  m4=%s\n", r, m3, m4);
}
</code>```

Title: Determine whether strings are anagrams

Body:
Challenge

Given two strings, work out if they both have exactly the same characters in them.

Example

Input

word, wrdo

This returns true because they are the same but just scrambled.

Input

word, wwro

This returns false.

Input

boat, toba

This returns true

Rules

Here are the rules!

Assume input will be at least 1 char long, and no longer than 8 chars.

No special characters, only a–z

All inputs can be assumed to be lowercase

Test Cases

```<code>boat, boat = true
toab, boat = true
oabt, toab = true
a, aa = false
zzz, zzzzzzzz = false
zyyyzzzz, yyzzzzzy = true
sleepy, pyels = false
p,p = true
</code>```

Body:
C 87 bytes

char*a,*b,*c;d(i,k){return!a[i]||!(c=strchr(b,a[i]))?i==k+1:(*c=1,d(i+1,k<c-b?c-b:k));}

this is one recursive function that has one not common way to have its input and write in one its argument...this use recursion + library function...

/*
char*a,*b,*c;
d(i,k)
{return !a[i]||!(c=strchr(b,a[i]))?i==k+1:(*c=1,d(i+1,k<c-b?c-b:k));}
87
*/

 main()
{char m1[]="12345", m2[]="54321", m3[]="a", m4[]="e";
 int  r;

 a=m1;b=m2;r=d(0,0);printf("r=%d m1=%s  m2=%s\n", r, m1, m2);
 a=m3;b=m4;r=d(0,0);printf("r=%d m3=%s  m4=%s\n", r, m3, m4);
}


答:
Pyth, 13 bytes

```<code>+z*@tBzqhzezt
</code>```

Test suite!

Explanation to follow.

Title: Let's do the Wave!

Body:
Pyth, 13 bytes

+z*@tBzqhzezt

Test suite!

Explanation to follow.


答:
PHP, 72 Bytes

```<code><?=($a=$argv[1]).str_repeat(substr($a,$a[0]==substr($a,-1)),$argv[2]-1);
</code>```

with PHP 7.1 it could be reduce to 65 Bytes

```<code><?=($a=$argv[1]).str_repeat(substr($a,$a[0]==$a[-1]),$argv[2]-1);
</code>```

Title: Let's do the Wave!

Body:
PHP, 72 Bytes

<?=($a=$argv[1]).str_repeat(substr($a,$a[0]==substr($a,-1)),$argv[2]-1);

with PHP 7.1 it could be reduce to 65 Bytes

<?=($a=$argv[1]).str_repeat(substr($a,$a[0]==$a[-1]),$argv[2]-1);


Title: Let's do the Wave!

Body:
Gema, 41 characters

* *=@subst{\? \$1=\?\; =;@repeat{$2;$1 }}

Sample run:

bash-4.3$ gema '* *=@subst{\? \$1=\?\; =;@repeat{$2;$1 }}' <<< '_.~"( 12'
_.~"(_.~"(_.~"(_.~"(_.~"(_.~"(_.~"(_.~"(_.~"(_.~"(_.~"(_.~"(

bash-4.3$ gema '* *=@subst{\? \$1=\?\; =;@repeat{$2;$1 }}' <<< "'°º¤o,¸¸,o¤º°' 3"
'°º¤o,¸¸,o¤º°'°º¤o,¸¸,o¤º°'°º¤o,¸¸,o¤º°'

bash-4.3$ gema '* *=@subst{\? \$1=\?\; =;@repeat{$2;$1 }}' <<< '** 6'
*******


答:
CJam, <s>72</s> 71 bytes

```<code>l',-~$__,2b,\)\(:A\;-\d/:B;{AB+:A;_{A<},,_@>}h;]_:e>:M;{'▉*MSe[}%NM*a+z
</code>```

Try it online!

```<code>l',-~$     e# read and sorts the list
__,2b,     e# find k
\)\(:A     e# find max and min (keep min as A)
\;-\d/:B;  e# find width (keep as B)
{          e# while entries remain
  AB+:A;   e#    find intervals upper bound
  _{A<},,  e#    count entries below bound
  _@>      e#    remove entries below bound
}h;        e# end while
]_:e>:M;   e# find maximum size
{'▉*MSe[}% e# convert to bars and pad columns
NM*a+z     e# add newlines and transpose to display upright
</code>```

Title: It's time to make a histogram

Body:
CJam, <s>72</s> 71 bytes

l',-~$__,2b,\)\(:A\;-\d/:B;{AB+:A;_{A<},,_@>}h;]_:e>:M;{'▉*MSe[}%NM*a+z

Try it online!

l',-~$     e# read and sorts the list
__,2b,     e# find k
\)\(:A     e# find max and min (keep min as A)
\;-\d/:B;  e# find width (keep as B)
{          e# while entries remain
  AB+:A;   e#    find intervals upper bound
  _{A<},,  e#    count entries below bound
  _@>      e#    remove entries below bound
}h;        e# end while
]_:e>:M;   e# find maximum size
{'▉*MSe[}% e# convert to bars and pad columns
NM*a+z     e# add newlines and transpose to display upright