| Bytes | Lang | Time | Link |
|---|---|---|---|
| 066 | Charcoal | 241227T113030Z | Neil |
| 165 | Ruby | 241227T025309Z | Level Ri |
| 140 | Retina | 241225T053344Z | Neil |
Charcoal, 66 bytes
E¹³E⪪”)⊞⟲λN0»⟲;»§,n⪪FPÞ⁺LD;⊕O;y⁴→ζ∕iG↙ζ”¹⁵⪫E⁵⭆⌕AλIν§β⎇‹π¹³﹪⁺πι¹³π
Try it online! Link is to verbose version of code. Explanation: Uses @LevelRiverStreet's idea of encoding the solution by listing the group each girl is in on each day.
¹³ Literal integer `13`
E Map over implicit range
”...” Compressed lookup table of groups
⪪ ¹⁵ Split into substrings of length `15`
E Map over substrings
⁵ Literal integer `5`
E Map over implicit range
ν Current group
I Cast to string
⌕A Find all occurrences in
λ Current substring
⭆ Map over indices and join
β Predefined variable lowercase alphabet
§ Indexed by
π Current index
‹ Is less than
¹³ Literal integer `13`
⎇ If true then
π Current index
⁺ Plus
ι Current offset
﹪ Modulo
¹³ Literal integer `13`
π Else current index
⪫ Join on spaces
Implicitly print
Ruby, 165 bytes
91.times{|i|s=[*?A..?M].rotate(i/7)+[?N,?O]
(i%=7)<1&&puts
a=(1..5).map{""}
15.times{|j|a[("l.>;Lqg/*8VY#^|0N<$E:LM{E1Q8xd"[j*2+i%2].ord/5**(i/2)+j/3)%5]<<s[j]}
p a}
Prints what is essentially the Denniston solution for the first week with the following changes
- relabelling so that the last row shows A through O alphabetically
- some reordering of the days of the week
- some reordering of the marching order of the groups of 3 girls on each day.
It then proceeds to print the remaining weeks by relabelling the first 13 girls in a cycle, in accordance with the Denniston solution.
The magic string has two characters per girl, tracking her position through the days. On the last day girl n (0 to 14) will be in group n/3 (0 to 4). On earlier days, her position is offset by one of her two characters in the magic string (one for even days, one for odd days) whose ASCII code is a base 5 encoding of the offset for the three even or odd days. These are extracted by dividing by powers of 5 and taking modulo 5. On the last day (day numbers 0..6) we divide by 5**3=125 so every girl's offset is zero.
The magic string was generated with the code below, showing the final week of Denniston's solution moved to the beginning. Note that because the order in which the five groups of girls march on a given day does not matter, the marching order was juggled slightly to ensure all characters in the magic string are printable.
g=[0]*15
"BEF CGL DHK IJM ANO
HIN ABJ CEM DGO FKL
ACH DEI FGM JLN BKO
ADL BHM GIK CFN EJO
CJK DMN AEG FHO BIL
AFI BCD EKN LMO GHJ
AKM DFJ EHL BGN CIO".lines{|i|
g.map!{|j|j*5}
15.times{|j|c=i[j*4/3].ord-65;g[c]+=j/3}
}
g.sort!
g.map{|i|k=i/15625;print ((i-k)%5+(i/5-k)%5*5+(i/25-k)%5*25).chr+((i/125-k)%5+(i/625-k)%5*5+(i/3125-k)%5*25).chr}
Retina, 140 bytes
abjcemfklhindgoachdeifgmjlnbkoadlbhmgikcfnejoaegbilcjkdmnfhoafibcdghjeknlmoakmdfjehlbgnciobefcgldhkijmano
L`.{15}
%| L`...
12+"¶¶"<T`ma-l`l
Try it online! Prints the Denniston solution using letters a-o, with each week double-spaced, each day on its own line, and each triple space-separated. Explanation:
abjcemfklhindgoachdeifgmjlnbkoadlbhmgikcfnejoaegbilcjkdmnfhoafibcdghjeknlmoakmdfjehlbgnciobefcgldhkijmano
Start with the first week but all of the triples in a single string.
L`.{15}
Split the week up into days.
%| L`...
Split each day up into triples.
12+"¶¶"<T`ma-l`l
Rotate the letters a-m to generate each of the 12 subsequent weeks, but firstly outputting the current week each time, with two trailing newlines to separate it from the next week. The final week then prints implicitly.