text:
Generate binary matrices which are distinct up to reflections
Here are all the 2x2 binary matrices
#0  #1  #2  #3  #4  #5  #6  #7  #8  #9  #10 #11 #12 #13 #14 #15
--  --  --  --  --  --  --  --  --  --  --  --  --  --  --  --
00  00  00  00  01  01  01  01  10  10  10  10  11  11  11  11
00  01  10  11  00  01  10  11  00  01  10  11  00  01  10  11

Two binary square matrices are equivalent under the relation ~ if one can be mapped onto the other by any number of reflections in the horizontal or vertical axes.
#1 ~ #2 under reflection in the vertical axis so we only need to keep one of these (it doesn't matter which). Likewise #3 ~ #12, #6 ~ #9 and so on.
THE GOAL is to produce a program which takes a single input N and prints as many N x N binary matrices as exist such that all matrices in the output are distinct under the above relation.
In hand-wavey pseudocode, an admissible solution would be
define M[i] = N by N matrix with bit pattern equal to i

for i = 0 to (2^(N^2)) - 1
    valid = true
    for j = i+1 to (2^(N^2)) - 1
        if (equivalent(M[i], M[j]))
            valid = false
            break
    if (valid)
        print (M[i])

For the input N=2 one valid output would be
00  00  00  01  10  01  11
00  01  11  01  01  11  11

But by selecting different matrices from the same equivalence class another valid output would be
00  10  11  11  11  10  01
00  00  00  10  11  10  10

The order of matrices doesn't matter, the particular choice from equivalent matrices doesn't matter, and whitespace doesn't matter, output the matrices however you like as long as it's human-readable.
The output must be exhaustive.
Shortest code wins.
EDIT: this is my first golf post and I've changed my mind on the winning criteria.
Shortest code in a language not specifically designed for conciseness/golfing wins.
I hope it's not bad etiquette to change this criterion post-hoc, but I think doing it in a "normal" language is a much more interesting proposition.

Welcome to PPCG! This is a nice first challenge, but I'd recommend letting people output the result in a flexible format (e.g. each matrix as a list of lists). That way people can focus on the very interesting core of the challenge (finding the unique matrices up to symmetries) instead of also having to worry about formatting the output (which could easily take just as many bytes and make the golfing of the main challenge less important).

Thanks for the feedback, both of you, I have edited the question accordingly.

I'd also recommend posting future challenge ideas in the sandbox where you can get feedback for it before the challenge goes live and people might start working on it.

Out of interest, why exclude rotations?

I was tempted to include rotations as an equivalence. I was also tempted to include inverting each bit as an equivalence. I was also tempted to include permutations of rows/columns as an equivalence. In the end, I made an arbitrary decision to keep the requirements fairly simple. Feel free to post a variation.

We've discussed this in the past and ruled against excluding or penalizing certain languages in code golf competitions, meaning that challenge that do so should be considered off topic. Furthermore, the accepted answer is the answer that wins the challenge, which means shortest code for code golf questions. Summarizing: If you don't want to accept any answer at all, then don't. However, if you accept an answer, it has to be the shortest one.

Finally, the J language is not a golfing language, but a high-level, general-purpose, high-performance programming language that has existed for 25 years. Even with your current rules, you've still accepted the wrong answer.

It's your choice. Meanwhile I change my vote from +1 to -1

Fair enough on J, @Dennis I accepted that one. My 2 cents on this issue is: if a language advertises itself as a golfing language then that's a bit cheeky. To respond to the analogy in the accepted answer, it's like going to a rifle range and asking people to actually hold the gun rather than use a tripod-mounted-stepper-motor to aim.

J, 66 56 53 bytes
[:~.,~{.@/:~@(2:_&(][:,(;|.;|."1)&>)<)@$"#.2#:@i.@^*:

Brute-force search.
Usage
   f =: [:~.,~{.@/:~@(2:_&(][:,(;|.;|."1)&>)<)@$"#.2#:@i.@^*:
   f 2
┌───┬───┬───┬───┬───┬───┬───┐
│0 0│0 0│0 0│0 1│0 1│0 1│1 1│
│0 0│0 1│1 1│0 1│1 0│1 1│1 1│
└───┴───┴───┴───┴───┴───┴───┘
   # f 3
168
   # f 4
16576

Explanation
[:~.,~{.@/:~@(2:_&(][:,(;|.;|."1)&>)<)@$"#.2#:@i.@^*:  Input: integer n
                                                   *:  Square n
                                           2      ^    Compute m = 2 ^ (n ^ 2)
                                               i.@     Make a range [0, m)
                                            #:@        Convert each to binary digits
    ,~                                                    Pair, make [n, n]
                                       $"#.            Reshape each binary list
                                                          to a matrix with size [n, n]
             (                       )@                Operate on each
                                    <                    Box it, call x
              2:                                         The constant 2
                _&(                )                     Repeat that many times on x
                       (        )&>                        For each box
                            |."1                             Reverse by column
                         |.                                  Reverse by row
                           ;                                 Join them
                        ;                                    Join with initial
                    [:,                                    Flatten
                   ]                                       Return that as the new x
         /:~@                                          Sort each
      {.@                                              Take the head of each
[:~.                                                   Unique and return

Jelly, 19 bytes
Ṛ€;U;
2ḶṗṗµWÇ³¡Ṃµ€Q

Try it online!
How it works
2ḶṗṗµWÇ³¡Ṃµ€Q  Main link. Argument: n (integer)

2Ḷ             Unlength 2; yield [0, 1].
  ṗ            Cartesian product; construct all vectors of {0, 1}^n.
   ṗ           Cartesian product; construct all vectors of ({0, 1}^n)^n.
               This yields A, the array of all binary n×n matrices.
    µ     µ€   Begin a new, monadic chain and apply it to all matrices M in A.
     W           Wrap; yield [M].
      Ç³¡        Call the helper link n times, initially with argument [M], then
                 on the previous return value.
         Ṃ       Take the minimum of the results.
               This replaces all matrices with the lexicographical minimum of their
               equivalence classes, mapping equivalent matrices to the same matrix.
            Q  Unique; deduplicate the resulting array of matrices.

Ṛ€;U;          Helper link. Argument: L (array of matrices)

Ṛ€             Reverse the order of the rows of each M in L.
   U           Reverse the order of the columns of each M in L.
  ;            Concatenate the resulting matrix arrays.
    ;          Concatenate the result with L.

Pyth - 24 23 21 bytes
Wanna look for  better way of getting all the reflections.
Thanks to @Pietu1998 for golfing me 2 bytes!
hM.gS+K_Bk_MMKcRQ^`T*

Try it online here.
Going to wait for golfing before doing a full explanation, but it essentially makes all possible binary matrices, then .groups them by the sorted list of all the possible reflections, then only takes one from each group.

If I run that with argument 3 the output begins [['000', '000', '00'], note the missing zero at the end.

@spraff whoops, I did ^2Q instead of Q^2. fix saves me a byte too :D

@spraff fixed it.

I'm pretty sure you can do _MM instead of mC_Cd.

@Pietu1998 oh yeah, thanks!

JavaScript (ES6), 195 bytes
n=>[...Array(p=1<<n*n)].map(_=>(p++).toString(2).slice(1)).filter((s,i,a)=>![1,0,1].some(c=>a.indexOf((c?b.reverse():b=b.map(s=>[...s].reverse().join``)).join``)<i,b=s.match(eval(`/.{${n}}/g`))))

Returns strings representing all matrix entries concatenated e.g. 111101111 represents a 3×3 matrix of 1s with a 0 in the middle. Explanation:
n=>[...Array(p=1<<n*n)].map(            Enumerate all binary matrices
 _=>(p++).toString(2).slice(1)          Convert to padded binary
).filter((s,i,a)=>![1,0,1].some(        Check reflections of each matrix
 c=>a.indexOf((c?b.reverse():           Reverse the order of lines
  b=b.map(s=>[...s].reverse().join``    Or reverse each line
  )).join``)<i,                         Has this been seen before?
 b=s.match(eval(`/.{${n}}/g`))))        Reshape string into a square

A recursive number-to-binary function is exactly the same length: .map(f=(x=p++)=>x>1?f(x>>1)+x%2:"")

Haskell, 100 bytes
import Data.List
r=reverse
e#n=mapM id$e<$[1..n]
f n=nubBy(\a b->elem a[r b,r<$>b,r$r<$>b])$"01"#n#n

Usage example: f 2 -> [["00","00"],["00","01"],["00","11"],["01","01"],["01","10"],["01","11"],["11","11"]].
How it works:
e#n=mapM id$e<$[1..n]        -- helper function: creates a list of all combinations
                             -- of the elements of e of length n
                             -- "01" # 2 -> ["00","01","10","11"]

                   "01"#n#n  -- creates all binary n x n matrices
nubBy                        -- remove duplicates according to the equivalence
                             -- relation
   \a b ->                   -- a equals b if
       a elem                -- a is an element of
         [r b,r<$>b,r$r<$>b] -- the list of reflections of b

Mathematica, 94 bytes
DeleteDuplicatesBy[{0,1}~Tuples~{#,#},Sort@Join[Join@@Outer[Reverse,{#},{1,2,{1,2}},1],{#}]&]&

Hi JHM! Thanks for the answer. I don't understand Mathematica very well, so could you add a bit of explanation as to what's going on? (I posted the same thing on your other recent answer. Giving some explanation is a strong expectation for answers on this site)

JavaScript (ES6), 184
This turned out to be quite similar to Neil's, but all in all the bag of tricks in javascript is not so diverse.
n=>eval("r=x=>[...x].reverse();for(l='',i=m=1<<n*n;i<m+m;i++)a=i.toString(2).slice(1).match(eval(`/.{${n}}/g`)),[b=a.map(x=>r(x).join``),r(a),r(b)].some(x=>~l.search(x))?0:l+=a+`\n`")

Less golfed
n=>{
  r = x =>[...x].reverse();
  for(l = '', i = m = 1<<n*n; i < m+m; i++)
    a = i.toString(2).slice(1).match(eval(`/.{${n}}/g`)), // base matrix as an array of strings
    b = a.map(x => r(x).join``), // horizontal reflection
    c = r(a), // vertical reflection
    d = r(b), // both reflections
    // check if already found
    [b, c, d].some(x => ~l.search(x)) // using search, arrays are converted to comma separated strings
      ? 0
      : l += a+`\n` // add new found to list (again as a comma separated string)
  return l
}

Test Beware, even for input 4 the running time is overly long

f=n=>eval("r=x=>[...x].reverse();for(l='',i=m=1<<n*n;i<m+m;i++)a=i.toString(2).slice(1).match(eval(`/.{${n}}/g`)),[b=a.map(x=>r(x).join``),r(a),r(b)].some(x=>~l.search(x))?0:l+=a+`\n`")

function update() {
  var i=+I.value;

  result = f(i)
  count = result.split('\n').length
  O.textContent = count+'\n'+result
}

update()
Input <select id=I onchange="update()"><option>2<option>3<option>4<option>5</select>


text:
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.

Okay, so maybe Helka's challenge wasn't impossible, but surely this is :D

@BetaDecay Is it really? :)

Befunge-98, infinite order, 54 52 38 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, 10, 34, 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!

While the output appears to be correct and this is certainly impressive, I'm not convinced a proper quine can use g, which seems to directly read the program's source code. That said, I'm hardly a Befunge expert, so I might be misunderstanding something.

I'm using g for two purposes here: to store data and to read the source code. The second one might be a little sketchy, even though http://esolangs.org/wiki/Befunge#Quine has an example using g to read the source code as well. In the meantime, I'll see if I can create a version that doesn't use any introspection.

I knew this had to be possible in Befunge, but I had no clue how. Thanks for showing me. +1

><>, 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, 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:
^^

..

**

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.

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/

sort: votes


text:
Get dimension of a list
Find out the dimension of a simple nested list:
[] -> 1
[[]] -> 2
[[[]]] -> 3
...

List taken as input, dimension as output.
No counting length of strings - list manipulation and loops only.
i.e. no getting the length of the input and dividing by 2.
Any language is permitted. Get golfing!

Isn't it just counting the number of [?

Good idea, but that is a loophole, so I will make that illegal. @MorganThrapp

@WheatWizard I'd say no, only because this doesn't actually require any parsing. Now, it's probably going to end up being a dupe of that, but it's not currently.

Okay, so I'll count the number of ]. Or divide the length of the input by 2. This challenge in its current state is trivial. The sandbox is a great place to get input on your challenges before posting them.

Read about patching out approaches.

avoid Do X without Y. In Python the len() function works for list so I could claim print len(raw_input())/2 is list manipulation, not string counting.

Is my 1 byte Retina answer as valid as the Jelly one?

Jelly, 2 bytes
ŒḊ

TryItOnline
It's a single atom, the depth monad.

Great solution!

Retina, 2 1 bytes
]

Just Regex.
One byte to Martin Ender.

] saves a byte.

Invalid since the last edit

Brain-Flak, 44 36 32 26 + 3 = 29 bytes
Try it online
([])({<({}[()()])>()}{}<>)

+3 bytes from the -a flag.
Explanation
([])                         #Push the stack height
     {<({}[()()])>()}{}      #For loop decrement by 2
    (                  <>)   #Push number of runs to the offstack

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/


text:
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):
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

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!

Nice diagrams! :) (And nice challenge, too. ;))

Would omitting "Swirling" be a valid output format, since it's implied when the input isn't "not swirling"?

@MartinEnder Yes, since it's understandable when it's swirling or not, can be empty for "not" and "1" for "yes", etc. (Glad you liked the diagrams and challenge! :))

Related -- all the swirling example words except COOK are also Bumpy Words.

@TimmyD But not all bumpy words are swirling. :)

@MartinEnder Very true. Hence "Related" and not "Close as dupe." -- This is a very nice challenge.

I wonder how much shorter answers would be if it was simply Truthy or Falsey output for swirling or not swirling.

It appears to me that rule 1 has no effect for the challenge, does it?

@LuisMendo it determines clockwise vs counterclockwise.

@Martin Oh, I see now. Thanks!

Are words with only two letters like MOM and DAD either centripetal or centrifugal? Are they spiralling?

@Linus According to Martin Ender proper suggestion, I updated the rules to avoid such "circular" case and don't mess up other working answers.

Tip for future challenges: your challenge includes a step that detracts from the “main idea”, namely removing duplicate letter runs (PILL → PIL). That kind of thing is generally Not Fun, and I think this challenge would have been better overall if there were fewer tricky edge cases to deal with (maybe a guarantee that there will be no duplicate letters in the input at all, not even words like IRIS, would have been nice.)

That said, this challenge (and its diagrams!) are wonderful. Maybe throw in some long test cases (like AZYBXC…)?

@Lynn Thanks for the appreciation and suggestions, I'll try to improve for the future. I added the "remove double" rule to anticipate people asking me things like "what do we do when there are doubles?" > you can consider doubles as 1 single character because from "L" going to "L" is zero distance :) Is not that I wanted to add tricky difficulties for it's own sake.

this function works correctly for the given test cases function f($z){$z=preg_replace("#(.)\\1#","$1",$z);for($i=0;++$i<strlen($z);){$a[]=abs($n=ord($z[$i-1])-ord($z[$i]));$i%2?$e[]=$n:$o[]=$n;}$c=$a[0]>end($a)?1:2;if(count(array_diff($e,range(0,-26)))==0)$c+=2;$c*=min(end($a),$a[0])==min($a)&&max(end($a),$a[0])==max($a)?1:0;return $c;}$z="test";echo ["N","F-","P-","F+","P+"][f($z,1)]; but if I try the word "test" if gives me a wrong result. And swirling words like bananas , banana or ananas looks great

@JörgHülsermann I tryed your function and it gives positive results for words which are not swirling words, like test or abcdefg so I think there is something wrong somewhere.

@Mario I think adding more false test cases is better to decide if a program do this job

@JörgHülsermann I added more false test cases

@Mario What did you use to make the diagrams?

@mbomb007 I used Illustrator because I use it in my job, but is possible to do that using Inkscape or Gimp for example

MATL, 33 31 30 bytes
lydhg)dt|dZSXz&=wZSdh?4M1)3M1)

Input is in uppercase letters (or in lowercase letters, but not mixed).
Output is:

If the word is non-swirling: no output is produced
If it is swirling: two numbers are produced in different lines:

First number 1/ -1  indicates centrifugal / centripetal.
Second number 1/ `-1'  indicates clockwise / counterclockwise.

Try it online! Or verify all test cases (code modified to take all inputs and to produce the two output numbers on the same line)
Explanation
Let's take input 'OPERAA' as an example.
The first part of the code removes double letters:
l     % Push 1
      %   STACK: 1
y     % Take input implicitly from below, and duplicate
      %   STACK: 'OPERAA', 1, 'OPERAA'
d     % Convert to code points and compute differences
      %   STACK: 'OPERAA', 1, [1 -11  13 -17 0]
h     % Concatenate horizontally
      %   STACK: 'OPERAA', [1 1 -11  13 -17 0]
g     % Convert to logical
      %   STACK: 'OPERAA', [true true true true true false]
)     % Index
      %   STACK: 'OPERA'

We now check if the distances between letters are non-decreasing (necessary condition for the word to be swirling):
d     % Convert to code points and compute differences
      %   STACK: [1 -11  13 -17]
t|    % Duplicate and take absolute value
      %   STACK: [1 -11  13 -17], [1 11  13 17]
d     % Differences
      %   STACK: [1 -11  13 -17], [10 2 4]
ZS    % Signum
      %   STACK: [1 -11  13 -17], [1 1 1]
Xz    % Remove zeros (gives a vertical vector). Needed for words like 'IRIS',
      % where some consecutive distances are equal
      %   STACK: [1 -11  13 -17], [1; 1; 1]
&=    % All pairwise equality comparisons. Gives a matrix. If all the signs
      % were equal the matrix will contain all ones
      %   STACK: [1 -11  13 -17], [1 1 1; 1 1 1; 1 1 1]

We then check if the letters go back and forth  (this is the other condition for the word to be swirling):
w     % Swap
      %   STACK: [1 1 1; 1 1 1; 1 1 1], [1 -11  13 -17]
ZS    % Signum
      %   STACK: [1 1 1; 1 1 1; 1 1 1], [1 -1 1 -1]
d     % Differences
      %   STACK: [1 1 1; 1 1 1; 1 1 1], [-2 2 -2]

Lastly, we check if the two conditions hold, and in that case produce the output:
h     % Concatenate horizontally
      %   STACK: [1 1 1 1 1 1 1 1 1 -2 2 -2]
?     % If all elements are nonzero
  4M  %   Push first signum array without zeros, from the automatic clipboard
      %     STACK: [1; 1; 1]
  1)  %   Get first element (tells if first difference was positive or negative)
      %     STACK: 1
  3M  %   Push second signum array, from the automatic clipboard
      %     STACK: 1, [1 -1 1 -1]
  1)  %   Get first element (tells if first movement was right or left)
      %     STACK: 1, 1
      %   Implicitly end if
      % Implicitly display

Mathematica, 117 111 bytes
Thanks to JHM for saving 6 bytes, and making it case-insensitive to boot!
 {o=OrderedQ/@{a=Abs[d=Differences[#&@@@Split@LetterNumber@#]],Reverse@a},d[[1]]>0,Or@@o&&Max[Most[d]Rest@d]<0}&

Unnamed function that takes a string and returns a nested list of booleans in the form {{B1,B2},B3,B4}. B4 records whether the word is swirling (and if it's not, the rest of the output is garbage). If the word is swirling, then B1 records whether the word is centrifugal, B2 records whether the word is centripetal, and B3 records whether the word is clockwise (True) or counterclockwise (False).
Here's a longer version that post-processes (first line) the above function (spaced over the 2nd-5th lines) to make it identical to the OP: NO if the word isn't swirling, and the appropriate choice of {SW,CF,CW} , {SW,CF,CC} , {SW,CP,CW}, or {SW,CP,CC} if the word is swirling:
If[#3, {SW, If[#[[1]], CF, CP], If[#2, CW, CC]}, NO] & @@
  {o = OrderedQ /@
    {a = Abs[d = Differences[# & @@@ Split@LetterNumber@#]], Reverse@a},
  d[[1]] > 0,
  Or @@ o && Max[Most[d] Rest@d] < 0} &

The explanation is the same as in Martin Ender's CJam answer, with one additional note: the list of consecutive differences must alternate in sign for the word to be swirling, and that can be detected by making sure all products of pairs of consecutive differences are negative (that's what Max[Most[d]Rest@d]<0 does).
Running the function on all 40,000+ words of Mathematica's WordList[], we find the following 8-letter swirling words, which are the longest of their respective swirling types:
operetta    {SW, CF, CW}
opposite    {SW, CF, CW}
stowaway    {SW, CF, CW}
assassin    {SW, CP, CW}
assessor    {SW, CP, CW}
baccarat    {SW, CF, CC}
keenness    {SW, CF, CC}
positive    {SW, CF, CC}

(Brownie points to positive for having no double letters, and fewer repeated letters than stowaway.)
But the absolute champion is the 9-letter counterclockwise-swirling centripetal word vassalage!

You can save 3 bytes by using LetterNumber instead of ToCharacterCode and another 3 bytes by using Most[d] instead of Drop[d,-1].

Scala, 110 bytes
def/(s:String)={val ? =s.sliding(2).map(t=>(t(0)-t(1)).abs).toSeq
(Seq(?,?reverse)indexOf(?sorted),s(0)<s(1))}

Returns a tuple (a,b) with

a == 1 if s is centripetal
a == 0 if s is centrifugal
a == -1 if s is not swirling

and

b == true if s is clockwise
b == false if s is counterclockwise
b can be true or false if s is not swirling

Explanation:
def/(s:String)={      //define a method called / with a String argument
  val ? =s            //define ? as...
    .sliding(2)       //an iterator for each two consecutive elements
    .map(t=>          //foreach 2 chars
      (t(0)-t(1)).abs //get the absolute value of their difference
    )
    .toSeq            //and convert the iterator to a Seq, because iterator doesn't have reverse and sorted methods
  (                   //return a tuple of
    Seq(?,?reverse)     //a Seq of ? and reversed ?
    .indexOf(?sorted)   //and check which of them is sorted ?
  ,                   //and
   s(0)< s(1)          //the difference bewteen the first two elements of the string.
  )
}

Jelly,  30  23 bytes
OIḟ0µAI©Ṡḟ0ṂṭḢṠ$µ®ḟ0ṠEṭ

Try it online! Or see the test cases
All upper or all lower.
Returns a flag list [D, F, S]:
D: clockwise = 1 / anticlockwise = -1
F: centrifugal = 1 / centripetal = -1
S: spinning = 1 / not spinning = 0
- if S is 0 the other flags are still evaluated even though they carry no useful information.
How?
OIḟ0µAI©Ṡḟ0ṂṭṠḢ$µ®ḟ0ṠEṭ - Main link: s
O                       - ordinals
 I                      - deltas (i.e. [a,b,c,...] -> [b-a,c-b,...])
  ḟ0                    - filter out zeros
                        - (call this Z)
    µ                   - start a new monadic chain (i.e. f(Z))
     A                  - absolute values
      I                 - deltas
       ©                - copy to register
        Ṡ               - signs
         ḟ0             - filter out zeros
           Ṃ            - minimum
                        - (i.e. F = {centrifugal: 1; centripetal: -1})
               $        - last two links as a monad:
             Ḣ          -   head (Z)
              Ṡ         -   sign
                        - (i.e. D = {clockwise: 1; anticlockwise: -1})
            ṭ           - tack
                µ       - start a new monadic chain (i.e. f([D,F]))
                 ®      - recall from register
                  ḟ0    - filter out zeros
                    Ṡ   - signs
                     E  - all equal?
                        - (i.e. S = {spinning: 1; not spinning: 0})
                      ṭ - tack
                        - (i.e. [D,F,S])

I think you are experiencing what I call the "newbie syndrome" here. I feel exactly the same as you. Maybe Dennis could be of some help here. But, I +1'd, just because I saw it's possible in Jelly. Also, you can remove the circular case; it no longer exists.

Thanks for the poke about circular words - as it turns out the 6 bytes to cater for them were actually unnecessary since the minimum of an empty list is 0 so this still works for those too!

So, it must work for them? I see you still have the circular(0) inside your explanation, maybe it's time to remove it as well.

It is not required, no - but this code still does after removing what I had used to explicitly make it do so, due to the fact that min([])=0 http://jelly.tryitonline.net/#code=W13huYI&input= - Note that since circular words are now never expected input, there is no problem in catering for them.

I just asked for you to double-check. And, I understood that you meant min([])==0, but I thought this is still golfable.

Yes, probably still golfable!

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

PHP, 322 Bytes
for(;++$i<strlen($z=preg_replace("#(.)\\1#","$1",$argv[1]));){$t[]=$z[$i-1]<=>$z[$i]?:0;$o[]=$z[0]<=>$z[$i];$i<2?:$k[]=$z[$i-2]<=>$z[$i];}$s=preg_match("#^1?(-11)*(-1)?$#",join($t))?($t[0]!=1?1:2):0;$s+=2*preg_match($r="#^(-1|0)?([01](-1|0))*[01]?$#",join($o));$s*=preg_match($r,join($k));count_chars($z,3)[2]?:$s=0;echo$s;

for a more pretty Output echo["n","+P","-P","+F","-F"][$s];
Expanded version
for(;++$i<strlen($z=preg_replace("#(.)\\1#","$1",$argv[1]));){
    $t[]=$z[$i-1]<=>$z[$i]?:0;
    $o[]=$z[0]<=>$z[$i];
    $i<2?:$k[]=$z[$i-2]<=>$z[$i];
    }
$s=preg_match("#^1?(-11)*(-1)?$#",join($t))?($t[0]!=1?1:2):0; #Clockwise direction or not
$s+=2*preg_match($r="#^(-1|0)?([01](-1|0))*[01]?$#",join($o)); # True centrifugal
$s*=preg_match($r,join($k)); #true or false second test for not
count_chars($z,3)[2]?:$s=0; # word must have >2 different characters
echo$s;# short output
echo["n","+P","-P","+F","-F"][$s]; #long output alternative

Task 2 second value without short doubles rule

4 -F killingness 11 Bytes positivize 10 Bytes
3 +F oppositive 10 Bytes logogogue 9 Bytes
2 -P vassalage 9 Bytes sarcocol,sasarara 8 Bytes
1 +P assession 9 Bytes apanage, aramaic, argonon, auction, avision, awarded, crenele, exesion, exition, eyewink
  7 Bytes

Visualize a word
header('Content-Type: image/svg+xml; charset=UTF-8');
$w=$_GET["w"]??"OOPERRA";
$w=strtoupper($w);
echo '<?xml version="1.0" encoding="UTF-8"?>'
.'<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">'

.'<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 -100 420 400">'
.'<title>Swirl Word</title><desc>Viualize a Word</desc>';
echo '<text x="210" y="-50" text-anchor="middle" font-family="arial">'.$w.'</text>';

foreach(range("A","Z")as $x=>$c){
    echo '<text x="'.(15+$x*15).'" y="110" text-anchor="middle" font-family="arial">'.$c.'</text>';
    $r[$c]=15+$x*15;
}
for($i=0;++$i<strlen($w);){
    echo '<path d="M '.($r[$w[$i-1]]).',105 A '.($radius=abs($r[$w[$i]]-$r[$w[$i-1]])/2).' '.($radius).' 0 0 0 '.($r[$w[$i]]).',105" style="stroke:gold; stroke-width:1px;fill:none;" />';
}
echo '</svg>';

in the snippet is the result of the SVG I have create

<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 -100 420 400"><title>Swirl Word</title><desc>Viualize a Word</desc><text x="210" y="-50"  text-anchor="middle" font-family="arial">KILLINGNESS</text><text x="15" y="110" text-anchor="middle" font-family="arial">A</text><text x="30" y="110" text-anchor="middle" font-family="arial">B</text><text x="45" y="110" text-anchor="middle" font-family="arial">C</text><text x="60" y="110" text-anchor="middle" font-family="arial">D</text><text x="75" y="110" text-anchor="middle" font-family="arial">E</text><text x="90" y="110" text-anchor="middle" font-family="arial">F</text><text x="105" y="110" text-anchor="middle" font-family="arial">G</text><text x="120" y="110" text-anchor="middle" font-family="arial">H</text><text x="135" y="110" text-anchor="middle" font-family="arial">I</text><text x="150" y="110" text-anchor="middle" font-family="arial">J</text><text x="165" y="110" text-anchor="middle" font-family="arial">K</text><text x="180" y="110" text-anchor="middle" font-family="arial">L</text><text x="195" y="110" text-anchor="middle" font-family="arial">M</text><text x="210" y="110" text-anchor="middle" font-family="arial">N</text><text x="225" y="110" text-anchor="middle" font-family="arial">O</text><text x="240" y="110" text-anchor="middle" font-family="arial">P</text><text x="255" y="110" text-anchor="middle" font-family="arial">Q</text><text x="270" y="110" text-anchor="middle" font-family="arial">R</text><text x="285" y="110" text-anchor="middle" font-family="arial">S</text><text x="300" y="110" text-anchor="middle" font-family="arial">T</text><text x="315" y="110" text-anchor="middle" font-family="arial">U</text><text x="330" y="110" text-anchor="middle" font-family="arial">V</text><text x="345" y="110" text-anchor="middle" font-family="arial">W</text><text x="360" y="110" text-anchor="middle" font-family="arial">X</text><text x="375" y="110" text-anchor="middle" font-family="arial">Y</text><text x="390" y="110" text-anchor="middle" font-family="arial">Z</text><path d="M 165,105 A 15 15 0 0 0 135,105" style="stroke:gold; stroke-width:1px;fill:none;" /><path d="M 135,105 A 22.5 22.5 0 0 0 180,105" style="stroke:gold; stroke-width:1px;fill:none;" /><path d="M 180,105 A 0 0 0 0 0 180,105" style="stroke:gold; stroke-width:1px;fill:none;" /><path d="M 180,105 A 22.5 22.5 0 0 0 135,105" style="stroke:gold; stroke-width:1px;fill:none;" /><path d="M 135,105 A 37.5 37.5 0 0 0 210,105" style="stroke:gold; stroke-width:1px;fill:none;" /><path d="M 210,105 A 52.5 52.5 0 0 0 105,105" style="stroke:gold; stroke-width:1px;fill:none;" /><path d="M 105,105 A 52.5 52.5 0 0 0 210,105" style="stroke:gold; stroke-width:1px;fill:none;" /><path d="M 210,105 A 67.5 67.5 0 0 0 75,105" style="stroke:gold; stroke-width:1px;fill:none;" /><path d="M 75,105 A 105 105 0 0 0 285,105" style="stroke:gold; stroke-width:1px;fill:none;" /><path d="M 285,105 A 0 0 0 0 0 285,105" style="stroke:gold; stroke-width:1px;fill:none;" /></svg>

Great Swirling Words Viewer! :) Maybe you can try to connect the characters with half ellipses instead of half circles. It will be more compact and look more "dinamic". But looks great anyway!

@Mario it only needs a factor '.(.8*$radius).' instead of '.($radius).' and if you replace ($radius).' 0 0 0 with ($radius).' 0 0 '.(($w[$i-1]<$w[$i]?1:0)^(($i-1)%2)).' the program has not a fix direction

Haskell, 148 bytes
z f=tail>>=zipWith f
g c=and.z c.filter(/=0).map abs.z(-).map fromEnum
(a:b:r)%c|a==b=(b:r)%c|1<3=c a b
f s|a<-[g(>=)s,g(<=)s]=or a:a++[s%(<),s%(>)]

Try it on Ideone.
Input must be either al lower or all upper-case.
Output is a list of five booleans: [SW?, CF?, CP?, CW?, CC?].
f "positive" -> [True,True,False,False,True]
This turned out longer than expected, especially handing the collapsing of repeated characters takes about 40 bytes.
At first I compared just the first two characters to yield CW or CC before noticing that testcases like bba or bbc are valid too and defeat this approach.

Python, 152 bytes:
lambda C:[C[-1]in max(C)+min(C),C[1]>C[0]]*all([[i>g,i<g][[h%2>0,h%2<1][C[1]>C[0]]]for i,g,h in filter(lambda i:i[0]!=i[1],zip(C,C[1:],range(len(C))))])

An anonymous lambda function. Call as print(<Function Name>('<String>')).
Takes input as all lowercase or uppercase, but not mixed case.
Outputs an array containing nothing ([]) if the word is not swirly, or an array in the following format otherwise:

1st element is True/False for Centrifugal/Centripetal.
2nd element is True/False for Clockwise/Counterclockwise.

Try It Online! (Ideone)

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
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.
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

For negative values of t the cycle is simply extended:
-1 -->  -#++----   % Same as 13
-2 -->  --#++---   % Same as 12

#Additional rules
You can write a program or function.
Output can contain trailing whitespace and a leading newline.
Shortest code in bytes wins.

Relevant.

Jelly, 28 22 bytes
-6 bytes thanks to the help of @Dennis! (upend first, then concatenate)
”-ẋ6;“#++”ṙ7Ḷ’¤Ḋ€U;$⁸ị

TryItOnline
Or perform four oscillations with a bonus easter egg!!
How?
”-ẋ6;“#++”ṙ7Ḷ’¤Ḋ€U;$⁸ị - Main link: n
”-   “#++”             - strings "-" and "#++"
  ẋ6                   - repeat six times: "------"
    ;                  - concatenate: "------#++"
              ¤        - nilad followed by atoms as a nilad (ie make a constant)
           7Ḷ’         -     range(7) decremented: [-1,0,1,2,3,4,5]
          ṙ            - rotate left by (makes)-----------> ["+------#+",
               Ḋ€      - Dequeue each                        "------#++",
                   $   - last two atoms as a monad           "-----#++-",
                 U     -     reverse (vectorises)            "----#++--",
                  ;    -     concatenate                     "---#++---",
                    ⁸  - left argument (n)                   "--#++----",
                     ị - index into (1 based and modular)    "-#++-----"])

JavaScript (ES6), 65 67 bytes
EDIT - Fixed for negative values. Now supporting N >= -8,000,000,000, which should provide a fairly good extended operating time in AUTO CRUISE mode. :-)

let f =

n=>[..."------#++-----".substr((n+=8e9)%7,8)].sort(_=>n/7&1).join``

// testing 28 frames
for(var i = -14; i < 14; i++) {
  console.log(f(i));
}

Animated version

let f =

n=>[..."------#++-----".substr((n+=8e9)%7,8)].sort(_=>n/7&1).join``

let n = 0;

setInterval(function() { document.getElementById("o").innerHTML = f(n++) }, 90);

You can save 1 byte with n>=7 instead of n/7&1

@Hedi - That would work if n was in [0 ... 13], but it's not.

JavaScript (ES6), 90 87 bytes
n=>"01234567".replace(/./g,i=>"-+##"[g=n=>!((+i+n)%14&&(n-i)%14),g(n)*2|g(n-1)|g(n-2)])

"-+##" is indexed by a bitmask, where bit 1 signifies an active light and bit 0 signifies a dimmed light. Active/dimmedness is now calculated by adding and subtracting the current position from the desired position and seeing if either result is divisible by 14.

Python, 53 bytes
lambda n:('-'*5+'++#'+'-'*6)[-n%7:][:8][::-n/7%2*2-1]

Creates the string -----++#------, takes a length-8 window depending on the input modulo 7, reverses for inputs modulo 14 that lie between 1 and 7 .

MATL, 34 30 27 bytes
'++#-'I:7XyY+4LZ)t2&P&viY))

7 bytes saved thanks to @Luis
Try it Online!
Another example with the first 25 steps
Explanation
'++#-'      % Push the string literal to the stack
I:          % Create the array [1 2 3]
7Xy         % Create a 7 x 7 identity matrix
Y+          % Perform 2D convolution between the vector and this matrix
4LZ)        % Grab all but the first column. Yields the following matrix
            %
            %    2 3 0 0 0 0 0 0
            %    1 2 3 0 0 0 0 0
            %    0 1 2 3 0 0 0 0
            %    0 0 1 2 3 0 0 0
            %    0 0 0 1 2 3 0 0
            %    0 0 0 0 1 2 3 0
            %    0 0 0 0 0 1 2 3
            %
t2&P&v      % Copy this matrix, flip it horizontally and vertically concatenate
            % it with itself.
i           % Explicitly grab the input (n)
Y)          % Get the n-th row of the above matrix (and use modular indexing)
)           % Index into the initial string literal to replace 2 with #, 1 and 3 with +
            % and all 0's with -
            % Implicitly display the result

><>, 51+3 = 54 bytes
<v{"------#++"%7&(7%*27:-1
}>:?!\1-$
{~&?r\~
l?!;o>

Input is expected on the stack at program start, so +3 bytes for the -v flag.
Try it online!

Pyth, 33 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!

JavaScript (ES6), 72
t=>`------${(t=(13+t%14)%14)>6?'#++':'++#'}------`.substr(t>6?t%7:7-t,8)

Less golfed
t=>(
  pad = '------',
  t = (13+(t%14))%14,
  u = t % 7,
  t > 6 ? (pad + '#++' + pad).substr(u, 8)
        : (pad + '++#' + pad).substr(7 - u, 8)
)

Test

f=
t=>`------${(t=(13+t%14)%14)>6?'#++':'++#'}------`.substr(t>6?t%7:7-t,8)

T=_=>(
  O.textContent=f(++N.textContent),
  setTimeout(T, 150)
)

T()
<input id=I type=number value=0 oninput='N.textContent=this.value'>

-100

JavaScript, 204 bytes
function g(i){var a=(i%16+16)%16
if(!a)return g(2)
if(1==a%14)return(g(2)+'-').substr(1)
if((1<a)&&(a<8))return Array(a-1).join('-')+'++#'+Array(8-a).join('-')
return g(a-7).split("").reverse().join("")}

Test

function g(i){var a=(i%16+16)%16
if(!a)return g(2)
if(1==a%14)return(g(2)+'-').substr(1)
if((1<a)&&(a<8))return Array(a-1).join('-')+'++#'+Array(8-a).join('-')
return g(a-7).split("").reverse().join("")}

for (var i = 0; i < 16; ++i) {
    console.log(i + '-->' + g(i));
}

Vim, 95 bytes
D7i-<esc>7a_<esc>@=(<C-r>"%14+13)%14+1
|r#8|i
<esc>:v/#/d
:s/.#/+#
f#i+<esc>:s/\v^(_*)(\+*)#(_*)$/\3#\2\1
:s/_/-/g

Try it online!
Explanation
There might be a better way to do this...
D

Delete the input number into the " register.
7i-<esc>7a_<esc>

Insert the string -------_______.
@=...
|

Go to the character with the 1-based index given by this expression...
<C-r>"%14

The previously deleted number, mod 14. Unfortunately, Vim's mod operator gives negative results if the left-hand side was negative, so we have to correct for that...
(...+13)%14+1

... by adding 14 and taking the result mod 14. But at the same time, we can subtract 1, mod 14, and add 1 to give the 1-based mod (same as the regular mod, except it gives 14 instead of 0).
r#

Replace the character at that index (- or _) with #.
8|i
<esc>

Go to index 8 and insert a newline, putting the -s and the _s each on their own line.
:v/#/d

Whichever line doesn't contain the #, delete it.
:s/.#/+#

If there's a character before the #, replace it with +.
f#i+<esc>

Go to the # and insert another + before it.
:s/\v^(_*)(\+*)#(_*)$/\3#\2\1

If the line has _ instead of -, reverse it.
:s/_/-/g

Replace _ with -.

Perl, 56 55 bytes
Includes +3 for -p
Run with the number on STDIN:
for i in 0 `seq 14`; do kitt.pl <<< $i; echo; done

kitt.pl:
#!/usr/bin/perl -p
$_=eval'1x8
|1x(7-abs$_--%14-7).++$^F#'x3;y;1537;-+#

Put this in a file without the final newline (add a final ; to the program if you don't want to bother with that). Unfortunately using a literal ^F doesn't work
This program contains 2 comment characters (ignore the #! line). One of them really is a comment and actually gains a byte....
Implements the actual afterglow algorithm

Perl, 65 bytes
Includes +1 for -n
Run with the number on STDIN:
for i in 0 `seq 14`; do perl -M5.010 kitt.pl <<< $i; done

kitt.pl:
#!/usr/bin/perl -n
$_="311e".--$_%14+4e16|0;s/.(.{8})/$&|reverse/e;y/013/-+#/;say//

Not very competitive but deserves a post for the strange method

Canvas, 23 bytes
±７％╵-８×#++１╋８ｍ⁸╷³╵％７＜？↔

Try it here!

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
Movie Title Styled String
Challenge
Ever seen those movie trailer titles (namely Martian, Interstellar, etc) where they have huge gaps in between letters slowly spreading out?
The challenge is to recreate this effect given a string, gap multiplier and direction, by inserting appropriate amount of spaces in between the letters.
Example
Input: 'INTERSTELLAR', Gap multiplier: 1.0, Direction: Increasing Inward
Output: I N  T   E    R     S      T     E    L   L  A R

The spacing is: [1, 2, 3, ... , 3, 2, 1]; replacing the spaces with '.' to better demonstrate the spacing:
I.N..T...E....R.....S......T.....E....L...L..A.R

Input: 'INTERSTELLAR', Gap multiplier: 0.5, Direction: Increasing Inward
Output: IN T E  R  S   T  E  L L AR

The spacing is multiplied by 0.5, therefore we get [0, 1, 1, 2, ... 2, 1, 1, 0] from integer division; using '.':
IN.T.E..R..S...T..E..L.L.AR

Input: 'CODEGOLF', Gap multiplier: 2.0, Direction: Increasing Outward
Output: C        O      D    E  G    O      L        F

The spacing is multiplied by 2, increasing outward, therefore we get [8,6,4,2,4,6,8]; replacing with '.':
C........O......D....E..G....O......L........F

Input: 'CODEGOLF', Gap multiplier: 0.4, Direction: Increasing Outward
Output: C O DEGO L F

The spacing is multiplied by 0.4, increasing outward, therefore we get [1,1,0,0,0,1,1]; replacing with '.':
C.O.DEGO.L.F

Rules

Takes 3 input: string, gap multiplier and direction
If input string is odd in length (even in # of gaps) e.g. 'HELLO', the spacing of the inner most 2 gaps should be the same H E  L  L O
The direction and gap multiplier can be parsed however you want, e.g. you could use -2 as 'increasing inward with a multiplier of 2', 1 as 'increasing outward with a multiplier of 1', etc.
It is only required to use spaces, however it is a bonus if the character filling is customizable.

Reference Animation

Have fun golfing!

Hello, and welcome to PPCG! You might want to make this a bit simpler by changing Increasing to 1 => Inward, 0 => Outward or vice versa.

@NoOneIsHere Thanks! The direction and ratio parsing is flexible, as per rule 3, you can use 0,1 to specifiy direction or even combining both parameters into one, like +4 for 4 inward, -0.5 for 0.5 outward etc, it just needs to be defined with the solution.

This is a very interesting challenge! Welcome to the site. :)

I don't see why a gap ratio of 2 is interpreted as growing outward, while 1 and 0.5 both grow inwards.

@xnor oh no sorry for the confusion, the direction has nothing to do with the ratio, the direction and ratio are separate parameters, a 2.0 inward would look like: C..O....D......E........G......O....L..F

@sanchises fair point, or even 'multiplier' would be better, I'll edit it

Why are you using a reference animation where the letters are evenly increasingly spaced?

JavaScript (ES6), 86 82 81 80 bytes
Input is expected in currying syntax f(s)(r), with:

s = string
r = ratio + direction: a negative float for inward or a positive float for outward

let f =

s=>r=>s.replace(/./g,(c,i)=>c+' '.repeat(n+=i<l?-r:r),l=s.length/2,n=r>0&&l*r+r)

console.log(f("INTERSTELLAR")(-1));
console.log(f("INTERSTELLAR")(-0.5));
console.log(f("CODEGOLF")(2));
console.log(f("CODEGOLF")(0.4));

05AB1E, 33 bytes
Uses CP-1252 encoding.
Gap multiplier is taken as negative when outwards increasing.
g;>Î.S<_²**ÄU¹vyð²¹g<;N.S*X+DUï×J

Try it online!

PHP, 129 Bytes
12 Bytes saved by @Titus Thank You
string = $argv[1],ratio = $argv[2],
direction =  $argv[3] inward = 0 ,Outward =1
for($i=0;$i+1<2*$l=strlen($t=($x=$argv)[1]);)echo$i%2?str_pad("",$x[2]*abs($x[3]*(0^$l/2+1)-($i++>=$l?$l-$i/2:$i/2))):$t[$i++/2];

str_pad should save 4 bytes. Try ++$i>$l?$l-$i/2:$i/2 and $t[$i++]/2 instead of increment in loop post-condition; that should save 9. Why 0^?

@Titus 0^3.12 result in 3 which is necessary

$i=0 is unnecessary.
++$i> still saves one byte over $i++>=.
And You can save one more byte by moving that increment to the pre-condition: ++$i<2*$l=... instead of $i+1<2*$l=..., swap true and false branches of the outer ternary, $i instead of ++$i and $t[$i/2-.5] instead of $t[$i++/2].

Defining inward as 1 and outward as 2, should enable you to save another 3 bytes : ($l>>1) instead of (0^$l/2+1); but I haven´t tested any of these.

@Titus this will result in greater spaces

APL, 40 bytes
{⍵\⍨0~⍨∊1,⍨1,¨-⌊⍺×(1+⌈/-+)⍣⍺⍺(⌽⌊+)⍳⍴1↓⍵}

This takes the string as its right argument, the ratio as its left argument and the direction as its left operand (0 for inward and 1 for outward).
      1 (0 {⍵\⍨0~⍨∊1,⍨1,¨-⌊⍺×(1+⌈/-+)⍣⍺⍺(⌽⌊+)⍳⍴1↓⍵}) 'INTERSTELLAR'
I N  T   E    R     S      T     E    L   L  A R
      0.5 (0 {⍵\⍨0~⍨∊1,⍨1,¨-⌊⍺×(1+⌈/-+)⍣⍺⍺(⌽⌊+)⍳⍴1↓⍵}) 'INTERSTELLAR'
IN T E  R  S   T  E  L L AR
      2 (1 {⍵\⍨0~⍨∊1,⍨1,¨-⌊⍺×(1+⌈/-+)⍣⍺⍺(⌽⌊+)⍳⍴1↓⍵}) 'CODEGOLF'
C        O      D    E  G    O      L        F
      0.4 (1 {⍵\⍨0~⍨∊1,⍨1,¨-⌊⍺×(1+⌈/-+)⍣⍺⍺(⌽⌊+)⍳⍴1↓⍵}) 'CODEGOLF'
C O DEGO L F

Explanation:

⍳⍴1↓⍵: get a list of numbers from 1 to N-1, where N is the length of the string
(⌽⌊+): invert the list, and at each position, get the lowest number of both lists (this gives the sizes of the gaps if increasing inwards)
(1+⌈/-+)⍣⍺⍺: subtract each number in the list from the highest number in the list, and add 1. Do this ⍺⍺ times. (If ⍺⍺=0, nothing will happen, and if ⍺⍺=1, this will give the sizes of the gaps if increasing outwards.)
-⌊⍺×: multiply each gap by ⍺, round it downwards, and negate it.
∊1,⍨1,¨: add a 1 in front of each gap, and a 1 at the very end of the list.
0~⍨: remove any zeroes.
⍵\⍨: use the resulting list to expand ⍵. Expand (\) works in the following manner: for each positive number, the current character is replicated that many times, and for each negative number, that many spaces are inserted, with the caveat that 0 and ¯1 do the same thing, which is why all the zeroes had to be removed earlier.

MATL, 31 bytes
nq:tPvX<i?tX>Qw-]*kQ1whYs''1Gb(

Inputs are: string; 0 or 1 for inward or outward increasing; multiplier.
Try it online!
Explanation
Consider inputs 'INTERSTELLAR', 1, 0.5 as an example.
nq:    % Input string implicitly. Push [1 2 ... N-1] where N is the string length
       %   STACK: [1 2 3 4 5 6 7 8 9 10 11]
tP     % Duplicate, reverse
       %   STACK: [1 2 3 4 5 6 7 8 9 10 11], [11 10 9 8 7 6 5 4 3 2 1]
vX<    % Vertically concatenate. Minimum of each column
       %   STACK: [1 2 3 4 5 6 5 4 3 2 1]
i      % Input direction flag
       %   STACK: [1 2 3 4 5 6 5 4 3 2 1], 1
?      % If input flag was 1 (meaning outward increasing)
  tX>  %   Duplicate. Maximum
       %     STACK: [1 2 3 4 5 6 5 4 3 2 1], 6
  Q    %   Add 1
       %     STACK: [1 2 3 4 5 6 5 4 3 2 1], 7
  w-   %   Swap. Subtract
       %     STACK: [6 5 4 3 2 1 2 3 4 5 6]
]      % End
*k     % Input multiplier implicitly. Multiply. Round down
       %   STACK: [3 2 2 1 1 0 1 1 2 2 3]
Q      % Add 1
       %   STACK: [4 3 3 2 2 1 2 2 3 3 4]
1wh    % Prepend a 1
       %   STACK: [1 4 3 3 2 2 1 2 2 3 3 4]
Ys     % Cumulative sum
       %   STACK: [1  5  8 11 13 15 16 18 20 23 26 30]
''     % Push empty string
       %   STACK: [1  5  8 11 13 15 16 18 20 23 26 30], ''
1G     % Push input string again
       %   STACK: [1  5  8 11 13 15 16 18 20 23 26 30], '', 'INTERSTELLAR'
b      % Bubble up
       %   STACK: '', 'INTERSTELLAR', [1  5  8 11 13 15 16 18 20 23 26 30]
(      % Assign the characters from the top string into the empty string at the
       % given positions. Intermediate positions are filled with character 0,
       % which is displayed as a space
       %   STACK: 'I   N  T  E R ST E L  L  A   R'
       % Dispaly implicitly

Racket 348 bytes
(define(f s)(let*((c #\space)(sp(λ(l)(define ol'())(for((i(length l)))(for((j i))
(set! ol(cons c ol)))(set! ol(cons(list-ref l i)ol)))(for((n(floor(/(length l)2))))
(set! ol(cons c ol)))ol))(m(floor(/(string-length s)2)))(s1(sp(string->list(substring s 0 m)
)))(s2(sp(reverse(string->list(substring s m))))))(list->string(append(reverse s1)s2))))

Ungolfed:
(define(f s)
  (let* ((c #\space)
         (sp (λ (l)           ; subfn to add increasing spaces to list of characters
               (define ol '())
               (for ((i (length l)))
                 (for ((j i))
                   (set! ol (cons c ol)))
                 (set! ol (cons (list-ref l i)ol)))
               (for ((n (floor(/ (length l)2))))
                 (set! ol (cons c ol)))
               ol))
         (m (floor (/ (string-length s) 2)))                 ; find midpoint
         (s1 (sp (string->list (substring s 0 m))))          ; add spaces to first part
         (s2 (sp (reverse (string->list (substring s m)))))) ; add spaces to second part
    (list->string (append (reverse s1) s2))                  ; re-combine 2 parts
    ))

Testing:
(f "INTERSTELLAR")

Output:
"I N  T   E    R     S      T     E    L   L  A R"


text:
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:
[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]

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:
▉
▉
▉
▉
▉
▉
▉▉
▉▉ ▉
▉▉ ▉▉

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

The specifications are inconsistent. You take k=4, but there are 5 bars in your histogram; and you say that b must be larger than the max value, but in your answer it equals the last value (thus causing an extra bar).

@GregMartin, I have edited the question. Is it ok now?

It's clear now, but you always have exactly 1 value in the last class, no less no more. It seems wrong

@edc65, how would that be true? I only said that the last class must contain the max value of the set, just in other words. This means that b must be greater than the max value if b is the (open) upper bound of the histogram

The width of each class is the range of your data set divided by the number of classes so the only value that can be inside the last class is the max value. If I'm wrong, could you please give me an example?

@edc65, how about [0,0,0,19,20,20]

The only value in the last class is 20 (present 2 times). So, ok, you can have more than 1 value (my bad wording) but only the max value eventually repeated

@edc65, yeah that's true

05AB1E, 50 49 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»

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))

CJam, 72 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

Pyth, 76 bytes
This code is absolutely disgusting.  I've mentioned before how bad I am at golfing string-output challenges, right?
J_Mr8Smf>+*T/-h.MZQKh.mbQ.EllQKd)Q)=Y_.tUMme@+J]0xhMJdSheJ;jmj""m@"▉ "qk\ dY

Explanation to follow.
Test it out online!

R, 105 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:
▉
▉
▉
▉
▉
▉
▉
▉
▉▉ ▉
▉▉ ▉▉

I have specified what k is. It is the lowest value for which 2^k>n

@Dopapp Ah, I misinterpreted "the number of bars is not final". I disagree that your definition of k is anything close to "ideal" but it's your challenge so your rules :) I'll update my code when I'm back at my desk.

Honestly, I agree that the way k is defined is not ideal, but it got a little overly complicated otherwise in my opinion

Right, k isn't ideal, but it's workable. But why the weird bin definition? Why not have k be the number of bins, and have the ranges be [1.04,16.6) [16.6,32) [32,47.5) [47.5,63.1) or something similar? Having the last bar reserved exclusively for max values is really bizarre. Anyway, I've updated my post to meet your original specifications.


text:
Sum evens between 0 and N
Challenge
Given an integer n, calculate the sum of all even numbers between 0 and n
Examples
n     output
-------------
100   2550
255   16256
1000  2502500

Shortest code in bytes wins

What are the expected inputs and outputs? What's the winning criterion? Please put them in your question instead of in the tags. Also, I'm fairly sure this is a dupe.

I closed as a dupe of summing odds. I don't think evens and lack of a lower bound changes much. Be aware that that question was poorly received, likely for being too easy. In the future, I'd suggest running challenge ideas through the sandbox on meta.

@xnor Fair enough. Though this allows for something much simpler like (n/=2)*n+n.

Scala - 18 bytes
shortest I could figure:
(0 to i by 2).sum

Using an anonymous function:
val i = (N:Int) => (0 to N by 2).sum

Your first snippet is neither a function nor a program, you can't assume that a predefined variable exists.


text:
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
1011011111010

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

If the middle digit is zero this number cannot be folded
Reverse the second half and superimposed on the first half
010111
101101

Add the digits in place
111212

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:
1010001010000

Split in half:
101000 1 010000

The middle is one so we continue
Superimpose the halves:
000010
101000

Added them:
101010

No twos so we continue
Split in half:
101 010

Fold:
010
101

111

The result is 111 (7 in decimal) so this is a Super Folding Number.
Test Cases
The first 100 Super Folding Numbers are:
[1, 2, 3, 6, 7, 8, 10, 12, 15, 20, 22, 28, 31, 34, 38, 42, 48, 52, 56, 63, 74, 78, 90, 104, 108, 120, 127, 128, 130, 132, 142, 150, 160, 170, 178, 192, 204, 212, 232, 240, 255, 272, 274, 276, 286, 310, 336, 346, 370, 400, 412, 436, 472, 496, 511, 516, 518, 524, 542, 558, 580, 598, 614, 640, 642, 648, 666, 682, 704, 722, 738, 772, 796, 812, 852, 868, 896, 920, 936, 976, 992, 1023, 1060, 1062, 1068, 1086, 1134, 1188, 1206, 1254, 1312, 1314, 1320, 1338, 1386, 1440, 1458, 1506, 1572, 1596]

Unless I'm mistaken, how did 3 sneak into the test cases again? I can't see how it can be folded, since it splits to 1 1, immediately giving a 2. Or are you saying that folding it zero times counts also?

@geobits 3 is supposed to be there. I checked this time ;). Three is 11 so it gets to only ones in zero files

I think it may be worth putting a note right near the top, just after you link to the other folding number question that points out that the individual folds in this question will use a different method.

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!

Welcome to PPCG! You can save a bunch of bytes  by removing the spaces after the :s, and returning 0 and 1 instead of True and False.

Thank you Steven. Also, I'm not 100% sure I counted the byte length correctly.

I'm seeing 232 bytes.  Give me a second and I can try to golf it a little further.

I used this to measure: http://bytesizematters.com/

When I checked it just now with Sublime Text 3 I got 232.

I was able to get it down to 201 with some simple optimizations.

@Kapocsi, bytesizematters.com counts newlines wrong. Compare with mothereff.in, 5 digits and 5 newlines should be 10 bytes, not the 14 I got on bytesize... its 232.

Some spaces can be removed: if B=='1'*L:return 1->if'1'*L==B:return 1; 0 and->0and; ) or->)or. First few lines of the function can be meged with ;. Also you can use the fact that the set of digits will be {'1'} to avoid len(S) and then merge the last to lines to return{S}=={'1'}or f(int(S,2)); then merge the new last two lines to return 0if(~L%2==0and'0'==B[M])or'2'in S else{S}=={'1'}or f(int(S,2)). This all takes you down to 167 bytes. You could save more by moving to Python 2 where str() can be replaced by backticks, \``

...and welcome to ṖṖCG!

what purpose does {S}=={'1'} serve? How is it different from S=='1'?

@Kapocsi I managed an even shorter, pretty confusing, doubly recursive version :)

@Cyoce {S} makes a set from the string S (if it is non-empty) and {'1'} makes one from the string '1', so if S only contains the character '1' the two sets will be equal. That is if S='111' (7) this will evaluate to True whereas S=='1' would not.

@JonathanAllan That's pretty cool.  Cryptic.  You're referencing your python 2 post, right?

@Kapocsi I am indeed. I've never used that mod 2 hack to bypass a logical or before, but it works a charm; flash of inspiration.

Java 7, 202 bytes
boolean g(Integer a){byte[]b=a.toString(a,2).getBytes();int i=0,l=b.length,o=0,c,z=(a+1&a)==0?-1:1;for(;i<l/2&z>0;o+=o+c*2,z*=c>1|(l%2>0&b[l/2]<49)?0:1)c=b[i]+b[l-++i]-96;return z<0?1>0:z<1?0>1:g(o/2);}

It took a bit of effort to make the old folding function recursable, but here it is. It's ugly as sin, to be honest. I'll have to take a look in the morning to see if I can golf it further, since I can barely stand to look at it right now.
With line breaks:
boolean g(Integer a){
    byte[]b=a.toString(a,2).getBytes();
    int i=0,l=b.length,o=0,c,z=(a+1&a)==0?-1:1;
    for(;i<l/2&z>0;o+=o+c*2,z*=c>1|(l%2>0&b[l/2]<49)?0:1)
        c=b[i]+b[l-++i]-96;
    return z<0?1>0:z<1?0>1:g(o/2);
}

CJam, 47 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.

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

m=l>>1, /2/.test(n), n.slice(l-m) (or slice the reversed string). I think if you switch the failure and success cases then you can use /0/.test(n)?f(...):1.

JavaScript (ES6), 113 109 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);
}

Perl, 71 70 bytes
Includes +1 for -p
Give number on STDIN
superfolding.pl:
#!/usr/bin/perl -p
$_=sprintf"%b",$_;s%.%/\G0$/?2:/.\B/g&&$&+chop%eg while/0/>/2/;$_=!$&

Python 2, 151 bytes
f=lambda n,r=0:f(bin(n)[2:],'')if r<''else(r==''and{'1'}==set(n)or(n in'1'and f(r,'')+2)or n!='0'and'11'!=n[0]+n[-1]and f(n[1:-1],r+max(n[0],n[-1])))%2

ideone
A doubly-recursive function which takes an integer, n, and returns 0 or 1.
A variable r is maintained to allow both the result of folding and to know if we currently: have an integer (first only); have a new binary string to try to fold (outer); or are folding (inner).
On the first pass n is and integer, which is <'' in Python 2 so the recursion starts by casting to a binary string.
The next execution has r='' and so the test {'1'}==set(n) is executed to check for a continuous string of 1s (the RHS cannot be {n} as we may need to pass this point later with r='' and an empty n when that would be a dictionary which wont equal {'1'}, a set).
If this is not satisfied the inner tail criteria is tested for (even if unnecessary): if n in'1' will evaluate to True when n is an empty string or a single 1, whereupon a new outer recursion is begun by placing r, by the then folded, binary string into n and '' into r. The literal 2 is added to the result of this function call to allow no fall through to the next part (to the right of a logical or) that is corrected later.
If that is not a truthy value (all non-zero integers are truthy in Python) the outer tail recursion criteria is tested for: n!=0 excludes the case with a middle 0 and the outer two characters are tested they do not sum to 2 by the string concatenation '11'!=n[0]+n[-1]; if these both hold true the outer bits are discarded from n with n[1:-1], and then a 1 is appended to r if there is one on the outside otherwise a 0 is, using the fact that '1'>'0' in Python with max(n[0],n[-1]).
Finally the addition of 2 at each inner recursion is corrected with %2.

PHP, 113 bytes
for($n=$argv[1];$n!=$c;$n=($a=$n>>.5+$e)|($b=$n&$c=(1<<$e/=2)-1))if($a&$b||($e=1+log($n,2))&!(1&$n>>$e/2))die(1);

exits with error (code 1) if argument is not super-folding, code 0 else. Run with -r.
Input 0 will return true (code 0).
breakdown
for($n=$argv[1];
    $n!=$c;                 // loop while $n is != mask
                            // (first iteration: $c is null)
    $n=                     // add left half and right half to new number
        ($a=$n>>.5+$e)      // 7. $a=left half
        |
        ($b=$n&             // 6. $b=right half
            $c=(1<<$e/=2)-1 // 5. $c=mask for right half
        )
)
    if($a&$b                // 1. if any bit is set in both halves
                            // (first iteration: $a and $b are null -> no bits set)
        ||                  // or
        ($e=1+log($n,2))    // 2. get length of number
        &
        !(1&$n>>$e/2)       // 3. if the middle bit is not set -> 1
                            // 4. tests bit 0 in length --> and if length is odd
    )
    die(1);                 // -- exit with error

PHP, 197 Bytes
function f($b){if(!$b)return;if(!strpos($b,"0"))return 1;for($n="",$i=0;$i<($l=strlen($b))>>1;)$n.=$b[$i]+$b[$l-++$i];if($l%2&&!$b[$i]||strstr($n,"2"))return;return f($n);}echo f(decbin($argv[1]));

Expanded
function f($b){
    if(!$b)return; # remove 0
    if(!strpos($b,"0"))return 1; # say okay alternative preg_match("#^1+$#",$b)
    for($n="",$i=0;$i<($l=strlen($b))>>1;)$n.=$b[$i]+$b[$l-++$i]; #add first half and second reverse
    if($l%2&&!$b[$i]||strstr($n,"2"))return; #if middle == zero or in new string is a 2 then it's not a number that we search
    return f($n); #recursive beginning
}
echo f(decbin($argv[1]));

True values < 10000

1, 2, 3, 6, 7, 8, 10, 12, 15, 20, 22, 28, 31, 34, 38, 42, 48, 52, 56, 63, 74, 78, 90, 104, 108, 120, 127, 128, 130, 132, 142, 150, 160, 170, 178, 192, 204, 212, 232, 240, 255, 272, 274, 276, 286, 310, 336, 346, 370, 400, 412, 436, 472, 496, 511, 516, 518, 524, 542, 558, 580, 598, 614, 640, 642, 648, 666, 682, 704, 722, 738, 772, 796, 812, 852, 868, 896, 920, 936, 976, 992, 1023, 1060, 1062, 1068, 1086, 1134, 1188, 1206, 1254, 1312, 1314, 1320, 1338, 1386, 1440, 1458, 1506, 1572, 1596, 1644, 1716, 1764, 1824, 1848, 1896, 1968, 2016, 2047, 2050, 2054, 2058, 2064, 2068, 2072, 2110, 2142, 2176, 2180, 2184, 2222, 2254, 2306, 2320, 2358, 2390, 2432, 2470, 2502, 2562, 2576, 2618, 2650, 2688, 2730, 2762, 2866, 2898, 2978, 3010, 3072, 3076, 3080, 3132, 3164, 3244, 3276, 3328, 3380, 3412, 3492, 3524, 3584, 3640, 3672, 3752, 3784, 3888, 3920, 4000, 4032, 4095, 4162, 4166, 4170, 4176, 4180, 4184, 4222, 4318, 4416, 4420, 4424, 4462, 4558, 4674, 4688, 4726, 4822, 4928, 4966, 5062, 5186, 5200, 5242, 5338, 5440, 5482, 5578, 5746, 5842, 5986, 6082, 6208, 6212, 6216, 6268, 6364, 6508, 6604, 6720, 6772, 6868, 7012, 7108, 7232, 7288, 7384, 7528, 7624, 7792, 7888, 8032, 8128, 8191, 8202, 8206, 8218, 8232, 8236, 8248, 8318, 8382, 8456, 8460, 8472, 8542, 8606, 8714, 8744, 8814, 8878, 8968, 9038, 9102, 9218, 9222, 9234, 9248, 9252, 9264, 9334, 9398, 9472, 9476, 9488, 9558, 9622, 9730, 9760, 9830, 9894, 9984