Implementation of https://xkcd.com/blue_eyes.html