Project: Battleship - paired
Summary
Battleship is a partner project that introduces students to pairing through collaboration on building a battleship game. The game has multiple components, such as ships, cells, board, game, and runner. Using TDD (test driven design), partners build a battleship game in which a player plays with the computer. There are three main ways of pairing: driver/navigator, ping pong and distributed. For this particular project, my partner and I chose to pair as driver/navigator because it enabled each of us to play to our own individual strengths.
Overall
Throughout the project, I had one main goal: learn something. I met my goal by learning how to pair as driver/navigator, learning how to pair remotely, being exposed to the pair git workflow, gaining a greater understanding of TDD, and finally, learning the components of a lib and test file.
Technical
As my partner and I worked together, we came across a particular challenge that we felt important to address. The computer was simply too easy to beat. We increased its intelligence by helping the computer to remember the previous coordinate it shot at, and store that information somewhere, then go into hunting mode around that coordinate if it had hit something. First, we created a shallow copy of the coordinate utilizing the .dup method, then we realized we could do something more simple by giving it the parameters for valid coordinates around it, and randomly choosing the next coordinate to shoot at with the .sample method.
Reflection
Overall, this project incresed my knowledge about how to collaborate with others in the tech industry. It aided me in strengthening my communication and organizational skills, as well as taught me new skills. I plan to push myself to work more independently on the next project.