Question: 1 Overview This assignment requires you to work on the design for the Battleship program, which will is not the next Long problem, but the
1 Overview This assignment requires you to work on the design for the Battleship program, which will is not the next Long problem, but the one after that (so that your TA will have time to grade your design, and give you feedback on it). Go read the spec for the long problem first, before you start on this project. 2 What You Must Discuss Your design document must give a good summary of how the various classes will interact. In particular, how will the Board and Ship classes interact? What does add_ship do? When a player makes moves (on the Board object), how is the Ship notified that it has been hit? What are the private attributes, and the public methods, that you plan to implement for each of the two classes? How will data be stored? How will the board be represented? (Think about this one for a bit, it's more complex than you probably realize at first.) How will the ships be represented? How will you keep track of what spaces on the board have been shot at, and how will you keep track of what portions of which ship have been hit? How will you, when printing out the board, know to print Xs (when a ship has been sunk) instead of 's (when just invididual spaces have been hit)? How will you implement the rotate() function? Do you see a pattern about how values change as a piece is rotated? A good design docuemtn will be at least one page, probably closer to two), Diagrams will probably help to make things clearer; they aren't formally re- quired, but I encourage you to use them. 3 What You Must Turn In You must turn in a PDF to GradeScope. Other file formats will not be accepted. 1 Overview This assignment requires you to work on the design for the Battleship program, which will is not the next Long problem, but the one after that (so that your TA will have time to grade your design, and give you feedback on it). Go read the spec for the long problem first, before you start on this project. 2 What You Must Discuss Your design document must give a good summary of how the various classes will interact. In particular, how will the Board and Ship classes interact? What does add_ship do? When a player makes moves (on the Board object), how is the Ship notified that it has been hit? What are the private attributes, and the public methods, that you plan to implement for each of the two classes? How will data be stored? How will the board be represented? (Think about this one for a bit, it's more complex than you probably realize at first.) How will the ships be represented? How will you keep track of what spaces on the board have been shot at, and how will you keep track of what portions of which ship have been hit? How will you, when printing out the board, know to print Xs (when a ship has been sunk) instead of 's (when just invididual spaces have been hit)? How will you implement the rotate() function? Do you see a pattern about how values change as a piece is rotated? A good design docuemtn will be at least one page, probably closer to two), Diagrams will probably help to make things clearer; they aren't formally re- quired, but I encourage you to use them. 3 What You Must Turn In You must turn in a PDF to GradeScope. Other file formats will not be accepted
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
