A 2nd IOPCC Winner

Author:

Judges' Comments

Very clever, uses a unique trick to confuse what is otherwise a simple algorithm.

Author's Comments

Highlights:

Python 3 version tried against

Invoked as python3 under MacOS: Python 3.9.6 (default, Nov 10 2023, 13:38:27) [Clang 15.0.0 (clang-1500.1.0.2.5)] on darwin

Example usage of the function

def DayOfWeek(y, m, d, tuple=' (["upseal.block"]) ', days=['Sun','Mon','Tues','Wednes','Thurs','Fri','Satur']): y -= m < 3 return days[(y + y // 4 - y // 100 + y // 400 + ord(tuple[m]) % 8 + d) % 7] + 'day' DayOfWeek(2024,5,29) 'Wednesday'

Example output

% python3 DayOfWeek_simple.py 2000 Saturday 2001 Monday 2002 Tuesday 2003 Wednesday 2004 Thursday 2005 Saturday 2006 Sunday 2007 Monday 2008 Tuesday 2009 Thursday 2010 Friday 2011 Saturday 2012 Sunday 2013 Tuesday 2014 Wednesday 2015 Thursday 2016 Friday 2017 Sunday 2018 Monday 2019 Tuesday 2020 Wednesday 2021 Friday 2022 Saturday 2023 Sunday 2024 Monday