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,
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.
Can we output arrays? For instance,
50
would give[[2], [2, 6], [2, 6, 10], [2, 6, 10], [2, 2]]
– JungHwan Min – 2017-12-12T00:31:18.8202IIRC every challenge that runs on a finite set of inputs with a constant output is a candidate for the kolmogorov tag. Nice challenge. – Uriel – 2017-12-12T00:33:04.553
is my output format ok ?
– Rod – 2017-12-12T00:51:19.7036
In the test cases,
– JungHwan Min – 2017-12-12T01:29:21.5003d
seems to be filled before4s
,4d
before5s
,6s
after4f
and5d
, which violate the Madelung rule. Should we golf programs that print the incorrect electron configurations on the pastebin?5Also, there are exceptions to the Aufbau principle (like Chromium (atomic no. 24) having
4s1 3d5
instead of4s2 3d4
). I see that it was asked in the sandbox post but was never answered. Do we ignore that issue? – JungHwan Min – 2017-12-12T01:37:09.4901OMG I swear I was going to post this exact same question...today – FantaC – 2017-12-12T03:21:26.980
1@Uriel [tag:status-completed] – MD XF – 2017-12-12T17:43:24.620
1@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) – JungHwan Min – 2017-12-13T03:56:01.823
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."
– JungHwan Min – 2017-12-13T08:05:05.883The problem being the incorrect electron configurations. e.g.
20 -> 1s2 2s2 2p6 3s2 3p6 3d2
should be20 -> 1s2 2s2 2p6 3s2 3p6 4s2
– JungHwan Min – 2017-12-13T08:11:18.270