It’s the little things.

One of the things I had been hung up on was how to move the checker into the lowest available spot in a column. I’d taken a shot at writing a function to do it. I would pass it the column to search and then loop through the values, using getElementById to look for an empty cell. It didn’t work. I’m not sure why it didn’t work. I tweaked it and rewrote it and tweaked it some more. I could hardcode values in and it would do what I wanted it to. Great.

Eventually I enlisted the help of one of my mentors, Chris Gomez. We used Cloud9’s collaboration tools to dig around in my code and run little tests. Finally, I found myself in the in the dev console of firefox, setting breakpoints and watching expressions. Without those tools, I don’t know how much longer it would have taken for me to find the problem. I was doing too much work. I had one too many steps. Luckily I could see that one of the expressions was evaluating to ’empty’. That was exactly what I was looking for. I think took that expression and tried to do more work on it, which ended up giving me a null and killing the loop.

I had what I needed. I cleaned up the function. Manually tested it a half a dozen times, and gave a spirited “Hell yes!” to my empty room. Made my day.

findLowest

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s