Closed wavesinaroom closed 1 year ago
Sometimes I feel that debugging tests is a hurdle for the project. On one hand I've found myself spending way too much time on a task because the test itself is buggy and my code is alright, that's annoying. On the other hand, my code is a lot simpler and cleaner thanks to TDD which makes me think that writing test is an art itself that needs more of my time. In the meantime, I'm gonna keep going with a not so cool design for creating CPU cause I'd not like to debug Jest when I remove the CPU module
Basic firing cpu attack function has already been tested. I'm still deciding whether coding a more intelligent attack AI or not
I've already coded some lines of code in placeRandomShip function that effectively place a randomship but it's likely to dissapear cause there's a much more accurate way to place ship that are within board boundaries and off of tiles with ships
Tried to code a function that checks random coordinate surrounding to avoid random ship placement clashing. Then, I realized that'd already been covered in gameboard.js... funny thing. Maybe that happened because the project grew and I couldn't remember all it space immediately. That makes me think ahead of a way to document my progress to avoid delays in production. Perhaps, checking gh issue more often helps.
For now, I'll leave CPU and the rest of the scripts because further changes may come alongside the HTML and CSS production stages
The game is played against the computer, so make ‘computer’ players capable of making random plays. The AI does not have to be smart, but it should know whether or not a given move is legal. (i.e. it shouldn’t shoot the same coordinate twice).