~kentbrew: Glint 1.0

     
     
     
     
     
     
     
     
     
     
     
     

What's This?

Glint is a toy originally made for the iPod Touch, back when there was no such thing as the App Store and Steve Jobs insisted we should all make "Web apps" out of HTML, CSS, and JavaScript. (Once again, Steve was ahead of his time.)

To play, fill the board completely with colors without duplicating a color in any row, column, or sub-board. If you mess up, some pieces will disappear and go back in the stack. It's like Sudoku, only hostile to color-blind people.

This version of Glint was specially made for tilde.club, to answer this question: "If I'd made Glint in 1996, what would it have looked like?"

Answer? TABLES! And FONT tags! And lots and lots of inline JavaScript, the kind that makes Doug Crockford spit out his Diet Dr. Pepper. Turns out I have an unique set of skills needed to make this happen: I spent a year and a half building individual ad mantles for the front page at yahoo.com, when it had to run flawlessly on Netscape 4.79.

I loved making this. LOVED. I've been sitting here cackling and rubbing my hands together all night. Which pretty much describes the entire tilde.club experience so far.

Notes

Unexpected consequence of 1996 technology. After I pinch to zoom, this version of Glint seems to work better on my recent-generation iPhone than the original version, which was optimized for 320px and has goofy Apple viewport headers that blows it up out of whack.

Trigger warning for OCD. Once you start trying for that perfect score you will never, ever stop.

Research in progress. Hooked up GA over lunch, trying to understand how often someone wins, restarts, misplays each of the available colors, etc. Nothing evil, I promise!

Special cool thing. lurking in here is a predictably-random number generator inspired by a processor bug documented in Numerical Recipes in Fortran 77. Why this is neat: we can seed it with the Unix timestamp divided by 86,400,000 to make a special game of Glint for every day, and you should come back tomorrow for the next one. You can reload the page to try today's puzzle again, or--if you're impatient--just change the number after the hash in your URL bar.

Here's how the predictably-random number generator gives us the same game for every day:

    if (!window.location.hash) {
      window.location.hash = Math.floor(new Date().getTime() / 86400000);
    }
    
    window.onhashchange = function () {
      document.location.reload();
    };
    
    var gameId = window.location.hash.split('#')[1];
    
    var rseed = gameId;
    
    var rnd = function (n) {
      rseed = (rseed * 9301 + 49297) % 233280;
      r = Math.floor(rseed / (233280.0) * n);
      return r;
    };

Once we have this in place we call rnd(n) instead of Math.random(n), and we get a stream of numbers that look random but are always the same for any initial seed. Presto, procedurally-generated quasi-randomness!

---

Games played since 10/8/2014: