Skip to content

01-DC/minesweeper-on-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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)

About

CLI based minesweeper game written in Javascript. NPM package is available as well. Can be directly executed using NPX.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published