Week 10

    I had numerous hurdles while doing homework 1. My first hurdle was that for some reason my output would always be blank no matter what. I was not properly adding the line to addFromFile so my outputs were messed up. For addLine I had issues figuring out the proper command to split a string with any whitespace characters as delimiters, so I looked on Stack Overflow and found a user mention to use something along the lines of myString.split("\\s+");. Which would ignore spaces and tabs to grab Hello and World. That worked wonderfully well, but for some reason my code was grabbing ["", "Hello", "there."] The extra white space in front of hello was throwing me off. Turns out it was an empty string getting added because of leading white space, and I wasn't properly skipping the empty string so it was getting added. So I needed to skip if the trimmed word is empty. As for another issue, implementing the randomWord method had its hiccups. I used Stack Overflow to figure out how to generate a random word from the ArrayList. Which is a lot easier in Java than C++ so I am grateful.
    The easiest test to pass for me was constructor, obviously, and endsWithPunctuation. Those were two freebies for me. As for what I'm most proud of completing was getting rid of that white space in front of "Hello there." That opened up all my other tests to be completable and it was a snowball effect from there.
    For week one we worked on a lot of stuff, learning about encapsulation, generics, try/catch. I spent way more than 45 minutes on Codingbat work. Getting used to the Java language and its different commands, I can use so I'm grateful. It was useful, especially for HW1 Markov, which dealt with a lot of strings. Then getting used to UML diagrams and JUnit Testcases. Then getting started on the enormous project of Legally Distinct Pocket Monsters. I'm getting more familiar with IntelliJ and Git. I don't really like the command console, although I think it looks cool, so maybe I will try to pick it up more down the line. 

Comments

Popular posts from this blog

Week 1

Week 4

Week 2