Please don't take my solutions too serious. They are very unoptimized not well thought through. They are just blobs of code that should never be used as serious code.
Cool now that that's out of the way, enjoy the monstrosity of code I've written :-)