Jump to content

Cheryl's birthday: Difference between revisions

→‎Functional Python: Minor tidying, reordering of comments.
(→‎Functional Python: Minor tidying, reordering of comments.)
Line 1,423:
(month, day) = (0, 1)
print(
# (A's month contains only one remaining day)
# (3 :: A "Then I also know")
# (A's month contains only one remaining day)
uniquePairing(month)(
# (B's day is paired with only one remaining month)
# (2 :: B "I know now")
# (B's day is paired with only one remaining month)
uniquePairing(day)(
# (A's month is not among those with unique days)
# (1 :: A "I know that Bernard does not know")
monthsWithUniqueDays# (FalseA's month is not among those with unique days)(
monthsWithUniqueDays(False)([
# 0 :: Cheryl's list:
listtuple(mapx.split()) for x in
lambda x: tuple(x.split()),
split(', ',
'May 15, May 16, 'May 19, ', +
'May 15, MayJune 1617, MayJune 1918, ' +
'JuneJuly 1714, JuneJuly 1816, ' +
'JulyAug 14, JulyAug 1615, Aug 17' +
'Aug 14, Aug 15, Aug 17')
])
))
)
)
)
9,659

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.