CST338 Week 2
This week I worked on a Markov text generator and had fun with the assignments use of data structure interaction. The interesting parts was working with nested data structures, specifically using an ArrayList within a HashMap. It was satisfying to see how the program could build and store chains of words efficiently, leading to some surprisingly coherent (and sometimes hilarious) generated text.
The most challenging unit test for me was addBadLineTest(), but not because of any deep logical error just a small oversight. I had correctly stripped whitespace from each input line but accidentally used the untrimmed version of the string when passing it to the addWord() method. Once I realized my mistake, it was an easy fix. The overall project only took a couple of hours and it was a fun way to get more practice with HashMaps.
Overall, it was a fun and productive first week, and I’m looking forward to tackling more challenges in the coming assignments!
Comments
Post a Comment