GSoC/GCI Archive
Google Code-in 2011 Parrot Foundation

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

  1. Create a fork of rosella.git on github.com
  2. Create the src/unstable/date/Doomsday.winxed file (create the directory if necessary)
  3. Add your new library and class file to the build in setup.winxed. Follow existing code examples for other unstable libraries.
  4. Build Rosella to show that your code compiles
  5. Create a Github pull request (button on the upper right of your fork) to have your changes incorporated into the master repository

Requirements

  1. Winxed programming language (or similar)

Additional Links