text:
Clearly parenthesize APL trains
In APL, you can write tacit functions, called trains. How they work is irrelevant for this challenge. Here are the different ways they can be grouped, using ⍴ as the function:
⍴      -> ⍴
⍴⍴     -> ⍴⍴
⍴⍴⍴    -> ⍴⍴⍴
⍴⍴⍴⍴   -> ⍴(⍴⍴⍴)
⍴⍴⍴⍴⍴  -> ⍴⍴(⍴⍴⍴)
⍴⍴⍴⍴⍴⍴ -> ⍴(⍴⍴(⍴⍴⍴))
...

The order remains the same. The procedure is that as long as there are strictly more than 3 functions, the last 3 functions are grouped into one function. If we meet a nested train, we parenthesize that first, before continuing. Here is the procedure applied to ⍴⍴⍴⍴⍴⍴:
Step 0: ⍴⍴⍴⍴⍴⍴
There are strictly more than 3 functions, repeat.
Step 1: ⍴⍴⍴(⍴⍴⍴)
There are strictly more than 3 functions, repeat.
Step 2: ⍴(⍴⍴(⍴⍴⍴))
There are 3 or less functions, we're done.

Here is the same procedure applied to ⍴⍴⍴(⍴⍴)⍴(⍴⍴⍴⍴(⍴⍴⍴))⍴⍴:
Step 0: ⍴⍴⍴(⍴⍴)⍴(⍴⍴⍴⍴(⍴⍴⍴))⍴⍴
There are strictly more than 3 functions, repeat.
We have met a nested train, applying procedure to that first:
  Step 0: ⍴⍴⍴⍴(⍴⍴⍴)
  There are strictly more than 3 functions, repeat.
  We have met a nested train, applying procedure to that first:
    Step 0: ⍴⍴⍴
    There are 3 or less functions, we're done.
  Step 1: ⍴⍴(⍴⍴(⍴⍴⍴))
  There are 3 or less functions, we're done.
Step 1: ⍴⍴⍴(⍴⍴)⍴((⍴⍴(⍴⍴(⍴⍴⍴)))⍴⍴)
There are strictly more than 3 functions, repeat.
We have met a nested train, applying procedure to that first:
  Step 0: ⍴⍴
  There are 3 or less functions, we're done.
Step 2: ⍴⍴⍴((⍴⍴)⍴((⍴⍴(⍴⍴(⍴⍴⍴)))⍴⍴))
There are strictly more than 3 functions, repeat.
Step 3: ⍴(⍴⍴((⍴⍴)⍴((⍴⍴(⍴⍴(⍴⍴⍴)))⍴⍴)))
There are 3 functions or less, we're done.

Input
For this challenge, input will be simplified. This means that you can choose 2 different chars for opening and closing parentheses and 1 char for functions, different from the ones chosen for parentheses. The chars you choose must be consistent. The input will not be empty, and will not contain parentheses with no content (i.e. ()).
Output
Again, you may choose 3 different chars, 2 for parentheses and 1 for functions. Note that they need not be the same as the ones chosen for input, but they must be consistent.
Rules

If there are parentheses which only enclose one function within them in the input, you must remove them in the output. Your output may not contain unneeded parentheses (i.e. enclosing only one function, or enclosing the whole output).
You don't need to implement the algorithm used here, as long as your solution is valid for this challenge.
Input and output are strings in the format explained in the Input and Output sections. The input will have at least one character.
Using the standard loopholes is strictly forbidden.
This is code-golf, so shortest answer wins. However, there won't be an accepted answer, since this is a per-language competition, and to encourage answering in languages in which this task would result in longer code compared to code written in other languages.

Test cases
The chars used here are ()⍴, you should replace them with your chosen chars.
⍴                          -> ⍴
⍴                          -> ⍴
⍴⍴                         -> ⍴⍴
⍴⍴⍴                        -> ⍴⍴⍴
⍴⍴⍴⍴                       -> ⍴(⍴⍴⍴)
⍴⍴⍴⍴⍴⍴⍴⍴⍴⍴⍴⍴⍴⍴⍴            -> ⍴⍴(⍴⍴(⍴⍴(⍴⍴(⍴⍴(⍴⍴(⍴⍴⍴))))))
⍴⍴⍴⍴⍴(⍴⍴⍴)⍴⍴(⍴(⍴⍴⍴)⍴⍴⍴)⍴⍴⍴ -> ⍴(⍴⍴(⍴⍴((⍴⍴⍴)⍴(⍴(⍴(⍴⍴⍴)(⍴⍴⍴))(⍴⍴⍴)))))
(⍴⍴⍴)(⍴⍴⍴)(⍴⍴⍴)            -> (⍴⍴⍴)(⍴⍴⍴)(⍴⍴⍴)
(⍴⍴⍴)(⍴⍴⍴)⍴⍴⍴              -> (⍴⍴⍴)(⍴⍴⍴)(⍴⍴⍴)
⍴⍴(⍴)⍴⍴                    -> ⍴⍴(⍴⍴⍴)
((⍴⍴))                     -> ⍴⍴
⍴⍴((⍴⍴))⍴⍴                 -> ⍴⍴((⍴⍴)⍴⍴)

This challenge has been posted in the Sandbox. If you have the required privilege, you can view the sandbox post here.

I think Fully is a better title than Clearly.

Reference answer to any test case.

@Adám I did expect that reference answer, it won't get many upvotes though ;)

@Adám The Clearly part in the title refers to the fact that you must remove unneeded parentheses. Fully is something you're supposed to do when you answer a challenge ;p

Is it true that this function will always be idempotent?

Can we assume there will never be ()?

@EsolangingFruit Yes, you can assume there will be no (), however what do you mean by "idempotent"?

@EriktheOutgolfer Idempotent means applying the function repeatedly won't change the result. I think the answer is "yes".

@EsolangingFruit Well, with proper adjusting of the I/O chars, the function should be idempotent.

I have to express my distaste for the additional requirement that degenerate inputs need to be trimmed.  I don't think it really adds anything to the challenge.

@WheatWizard Well, it was suggested to me in the sandbox.

Do the three chosen characters have to be printable?

@Οurous No, they don't. But you still need to actually output them.

APL (Dyalog Classic), 71 68 65 63 bytes
0{⍵≡⍕⍵:⍵⋄⍬≡⍵:'⍬'⋄1=≢⍵:⍺∇⊃⍵⋄3≥≢⍵:⍺⌽')(',⍣⍺∊1∇¨⍵⋄⍺∇¯3(↓,∘⊂1∇↑)⍵}⍎

Try it online!
The characters I chose for I/O are '(', ')', and '⍬'.
This solution is itself an APL train.
⍎ parses the input as if it's a nested array - a tree with empty numeric vectors (⍬) as leaves.
The dfn (i.e. lambda - { }) traverses the tree recursively and converts it to a properly parenthesised string. The left argument ⍺ controls whether parentheses should be added to the current level if necessary.
The dfn handles the following cases based on the right argument:

if it's already a string (⍵≡⍕⍵), return it
if it's ⍬, return the char '⍬'
if it's a singleton, just dig deeper (∇ is the symbol for a recursive call)
if its length is ≤3, recurse for each of the items and surround with () if necessary
otherwise, recurse for the 3-tail, prepend all but the 3-tail, and recurse again

Looks like 63 characters, most of them Unicode.  What character encoding produces 63 bytes for this?  I make it 141 bytes in UTF8.

@Corey APL has its own 8-bit code page.

@Corey Relevant meta post.

@Adám Thanks for that.  I looked but didn't know what to search for to get that answer up.

CJam, 56 bytes
Beats APL!
lW%~]]]{{_,{K_,({~}|}&}%{_,3>}{3/(aa\+:~}w}:K~~`1>W<W%S/

Try it online!
This works (I think) and I have no idea why...
Input characters are ][T for ()⍴, and output characters are ][0 for ()⍴ (yes, this means they are reversed from what you would expect; for example, you might pass in TTT]TT[T]TTTT]TTT[[TT).
High-Level Overview
The program works with the input backwards, because it's more convenient. To parse the input, we leverage CJam's parser — reversing and executing the input provides the (backwards) parsed form of the input.
We then define a procedure K. K does most of the work for our submission, and it works as follows:

The input array will be a mix of zeroes and nonempty sub-arrays. Identify the sub-arrays and recursively apply K to them. The result should be another array, and if this array consists of just a single element, unpack it (this gets rid of redundant parentheses).
As long as the result has more than three elements, group its first three (not its last three; recall that the input is being processed backwards) into a single list.
Return the result.

By applying K to the input, we get the properly parenthesized form of the input (the only thing to note is that we actually wrap the input in a singleton list and unwrap it afterwards; the reason for this is that we want the snippet that unpacks singletons to apply to the top-level program, and not just its sub-arrays). Afterwards, we just apply some minimal formatting to get our result.
Some explanation for golfed bits
The golf I'm most proud of is using , to perform the check between integers and arrays.

If the top-of-stack is an integer n, , generates the range [0..n). Since the only integer we will encounter is 0, this always gives us the empty list [], which is falsey.
If the top-of-stack is an array, , takes its length. Since all arrays we encounter will be non-empty, this always gives us a positive integer, which is truthy.

Another golf that might be of interest is the method I use to group the first three elements of the array; it's somewhat similar to my "Turing complete language interpreter code golf" submission. CJam doesn't have a short way to break an array into two pieces (you can try to slice off the first part and then the other part while keeping the original array and index on the stack, but that doesn't work very well), so what I do instead is use 3/, which groups an array into blocks of 3. I can then pop off the first element (, wrap in array twice aa, and then append back on to the start of the list \+. The reason we wrap in array twice is that we have to take off a layer with :~, since we just grouped the rest of the array into sections as well.

Nitpick: this beats APL without builtins.

@EriktheOutgolfer Fair enough.

JavaScript (ES6), 149 146 bytes

i='a';f=s=>s==(s=s[R='replace'](/\((\w+)\)/,(q,t)=>(f[q=i+=0]=f(t),q)))&&s==(s=s[R](/(?!^)((a0+|p){3})$/,"($1)"))?s[R](/a0+/g,t=>`(${f[t]})`):f(s)
<textarea cols=80 id=I>ppp(pp)p(pppp(ppp))pp</textarea>

<button onclick=O.innerText=f(I.value)>Run</button>

Uses ()p, although you to use a different letter you can just change the p toward the end.


text:
Help me with my chemistry homework!
Near the middle of the semester in chemistry, we get problems like:

Convert 1.283850057 to Scientific Notation

and

Convert 3.583✕106 to Standard Notation

This is just stupid busy work for people who already know how to do this. So…
The Challenge
Given an input in any reasonable, convenient format, in either standard notation or scientific notation, output the same number in the other notation. However, note that e will not be accepted in place of *10^, as this gives a significant advantage to languages with builtins with e.
If not otherwise specified, standard notation will take this format:
x             (an integer)
xxxxxxxxxx    (a large integer with no more than 10 digits)
x.xxxx        (a float)
x.xxxxxxxxxx  (a float with no more than 10 x's after the decimal point)

While scientific notation will take this format:
x*10^x
x.zzzz*10^z (x will be >= 1)
x*10^-x
x.zz*10^-xx (x will be >= 1)

I/O
Input will never contain more than 10 leading+10 trailing digits, and you may decide how to deal with trailing zeroes after the decimal point. The exponent will never be so large as to max out your language's allowance for large numbers. You should only need to handle up to about 1010.
input => output

---scientific to standard---

4.5*10^7 => 45000000
1*10^0 => 1
8.9*10^-2 => 0.089
1.0001*10^5 => 100010
9.999999*10^9 => 9999999000
4.00038*10^2 => 400.038

---standard to scientific---

7354 = 7.354*10^3
385.43 => 3.8543*10^2
0.32 = 3.2*10^-1
0.00044 => 4.4*10^-4
0.053 => 5.3*10^-2

As always, standard loopholes are disallowed. This is code-golf, so shortest bytes wins!

@Uriel that is true and yes, this isn't an extremely hard challenge (litotes), but it also involves doing the opposite conversion, which adds a degree of complexity

I realize I answered already, but do we have to use *10^ for e when outputting scientific notation?

@Giuseppe Yessir

R, 70 bytes
function(s)sub("e","*10^",format(eval(parse(t=s)),sc=!grepl("\\^",s)))

Try it online!
An anonymous function. Takes input as a string and outputs as a string.
This function evaluates the string eval(parse(t=s)), then formats it, with the flag scientific set to whether the string contains a ^ or not. Then it replaces e with *10^ to match the right output spec.

Python 3, 100 bytes
lambda a:eval(a.replace("*10^","e+"))if type(a)==str else re.sub("0*e\+?0*","*10^","%e"%a)
import re

Try it online!

JavaScript (ES6), 83 80 bytes
a=>(r=a.split(N='*10^'))[1]?+r.join`e`+'':(+a).toExponential().replace(/e\+?/,N)

An anonymous function. Takes input as a string and outputs as a string.

Hacked on '1.3*10^-8'

Python 2, 87 bytes
lambda s:eval(s.replace('^','**'))if'^'in`s`else re.sub('e\+?','*10^','%e'%s)
import re

Try it online!

Excel VBA, 80 Bytes
Anonymous VBE immediate window function that takes input from cell [A1] and outputs to the VBE immediate window.
v=Evaluate("="&[A1]):e=Int(Log(v)/2.3):?IIf(Instr([A1],"^"),v,v*10^-e &"*10^"&e)

''  Or

v=Evaluate("="&[A1]):e=Int(Log(v)/2.3):?IIf(Instr([A1],"^"),v,v/(10^e)&"*10^"&e)

''  Or

[B1]="="&[A1]:v=[B1]:e=Int(Log(v)/2.3):?IIf(Instr([A1],"^"),v,v*10^-e &"*10^"&e)

''  Or

[B1]="="&[A1]:e=[Int(Log10(B1))]:?IIf(Instr([A1],"^"),[B1],[B1]/(10^e)&"*10^"&e)

source: Stack Exchange

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

sort: votes


text:
Electron Configuration

In atomic physics and quantum chemistry, the electron configuration is the distribution of electrons of an atom in atomic orbitals. For example, the electron configuration of the neon atom is 1s2 2s2 2p6 (From Wikipedia)

Challenge
Your challenge is to take a number representing the atomic number of an element and output the electron configuration of that element as defined by the Aufbau principle.
Iron (26) has the electron configuration 1s2 2s2 2p6 3s2 3p6 3d6 4s2. However, superscripts are unnecessary; the output for Iron (26) should be along the lines of 1s2 2s2 2p6 3s2 3p6 3d6 4s2.
Specification

You do not have to handle any inputs outside of the range 1 <= n <= 118.
Your output should look something like the test cases, but you may use any non-digit character/characters (aside from s, p, d, and f) to delimit the different orbitals.
You must return/print a string containing the orbital names/values/delimiters; you cannot simply return/print an array.
You do not need to handle any exceptions to the Aufbau principle; where there are exceptions, printing the "incorrect" configuration is fine.

Examples:
Input -> Valid output            -> Invalid output
16    -> 1s2 2s2 2p6 3s2 3p4     -> 1s22s22p63s23p4
16    -> 1s2, 2s2, 2p6, 3s2, 3p4 -> [[1, 2], [2, 2], [2, 6], [3, 2], [3, 4]]
17    -> 1s2+2s2+2p6+3s2+3p5     -> 1s2s2s2s2p6p3s2s3p5

Here is a list of all the electronic orbitals. The maximum values they can contain are below the name:
name: 1s 2s 2p 3s 3p 3d 4s 4p 4d 5s 5p 4f 5d 6s 6p 5f 6d 7s 7p
max:  2  2  6  2  6  10 2  6  10 2  6  14 10 2  6  14 10 2  6

Test Cases
Input -> Output
1     -> 1s1
2     -> 1s2
16    -> 1s2 2s2 2p6 3s2 3p4
50    -> 1s2 2s2 2p6 3s2 3p6 3d10 4s2 4p6 4d10 5s2 5p2
115   -> 1s2 2s2 2p6 3s2 3p6 3d10 4s2 4p6 4d10 5s2 5p6 4f14 5d10 6s2 6p6 5f14 6d10 7s2 7p3

Here is a complete list and a reference implementation of sorts (Try it online!)
This is code-golf, the shortest code wins!

Can we output arrays? For instance, 50 would give [[2], [2, 6], [2, 6, 10], [2, 6, 10], [2, 2]]

IIRC every challenge that runs on a finite set of inputs with a constant output is a candidate for the kolmogorov tag. Nice challenge.

is my output format ok ?

In the test cases, 3d seems to be filled before 4s, 4d before 5s, 6s after 4f and 5d, which violate the Madelung rule. Should we golf programs that print the incorrect electron configurations on the pastebin?

Also, there are exceptions to the Aufbau principle (like Chromium (atomic no. 24) having 4s1 3d5 instead of 4s2 3d4). I see that it was asked in the sandbox post but was never answered. Do we ignore that issue?

OMG I swear I was going to post this exact same question...today

@Uriel [tag:status-completed]

@MDXF could you create new test cases that follow the correct electron configuration, but preserve the current one? (so new answers must golf the new version, but without invalidating existing answers)

Actually, there doesn't seem to be a consensus on how to handle challenges with incorrect information. I posted this issue on meta. Personally, I strongly urge that you fix the problem (but not invalidate existing answers); otherwise, all of the solutions here are technically "incorrect."

The problem being the incorrect electron configurations. e.g. 20 -> 1s2 2s2 2p6 3s2 3p6 3d2 should be 20 -> 1s2 2s2 2p6 3s2 3p6 4s2

Jelly, 63 62 56 55 bytes
ḊFµi@€QḤ’Ḥ
“ŒµḊuÆẓƙỊ’D,“çƥ÷£ḟ’ṃ“spdf”¤µxÇZ
¢ḣŒg'µQ€żL€K

Try it online!
Thanks to user202729 for saving 6 bytes with base decompression!
Explanation
First I construct the list [[1,2,2,3,3,3,4,4,4,5,5,4,5,6,6,5,6,7,7],'sspspdspdspfdspfdsp'] with the code “ŒµḊuÆẓƙỊ’D,“çƥ÷£ḟ’ṃ“spdf”¤ in the second link.

“ŒµḊuÆẓƙỊ’ is the number 1223334445545665677 compressed into base 250. D gives turns this into a list of digits.
“çƥ÷£ḟ’ṃ“spdf” changes the base 250 number “çƥ÷£ḟ’ into base 4 and indexes it into the string “spdf” yielding 'sspspdspdspfdspfdsp'. This was contributed by user202729.

The list is then take to the fist link by Ç. The first link does the following:
ḊFµQiÐ€µḤ’Ḥ
ḊF           Dequeue then flatten yields 'sspspd...'. Ṫ doesn't work because it modifies the input.
  µ          New monadic link
   Q         Unique elements → 'spdf'
    iÐ€      The index of each of 'sspspd...' into the string 'spdf' → [1,1,2,1,2,3...]
       µ     New monadic link. This prevents Ḥ from acting on the right argument of iÐ€.
        Ḥ’Ḥ  Takes [1,1,2,1...] and computes 2(2l+1) → [2,2,6,2,6,10...]

Now back to the second link. With xÇ we repeat each of the elements in each sublist of [[1,2,2,3...7],['sspspd...p']] by the numbers in our new list [2,2,6...]. This yields [[1,1,2,2,2,2...],['sssspp...']]. Z zips the two sublist which yields [[1,'s'],[1,'s'],[2,'s']...].
Now to the main link. ¢ calls the second link which yields the final list of tuples described above. Assume the input to the program is 5 as an example.
¢ḣŒg'µQ€żL€K
¢             Calls the second link as a nilad which yields the final list of tuples described above
 ḣ            Takes the first 5 tuples → [[1,'s'],[1,'s'],[2,'s'],[2,'s'],[2,'p']]
  Œg'         Group together runs of equal elements → [[[1,'s'],[1,'s']],[[2,'s'],[2,'s']],[[2,'p']]]
     µ        New monadic link
      Q€      Unique elements of each of these runs
         L€   Length of each of these runs
        ż     Zip these together → [[[1,'s'],2],[[2,'s'],2],[[2,'p'],1]]
           K  Join this list with spaces → 1s2 2s2 2p1

Any way to compress the sspspdspd... string?

@MDXF I tried but it ended up being longer. I also tried to construct it various ways and individual parts were shorter but as a whole it was longer

@dylnan “çƥ÷£ḟ’ṃ“spdf”¤ for -6 byte. Used this for base 250 integer and ṃ for base decompression.

@user202729 nice, thank you!

Python 2, 129 128 bytes
-1 byte thanks to notjagan

n=input()
d='spdf'.find
s='sspspdspdspfdspfdsp'
i=0
while n>0:c=s[i];t=d(c)*4+2;print`s[:i].count(c)-~d(c)`+c,min(t,n);n-=t;i+=1

Try it online!

-1 byte.

Imperative Tampio, 930 bytes
Yöllä on ilot.Olkoon oma ilo uusi yö, jonka iloja ovat ilo"1s",ilo"2s",ilo"2p",ilo"3s",ilo"3p",ilo"3d",ilo"4s",ilo"4p",ilo"4d",ilo"5s",ilo"5p",ilo"4f",ilo"5d",ilo"6s",ilo"6p",ilo"5f",ilo"6d",ilo"7s"ja ilo"7p".Olkoon iso yö uusi yö, jonka iloja ovat 2,2,6,2,6,10,2,6,10,2,6,14,10,2,6,14,10,2 ja 6.Kun iso luku juo ison ilon,iso ilo näyttää oman yön,missä oma yö on oman ilon ensimmäinen ilo ja ujo ilo on ison yön ensimmäinen ilo,jos iso luku on suurempi kuin ujo ilo,niin iso ilo näyttää ujon ilon,iso ilo näyttää ilon" ",oman ilon iloiksi asetetaan oman ilon ilot toisesta alkaen,ison yön iloiksi asetetaan ison yön ilot toisesta alkaen ja iso luku vähennettynä ujolla ilolla juo ison ilon ja,jos iso luku on pienempi tai yhtä suuri kuin ujo ilo,niin iso ilo näyttää ison luvun.Olkoon oma muuttuja uusi muuttuja.Kun iso sivu avautuu,omaan muuttujaan luetaan luku ja oman muuttujan arvo juo ison sivun.

Yöllä on ilot.Olkoon oma ilo uusi yö, jonka iloja ovat ilo"1s",ilo"2s",ilo"2p",ilo"3s",ilo"3p",ilo"3d",ilo"4s",ilo"4p",ilo"4d",ilo"5s",ilo"5p",ilo"4f",ilo"5d",ilo"6s",ilo"6p",ilo"5f",ilo"6d",ilo"7s"ja ilo"7p".Olkoon iso yö uusi yö, jonka iloja ovat 2,2,6,2,6,10,2,6,10,2,6,14,10,2,6,14,10,2 ja 6.Kun iso luku juo ison ilon,iso ilo näyttää oman yön,missä oma yö on oman ilon ensimmäinen ilo ja ujo ilo on ison yön ensimmäinen ilo,jos iso luku on suurempi kuin ujo ilo,niin iso ilo näyttää ujon ilon,iso ilo näyttää ilon" ",oman ilon iloiksi asetetaan oman ilon ilot toisesta alkaen,ison yön iloiksi asetetaan ison yön ilot toisesta alkaen ja iso luku vähennettynä ujolla ilolla juo ison ilon ja,jos iso luku on pienempi tai yhtä suuri kuin ujo ilo,niin iso ilo näyttää ison luvun.Olkoon oma muuttuja uusi muuttuja.Kun iso sivu avautuu,omaan muuttujaan luetaan luku ja oman muuttujan arvo juo ison sivun.

Online version
It is a very straightforward implementation. In the golfed version I simply replaced the words with short words like ilo, yö, iso, oma, etc.
Ungolfed:

Listalla on alkiot.
Olkoon lyhyt orbitaalilista uusi lista, jonka alkioita ovat
orbitaali "1s",
      orbitaali "2s",
      orbitaali "2p",
      orbitaali "3s",
      orbitaali "3p",
      orbitaali "3d",
      orbitaali "4s",
      orbitaali "4p",
      orbitaali "4d",
      orbitaali "5s",
      orbitaali "5p",
      orbitaali "4f",
      orbitaali "5d",
      orbitaali "6s",
      orbitaali "6p",
      orbitaali "5f",
      orbitaali "6d",
      orbitaali "7s" ja
orbitaali "7p".
Olkoon lyhyt maksimilista uusi lista, jonka alkioita ovat
2,
      2,
      6,
      2,
      6,
      10,
      2,
      6,
      10,
      2,
      6,
      14,
      10,
      2,
      6,
      14,
      10,
      2 ja
6.
Kun jaetaan orbitaaleille pienehkö elektronimäärä nykyisellä sivulla,

nykyinen sivu näyttää nykyisen orbitaalin, missä
      nykyinen orbitaali on lyhyen orbitaalilistan ensimmäinen alkio ja
      nykyinen maksimi on lyhyen maksimilistan ensimmäinen alkio,
jos pienehkö elektronimäärä on suurempi kuin nykyinen maksimi,
  niin

nykyinen sivu näyttää nykyisen maksimin,
nykyinen sivu näyttää välin " ",
lyhyen orbitaalilistan alkioiksi asetetaan lyhyen orbitaalilistan alkiot toisesta alkaen,
lyhyen maksimilistan alkioiksi asetetaan lyhyen maksimilistan alkiot toisesta alkaen
ja jaetaan orbitaaleille pienehkö elektronimäärä vähennettynä nykyisellä maksimilla nykyisellä sivulla,

ja, jos pienehkö elektronimäärä on pienempi tai yhtä suuri kuin nykyinen maksimi,

niin
  nykyinen sivu näyttää pienehkön elektronimäärän.

Olkoon mukava muuttuja uusi muuttuja.
Kun nykyinen sivu avautuu,

mukavaan muuttujaan luetaan luku
ja jaetaan orbitaaleille mukavan muuttujan arvo nykyisellä sivulla.

Online version
Translation:

A list has items.
Let the short orbital list be a new list, its items are
  the orbital "1s",
  the orbital "2s",
  the orbital "2p",
  the orbital "3s",
  the orbital "3p",
  the orbital "3d",
  the orbital "4s",
  the orbital "4p",
  the orbital "4d",
  the orbital "5s",
  the orbital "5p",
  the orbital "4f",
  the orbital "5d",
  the orbital "6s",
  the orbital "6p",
  the orbital "5f",
  the orbital "6d",
  the orbital "7s" and
  the orbital "7p".
Let the short maximum list be a new list, its items are
  2,
  2,
  6,
  2,
  6,
  10,
  2,
  6,
  10,
  2,
  6,
  14,
  10,
  2,
  6,
  14,
  10,
  2 and
  6.
When a small number of electrons is divided to the orbitals at the current page,

the current page shows the current orbital, where the current orbital is the first item in the short orbital list and the current maximum is the first element in the short maximum list,
if the small number of electrons is greater than the current maximum,

the current page shows the current maximum,
the current page shows the space " ",
the elements of the short orbital list are set to be the elements of the short orbital list beginning from the second,
the elements of the short maximum list are set to be the elements of the short maximum list beginning from the second
and the small number of electrons subtracted by one is divided to the orbitals at the current page,

and, if the small number of electrons is less than or equal to the current maximum,

the current page shows the small number or electrons.

Let the nice variable be a new variable.
When the current page opens,

a number is read to the nice variable
and the value of the nice variable is divided to the orbitals at the current page.

The translation is approximate, I had to change the word order to make the English more natural.

wtf that's good...

Surely there is a more tacit language that has all the features of this one.

Could you be so kind as to add a translation into English so we can understand this language?

@Zacharý I added it.

Charcoal, 72 bytes
Ｎθ≔”{⊞″I⌀⁼C$Pπ3”α≔⁰ιＷ›θ⁰«§”o⧴∨c▷⎇_'l|”ι§αι≔⁺×⁴⌕spdf§αι²εＩ⌊⟦εθ⟧→≔⊕ιι≔⁻θεθ

Try it online!
Here you have the verbose version.

JavaScript (ES6), 102 bytes
n=>'0010120120132013201'.replace(/./g,k=>n?++p[m=k*4+2,n-=e=m>n?n:m,k]+'spdf'[k]+e+' ':'',p=[0,1,2,3])

Test cases

let f =

n=>'0010120120132013201'.replace(/./g,k=>n?++p[m=k*4+2,n-=e=m>n?n:m,k]+'spdf'[k]+e+' ':'',p=[0,1,2,3])

console.log(f(  1)) // -> 1s1
console.log(f(  2)) // -> 1s2
console.log(f( 16)) // -> 1s2 2s2 2p6 3s2 3p4
console.log(f( 50)) // -> 1s2 2s2 2p6 3s2 3p6 3d10 4s2 4p6 4d10 5s2 5p2
console.log(f(115)) // -> 1s2 2s2 2p6 3s2 3p6 3d10 4s2 4p6 4d10 5s2 5p6 4f14 5d10 6s2 6p6 5f14 6d10 7s2 7p3

Formatted and commented
n =>                          // given the atomic number n
  '0010120120132013201'       // list of azimuthal quantum numbers
  .replace(/./g, k =>         // replace each character k in the above string with:
    n ?                       //   if n does not equal 0:
      ++p[                    //     ++p[k] = updated principal quantum number
        m = k * 4 + 2,        //       m = maximum number of electrons
        n -=                  //       subtract from n:
          e = m > n ? n : m,  //         e = min(m, n) = number of electrons
        k                     //       index actually used to access the p[] array
      ] +                     //     followed by:
      'spdf'[k] +             //     the label
      e + ' '                 //     and the number of electrons
    :                         //   else:
      '',                     //     an empty string
    p = [0, 1, 2, 3]          //   initial list of principal quantum numbers
  )                           // end of replace()

Swift, 177 175 156 bytes
Loosly based on @Arnauld's Javascript answer
func f(n:Int){var i=n,a=0,b=[0,1,2,3];[0,0,1,0,1,2,0,1,2,0,1,3,2,0,1,3,2,0,1].map{a=$0*4+2;b[$0]+=1;i>0 ?print(b[$0],"spdf".map{$0}[$0],min(a,i)):();i-=a}}

Try it online!
Without the spaces in the electron groups, 190 187 169 bytes:
func f(n:Int){var i=n,a=0,b=[0,1,2,3];[0,0,1,0,1,2,0,1,2,0,1,3,2,0,1,3,2,0,1].map{a=$0*4+2;b[$0]+=1;i>0 ?print(b[$0],"spdf".map{$0}[$0],min(a,i),separator:""):();i-=a}}

Try it online!

Wolfram Language (Mathematica), 43 42 bytes
#~ElementData~"FullElectronConfiguration"&

-1 byte thanks to ovs.
This does not work with Try it online!, so I've provided a screenshot instead.  Note that this correctly shows the exceptions, such as 4s1 3d5 for chromium (Z=24), which occurs because half-filled and fully-filled orbitals are energetically favorable (thus slightly advantaging 4s1 3d5 over 4s2 3d4); and 5s1 4d7 for ruthenium (Z=44):

In order to get the full electron configuration, it is necessary to use the "FullElectronConfiguration" option; the "ElectronConfigurationString" option will instead provide the electron configuration using "core notation" shorthand. E.g., for Z = 16, core notation is:

where [Ne] means "the electron configuration for Ne", i.e., 1s2 2s2 2p6

42 bytes using the infix notation

C (gcc), 260 187 167 156 152 147 143 138 bytes
i,*m;f(e){for(m=L"...",i=0;e>0;printf("%.2s%d ","1s2s2p3s3p3d4s4p4d5s5p4f5d6s6p5f6d7s7p"+i++*2,(e-=*m)<0?*m+e:*m++));}

Try it online! Golfed from the reference implementation.
StackExchange removes unprintables, so the value of m is replaced with "...".
Here is a reversible hexdump of the program, since it uses unprintables in a string, which replaces the integer array {2,2,6,2,6,10,2,6,10,2,6,14,10,2,6,14,10,2,6} with the literal byte values of the integers.
00000000: 692c 2a6d 3b66 2865 297b 666f 7228 6d3d  i,*m;f(e){for(m=
00000010: 4c22 0202 0602 065c 6e02 065c 6e02 060e  L".....\n..\n...
00000020: 5c6e 0206 0e5c 6e02 0622 2c69 3d30 3b65  \n...\n..",i=0;e
00000030: 3e30 3b70 7269 6e74 6628 2225 2e32 7325  >0;printf("%.2s%
00000040: 6420 222c 2231 7332 7332 7033 7333 7033  d ","1s2s2p3s3p3
00000050: 6434 7334 7034 6435 7335 7034 6635 6436  d4s4p4d5s5p4f5d6
00000060: 7336 7035 6636 6437 7337 7022 2b69 2b2b  s6p5f6d7s7p"+i++
00000070: 2a32 2c28 652d 3d2a 6d29 3c30 3f2a 6d2b  *2,(e-=*m)<0?*m+
00000080: 653a 2a6d 2b2b 2929 3b7d                 e:*m++));}

Alternatively, you could just copy the code from the TIO link.

Clarion, 388 bytes
PROGRAM
  Map
  End
o CString('sspspdspdspfdspfdsp')
n CString('1223334445545665677')
m CString('2 2 6 2 6 102 6 102 6 14102 6 14102 6 ')
r CString(129)
Code
  e#=Command('ATOM'); Loop i#=1 To 19
  If e#>m[(i#*2)-1:(i#*2)] Then r=r&n[i#]&o[i#]&Clip(m[(i#*2)-1:(i#*2)])&' '
  e#-=m[(i#*2)-1:(i#*2)]; Cycle.;If e# < m[(i#*2)-1:(i#*2)] Then r=r&n[i#]&o[i#]&e#;Break.;End;Message(r)

Loosely based on @Rod's Python answer

Welcome to the Code Golf StackExchange! I hope you enjoy your stay! :)

Scala, 173 bytes
A port of @Endenite's Swift answer in Scala.
173 bytes. It can be golfed much more.

Golfed version. Try it online!
n=>{var(i,a,b)=(n,0,Array(0,1,2,3));Seq(0,0,1,0,1,2,0,1,2,0,1,3,2,0,1,3,2,0,1).map{x=>a=x*4+2;b(x)+=1;if(i>0){println(b(x).toString+"spdf"(x)+math.min(a,i).toString)};i-=a}}

Ungolfed version. Try it online!
object Main {
  def f(n: Int): Unit = {
    var i = n
    var a = 0
    var b = Array(0, 1, 2, 3)
    List(0, 0, 1, 0, 1, 2, 0, 1, 2, 0, 1, 3, 2, 0, 1, 3, 2, 0, 1).map { x =>
      a = x * 4 + 2
      b(x) += 1
      if (i > 0) {
        println(b(x).toString + "spdf"(x) + math.min(a, i).toString)
      }
      i -= a
    }
  }

  def main(args: Array[String]): Unit = {
    f(16)
  }
}

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

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


text:
Cases variations of a string
For any String that is composed of lower cased alphabetical characters, make a function that returns a list of all of it's variations, empty strings returns empty list
Test Cases
"" -> []
"a" -> ["a", "A"]
"ab" -> ["ab", "Ab", "aB", "AB"]
"abc" -> ["abc", "Abc", "aBc", "ABc", "abC", "AbC", "aBC", "ABC"]

This is Code-golf. Shortest code in bytes wins

Should the output follow a specific order?

In my opinion, it is much more natural if the empty string "" returns the list [""], because for all other cases, list length = 2 ^ string length.

To avoid unclear details in the question (example unclear details: ColeraSu comment above), you can consider leaving your question in the Sandbox for about 24 hours before posting. For now I will temporarily vote to close the question. You may also want to register your profile.

Veeeery closely related. (Essentially the same thing, but the input can contain upper-case letters and non-letters.)

@MartinEnder So should this be closed as a duplicate? Because all answers there can be ported here, and of course very competitive.

Huh, I was able to recall my answer to that question even down to the variable names... but at least I was able to backport a golf (even better it saves 2 bytes there).

JavaScript (Firefox 30-57), 75 bytes
f=([c,...s])=>c?[for(t of s[0]?f(s):[''])for(d of c+c.toUpperCase())d+t]:[]

67 bytes if the empty string returns [""]:
f=([c,...s])=>c?[for(t of f(s))for(d of c+c.toUpperCase())d+t]:['']


text:
Duck, Duck, Josephus
Given an Integer array:

Start from the first number
Jump forward n positions where n is the value of the current position
Delete the current position, making what was the next position the current position.
Goto step 2 until there is one number remaining
Print that number

Rules
The array wraps-around (the next number after the last number in the array is the first number).
A zero removes itself (Obviously).
Negative numbers are not allowed as input.
Test Cases
[1] => 1
[1,2] => 1
[1,2,3] => 3
[1,2,2] => 1
[1,2,3,4] => 1
[6,2,3,4] => 4
[1,2,3,4,5] => 5
[0,1] => 1
[0,0,2,0,0] => 0

Step-by-step example
[1,4,2,3,5]
 ^          start from the first position
   ^        jump 1 position (value of the position)
[1,  2,3,5] remove number in that position
     ^      take next position of the removed number (the 'new' 'current' position)
         ^  jump 2 positions
[1,  2,3  ] remove number in that position
 ^          take next position (looping on the end of the array)
     ^      jump 1 position
[1,    3  ] remove number in that position
       ^    take next position (looping)
 ^          jump 3 positions (looping on the end of the array)
[      3  ] remove number in that position
print 3

Example #2
[4,3,2,1,6,3]
 ^            start from the first position
         ^    jump 4 positions
[4,3,2,1,  3] remove number in that position
           ^  take next position
     ^        jump 3 positions
[4,3,  1,  3] remove number in that position
       ^      take next position
           ^  jump 1 positions
[4,3,  1    ] remove number in that position
 ^            take next position
   ^          jump 4 positions
[4,    1    ] remove number in that position
       ^      take next position
 ^            jump 1 position
[      1    ] remove number in that position
print 1

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

Nice first challenge!

@LuisMendo Yes.. the "skip like a..." challenges

@Jenny_mathy I didn't think there would be a similar one, but as Luis said, the wraparound array makes an interesting challenge for golfing. I think :/

Related, but I don't think it's a duplicate

closely related (dupe?)

@EriktheOutgolfer Not really a dupe. The elements there are indistinguishable and the step size is fixed. Luis's is much closer, but still sufficiently different I think.

Does it need to actually print the final number, or can it just return it?  Does it need to actually return the number, or can it just operate on the array in-place so the after the function is run, the array contains just the number?

@iamnotmaynard, see this consensus.

Husk, 7 bytes
This returns the result as a singleton list
ΩεSotṙ←

Try it online!
Explanation
Ω               Until
 ε              the result is a singleton list
     ṙ          Rotate left by
  S   ←         the first element
   ot           Then remove the first element

Haskell, 54 50 48 bytes
f[x]=x
f(x:r)=f$snd<$>zip r(drop(x+1)$cycle$x:r)

Try it online!
Explanation:

f[x]=x: If the given list is a singleton list, return its element.
f(x:r)=f$ ...: Otherwise recursively apply f to the following list:

The elements of the current list cycled infinitely (cycle$x:r),
with the first x+1 elements removed (drop(x+1)$),
and truncated to length of r. (snd<$>zip r is a shorter alternative to take(length r)).

Previous 54 byte version:
f=(%)=<<head
_%[x]=x
n%(x:r)|n<1=f r|s<-r++[x]=(n-1)%s

Try it online!

Ruby, 37 bytes
->r{r.rotate!(r[0]).shift while r[1]}

Modifies the array in-place, which appears to be acceptable as output. Try it online!

Python 3, 54 51 bytes
f=lambda x:x and f((x+x*x[0])[x[0]:][1:len(x)])or x

Output is a singleton list.
Try it online!

Completely unrelated, but I like your unicorn hat, Dennis. xD (And nice answer of course, as always!)

MATL, 21 bytes
1`yy)+ynX\[]w(5Mynq]x

Try it online! Or verify all test cases.
Explanation
1        % Push 1: current position in the array
`        % Do...while
  yy     %   Duplicate top two elements in the stack. Takes input implicitly
         %   in the first iteration.
         %   STACK: array, position, array, position
  )      %   Get specified entry in the array
         %   STACK: array, position, selected entry
  +      %   Add
         %   STACK: array, position (updated)
  y      %   Duplicate from below
         %   STACK: array, position, array
  n      %   Number of elements of array
         %   STACK: array, position, number of elements or array
  X\     %   1-based modulus
         %   STACK: array, position (wrapped around)
  []     %   Push empty array
         %   STACK: array, position, []
  w      %   Swap
         %   STACK: array, [], position
  (      %   Write value into specified entry in array. Writing [] removes
         %   the entry
         %   STACK: array (with one entry removed)
  5M     %   Push latest used position. Because of the removal, this now
         %   points to the entry that was after the removed one
         %   STACK: array, position
  y      %   Duplicate from below
         %   STACK: array, position, array
  n      %   Number of elements of array
         %   STACK: array, position, number of elements of array
  q      %   Subtract 1
         %   STACK: array, position, number of elements of array minus 1
]        % End. If top of the stack is nonzero, proceed with next iteration
         % STACK: array (containing 1 entry), position
x        % Delete. Implicitly display
         % STACK: array (containing 1 entry)

Note: using list rotations instead of keeping a pointer will probably make this much shorter.

@Erik Thanks. But now that I added the explanation I think I’ll leave it like this

Well, you can always remove the explanation, it will be kept in the history :)

CJam, 15 bytes
l~_,({_0=m<1>}*

Try it online!
Explanation
Instead of keeping track of a pointer, I just shift the array cyclically so that the current element is always at the front.
l~     e# Read and evaluate input.
_,(    e# Get its length L and decrement to L-1.
{      e# Run this block L-1 times...
  _0=  e#   Get the first element X.
  m<   e#   Rotate the array left by X positions.
  1>   e#   Discard the first element.
}*
       e# The final element remains on the stack and gets printed implicitly.

A fun alternative which unfortunately doesn't save any bytes:
l~_{;m<1>_0=}*;

Jelly, 9 bytes
ṙḷ/ḊµL’$¡

Try it online!
-2 bytes thanks to user202729
Explanation
ṙḷ/ḊµL’$¡  Main Link
     L’$¡  Repeat <length - 1> times
ṙ          Rotate left by
 ḷ/        The first element (from JHT; thanks to user202729)
   Ḋ       Take all but the first element

Python 2, 55 bytes
def f(a):
 while a[1:]:l=a[0]%len(a);a[:]=a[-~l:]+a[:l]

Try it online!
Outputs as a singleton list, as allowed by default.
 Saved a few bytes thanks to Dennis, by reminding me that modifying the function argument is allowed.
How it works

def f(a) - Defines a function with a parameter a.
while a[1:]: - While a with the first element removed is truthy, run the block of code to follow. A list with one element or more is truthy, and empty lists are falsy in Python, hence this will stop once a reaches a length of 1.
l=a[0]%len(a) - Take the first element, and get the remainder of its division by the length of a. Assign the result to l.
a[:]=a[-~l:]+a[:l] - Rotate a to the left by l elements, and remove the first one, while assigning this to a in place.

Python 2, 63 bytes
f=lambda a,i=0:a[1:]and f(a,a.pop(((a*-~i)[i]+i)%len(a))+1)or a

Try it online!
Although longer, this seems much more elegant. Also thanks to ovs for helping in chat.

Couldn't you do something like a,*b=input() (python3) and save few bytes? However I'm not sure how that would affect l and the slice

@Rod I don't think so, I would need to evaluate the input too in Python 3

Jelly, 7 bytes
ṙḷ/ḊµḊ¿

Try it online!
Full program.

That ḷ/ is damn clever.

Could you add an explanation, please? I've now looked at the Quicks and Atoms on the linked GIT-pages, and +1-ed based on that, but I can imagine not everyone having the patients to do the same. ;)

Brain-Flak, 88 bytes
([[]]()){({}<(({})){({}<({}<([]){({}{}<>)<>([])}{}>)<>{({}[<>[]])<>}<>>[()])}{}{}>())}{}

Try it online!
Explanation
([[]]())                      Push negative N: the stack height - 1
{({}< … >())}{}               Do N times
     (({}))                     Duplicate M: the top of the stack
     {({}< … >[()])}{}          Do M times
                                  Rotate the stack by 1:
          ({}< … >)               Pop the top of the stack and put it back down after
          ([]){({}{}<>)<>([])}{}  Pushing the rest of the stack on to the other one, in reverse, with the stack height added to each element (to ensure that all are positive)
          <>{({}[<>[]])<>}<>      Push the rest of the stack back, unreversing, and subtracting the stack height from each element
                      {}        Pop the top of stack

A very strange golf but here it is in 88 bytes.

@WheatWizard Nice, surprisingly I tried something like that earlier on.

I can never know how people can code like that! is there a pseudo-code translator or something?

@workoverflow no, it's honestly easier than it looks. It was very daunting before I actually started , but the when the commands are this simple, it's easy to learn.

Julia 0.6, 46 42 bytes
!x=length(x)>1?!circshift(x,-x[])[2:end]:x

Try it online!
Straightforward recursive Julia version. x[] accesses the first element of x.

Python 3, 60 bytes
def f(a):b=a[0]%len(a);return f(a[-~b:]+a[:b])if a[1:]else a

Try it online!
-3 bytes thanks to ovs

JavaScript (ES6), 54 60 bytes
Saved 1 byte thanks to @Shaggy
Fixed version (+6 bytes)
Modifies the input array, which is reduced to a singleton.
f=(a,p=0)=>1/a||f(a,p=(p+a[p%(l=a.length)])%l,a.splice(p,1))

Test cases

f=(a,p=0)=>1/a||f(a,p=(p+a[p%(l=a.length)])%l,a.splice(p,1))

;[
  [1],         // [1]
  [1,2],       // [1]
  [1,2,3],     // [3]
  [1,2,2],     // [1]
  [1,2,3,4],   // [1]
  [6,2,3,4],   // [4]
  [1,2,3,4,5], // [5]
  [0,1],       // [1]
  [0,0,2,0,0], // [0]
  [3,5,7,9]    // [5]
].forEach(a => f(a) && console.log(JSON.stringify(a)))

How?
We recursively apply the algorithm described in the challenge. Only the stop condition 1/a may seem a bit weird. When applying an arithmetic operator:

Arrays of more than one element are coerced to NaN and 1/NaN is also NaN (falsy).
Arrays of exactly one integer are coerced to that integer, leading to either 1/0 = +Infinity or 1/N = positive float for N > 0 (both truthy).

f = (a, p = 0) =>                 // a = input array, p = pointer into this array
  1 / a ||                        // if a is not yet a singleton:
    f(                            //   do a recursive call with:
      a,                          //     a
      p = (                       //     the updated pointer
        p + a[p % (l = a.length)] //
      ) % l,                      //
      a.splice(p, 1)              //     the element at the new position removed
    )                             //   end of recursive call

Seeing as splice modifies the original array, you could do f=(a,p=0)=>1/a||f(a,p=p+a[p]%a.length,a.splice(p,1)) for 52 bytes

it seems it doesn't give the right result for the second step by step example, f=(a,p=0)=>1/a?a:f(a,p=(p%a.length+a[p%a.length])%a.length,a.splice(p,1)) is ok but may be optimized

@NahuelFouilleul Oops. I thought at some point that the parentheses around p+a[p] could be removed. Which -- of course -- is not the case. Thanks for reporting this!

See this consensus, which @Neil brought to my attention here.

@Shaggy Oh, I see. Thank you! (I missed your TIO link the 1st time...)

@Arnaud, in fact i think %a.length is needed twice: before splice, to get a valid index, and after to take next position in the case the removed element is the last, maybe tests don't cover all cases

@NahuelFouilleul I agree, this code is currently incorrect for [3, 5, 7, 9].

APL (Dyalog), 20 18 bytes
{1<≢⍵:∇1↓⊖∘⍵⊃⍵⋄⊃⍵}

Try it online!

Java 8, 79 bytes
This lambda accepts a Stack<Integer> and returns an int or Integer.
l->{for(int i=0,s=l.size();s>1;)l.remove(i=(i+l.get(i%s))%s--);return l.pop();}

Try It Online
Ungolfed
l -> {
    for (
        int i = 0, s = l.size()
        ; s > 1
        ;
    )
        l.remove(
            i = (i + l.get(i % s)) % s--
        );
    return l.pop();
}

Acknowledgments

-2 bytes thanks to Nahuel Fouilleul

i%=s may be removed if l.get(i) changed by l.get(i%s)

J, 21 17 bytes
-4 bytes thanks to FrownyFrog
((1<#)}.{.|.])^:_

Try it online!
Original:
([:}.{.|.])^:(1<#)^:_
How it works:
^:_ repeat until the result stops changing
^:(1<#) if the length of the list is greater than 1
{.|.] rotate the list to the left its first item times
[:}. drop the first element and cap the fork
Try it online!

Mathematica, 36 bytes
uses Martin's algorithm
#//.l:{x_,__}:>Rest@RotateLeft[l,x]&

-5 bytes from Misha Lavrov && Martin Ender
Try it online!

You can save two bytes by using the pattern to pick out the first element #//.{x_,y__}:>Rest@RotateLeft[{x,y},x]&. (This stops when there is only one element because {a} no longer matches the pattern {x_,y__}.)

@MishaLavrov can't test right now, but you can probably shorten that further by dropping the y, calling the entire list l and then using l instead of {x,y}.

@MartinEnder You mean like this - #//.l:{x_,__}:>Rest@RotateLeft[l,x]&?

@MishaLavrov yep.

Pyth, 9 bytes
.WtHt.<Zh

Try it here!
This outputs the result as a singleton list, as allowed by default.
How it works
.WtHt.<Zh ~ Full program.

.W        ~ Functional while. It takes three arguments, two functions: A and B
            and a starting value, which in this case is automatically assigned
            to the input. While A(value) is truthy, value is set to B(value).
            Returns the ending value. A's argument is H and B's is Z.
  tH      ~ A (argument H): Remove the first element of H. A singleton list
            turns into [], which is falsy and thus breaks the loop. Otherwise,
            it is truthy and the loops goes on until the list reaches length 1.
     .<Zh ~ B (argument Z): Cyclically rotate Z by Z[0] places, whereas Z[0]
            represents the first element of Z.
    t     ~ And remove the first element.

Note: If you don't want to see those brackets, just add h or e in front of the whole code.

Brain-Flak, 104 bytes
H.PWiz has a shorter answer here that I helped to make, you should check it out.
([[]]()){({}()<(({})){({}[()]<({}<(([])<{{}({}<>)<>([])}{}<>>)<>>)<>{({}[()]<({}<>)<>>)}{}<>>)}{}{}>)}{}

Try it online!
Explanation
([[]]())   #Push 1 minus stackheight
{({}()<    #N times
 (({}))    #Get a copy of the top
 {({}[()]< #N times
  ({}<(([])<{{}({}<>)<>([])}{}<>>)<>>)<>{({}[()]<({}<>)<>>)}{}<>
           #Roll the top to the bottom (From the wiki)
 >)}{}     #End loop
 {}        #Remove one value
>)}{}      #End loop

I thought I would compete. Then I realised that mine was almost exactly the same as yours, apart from a different "top roll"

I saw that ;).  Using the fact that everything is non-negative is rather clever.

Swift, 87 bytes
func f(a:inout[Int]){var i=0,c=0;while(c=a.count,c>1).1{i=(i+a[i%c])%c;a.remove(at:i)}}

Returns as a singleton list by modifying the input. Try it online!
Explanation
func f(a:inout[Int]){
  var i=0,c=0;            // Set the index i to 0
  while(c=a.count,c>1).1{ // While the length of the list > 0:
    i=(i+a[i%c])%c;       //  Add a[i] to i and loop back using modulo
    a.remove(at:i)        //  Remove a[i]
  }
}

Perl 6, 46 45 bytes
(-1 byte thanks to Brad Gilbert)
{($_,{(|$_ xx*)[.[0]+(1..^$_)]}...1)[*-1][0]}

Try it online!
($_, { ... } ... 1) generates a sequence of lists, starting with the input list $_, each successive element being generated by the brace expression, and terminating when the list smart-matches 1--ie, has a length of 1.  The trailing [* - 1] obtains the final element, and the final [0] takes the sole element out of that singleton list.
(|$_ xx *) generates a flat, infinitely replicated copy of the current element.  This list is indexed with the range .[0] + (1 ..^ $_) to extract the next finite list in the series.

mind blown o.O

[*-1][0] can be combined into [*-1;0] saving a byte. Also 1..$_-1 is better written as 1..^$_ again saving a byte.

@BradGilbertb2gills I tried [*-1;0], but it seems not to be equivalent somehow.  The function then returns a list rather than a number.

That doesn't stop the 1..^$_ optimization

Clean, 78 bytes
Uses the same method as Laikoni's Haskell answer.
import StdEnv
f[e]=e
f[x:r]=f(take(length r)(drop(x+1)(flatten(repeat[x:r]))))

Try it online!

R, 111 117 126 bytes
Thanks to @Giuseppe for golfing off 11 bytes by changing to a while loop, got another 4 by removing the function and reading user input directly.
I don't feel great about what it took to get there - I'm sure a more elegant solution exists.
i=scan();m=1;while((l=sum(i|1))-1){j=i[m];p=`if`(j+m>l,j%%l+!m-1,j+m);p=`if`(!p,m,p);i=i[-p];m=`if`(p-l,p,1)};i

Try it online!
Ungolfed code
i=scan()
m=1
while((l=sum(i|1))-1){
  j=i[m]
  p=`if`(j+m>l,j%%l+!m-1,j+m)
  p=`if`(!p,m,p)
  i=i[-p]
  m=`if`(p-l,p,1)
}
i

117 bytes -- note that since this is a recursive function, the name f= needs to be included

I found this quite a difficult challenge with a 1 based-index language without array rotations; this is potentially 1-3 bytes shorter with a while loop, I think.

115 bytes with a while loop

my previous 115 byter was invalid since we both forgot the f= part of the recursive function. :(

I updated the old score and the new score to reflect the recursiveness :) With the 'while' loop I golfed off another 4 bytes using scan.

Perl 5, 47 43 41 + 2 (-ap) = 43 bytes
$\=splice@F,($_+=$F[$_%@F])%@F,1while@F}{

Try it online!
Takes input as space separated numbers.

it seems it does not exactly the same as the step by step example following does but is longer $x%=@F,splice@F,$x=($x+$F[$x])%@F,1while$#F;$_="@F"

wow o.O Need to get my game up.

Haskell, 56 bytes
f[x]=x
f l|m<-head l`mod`length l=f$drop(m+1)l++take m l

Try it online!

55 bytes

Python 3, 57 56 bytes
f=lambda a,*b:f(*([a,*b]*-~a)[a+1:a-~len(b)])if b else a

Try it online!

Java 8, 325 Bytes
Golfed:
static void n(Integer[]j){Integer[]h;int a=0;h=j;for(int i=0;i<j.length-1;i++){if(h.length==a){a=0;}a=(a+h[a])%h.length;h[a]=null;h=m(h);}System.out.print(h[0]);}static Integer[] m(Integer[]array){Integer[]x=new Integer[array.length-1];int z=0;for(int i=0;i<array.length;i++){if(array[i]!=null){x[z]=array[i];z++;}}return x;}

Ungolfed:
 interface ArrayLeapFrog {
static void main(String[] z) throws Exception {
    Integer[] j = {6, 2, 3, 4};
    n(j);
}

static void n(Integer[] j) {
    Integer[] h;
    int a = 0;
    h = j;
    for (int i = 0; i < j.length - 1; i++) {
        if (h.length == a) {
            a = 0;
        }
        a = (a + h[a]) % h.length;
        h[a] = null;
        h = m(h);
    }
    System.out.print(h[0]);
}

static Integer[] m(Integer[] array) {
    Integer[] x = new Integer[array.length - 1];
    int z = 0;
    for (int i = 0; i < array.length; i++) {
        if (array[i] != null) {
            x[z] = array[i];
            z++;
        }
    }
    return x;
  }
}

Welcome! A couple tips: No need to count the static keywords here. Typically multi-method solutions are implemented as non-static members of a class, and main creates an instance for testing. Also, if you do it that way you support Java 7 and can submit as simply a "Java" solution. For future reference, input format tends to be quite flexible here, so for example you could choose to take input as a List (which is quite helpful for this problem).

APL+WIN, 36 bytes
¯1↑⍎¨(1⌈¯1+⍴v←,⎕)⍴⊂'v←(1<⍴v)↓v[1]⌽v'

Explanation:
Prompts for screen input.
'v←(1<⍴v)↓v[1]⌽v' Loop logic as a string

 (1<⍴v)↓ only drop the first when number of elements n>1

 (1⌈¯1+⍴v←,⎕)⍴⊂ create a nested vector of logic of length 1 max n-1

 ⍎¨ execute each element of the nested vector in turn

¯1↑ take answer from executing final element

JavaScript, 58 56 59 bytes

let f =

a=>{for(i=0,k=a.length;k>1;)i+=a[i%=k],a.splice(i%=k--,1)}
<h2>Test</h2>
Enter or paste a valid array literal within square brackets and click Run.
<blockquote>
   <input id = "array" type="text" length="20">
   <button type="button" onclick="run()">Run</button>
</blockquote>
Result: <pre id="o"></pre>

<script>
    function run() {
       let a = JSON.parse(array.value);
       f(a);
       o.textContent = a;
    }
</script>

Returns the result as the only element remaining in the input array which is updated in place.
Two bytes saved by using a comma separated statement instead of a block statement in the for loop body! Three bytes lost to skip from an element deleted at end of array (:
Less golfed:
a => {
    for(i=0,k=a.length;k>1;) // once less than array length
        i+=a[i%=k],          // the new index
        a.splice(            // delete an element
           i%=k--,           // ensuring index is within array,
                             // and post decrement loop count
           1
        )
}

This seems to give the wrong answer for [3, 5, 7, 9].

Wrong for [3,5,7,9]. Expected value 5

The function does not return the value, i'm not sure if the byte count is proper keeping that in mind, since it can't work on it's own...

@edc65 and Neil , thanks - the index of an element deleted at end of array was not being adjusted to the start of the shortened array.

@BrianH. the function modify its parameter, there is consensus about that https://codegolf.meta.stackexchange.com/a/4942/21348

didn't know that, nevermind me then ;)

Python 2, 61 bytes
def f(x):
 while x[1:]:y=x[0]%len(x);x=x[y+1:]+x[:y]
 print x

I know a bunch of python answers exist, but I figured I might as well add my own.

Perl, 62 bytes
@_=@ARGV;while(@_>1){splice(@_,$i=($i+$_[$i])%@_,1)}print$_[0]

Requires that the numbers are added at command line.  Default $i equivalent to 0.
@_=@ARGV;                         # gets the array passed on command line
while(@_>1)                       # if there is more than one element in array, loop
{
   splice(@_,$i=($i+$_[$i])%@_,1) # embedded assignment to $i, removes element.
}
print$_[0]                        # prints remaining element

Perl 5, 43 + 2 (-ap) = 45 bytes
$_="@F[$`%@F+1..$#F,0..$`%@F-1]",redo if/ /

try it online

Pushy, 11 bytes
@Lt:&:};.;#

Try it online!
This challenge is well suited to be run on a stack:
             \ Implicit: Input on stack
@            \ Reverse the stack
 Lt:     ;   \ len(stack)-1 times do:
    &: ;     \    (last item) times do:
      }      \      Cyclically shift the stack right
        .    \    Pop top of stack
          #  \ Print remaining value

Python 2, 57 bytes
A couple bytes longer than Mr Xcoder's solution, but I thought it was worth posting this alternate approach.

def f(a,p=0):
 while a[1:]:p=(p+(a+a)[p])%len(a);del a[p]

Try it online!
Initially I did this recursively, but it's a few bytes longer:
def f(a,p=0):
 if a[1:]:p=(p+(a+a)[p])%len(a);del a[p];f(a,p)

Try it online!

Common Lisp, 129 bytes
(do*((m(coerce(read)'list))(k(rplacd(last m)m)))((eq(cdr m)m)(princ(car m)))(setf k(nthcdr(1-(car m))m)m(cdr(rplacd k(cddr k)))))

Try it online!

><>, 23 + 3 = 26 bytes
{:l3(?\:?\~~
 1-&{&\n;\

Try It Online
Takes a series of integers via the -v option.
How It Works
{:l3(?\   Get the first element of the stack and dupe it
 .....\n; If the length of the stack is only 2 (the first element twice), then print the number and end the program, else enter the loop

 .....\:?\.. Enter the loop with the array and a copy of the first value.
 1-&{&\..\   Exit the loop if the copy is 0, else shift the stack right and decrement the copy.

{:l3(?\..\~~ Pop the excess 0 and the current element of the array
 ...         Go back to the beginning, having one less element than before

Perl, 36 bytes
Includes +2 for ap
perl -apE '--($m||=$_+1)?$F[@F]:$\=$_ for@F}{' <<< "1 4 2 3 5"; echo

Nicely evil...

Thunno 2, 7 bytes
(ḣ;DhỴḣ

Try it online!
Explanation
(ḣ;DhỴḣ  # implicit input
(        # while loop
 ḣ       # (condition)  length > 1
  ;D     # (body)  duplicate current list
    hỴ   #         rotate left by first item
      ḣ  #         then remove first item
         # implicit output

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


text:
Best Yahtzee score
Yahtzee is a game played with five six-sided dice and a score sheet with thirteen different boxes to fill a score in. Each box has its own scoring rules:

1s, 2s, 3s, 4s, 5s, 6s all score points equal to the sum of the respective dice (that is, a roll of [3, 2, 3, 1, 5] scored as 3s would be awarded 6 points: 3 for each 3).
3-of-a-kind and 4-of-a-kind (as they sound, three or four dice rolled the same) score points equal to the sum of all five dice.
Full house (two dice show one value, the other three show another) scores 25 points
Small straight (four consecutive values) scores 30 points
Large straight (all consecutive values) scores 40 points
Yahtzee (all dice show the same value) scores 50 points

The thirteenth (chance) makes sense in-game, but not so much for this challenge; additionally the game has bonuses for extra Yahtzees which make no sense here. Because the challenge is...
Given five dice as input (five integers 1-6, input however is convenient, you can assume input is always valid), output the highest score possible for that 'hand'. For the purposes of this challenge, only the scoring methods in the list above are valid (specifically, chance is not a valid score box for this challenge). The score should be output as its decimal numeric value, whether that's an integer or a string representation thereof, whatever. It should be immediately recognizable as a number. Leading/trailing whitespace is fine, this is about getting the score and not presentation.
Code golf, so the answer with the fewest bytes in a given language wins. Standard loopholes forbidden.
Test cases
(Note that these are all independent, the challenge is to score one 'hand' of dice):
in: 1 5 4 3 2
out: 40
in: 1 1 4 3 1
out: 10
in: 2 2 6 5 3
out: 6
in: 2 4 2 4 6
out: 8
in: 1 1 1 1 1
out: 50
in: 5 2 5 3 6
out: 10
in: 1 6 3 4 2
out: 30
in: 1 3 1 1 3
out: 25
in: 6 5 5 6 6
out: 28
in: 1 2 3 5 6
out: 6

should we close the older question instead? IMO this is a better question than that one...

IMO this is not at all a duplicate of score a game of yahtzee
This explicitly states it is the highest score for one hand, where the other question is asking for an entire score from a list of die rolls. Lastly, and most importantly, I do not see any answers from the possible dupe being able to be used here in a "copy-paste" scenario. Please consider reopening.

meta post about this question

FWIW, I was aware of the older question when I put this one together. My thoughts echoed what @DevelopingDeveloper said. Having done this as an exercise once before, I found some interesting opportunities to optimize this process. I also just think this is a tidier challenge.

"The thirteenth (chance) makes sense in-game, but not so much for this challenge" So is it counted?

@Unihedron, No, do not count chance as a scoring box for the purposes of this challenge. Doing so would eliminate 1s-6s and effectively 3/4-of-a-kind as well (since chance would always score higher or the same as these). I should have made this more clear in the challenge and will update.

Related

R, 146 141 bytes
function(d)max(unique(d<-sort(d))*(g=table(d)),any(g>2)*sum(d),all(2:3%in%g)*25,(s=sum((R=diff(d))==1))<4&all(R<2)*30,(s>3)*40,(0==sd(d))*50)

Try it online!
Outgolfed by plannapus
Takes input as a list, and returns the score.
ungolfed a bit:
function(d){
 d <- sort(d)
 u <- unique(d)                  # unique dice
 g <- table(d)                   # table of counts
 Ns <- u*g                       # scores as 1s, 2s, ... etc.
 NKind <- any(g>2)*sum(d)        # 3 or 4 of a kind if any counts are at least 3
 FHouse <- all(2:3%in%g)*25      # full house is 25 if 2 & 3 are in counts
 R <- diff(d)                    # consecutive differences
 s <- sum(R==1)                  # sum of differences equal to 1
 sStraight <- s<4 &              # if the number of 1s is 3 and
               all(R<2)*30       # no consecutive numbers are 2 apart
 bStraight <- (s>3)*40           # all 1s means big straight
 Yahtzee <- sd(d)==0             # sd = 0 means all are equal
 max(Ns,NKind,FHouse,sStraight,bStraight,Yahtzee)
}

f(c(1,2,3,5,6)) fails — it should yield 6 and instead yields 30. It seems this is because you're counting how many pairs (post-sorting) differ by one, which is in fact four for the above sequence, even though it isn't a straight of four. I think I ran into this when I did this as an exercise a while back, and I should probably add that as a test case...

@brhfl this is fixed now.

Python 2, 187 184 167 165 bytes
-17 bytes thanks to @mypetlion
-2 bytes thanks to @chrstphrchvz
def f(d):r=range(1,7);c=d.count;m=map(c,r);s=`m`[1::3];return max([i*c(i)for i in r]+[sum(d)*(max(m)>2),25*(set(m)>{2,3}),30*(4*'1'in s),40*(5*'1'in s),50*(5 in m)])

Try it online!

R, 136 134 bytes
function(n,y=table(factor(n,1:6)),z=sum(!diff(diff(sort(n)))))max(1:6*y,c(25,sum(n),10*3:5)[c(all(y<4&y-1),any(y>2),z>1,z>2,any(y>4))])

Golfed down 2 bytes thanks to @Giuseppe!
Indented,
function(n, #vector of die scores
         y=table(factor(n,1:6)), #Contingency table
         z=sum(!diff(diff(sort(n))))) #Diff of diff of ordered scores
    max(1:6*y,
        c(25,sum(n),10*3:5)*c(all(y<4&y-1), #Full house
                            any(y>2), #3 and 4 of a kind
                            z>1, #Small straight
                            z>2, #Long straight
                            any(y>4))] #Yahtzee

A few test cases:
> f=function(n,y=table(factor(n,1:6)),z=sum(!diff(diff(sort(n)))))max(1:6*y,c(25,sum(n),10*3:5)*c(all(y<4&y-1),any(y>2),z>1,z>2,any(y>4)))
> f(c(2,4,2,4,6))
[1] 8
> f(c(1,2,3,5,6))
[1] 6
> f(c(6,5,5,6,6))
[1] 28
> f(c(6,5,3,1,4))
[1] 30
> f(c(6,5,3,2,4))
[1] 40

Huh, I considered factor for a hot second before I got distracted. But I think if I use your approach with z (s in my answer), I can golf mine down to 134...

Additionally, you can save three bytes by using all(y<4&y-1) and using * instead of [, and setting y inline rather than as a function argument, and it still passes all test cases: Try it online!

also, I restructured the max and I think it saved the byte from setting y inline.

Batch, 359 bytes
@echo off
set/at=s=m=r1=r2=r3=r4=r5=r6=0
for %%r in (%*)do set/a"m+=!(m-r%%r),r%%r+=1,t+=%%r,p=s-r%%r*%%r,p&=p>>9,s-=p
goto %m%
:1
if %r1% neq %r6% set s=40&goto g
:2
set/at=r3*r4*(r2*(r1+r5)+r5*r6)
if %t% gtr 0 set s=30
goto g
:3
set/a"s=r1^r2^r3^r4^r5^r6"
if %s%==1 if %t% lss 25 set s=25&goto g
:4
set/as=t
goto g
:5
set s=50
:g
echo %s%

Explanation:
@echo off
set/at=s=m=r1=r2=r3=r4=r5=r6=0
for %%r in (%*)do set/a"m+=!(m-r%%r),r%%r+=1,t+=%%r,p=s-r%%r*%%r,p&=p>>9,s-=p
goto %m%

Calculate the number of dice for each number, plus the maximum, plus the total of all the dice, plus the highest total of dice of the same number.
:1
if %r1% neq %r6% set s=40&goto g

If all the dice are different, this might be a long straight, but that needs there to be either no 1 or no 6.
:2
set/at=r3*r4*(r2*(r1+r5)+r5*r6)
if %t% gtr 0 set s=30
goto g

Otherwise, or if if at most two dice are the same, then this could still be a short straight. There must be at least a 3 and a 4 and also a combination of the other four numbers.
:3
set/a"s=r1^r2^r3^r4^r5^r6"
if %s%==1 set s=25&goto g

If there are three dice the same, check for a full house, since 3^2==1. However, some full houses, such as 6s and 5s, score higher as 3-of-a-kind.
:4
set/as=t
goto g

Otherwise, or if there are four the same, then score the total.
:5
set s=50

And if there are five the same, then Yahtzee!
:g
echo %s%

Output the best score.

Thanks for reminding me of the potential [5,5,6,6,6]-scored-as-full-house pitfall - I have added this as a test case. I knew there were a couple of weird fringe cases I was forgetting.

Jelly, 58 bytes
ċÐ€`Ṁ>2ȧS
ṢI=1Ạµ-ƤẸ,E;ṢI$E$;⁸Lƙ`Ṣ⁼2,3¤a3,5,4,2.Ṁ×⁵»Ç»Sƙ`Ṁ$

Try it online!

It's perfectly valid, but I'm curious and don't know Jelly well enough to suss it out on my own... why does full house return 25.0 while no other case has the trailing .0?

@brhfl Well, because it's inferred as 2.5 × 10 = 25.0 (float arithmetic), while the others such as 30 are inferred as 3 × 10 = 30 (integer arithmetic).

Thanks! I didn't really word my question well; I was more curious what method you're using to detect a full house that results in doing the math differently - but now that I think about it, I'm guessing it's just golfier to do 2.5, 3, 4, 5 * 10 vs 25, 30, 40, 50. Think I answered my own question.

@brhfl Exactly, since × 10 is 2 bytes, 2.5 is 2 bytes just like 25, and 3,5,4 saves 3 bytes over 30,50,40, so 3 + 0 - 2 = 1 byte saved.

Perl 6, 159 bytes
->\b{max map {$_(b)},|(1..6).map({*{$_}*$_}),{.kxxv.sum*?.values.grep(*>2)},{25*(6==[*]
.values)},30*?*{3&4&(1&2|2&5|5&6)},40*?*{2&3&4&5&(1|6)},50*(*.keys==1)}

Try it online!
Since input may be accepted "however is convenient," my function takes it as an instance of the Bag class, which is a container with multiplicity.  A Bag is also an associative container; $bag{$key} returns how many times $key occurs in the bag.
The bulk of the function is just a list of functions that evaluate each possible Yahtzee hand, returning the score for that hand or zero if the conditions for the hand are not met.

|(1..6).map({ *{$_} * $_ }) is a list of six functions that evaluate hands based on repeated runs of the numbers 1-6.  The leading | flattens this list into the surrounding list.
{.kxxv.sum * ?.values.grep(* > 2) } evaluates the 3- and 4-of-a-kind hands.  .kxxv on a Bag returns the keys repeated with each's multiplicity, recovering the original list of die rolls, and .sum of course sums the dice.  That sum is multiplied by a boolean value (?) which is true if the bag's .values (ie, the multiplicities) contain a value larger than 2.
{ 25 * (6 == [*] .values) } evaluates the full house hand.  25 is multiplied by a boolean value which is true if the product of the multiplicities is 6, which for five dice can only happen if one is 3 and the other is 2.
30 * ?*{ 3 & 4 & (1 & 2 | 2 & 5 | 5 & 6) } evaluates the small straight hand.  It's a WhateverCode function; the second star * is the Bag.  The expression between the braces is the junction of values 3 and 4, and either 1 and 2, or 2 and 5, or 5 and 6.  Looking up this junction in the Bag results in a junction of the corresponding multiplicities.  If the mulitplicities of 3 and 4, and at least one of 1 and 2, or 2 and 5, or 5 and 6, are nonzero, the junction is true when coerced to a boolean (with ?), and this boolean is multiplied by 30 to get the score.
40 * ?*{ 2 & 3 & 4 & 5 & (1 | 6) } similarly evaluates the large straight hand.  It's simpler because the dice must include each of the numbers 2-5, and either 1 or 6.
50 * (*.keys == 1) evaluates the Yahtzee hand.  It's simply 50 times a boolean value which is true if the number of distinct dice is one.

Pip, 65 63 bytes
n:_NgM\,6MXn*\,6AL[2<MXn23=JSNn3<Y#MX Jn^0MXn=5]*[$+g25--y*t50]

Takes the dice as five command-line arguments. Try it online!
Ungolfed + explanation
(This is the original version.)
                    g is list of cmdline args; t is 10 (implicit)

Y                   Yank into y:
  _Ng                function that counts occurrences of its argument in g
 M                   mapped to
  \,6                inclusive range from 1 to 6
                    This gives us how many dice are showing each number 1-6

s:                  Assign to s:
  # MX               length of max of
      Jy ^ 0         join y into string and split on zeros
                    This gives us the length of the longest straight

MX                  Max of
   y * \,6           each die frequency in y, times its value
 AL                  to which list append
   [                 this list:
                      3- and 4-of-a-kind:
    MXy > 2 & $+g      If max frequency is 3 or more, sum of g (else 0)
                      Full house:
    23 = J SNy & 25    Sort y and join into string; if it's 000023, 25 (else 0)
                      Straights:
    s > 3 & --s*t      If s is 4 or more, (s-1)*10 (else 0)
                      Yahtzee:
    MXy = 5 & 50       If max frequency is 5, 50 (else 0)
   ]
                    The result of the last expression is autoprinted

Ruby, 184 bytes
Full program. To make it easier to test input, add $/=' ' on top to read in the "digit separated by spaces" format. (191 chars)
a=$<.map &:to_i
b=a.|c=[]
d=(1..6).map{|x|e=a.count x
c<<x*e
e}
e=a.sum
p !b[1]?50:b[4]&&!(a&[1,6])[1]?40:(1..3).any?{|x|(a&[*x..x+3])[3]}?30:(d-[0,2,3])[0]?d.max>2?e:c.max: [25,e].max

I set out the break the 200 bytes barrier and I managed to destroy it with a dozen bytes left, with ease!
Try it online!
Explanation
Not a very good one though. Hope you have some Ruby knowledge~
a=$<.map &:to_i # a: input as [number]*5
b=a.|c=[]       # c: [], b: a.uniq
d=(1..6).map{|x|
    e=a.count x # e: occurrence count in a
    c<<x*e      # add (number * occurrence count) to c
    e           # return value in d
}
e=a.sum         # e: sum of input
p !b[1] ? 50 :  #   condition to print 50 <= if a.uniq has length 0 (el 1 is nil)
  b[4] &&       #   condition to print 40 <= if a.uniq has length 5 (el 4 exists)
  !(a&[1,6])[1] ? 40 : # <- arr & [mask]  # and a does not have both 1 and 6
  (1..3).any?{|x| # condition to print 30 <= if any of 1..4, 2..5, 3..6
  (a&[*x..x+3])[3]} ? 30 : # [3] to assert entire mask is found in a
  (d-[0,2,3])[0] ? # if, after removing 0 (not found) 2 (a pair) 3 (a triple)
                   # and something is found, this is not full house
  d.max > 2 ?   # is triple / quadruple ?
     e :        # weakly dominating alternatives
     c.max      # choose best by-suit
  : [25,e].max  # choose best by-score


text:
Decode Factor Trees
In case you missed Encode Factor Trees, here is the definition of a Factor Tree:

The empty string is 1.
Concatenation represents multiplication.
A number n enclosed in parentheses (or any paired characters) represents the nth prime number, with 2 being the first prime number.

Note that this is done recursively: the nth prime is the factor tree for n in parentheses.

The factors of a number should be ordered from smallest to largest.

For example, here are the factor trees for 2 through 10:
()
(())
()()
((()))
()(())
(()())
()()()
(())(())
()((()))

This challenge uses a similar format; however, this challenge is to decode these structures.
Test Cases
Shamelessly stolen repurposed from the last challenge.
In addition to the 9 above…
()()((()))((())) => 100
(()(()(()))) => 101
(()())(((())))(()(())) => 1001
(((((((()))))))) => 5381
(()())((((()))))(()()(())(())) => 32767
()()()()()()()()()()()()()()() => 32768

Rules

The paired characters in the input are your choice of parentheses, brackets, braces, or angle brackets. I may allow other formats (e.g. XML tags) if asked.
You should be able to handle Factor Trees for any number from 2 to 215 or 32768.
Since this is code-golf, the shortest answer in bytes wins.

Wolfram Language (Mathematica), 52 45 bytes
ToExpression@*StringReplace[{"["->"Prime[1"}]

Try it online!
Input uses brackets.
Transforms the input into a Mathematica expression that computes the result. We do this simply by replacing [ with Prime[1. This works because concatenation is multiplication in Mathematica.

Prolog (SWI), 134 128 127 124 bytes
This answer is part of a collaboration between myself and 0'. We both worked on this together, the only reason I'm posting it is because I won Rock, Paper, Scissors.
\Q-->{Q=1};"(",\N,")",\B,{findnsols(N,I,(between(2,inf,I),\+ (between(3,I,U),0=:=I mod(U-1))),L)->append(_,[Y],L),Q is Y*B}.

Try it online!
Explanation
This answer is a perfect exemplar of what makes golfing in prolog fun.

This answer uses Prologs powerful system for definite clause grammars.  Here is our grammar ungolfed a bit.
head(1)-->[].
head(Q)-->"(",head(N),")",head(B),{prime(N,Y),Q is Y*B}.
isprime(I):- \+ (between(3,I,U),0 =:= I mod(U-1)).
prime(N,Y):-
  findnsols(N,I,(
    between(2,inf,I),
    isprime(I)
  ),L),
  append(_,[Y],L),!.

The first construction rule is:
head(1)-->[].

This tells Prolog that the empty string corresponds to 1.
Our second rule of construction is a tiny bit more complex.
head(Q)-->"(",head(N),")",head(B),{prime(N,Y),Q is Y*B}.

This tells us that any non empty string contains parentheses around a clause with these same rules, to the right of a clause with these same rules.
It also tells us that the value of this clause (Q) follows the rule:
{prime(N,Y),Q is Y*B}

Breaking this down, Q is the product of 2 numbers Y and B.  B is just the value of the clause to the left and Y is the Nth prime where N is the value of the clause inside the parentheses.
This rule covers both of the formation rules of the factor tree

Concatenation multiplies
Enclosure takes the nth prime

Now for the predicate definitions.  In the ungolfed version there are two predicates at play (in my actual code I've forward chained the predicates away).
The two relevant predicates here are isprime/1, which matches a prime number, and prime/2, which, given N and Y, matches iff Y is the Nth prime.  First we have
isprime(I):- \+ (between(3,I,U),0 =:= I mod(U-1)).

This works of a pretty standard definition of primality, we insist that there is no number between 2 and I, including 2 but not I that divides I.
The next predicate is also pretty simple
prime(N,Y):-
  findnsols(N,I,(
    between(2,inf,I),
    isprime(I)
  ),L),
  append(_,[Y],L),!.

We use findnsols to find the first N numbers that are prime, we then return the last one.  The trick here is that while findnsols is not guaranteed to find the smallest N primes, because of the way SWI handles between it will always find smaller primes sooner.  This however means we have to cut to prevent it from finding more primes.

The golfs
We can forward reason in our code twice.  Since isprime is only used once its definition can be moved inside of prime.  The next one is to move prime directly inside of the DCG, however since we use a cut in prime to prevent findnsols from producing too many primes we have a bit of an issue.  The cut, cuts the entire DCG instead of just the bit we want.  After a bit of documentation digging we found that once/1 could be used to cut just this portion but not the entire DCG.  However more documentation digging revealed that the -> operator could also be used to perform a similar task.  The -> operator is roughly equivalent to ,!, so we moved our cut to the other side of append/3 and replaced it with ->.
In SWI-Prolog predicates (and rules) can be give operators as names which allows us to drop the parentheses normally required. Thereby we can save 6 bytes by calling the rule \.

Python 3, 125 110 bytes
lambda s:eval(s.replace("]","1]*").replace("[","p[1*")+"1")
p=2,
k=P=1
while k<1e4:
 if P%k:p+=k,
 P*=k*k;k+=1

Try it online!
Uses xnor's implementation of the Wilson Theorem method to generate primes. Substitutes () with [].

JavaScript (ES6), 98 bytes
Inspired by notjagan's Python answer. Turns the input expression into a huge and ugly executable string.
s=>eval(s.split`)(`.join`)*(`.split`(`.join`(g=(n,k)=>(C=d=>n%--d?C(d):k-=d<2)(++n)?g(n,k):n)(1,`)

Merging the C and g functions into a single one may save some bytes, but it would require even more recursion.
Test cases

let f =

s=>eval(s.split`)(`.join`)*(`.split`(`.join`(g=(n,k)=>(C=d=>n%--d?C(d):k-=d<2)(++n)?g(n,k):n)(1,`)

;[
  "()",                             // 2
  "(())",                           // 3
  "()()",                           // 4
  "((()))",                         // 5
  "()(())",                         // 6
  "(()())",                         // 7
  "()()()",                         // 8
  "(())(())",                       // 9
  "()((()))",                       // 10
  "()()((()))((()))",               // 100
  "(()(()(())))",                   // 101
  "(()())(((())))(()(()))",         // 1001
  "(((((((())))))))",               // 5381
  "(()())((((()))))(()()(())(()))", // 32767
  "()()()()()()()()()()()()()()()"  // 32768
]
.forEach(s => console.log(s, '-->', f(s)))

Jelly, 15 bytes
OḂ;ṪÆN×ṪƲ1ṛ?¥ƒ1

Try it online!
OḂ                 Codepoints odd or even? ('(' -> 0, ')' -> 1)
             ƒ     Reduce starting from
              1    one (implicitly treated as a singleton list):
  ;         ¥       append:
        Ʋ ṛ?         if right argument (is parenthesis closing?):
   Ṫ                  pop last element from left argument,
    ÆN                get nth prime,
       Ṫ              pop the next last element
      ×               and multiply.
                     Else:
         1            1.

Essentially interprets a stack language where ( means "push 1" and ) means "pop n, multiply top of stack by n-th prime", starting with a stack containing a single 1, outputting the single remaining stack item at the end.

Stax, 12 11 bytes
ÄKWα╛⌠ï_☻!■

Run and debug it
-1 thanks to Razetime
Translation of my Jelly answer. I felt I ought to try this in a stack-based language. First choice was 05AB1E, but I couldn't quite figure out i...
O+k|e1{v|6*}?    Unpacked representation

O+               Prepend 1 to the input. (strings = codepoint lists, mostly)
  k              Reduce that array by the rest of the program:
   |e            Even? ('(' -> 0, ')' -> 1)
            ?    If so,
     1           push 1, else
      {    }     perform:
       v         decrement,
        |6       0-indexed nth prime,
          *      multiply.

The way Stax's reduce operates on the stack is by pushing the first element of the top of the stack, then for each remaining element pushing that and evaluating the block it closes (which is the entire program if there is no block to close). Unfortunately, there doesn't seem to be any alternative which skips the special treatment for the first element--preferably after performing s--but there is a builtin for "tuck 1 under top of stack", so it works out anyways.


text:
Circles, where do you meet?
Given 2 random circle sections, return how many times they intersect. Rules/clarifications are as below.

You are provided 10 total values,

The center (x,y) of the circle section
Angles of the circle (i.e. (0,90) would be a quarter circle "facing" the top-right corner.
The radius of the circle section

The circle sections are "drawn" on a 128 by 128 screen, with (0,0) being the center. They have a max radius of 64.
You don't need to draw the circles - the program should only print out the number of intersections.
You can choose to generate the values randomly, in-program, or have the user write it in at program start. (The latter is preferred, but not necessary.)

Below is an example case. As you can see, it has one intersect.

The output should look something like this:
$ run ./circle
input (circle 1 center)
input (circle 1 radius)
input (circle 1 angles)
input (more inputs...)
...
intersections

Heres the output for the example case (the prompts are optional):
$ run ./circle
c1center: (20,20)
c1radius: 40
c1angles: (210,150)
c2center: (-30,-30)
c2radius: 90
c2angles: (270,180
1

Anyway, best of luck! This is code golf, so the minimum number of bytes in any programming language wins!
Oh, and it'd be nice if you could provide a description/link to your program in the answer. Standard Loopholes are not allowed. If you find any errors in my explanation or want me to clarify, just ask. Thanks!

May we assume that the circles are distinct so that there are not infinite intersections?

@notjagan yes, circles are completely different in that respect.

What if the intersection is outside the monitor/screen?

@user202729 It should be counted - only the center of the circles themselves need to be on-screen. I hope this helps.

Will the angle be in degrees or radians?

@iamnotmaynard either is fine, just be sure to specify in your answer.

Note that challenges should be completely clear since it was posted, because edits to the question may validate existing answers. That's a common mistake with challenges of new users. To achieve that, using the Sandbox is often helpful.

Thanks, @user201729 I'm new to this community, and I'm still trying to work it out. I'll keep it in mind for later questions as well.  Is there a way to move this question to the sandbox?

@i.. Good first question, you can use the Sandbox to see how your challenge holds up before posting it next time, but still, good job and I hope to see more of your questions in the future

@LiefdeWen I'm working on my second question, and it's in the Sandbox now: https://codegolf.meta.stackexchange.com/questions/2140/sandbox-for-proposed-challenges/14385#14385

Python 3 + numpy, 310 291 bytes
 -19 bytes thanks to ovs!
v=lambda c,x,y:sin(arctan2(*c[::-1])-x)>sin(y-x)
def f(a,r,w,x,b,s,y,z):
 d=linalg.norm(b-a)
 if abs(r-s)<d<r+s:e=(r*r-s*s+d*d)/2/d;g=a+e*(b-a)/d;t=(sqrt(r*r-e*e)*(b-a)/d*[1,-1])[::-1];return int(v(g+t-a,w,x)and v(g+t-b,y,z))+int(v(g-t-a,w,x)and v(g-t-b,y,z))-(t==0).all()
from numpy import*

Try it online!
This is a horrible answer.
Takes angles in radians.

Pretty good answer. I was wondering if anyone could do it in less than 500 bytes. +1

291 bytes, no need to convert bool to int, a%(2*pi)<b%(2*pi) is equivalent to sin(a)>sin(b) ...


text:
N-bit Variation on Subset-Sum
For another challenge I am writing, I need to verify that test cases are solveable with bounded integers. Specifically, I need to verify the following, for a non-empty array of integers A and an integer bit width n:

All integers a in A satisfy -2**(n-1) <= a < 2**(n-1) (representable with n-bit two's complement integers).
The length of A is less than 2**n.
The sum of A satisfies -2**(n-1) <= sum(A) < 2**(n-1).
All combinations of elements in A satisfy all of the above conditions.

Naturally, I've decided to outsource this problem to you!
Given an array of integers A and a positive integer bit width n, verify that A satisfies the conditions above.
Test Cases
[0, 0, 0], 2: True
[0, 0, 0, 0], 2: False (violates #2)
[1, 2, 3, 4, 5], 8: True
[1, 2, 3, 4, 5], 2: False (violates all conditions)
[1, 2, 3, 4, 5], 5: True
[-3, 4, 1], 4: True
[10, 0, -10], 4: False (violates #1 and #4)
[27, -59, 20, 6, 10, 53, -21, 16], 8: False (violates #4)
[-34, 56, 41, -4, -14, -54, 30, 38], 16: True
[-38, -1, -11, 127, -35, -47, 28, 89, -8, -12, 77, 55, 75, 75, -80, -22], 7: False (violates #4)
[-123, -85, 6, 121, -5, 12, 52, 31, 64, 0, 6, 101, 128, -72, -123, 12], 12: True

Reference Implementation (Python 3)
#!/usr/bin/env python3
from itertools import combinations
from ast import literal_eval

def check_sum(L, n):
  return -2**(n-1) <= sum(L) < 2**(n-1)

def check_len(L, n):
  return len(L) < 2**n

def check_elems(L, n):
  return all(-2**(n-1) <= a < 2**(n-1) for a in L)

A = literal_eval(input())
n = int(input())
OUTPUT_STR = "{}, {}: {}".format(A, n, "{}")

if not (check_elems(A, n) and check_len(A, n) and check_sum(A, n)):
  print(OUTPUT_STR.format(False))
  exit()

for k in range(1, len(A)):
  for b in combinations(A, k):
    if not check_sum(b, n):
      print(OUTPUT_STR.format(False))
      exit()

print(OUTPUT_STR.format(True))

Try it online!

Sandbox

Must we handle the empty list?

@Mr.Xcoder No, I'll clarify.

Wolfram Language (Mathematica), 40 bytes
Max[x=2Tr/@Subsets@#,-x-1,Tr[1^#]]<2^#2&

Try it online!
Condition 1 is implied by checking condition 3 for all subsets, including the one-element ones. So we take the max of

twice the sum of each subset,
one less than twice the negative of the sum of each subset, and
the length of the whole set

and check if that's less than 2^#2 (where #2 is the bit-width input).
At the cost of only 6 more bytes, we can replace Subsets@# with GatherBy[#,Arg], which is much more efficient because it computes only the two worst-case subsets: the subset of all nonnegative values, and the subset of all negative values. (This works because Arg has a value of 0 on the former and π on the latter.)

Jelly, 19 bytes
ŒPS€;⁸L¤ḟ⁹’2*$ŒRṖ¤Ṇ

Try it online!
It suffices to check that mapped sum of powerset + length of set is in the required range.

I think (though I am not sure) you can use ÆẸ instead of 2*$ (untested)

@Mr.Xcoder It does work.

05AB1E, 13 12 11 bytes
Saved 1 byte thanks to Mr. Xcoder
æO·D±¹gMIo‹

Try it online!
Explanation
æ             # powerset of first input
 O            # sum each subset
  ·           # multiply each element by 2
   D          # duplicate
    ±         # bitwise negation of each element in the copy
     ¹g       # push length of first input
       M      # get the maximum value on the stack
        Io    # push 2**<second input>
          ‹   # compare

JavaScript (ES6), 75 63 58 bytes
a=>n=>!a.some(e=>(a.length|2*(e<0?l-=e:u+=e))>>n,u=0,l=-1)

The sum of any subset of a lies between the sums of the negative and nonnegative elements, so checking the two sums suffices for everything except case 2. Edit: Saved 12 17 bytes thanks to @Arnauld.

Far much better than my naive approach. :-) This could be shortened down to 61 bytes

Actually, we can just process the test within the loop for 56 bytes.

Hacked on ([-2,-1,-2])(3)

@l4m2 Good catch. Suggested fix (57 bytes)

@Arnauld The problem here is that [-2, -2], 3 should be true, no?

@Arnauld I managed to repair your previous version at least...

I think that l should just be initialized to -1 instead of 1 in the 57 bytes version. But that requires some double-checking.

@Arnauld Did you ever get around to double-checking?

@Neil Sorry, I've completely lost my train of thought on that one. But a brute force test on some millions of random entries does suggest that a=>n=>!a.some(e=>(a.length|2*(e<0?l-=e:u+=e))>>n,u=0,l=-1) always gives the same result as your current one, except for singletons. (But this is a bug in the current version: singletons are coerced to integers when the | is applied).

@Arnauld Oh, I see how that works now. Very sneaky!

Jelly, 21 20 bytes
»0,«0$S€~2¦Ḥ;LṀ<2*Ɠ¤

Try it online!
Linear time complexity solution. Turns out that I over-estimated the time complexity

in The Nineteenth Byte, 2017-12-11 13-15-03Z, by user202729

@NewSandboxedPosts "Real" subset sum problem are much harder. This one can be done in linearithmic time...

because now I realize sorting the array is completely unnecessary.

Explanation:
»0,«0$S€~2¦Ḥ;LṀ<2*Ɠ¤    Main link. Example list: [-1, 0, 1]
»0                      Maximize with 0. Get [0, 0, 1]
  ,                     Pair with
   «0$                    minimize with 0. Get [-1, 0, 0]
      S€                Sum €ach. Get [1, -1]
        ~               Inverse
          ¦               at element
         2                2. (list[2] = ~list[2]) Get [-1, 2]
           Ḥ            Unhalve (double, ×2). Get [-2, 4]
            ;           Concatenate with
             L            Length (3). Get [-2, 4, 3]
              Ṁ         Maximum of the list (4).
               <   ¤    Still less than
                2         two
                 *        raise to the power of
                  Ɠ       eval(input())

Seems that ~2¦ can be ;~. EDIT: Done.

@user202729 Wrong. Still, ;~$ will work.

JavaScript (ES6), 114 bytes
Takes input in currying syntax (A)(n). Returns a boolean.
A=>n=>!(A.reduce((a,x)=>[...a,...a.map(y=>[x,...y])],[[]]).some(a=>(s=eval(a.join`+`),s<0?~s:s)>>n-1)|A.length>>n)

Test cases

let f =

A=>n=>!(A.reduce((a,x)=>[...a,...a.map(y=>[x,...y])],[[]]).some(a=>(s=eval(a.join`+`),s<0?~s:s)>>n-1)|A.length>>n)

console.log('[Truthy]')
console.log(f([0, 0, 0])(2))
console.log(f([1, 2, 3, 4, 5])(8))
console.log(f([1, 2, 3, 4, 5])(5))
console.log(f([-3, 4, 1])(4))
console.log(f([-34, 56, 41, -4, -14, -54, 30, 38])(16))
console.log(f([-123, -85, 6, 121, -5, 12, 52, 31, 64, 0, 6, 101, 128, -72, -123, 12])(12))

console.log('[Falsy]')
console.log(f([0, 0, 0, 0])(2)) // violates #2
console.log(f([1, 2, 3, 4, 5])(2)) // violates all conditions
console.log(f([10, 0, -10])(4)) // violates #1 and #4
console.log(f([27, -59, 20, 6, 10, 53, -21, 16])(8)) // violates #4
console.log(f([-38, -1, -11, 127, -35, -47, 28, 89, -8, -12, 77, 55, 75, 75, -80, -22])(7)) // violates #4

Clojure, 121 117 bytes
#(let[l(int(Math/pow 2(dec %2)))](every?(set(range(- l)l))(cons(count %)(for[i(vals(group-by pos? %))](apply + i)))))

Well that was a bit dumb, splitting into positive and negative values is a lot better than sorting. Original, but surprisingly not much longer:
#(let[l(int(Math/pow 2(dec %2)))S(sort %)R reductions](every?(set(range(- l)l))(concat[(count S)](R + S)(R +(into()S)))))

This works by checking prefix sums of the sequence in ascending and descending order, I think it isn't necessary to generate all combinations of elements in A.
(into () S) is in effect same as (reverse S), as lists grow from the head. I couldn't figure out a way to use cons instead of concat when there are two lists to cons to. :/

Jelly, 15 bytes
ŒPS€Ḥ;~$;LṀl2<Ɠ

Try it online!
Explanation
ŒPS€Ḥ;~$;LṀl2<Ɠ ~ Monadic full program.

ŒP              ~ Powerset.
  S€            ~ The sum of each subset.
    Ḥ           ~ Double (element-wise).
     ;~$        ~ Append the list of their bitwise complements.
        ;L      ~ Append the length of the first input.
          Ṁ     ~ And get the maximum.
           l2   ~ Base-2 logarithm.
             <Ɠ ~ Is smaller than the second input (from stdin)?

Saved 1 byte thanks to caird coinheringaahing (reading the second input from STDIN instead of CLA).

@user202729 I have asked the OP, and we don’t have to handle the empty list

Pyth, 20 bytes
>EleS++KyMsMyQmt_dKl

Try it here!

@user202729 I have asked the OP, and we don’t have to handle the empty list

Husk, 14 bytes
≥Lḋ▲ṁ§eLöa→DΣṖ

Going with brute force by looping over all sublists, since splitting into positive and negative parts takes more bytes.
Try it online!
Explanation
≥Lḋ▲ṁ§eLöa→DΣṖ  Implicit inputs, say A=[1,2,3,4,5] and n=5
             Ṗ  Powerset of A: [[],[1],[2],[1,2],..,[1,2,3,4,5]]
    ṁ           Map and concatenate:
                  Argument: a sublist, say S=[1,3,4]
            Σ     Sum: 8
           D      Double: 16
          →       Increment: 17
        öa        Absolute value: 17
     §eL          Pair with length of S: [3,17]
                Result is [0,1,1,3,1,5,2,7,..,5,31]
   ▲            Maximum: 31
  ḋ             Convert to binary: [1,1,1,1,1]
 L              Length: 5
≥               Is it at most n: 1

Python 2, 72 71 70 bytes
def f(x,n):t=2*sum(k*(k<0)for k in x);max(2*sum(x)-t,~t,len(x))>>n>0>_

Output is via presence/absence of an error.
Try it online!