This is code that is accompanying the blog post at https://radanskoric.com/experiments/minesweeper-100-lines-of-clean-ruby.
To play it, clone the repository and run it with:
ruby lib/play.rb 20, 10, 20
Parameters are: width, height, number of mines.