Skip to content

Minesweeper: deviance from problem specs and other tweaks #2046

Closed
@andrerfcsantos

Description

@andrerfcsantos

I noticed the Minesweeper exercise deviates from the problem specs in a way that is not documented. The original exercise asks the student the student to fill each square of a board with the number of mines adjacent to that square. The Go version of the exercise deviates from this spec by adding a border to the board. However, there's nothing in the description talking about this additional border. The tests check if the border is "correct", without explicit saying what makes a border correct (the student has to look at the tests and do some guesswork).

Overall, this exercise feels like it could use "more love". What I think we should look at:

  • Decide if we want to keep the deviance from problem specs or not. If we want to keep it, we must include an additional description mentioning the board border and we should add more custom tests checking if the border is correct (as of right now, they allow some incorrect borders). I think we should adhere to the problem specs, as I don't think adding a border to the board adds much to the exercise, but I'm interested to see other opinions.
  • Improve the tests organization. Might be worth to organize the tests into named sub-tests that can be picked up by the test runner, like what happens with other exercises. This would improve the experience for someone using the online editor and the testing experience in general.
  • The board is a [][]byte, which I find a bit weird, not sure if anyone else feels the same. Seems like a more natural choice would be [][]rune. For some solutions this makes no difference, but there are other solutions where students make smaller functions, and I find a bit weird seeing them receiving bytes representing characters of the board. I feel like working with runes would be more appropriate.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions