add my solution

It’s pretty much overkill in that it implements every feature you ask for, and some more. But there are probably still some bugs. Please read the `.coffee.md` file, it should be self-explanatory.