neu-cs4530 / spring24-project-team-208

spring24-project-team-208 created by GitHub Classroom
https://coveytownbattleship.onrender.com/
BSD 3-Clause "New" or "Revised" License
2 stars 0 forks source link

Implementing functionality to apply guess (applyMove) and testing #33

Closed rayanyedaly closed 6 months ago

rayanyedaly commented 6 months ago

Implemented the applyMove() function using existing code to check for wins. applyMove() does the following:

I also wrote a nearly complete test suite that I am hesitant to put in the PR until it's done. I need to write a couple more but I also have some questions regarding applying/validating moves that I'd like to clarify with the group:

  1. Is the backend meant to update the game state to record "Hits" and "Misses" or will that be handled by the controller in the frontend using the game state moves? If the former is true, then this is something applyMove() should probably handle and we'd have to add something to the class design to keep track of this.
  2. Should we be handling repeat guesses? Does that make sense in our design here?

Sorry, I hope that makes sense, just want to make sure I'm thinking of this correctly.

alinachiu commented 6 months ago

Looks good so far! I think the answer for question 1 is probably best to ask @nkosko21 since I'm not too familiar with how hits and misses are currently being displayed on the frontend. If there's already a workaround on the front end, then there shouldn't be a need to add additional gamestate info/backend logic. For question 2, based on the battleship rules document, I don't think our original design needs to handle repeat guesses, but this can be an extension that we add if we have time. Feel free to let me know what you all think.

rayanyedaly commented 6 months ago

OKsounds good, I'll wait to hear from @nkosko21 about the hits/misses.

rayanyedaly commented 6 months ago

Ok if the frontend handles the repeat guess, then no need to worry about it for applyMove().

As for the hits and misses, I'll continue writing tests for the current version of applyMove() I have and then once you submit your PR with the new version, I'll add tests for recording hits and misses.

rayanyedaly commented 6 months ago

Yup, sorry about that. Should be all set