[Question]
  [
The challenge here is to take a string and output all its rotations, by repeatedly moving the first character to the end, once per character in the string, ending with the original string:
```
john -> ohnj, hnjo, njoh, john
```
You may also cycle in the other direction, moving characters from the end:
```
john -> njoh, hnjo, ohnj, john
```
You should still output one rotation per letter even if the original word is reached before that:
```
heehee -> eeheeh, eheehe, heehee, eeheeh, eheehe, heehee
```
Character arrays are allowed, as long as the result works as shown above.
Shortest answer wins!
  
[Answer]
## Haskell, 27 bytes
```
scanl(\(a:b)_->b++[a])=<<id
```
[Try it online!](https://tio.run/##BcHRCYAgEADQVQ7pQ5EWCG2RjDgt07JLsvm73kvYzq0UjtZxC0hFOomDV0s/eq0nnJU1Jq98YSawUJ9ML3QQQRx3IsFfiAX3xn2o9Qc "Haskell – Try It Online")
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 2 [bytes](https://github.com/DennisMitchell/jelly/wiki/Code-page)
```
ṙJ
```
A monadic Link accepting a list of characters which yields a list of lists of characters
**[Try it online!](https://tio.run/##y0rNyan8///hzple/w@3R/7/r@SVn5GnBAA "Jelly – Try It Online")** (footer pretty prints by calling the link and joining with newline characters)
[Answer]
# [Python 2](https://docs.python.org/2/), 38 bytes
```
s=input()
for c in s:s=s[1:]+c;print s
```
[Try it online!](https://tio.run/##K6gsycjPM/r/v9g2M6@gtERDkystv0ghWSEzT6HYqti2ONrQKlY72bqgKDOvRKH4/3@lrPyMPCUA "Python 2 – Try It Online")
[Answer]
# JavaScript (ES6), ~~37~~ 32 bytes
Returns an array of strings.
```
s=>[...s].map(c=>s=s.slice(1)+c)
```
[Try it online!](https://tio.run/##XclBCoAgEEDRfcdwpUQDHUAvEi1kGlMxR5ro@uY6@Kv3s3@94J3as1Q@qAfbxboNAGSHyzeN1okVkJKQ9GpmNB25CheCwqcOWmWOVRkz/TgSjcboHw "JavaScript (Node.js) – Try It Online")
[Answer]
# [APL (Dyalog Unicode)](https://www.dyalog.com/), 6 [bytes](https://codegolf.meta.stackexchange.com/a/9429/43319 "When can APL characters be counted as 1 byte each?")[SBCS](https://github.com/abrudz/SBCS ".dyalog files using a single byte character set")
```
⍳∘≢⌽¨⊂
```
[Try it online!](https://tio.run/##SyzI0U2pTMzJT////1Hv5kcdMx51LnrUs/fQikddTf/THrVNeNTb96hvqqf/o67mQ@uNH7VNBPKCg5yBZIiHZ/D/NAX1rPyMPHUA "APL (Dyalog Unicode) – Try It Online")
`⍳` the indices
`∘` of
`≢` the tally
`⌽¨` each rotate (to the left)
`⊂` the entire string
[Answer]
# Japt, ~~5~~ 3 bytes
Takes input as a character array, outputs an array of character arrays
```
£=é
```
[Try it here](https://ethproductions.github.io/japt/?v=1.4.6&code=oz3p&input=WyJqIiwibyIsImgiLCJuIl0KLVE=)
```
£=é     :Implicit input of character array U
£       :Map
  é     :  Rotate U one element to the right
 =      :  Reassign to U for next iteration
```
[Answer]
# [MATL](https://esolangs.org/wiki/MATL), ~~6~~ 5 bytes
```
tf&+)
```
*1 byte saved thanks to @luis!*
Try it at [MATL Online](https://matl.io/?code=tf%26%2B%29&inputs=%27John%27&version=20.10.0)!
**Explanation**:
```
    # Implicitly grab input string
t   # Duplicate the input
f   # Create an array [1, ..., N] where N is the number of characters in the input
&+  # Add the transpose of this array to itself to create a 2D array of indices
    #
    #   +   1  2  3  4
    #       ----------
    #   1 | 2  3  4  5
    #   2 | 3  4  5  6
    #   3 | 4  5  6  7
    #   4 | 5  6  7  8
    #
)   # Use this 2D array to index into the original string using periodic indexing
    # Implicitly display the resulting character array
```
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), 3 bytes
```
ā._
```
[Try it online!](https://tio.run/##yy9OTMpM/f//SKNe/P//WfkZeQA "05AB1E – Try It Online")
[Answer]
# [J](http://jsoftware.com/), 7 bytes
```
#\|."{]
```
[Try it online!](https://tio.run/##y/qfVmyrp2CgYKVg8F85pkZPqTr2vyaXkp6CepqtnrqCjkKtlUJaMRdXanJGvkKagnpWfkaeOoTn4wYXzUhNBSJ1rv8A "J – Try It Online")
## Explanation:
```
  |."{    - rotate ( "{ is short for "0 1 - rank 0 1 ) 
      ]   - the input
#\        - lenght of the successive prefixes of the input 
```
[Answer]
# [brainfuck](https://github.com/TryItOnline/brainfuck), 59 bytes
```
,[>,]<[>>[>]+[<]<[<]>-[[>]>[>]<+[<]<[<]>-]>[.>]>[.>]<[<].<]
```
[Try it online!](https://tio.run/##SypKzMxLK03O/v9fJ9pOJ9Ym2s4u2i5WO9oGyLSJtdONBvJAIjYIISBfzw5CgAT0bGL//8/Kz8gDAA "brainfuck – Try It Online")
Outputs each string separated by null bytes.
### Explanation:
```
,[>,]    # Get input
<[       # Start loop over input
  >>[>]       # Go to end of the string
  +           # Set it to one to mark it
  [<]<[<]>    # Move to the beginning of input
  -[[>]>[>]<+[<]<[<]>-]   # Transfer the first character to the end
  >[.>]>[.>]  # Print the rotated string
  <[<].       # Print a nul byte
<]       # Repeat loop while input
```
[Answer]
# [Wolfram Language (Mathematica)](https://www.wolfram.com/wolframscript/), ~~35~~ 26 bytes
```
Partition[#,Tr[1^#],1,-1]&
```
[Try it online!](https://tio.run/##y00syUjNTSzJTE78H1CUmVcS/T8gsagksyQzPy9aWSekKNowTjlWx1BH1zBW7b@Cg4JzRmJRYnJJalFxtFJWfkaeUmzsfwA "Wolfram Language (Mathematica) – Try It Online")
Takes a list of characters as input.
`Partition` (but not its variant `StringPartition`used below) has an optional fourth argument for treating its input as cyclic (and for specifying how exactly to do so), which makes this solution simpler than the string one - in addition to not having any 15-character built-in functions.
# [Wolfram Language (Mathematica)](https://www.wolfram.com/wolframscript/), 44 bytes
```
Rest@StringPartition[#<>#,StringLength@#,1]&
```
[Try it online!](https://tio.run/##y00syUjNTSzJTE78H1CUmVcS/T8otbjEIbgEyEkPSCwqySzJzM@LVraxU9aBCPqk5qWXZDgo6xjGqv1XcFBQysrPyFOK/Q8A "Wolfram Language (Mathematica) – Try It Online")
The same, but takes a string as input.
Turns `"john"` into `"johnjohn"`, then takes all the length-`StringLength["john"]` substrings of this string with offset 1, producing `{"john","ohnj","hnjo","njoh","john"}`, then drops the first of these with `Rest`.
[Answer]
# [Attache](https://github.com/ConorOBrien-Foxx/Attache), 13 bytes
```
Rotate#{1:#_}
```
[Try it online!](https://tio.run/##SywpSUzOSP2fpmBl@z8ovySxJFW52tBKOb72v19qakpxtEpBQXJ6LFdAUWZeSUhqcYlzYnFqcXSajkK0UlZ@Rp6SjoJSRmoqEIFYhkbGJiBaz0pRKTb2PwA "Attache – Try It Online")
## Explanation
```
Rotate#{1:#_}
      #          fork(f, g) = ${ f[x, g[x]] }; this forks:
Rotate               rotate's the input by
       {1:#_}        each number from 1 to the length of the input
```
## Alternatives
**15 bytes**: `{_&Rotate!1:#_}`
**16 bytes**: `{Rotate[_,1:#_]}`
**16 bytes**: `Rotate@Rotations`
**16 bytes**: `Rotate#(1&`:@`#)`
**17 bytes**: `Rotate#{1+Iota@_}`
**18 bytes**: `Rotate#(1&`+@Iota)`
**19 bytes**: `Rotate#(Succ=>Iota)`
[Answer]
# [R](https://www.r-project.org/), 58 bytes
```
function(s,`[`=substring)paste0(s[n<-nchar(s):1],s[1,n-1])
```
[Try it online!](https://tio.run/##DcZBCoAgEADAex/RBYW8Rr5EBEs07bCGq@/fhDlM52w5T4yjNpSkgguW5k2jV3zgu2ikXZLDU2MsV5cEh/GKnFGojQfOUrytoIBtraS0COAf "R – Try It Online")
[Answer]
# [C# (Visual C# Interactive Compiler)](http://www.mono-project.com/docs/about-mono/releases/5.0.0/#csc), 34 bytes
```
x=>x.Select(c=>x=x.Substring(1)+c)
```
[Try it online!](https://tio.run/##Sy7WTS7O/O9WmpdsU1xSlJmXruPpmleam1qUmJSTChWys1NIU7D9X2FrV6EXnJqTmlyikQxk2wJ5pUkQJRqGmtrJmv@tuQKAvBKNNA2lrPyMPCVNvZB8x6KixEoNTU0kuYzUVCBClf0PAA "C# (Visual C# Interactive Compiler) – Try It Online")
[Answer]
# [Ruby](https://www.ruby-lang.org/), 39 bytes
```
->s{a=s.chars.to_a;a.map{a.rotate!*''}}
```
[Try it online!](https://tio.run/##KypNqvyfZvtf1664OtG2WC85I7GoWK8kPz7ROlEvN7GgOlGvKL8ksSRVUUtdvbb2f4FCWrR6Vn5GnnrsfwA "Ruby – Try It Online")
[Answer]
# C (32-bit), ~~58~~ ~~51~~ 50 bytes
-1 byte for a nice round number thanks to ceilingcat
```
i;f(s){for(i=0;i++<printf("%s%.*s\n",s+i,i,s)-2;);}
```
[Try it online!](https://tio.run/##Jcu7CsIwFIDhV4mFQm4VL@Ohu2/goA4hJs2RNJGk1EH00T1ahH4l892g7VECJ5X8fS5cOw38FYK1b1gmjxv2tquZT2nRleFGnUVIOBFo8HErZ6FDaZIOcNfp4lhvwU2n/ACDJUSni@/EArO/aJbDokOLsbMjrnE6@pjfTRDpe5B3bjffQE "C (gcc) – Try It Online")
## Degolf
```
i;           // "Global" i.
f(s){   // s is pointer to string, which conveniently fits in a 32 bit integer.
    for(i=0; // Initialize i.
        // Increment i and take its complement, and add it to the
        // return value of printf(); which just happens to be strlen(s)+1.
        // ~i + strlen(s) + 1 == strlen(s) + 1 - i - 1, so the last printed
        // string is the original string.
        ~++i + printf("%s%.*s\n",s+i,i,s);
        // The printf prints two strings: first until the terminating \0,
        // the second until a \0 or until i chars have been printed. It also
        // prints a linefeed.
}
```
[Answer]
# JavaScript, ~~48~~ ~~43~~ 36 bytes
*-5 bytes courtesy of @Bubbler*
\*-7 bytes courtesy of @Shaggy
Input is a character array and output is an array of character arrays.
```
s=>s.map(_=>([a,...b]=s,s=[...b,a]))
```
[Try it online!](https://tio.run/##XcnBDYAgDEDRu2NwgqjdoCxijBYElSg11rg@cjb5p/cTvST@3q@nz7yEErEI2gEAZISTLj2h1QN1FdyI0gk6SLzneW7JmOI5Cx8BDl511CrxlpUxzY@3EGp1lA8)
[Answer]
# [brainfuck](https://github.com/TryItOnline/brainfuck), 38 bytes
```
,[>>,]<<<+>[[.>>]<<[<<]>-[+>.>-].<<+>]
```
[Try it online!](https://tio.run/##SypKzMxLK03O/v9fJ9rOTifWxsZG2y46Ws/ODsiMtrGJtdON1rbTs9ON1QPJxP7/n5WfkQcA "brainfuck – Try It Online")
Based on the idea of JoKing to use null-characters as space symbols. This code marks the current letters to print and loops until it reaches the left end.
```
,[>>,]<<    input string with empty cells in between
<+>         set first marker
[           main loop
  [.>>]     print remaining characters
  <<[<<]    return to start
  >-[+>.>-] print until marker (remove marker)
  .         print null
  <<+       set new marker
  >         restart loop with next character to the left
]           stop if there's no character to the left
```
[Answer]
# [Fig](https://github.com/Seggan/Fig), \$13\log\_{256}(96)\approx\$ 10.701 bytes
```
$#GLxWxO'+]xq
```
[Try it online!](https://fig.fly.dev/#WyIkI0dMeFd4TycrXXhxIiwiam9obiJd)
This is so long
[Answer]
# [Go](https://go.dev), 105 bytes
```
func f(s[]rune)(o[][]rune){for i:=0;i<len(s);i++{o=append([][]rune{append(s[i:],s[:i]...)},o...)}
return}
```
[Attempt This Online!](https://ato.pxeger.com/run?1=RY_BTsQgEIbP8hSEE2Sx8WhY-w7em8ZgF7q4W2hm6In0Sbw0Jj6EV9_Ct5EtrRKSmUn--b_53z_6sHyNurvo3tBBO0_cMAaIFbNDZJ9TtPePP85OvqOWY9PC5I3goWm3NtkA1Kn64eiersZzFEd3OKRQ63E0_sR3YdpmbJxqJTbKtVVViVmGtRAwcQI_b8DvFXjhgH8gjrnHCM73BfoiQdWgfb4bMCHuRERZZBzEvzEhq-UtIRc0EUSqaro7JvYWzp5Jys7G5H_r9Gt3MpbNpMBWfcHl3UTunvNivObEMh9qeTkz58-PzGRLsiyl_gI)
Without the requirement of the original being at the end, this saves 13 bytes:
### 92 bytes
```
func f(s[]rune)(o[][]rune){for i:=0;i<len(s);i++{o=append(o,append(s[i:],s[:i]...))}
return}
```
[Attempt This Online!](https://ato.pxeger.com/run?1=TY9BbsMgEEXX5RSIFSjU6rIi9R2yd62KOuDQxGDN4BXySbqxKvUQ3fYWvU2JcaqikfiLmf_-f__ow_I16u6se0MH7TxxwxggVswOkX1O0d4__jzbyXfUcmxamLwRPDTtJpMNQJ2qH_bu6WI8R7F3u10KtR5H4488yE1g41QrsVGurapKiJmAiRP4eWN8r4wzB_zz5pg1RnC-L5wXCaoG7XNUwIR4gyDKssbhnzEhq-W1FBc0EUSqanpzTOwtnDyTlJ2MyXNV-rU7GstmUmDrfsHl20TuDvkwXnJJmYNaXmLmyvmRmWxNlqX8vw)
[Answer]
# [Stax](https://github.com/tomtheisen/stax), 3 bytes
```
:(m
```
[Run and debug it](https://staxlang.xyz/#c=%3A%28m&i=john%0Aheehee&a=1&m=2)
[Answer]
# [Ruby](https://www.ruby-lang.org/) `-nl`, 26 bytes
```
$_.scan(/./){puts$'+$`+$&}
```
[Attempt This Online!](https://ato.pxeger.com/run?1=m72kqDSpcnm0km5ejlLsgqWlJWm6FrtU4vWKkxPzNPT19DWrC0pLilXUtVUStFXUaiEKoOoWLMnKz8iDsAE)
[Answer]
# [Vyxal](https://github.com/Vyxal/Vyxal), 3 bytes
```
(Ǔ…
```
### Explanation:
```
(   # For each char in the input
 Ǔ  # Rotate left
  … # Print without popping
```
[Try it Online!](https://vyxal.pythonanywhere.com/#WyIiLCIiLCIox5PigKYiLCIiLCJqb2huIl0=)
[Answer]
# [Julia 1.0](http://julialang.org/), 31 bytes
```
!s=(r=keys(s)).|>i->(s*s)[i.+r]
```
[Try it online!](https://tio.run/##yyrNyUw0rPj/X7HYVqPINju1slijWFNTr8YuU9dOo1irWDM6U0@7KPa/Q3FGfrmColJWfkaeEheMl5GaCkRK/wE "Julia 1.0 – Try It Online")
[Answer]
# [Thunno 2](https://github.com/Thunno/Thunno2), 3 [bytes](https://github.com/Thunno/Thunno2/blob/main/docs/codepage.md)
```
ż€Ỵ
```
[Attempt This Online!](https://ato.pxeger.com/run?1=m728JKM0Ly_faMGCpaUlaboWK47uedS05uHuLUuKk5KLoYILlmWkpgIRhAcA)
#### Explanation
```
ż€Ỵ  # Implicit input
ż    # Push the length range
 €   # For each number in this range:
  Ỵ  #  Rotate the input left that many times
```
[Answer]
# [Arturo](https://arturo-lang.io), 30 bytes
```
$->s[0-1map s=>[rotate s<=1+]]
```
[Try it!](http://arturo-lang.io/playground?rEtDLt)
[Answer]
# [JavaScript (Node.js)](https://nodejs.org), 41 bytes
Another JS answer, which doesn't beat any of the previous JS ones.  
Input is an array of characters (as seen in other answers), and output is an array of strings.  
Rotates the string the inverted way, as allowed by OP.
```
s=>[...s].map(_=>[...s]=s.pop()+s.join``)
```
[Try it online!](https://tio.run/##dY5BCsIwEEX3niLMKsGYAwjRvQtduBSxpU5tSk1CJ4oewJ1H0Mt5kRobuxGEgc/Pf/MzdX7OqWiNDxPr9tiVuiM92yilaKuOuee7wWlS3nkuxqRqZ2yWiS4nwjZobqw/BYkXj0XAvWyRTk3Qi/VqqSi0xh5MeeVlwoQQelY4S65B1bgD519c66FgDq/HjcEUXs87AzFOgBiN0n@csc9FULvKwpZJlm3ARgMSqqhRYlBHSUDGmPjZrBDjDLvY28j3r31NyuX/qG/t3g "JavaScript (Node.js) – Try It Online")
---
Different approach that swaps each character with their corresponding one, obtained via calculation of its index (correct rotation direction, **58 bytes**) :
```
s=>s.map((_,i)=>s.map((_,j)=>s[(i+j+1)%s.length]).join``)
```
[Try it online!](https://tio.run/##dY3BasMwDIbvfQojKFjEM@w68HbfoT3sGMoSUiWxyewQuWV7gN32CNvL9UUyJ15hDAZCv3706ZerzzU3kx3jjQ9Hmlszs7ln/VKPUj4ri7@MW0wpbeGKW9yyHsh3sT@gdsH6qsK5ZqYpGmn9eIqKXkdqIh3VRHwaonl82u80x8n6zrZvss0YYkptgucwkB5CJ@UPbsw14AEun@8C7uDy9SEAiwzgZpP/SSFKrTW40Hs4CCWqEtLoQEHqIUnqfZIMVELgn8ueKNX1djULvyotMXmv/l@tqfM3 "JavaScript (Node.js) – Try It Online")
[Answer]
# [ForWhile](https://esolangs.org/wiki/ForWhile) 23 bytes
`{:0$(.0@,0@(.0@,#:)9#)}`
Input: a char array followed by its length (stored on stack)
Output: prints rotations of input separated by tab (newline would need an additional character)
[online interpreter](https://bsoelch.github.io/OneChar.js/?lang=forwhile&src=ezowJCguMEAsMEAoLjBALCM6KTkjKX0KMSQKCiJGb3JXaGlsZSIgMUA_)
# Explanation
```
{          \ define anonymous procedure
:0$        \ store copy of string length at address 0
(.         \ start for-loop, ignore loop-counter
0@,        \ rotate top (string length) stack elements
0@(.0@,#:) \ print string but keep it on the stack
9#         \ print tab
)          \ end outer for-loop
}          \ end procedure
```
Calling the procedure:
```
{:0$(.0@,0@(.0@,#:)9#)} \ procedure
1$                      \ store procedure at address 1
"ForWhile"              \ procedure argument
1@?                     \ call procedure
```
prints:
```
orWhileF    rWhileFo    WhileFor    hileForW    ileForWh    leForWhi    eForWhil    ForWhile
```
[Answer]
# [Charcoal](https://github.com/somebody1234/Charcoal), 10 bytes
```
⮌Ｅθ⭆θ§θ⁻μκ
```
[Try it online!](https://tio.run/##S85ILErOT8z5/z@gKDOvRCMotSy1qDhVwzexQKNQRyG4BCiaDuU4lnjmpaRWgJi@mXmlxRq5OgrZmmBg/f9/Vn5G3n/dshwA "Charcoal – Try It Online") Link is to verbose version of code. Explanation:
```
  θ         Input string
 Ｅ         Map over characters
    θ       Input string
   ⭆        Map over characters and join
      θ     Input string
     §      Circularly indexed by
       ⁻    Difference between
        μ   Inner index
         κ  Outer index
⮌           Reversed
            Implicitly print each string on its own line
```
To rotate in the opposite direction, replace `Minus` with `Plus`.
[Answer]
# [Red](http://www.red-lang.org), 49 43 bytes
```
func[s][forall s[print move head s tail s]]
```
[Try it online!](https://tio.run/##DcnBCcAgDEDRu1MEx@gYvYYcpEnQoqao7fqp8A8P/hD2Uxgp6OH69gsnodpItcLEZ5S@oNknkCUxTFip7EHkCvG23GPYyCK76D8 "Red – Try It Online")
]