minesweeper-on-cli

1.7.1 • Public • Published

Minesweeper On CLI

Description

Play minesweeper on the command line. You can play either ascii character mode or unicode symbol mode depending on the font style supported by your terminal. Node.js is required. You can also play it using npm or npx.

Emoji version

screenshot-6

ASCII version

screenshot-4

Usage

Arguments

Has two optional arguments:

  • size Default value is 10. Can be any integer value greater than 1. Sets the board dimensions as size * size. Can be supplied using --size=20.
  • mines Default value is 10. Can be positive integer value. Sets the number of mines on board. More mines for higher difficulty. Can be supplied using --mines=20.
Method 1
  • Clone the repository.
  • Open the folder.
  • Execute using Node.js: node index
  • Follow the prompts on screen.
  • Use Arrow Keys to move cursor and Enter or Spacebar for actions.
Method 2
  • Open terminal.
  • Execute npx minesweeper-on-cli
  • Enter y when prompted.
Method 3
  • Open terminal in a folder containing npm.
  • Execute npm i minesweeper-on-cli
  • Create a .js file with code:
    const minePretty = require('minesweeper-on-cli/minesweeper-pretty')
    const mineAscii = require('minesweeper-on-cli/minesweeper-ascii')
    
    let size= 10
    let mines= 10
    minePretty(size, mines)
    // mineAscii(size, mines)

Package Sidebar

Install

npm i minesweeper-on-cli

Weekly Downloads

1

Version

1.7.1

License

ISC

Unpacked Size

60.6 kB

Total Files

7

Last publish

Collaborators

  • 01dc