Implement the Doomsday Rule for Rosella in Winxed
completed by: Nagato Yuki
mentors: Andrew Whitworth
Task Description
Create an implementation of the Doomsday Rule in Winxed for Rosella. This will be the first portion of a new date/time library that will be created. Create a class called "Doomsday" in src/unstable/date/Doomsday.winxed (create the directory if necessary). The class should provide a method get_day(yyyy, mm, dd) that should return the day of the week. It may return either an integer (Sunday=0, Monday=1, etc) or a string name of the day, at your discretion.
The algorithm you use may utilize pre-computed tables. Notice that the Gregorian calendar wasn't created until 1582, so your algorithm only needs to be accurate that far back. Subtle changes in calendars and the tracking of time prior to 1582 are not important for our purposes.
Steps To Complete This Task
- Create a fork of rosella.git on github.com
- Create the src/unstable/date/Doomsday.winxed file (create the directory if necessary)
- Add your new library and class file to the build in setup.winxed. Follow existing code examples for other unstable libraries.
- Build Rosella to show that your code compiles
- Create a Github pull request (button on the upper right of your fork) to have your changes incorporated into the master repository
Requirements
- Winxed programming language (or similar)