Skip to content

minesweeper: remove number from input, add mines#456

Merged
petertseng merged 1 commit intoexercism:masterfrom
petertseng:minesweeper
Nov 29, 2016
Merged

minesweeper: remove number from input, add mines#456
petertseng merged 1 commit intoexercism:masterfrom
petertseng:minesweeper

Conversation

@petertseng
Copy link
Copy Markdown
Member

an input containing only "8" implies that the student solution is
supposed to read a board with numbers and fill in the mines, which is
contrary to all other tests (read a board with mines, fill in the
numbers)

an input containing only "8" implies that the student solution is
supposed to read a board with numbers and fill in the mines, which is
contrary to all other tests (read a board with mines, fill in the
numbers)
Copy link
Copy Markdown
Contributor

@rbasso rbasso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch!

@petertseng petertseng merged commit c59c2c4 into exercism:master Nov 29, 2016
@petertseng petertseng deleted the minesweeper branch November 29, 2016 09:19
@petertseng
Copy link
Copy Markdown
Member Author

petertseng commented Nov 29, 2016

Found with:

require 'json'

json = JSON.parse(IO.read('canonical-data.json'))

json['cases'].each { |c|
  input = c['input']
  output = c['expected']
  clean = output.map { |l| l.gsub(/\d/, ' ') }

  raise "Nope on #{c}, got #{clean}" if clean != input
}

https://github.com/petertseng/x-common/blob/verify/exercises/minesweeper/verify.rb

@stevejb71
Copy link
Copy Markdown
Contributor

That was a good catch. Is the verify script something that could be added to the CI build?

emcoding pushed a commit that referenced this pull request Nov 19, 2018
Replace hard-coded Bowling tests with test generator (#456)
Also updated the example solution to address new test case
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants