i am dustin diaz

a JavaScriptr...

boosh.

don't worry about it.

YUI Tetris!

It started with a challenge. The other day as my coworkers and I were walking to lunch one of them told a story about an interview question he was once asked. That question was How long would it take for you to make a tetris game using any language of your choice? He thought about the question, and delivered an answer. It was nothing that they were proud of so they shook their heads and pardoned him off. They were more or less looking for an answer along the lines of ... maybe a couple of hours. And as it turns out, one guy actually did it in about one and a half hours. Little did I know he was dropping in some tetris.pl file and made the whole thing with ascii text.

Moving right along, this same coworker looked at me and said, How long would it take you? You think you could do it in a day?

I pondered the question, quickly latched onto a language that I'm comfortable with (JavaScript), and gave a nod. Sure, I said. I can totally do it.

Needless to say, I lost the bet. But 2.5 days later, I finished it . And I did it with my favorite utilities from the Presentation Platform YUI Utilities.

Really, you made Tetris?

Yep, I totally made tetris. Using a combination of the Event Utility and the DOM Collection utility, I was able to roll out perhaps the sweetest piece of eye candy I've ever built. And granted, it's not to say that it hasn't been done before, but with the help of YUI, this bad boy works in Firefox1.0+, Opera8+, Safari2, and IE6, and yes, it only took 2.5 days! Go ahead, see it in action!

Update! I've now made an alternate version with sound. Enjoy!

this is who i am

Hi, my name is Dustin Diaz and I'm an Engineer @ObviousCorp. Previously @Twitter, @Google, and @Yahoo, author of Strobist® Info co-author of JavaScript Design Patterns, co-creator of the Ender JavaScript Framework, a Photographer, and an amateur Mixologist. This is my website. Welcome!

On this site I write about JavaScript. You can also follow along with my open-source work on Github.

This site is optimized and works best in Microsoft Internet Explorer 6.