Open saiema opened 8 years ago
@martinlopez this method sets the mines but doesn't increase the value of boardMines, this means that the amount of mines in the board is not equal to boardMines and this causes some tests to fail. Please fix this.
Also, according to the specification given by @saiema this method should allow the 0 and n arguments, right now this is throwing a IllegalArgumentException.
The tests created in this commit: 8038bc3 referenced by this issue: #124 should be modified accordingly to pass when the amount of mines is either 0 or n.
Please hurry up solving this issue!
Fixed in f56e25ed2dbf0df622582559b4ce7c0055b79824
Fixed the accepted range of the amount of mines in 6dd3880e95010b01f74960518d422ee2298e58db
The tests created in this commit: 8038bc3 referenced by this issue: #124 should be modified accordingly to pass when the amount of mines is either 0 or n.
Implement method
addRandomMines(int)
inMinesweeperBoard
that takes a integer value that represents how many mines to add to the board, and adds them in random coordinates.The method should check that the value is valid 0<=mines<=#(unblocked, not mined, and closed cells) and throw an
IllegalArgumentException
otherwise.