Last week’s scala kata was a bit challenging as it required a bit more advanced scala knowledge than the katas I’ve done so far. Breaking from last week I’ve decided to head back to the basics and dream up a kata to help focus on some of scala’s language features versus a full blown program.

For this week’s scala kata I decide it would be interesting to model the Weekday Heptagram. Conceptually the kata should be to take one of the seven Stellar Objects ( Saturn, Jupiter, Mars, Sun, Venus, Mercury, and Moon) and the hour of the day using the 24 hour scale and deduce what day of the week it is. For example, if it’s the 1st hour of the day and the stellar object is Saturn then it is obviously Saturday. If it is the second hour of the day and the stellar object is Saturn then it is Monday. See the table near the top of this page for additional examples to use for your specifications.

Other operations that could be useful include:

  • identify the dominant stellar object for a given date/time
  • given a day and hour what is the stellar object n hours from now
  • given a specific day and hour, what are the stellar objects for that hour for the remainder of the week?

Hopefully this should be a fun little coding exercise. :)

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Google
  • BlogMemes
  • Blogosphere News
  • description
  • Fark
  • LinkedIn
  • NewsVine
  • StumbleUpon
  • Technorati
  • TwitThis
  • Yahoo! Buzz

If you're new here, you may want to subscribe to my RSS feed. Thanks for visiting!