Minesweeper Board Generator

Example Beginner board (Format: 9x9, 10 mines)
Minesweeper is a logic puzzle game where "mines" are randomly hidden among a board of indistinguishable tiles, or cells.
Clicking on a cell will reveal the contents underneath, with 1 of 3 possibilities:
1. The cell contains a mine. Opening a mine cell results in a game loss. These cells are painted red by the generator.
2. The cell does not contain a mine and displays a number ranging 1-8. This represents the number of mines adjacent/diagonal to that cell.
These cells are painted green by the generator, or blue if connected to a blank cell.
3. The cell does not contain a mine and is blank, meaning there are no mines adjacent/diagonal to that cell. Opening a blank cell also opens all adjacent/diagonal cells.
These cells are painted blue by the generator.
The game is won by revealing all non-mine cells.
A rough estimate of board difficulty is given by 3BV (Bechtel's Board Benchmark Value), which is the minimum number of left clicks required to win the board.

Example Intermediate board (Format: 16x16, 40 mines)
Until I A) rewrite this script in JavaScript or B) figure out how to execute Python in browser, you'll need to download it.
Note: Your terminal must support ANSI escape sequences and 24-bit color.
Download Script
P.S. Curious about my times?
2.19 + 16.76 + 58.39 = 77.34
My Minesweeper Online profile

Example Expert board (Format: 30x16, 99 mines)