shlogg · Early preview
Alexandr @al3xsus

Software Engineering Mistakes On Mars: A Martian Weekday Calculator

Mars has 8-day weeks with 2 Mondays (M1, M2). Leap years skip M2. Create a script to convert [year, day] to Martian weekday string.

Imagine you're on Mars. One Martian year takes 668 Martian days to complete one circle around the sun. There is an 8-day week - due to 2 moons, Mars has Monday1 and Monday2, so the week looks like that: Sun, M1, M2, Tue, Wed, Thu, Fri, Sat.

Two Mondays, Jesus Christ

But fear not! Sometimes (every 5th year) there is a special leap year, where the second Monday does not exist! 

Thank you, universe

It still takes 668 days, though. And we know that the Martian date system started on Sunday. Your task is to create a script that will take an array of format [year, day] on input and return the we...