Problem of the Day: Smiley Face (update)

Straight forward implementation of my plan. Found two bugs that were my mistakes:

  1. Typo on when to decrement the counter, I used “)” instead of “(“
  2. When using the split() function I didn’t know I had to escape the “)” character because it is a reserved character. The more you know.

Otherwise it works well. I made sure to keep the functions that do the work, countPar() and print(), separate from main() which should make using a JUnit test to check it rather than calling it from main(). I should really learn how to use JUnit tests. Maybe tomorrow.

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s

%d bloggers like this: