Tuesday, April 19, 2011

Number Five is NOT alive!

Anybody ever see Short Circuit?  I used to love that movie and whenever I think the phrase "number five" and think of that little guy saying "Number Five is alive!"  Only in this case I'm referring to a bug that has been successfully squashed! No more Bug #5!

Bug #5 was more of a confusion to the user than anything else.  According to the wiki, each day of the game consisted of:
  1. Going to the store in the morning
  2. Selling lemonade
  3. Closing shop for the night and entering the day's activities and profits into the log
The program did all these things, but it updated the log's day after going to the store.  So, for example, at the beginning of the game, it would begin the log with Day 1.  Then the user would visit the store, buy supplies, and all of a sudden the log says it is Day 2 and records the user's purchases and profits under the Day 2 heading.  Confusing? I think so, and so did the rest of the team.

We found the place in the code where it processes the day's logic and the night logic.  At first I thought that moving the day incrementer to the night logic instead of the day logic would fix the problem, but it didn't.  After a bit of confusion we realized that the problem was that the daily log displayed yesterday's activities under the current day - and that did not make sense.  So we played a little bit more and figured out that the problem was not in the logic at all, but in the displaying of information.  We turned away from the Main file and investigated the GUI file and sure enough we found the code where it added new values to the log.  At this point we simply changed the day value to day - 1, so that the log displays yesterday's entry.  We also modified it so that on the first day the log shows a welcome message instead of "Day 0."

I was really excited about this success because this was the first bug that I beat my teammates to the solution!  For the last several bugs by the time my to-do list reaches LemonadeStand, I've received emails from my team saying that they found, fixed, and committed the bug.  I've been so thankful for a team that I can rely and trust to share the work, so please don't think I'm complaining about it.  I've simply felt like I wasn't keeping up with my contributions.  Anyway, this was a big victory for me because I was able to find and commit the solution.

And so we had success - except for one little thing.  Now the game play seemed confusing because there was nowhere to indicate what the current day was.  As we looked at the activity wiki we realized that their picture showed the current day with the day's weather, but that feature seemed to have been removed since the picture was posted.  We decided that it was worthwhile to add it back in and so appended a message to that block.

And now we are done!  We have completed the bugs! Of course, we also just realized that we've only been committing our code t our subversion server and not to the project...oops!  Our solution is to create several patch files based on our bugs and submit each of them.  Guess that is our work for this week!

No comments:

Post a Comment