RosettaCodeData/Task/Dinesmans-multiple-dwelling-problem/J/dinesmans-multiple-dwelling-problem-7.j
2024-10-16 18:07:41 -07:00

11 lines
613 B
Text

(({~(!A.&i.])@#)'BCFMS') [F..(128!:2"1 # ]) ];._2 (0 :0)
'B' ~: {: NB. Baker not on top floor
'C' ~: {. NB. Cooper not on bottom floor
'F' ~: {: NB. Fletcher not on top floor
'F' ~: {. NB. Fletcher not on bottom floor
</@i.&'CM' NB. Miller on higher floor than Cooper
0 = +/@E.~&'SF' NB. Smith not immediately below Fletcher
0 = +/@E.~&'FS' NB. Fletcher not immediately below Smith
0 = +/@E.~&'CF' NB. Cooper not immediately below Fletcher
0 = +/@E.~&'FC' NB. Fletcher not immediately below Cooper
)