Last Updated:

Week 13: The Home Stretch

Categories Updates

This week mainly focused on finding and fixing as many errors and bugs as I could find. I also enlisted the help of some friends to break my project, and a few of them succeeded.

Fixing the Circles

Although I am presenting the original version that uses the state outlines, I wanted to fix up the circle version a bit to present it as an extension for the person who would have it next. After a lot of trial and error, I was able to create the circles in an array and that allowed me to call them one by one to update them.

I am going to spend a few hours this weekend trying to create a few new points using weighted averages. To be honest, I’m not super hopeful that it will work, but I’m going to try.

Info Box Errors

The main errors this week focused on my info div and the errors that I had with it.

I now have it so when you click the info button when the div is already open, it closes it. There is also a hide button on the bottom, but each option does the same thing.

When the animation is done and the user wants to check the info box again, I noticed the bottom was covered up by the key. Because of this, when the info div is open I hid the key and when the info div is closed I have the key reappear.

The last “bug” I fixed was disabling the play button when the info div was open. I think I could have left it the way it was, but I was worried about the user accidentally hitting play before reading and picking all of the options.

In the text of the info box div, I mention what the current start and end years are set to, but I grabbed that data when the box was open. If the user changed it while the box was open, it didn’t update. I was able to add a listener to the start input box to update the text. I did the same for the end text and now when the start or end year are changed, the text updates.

If the year is invalid, the text changes to “INVALID”. I wanted to warn the user when they clicked out of the box, but because it was a listener, an alert would continually appear and you couldn’t get out of it to change the value. You cannot run the program with invalid data, so I don’t think this is the worst solution.

Invalid Start and End Years

A Silly Mistake

One of my friends, Leah, was able to find an error I hadn’t thought of and it led to me figuring out that the way I was doing my math was incorrect. She let me know that if you do the same start and end year the program is confused and tries running the default. This was because I was making a simple math mistake and my count was one off. In order to show the data for each year between 1900 and 2000, there are 101 years because you have to include both 1900 and 2000. So after figuring that out, each year should be showing correctly.

In the case of starting and ending on the same year, the count I created was zero, but it needed to be one. Once I added one to the final count, it now only displays the one year.

I also realized that the program was showing the text a year off. So if the program started in 1900, the text showed that the data was instead for 1901. This was because I was updating the current year before showing the text.


The next week is going to be focused on creating and practicing my presentation, fixing any other small errors that come up, cleaning up my code, and preparing for defenses. I also want to record a video for my demo just in case something would happen to compsci04.

Leave a Reply

Your email address will not be published.