Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

arraysweeper

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

arraysweeper

A array based implementation of a minesweeper board. Can be used via a browserconsole or the command line via node JS. The main intended purpose of this is to provide the board, and logic to implement a traditional minesweeper game using the api.

  • 0.0.6
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
8
increased by700%
Maintainers
1
Weekly downloads
 
Created
Source

ArraySweeper

A module for creating an array based minesweeper game.


ArraySweeper.module:ArraySweeper(height, width, count)

A module for creating an array based minesweeper game.

Parameters

height: number, Height of the board to create.

width: number, Width of the board to create.

count: number, The number of mines to place on the board.

ArraySweeper.mineCount(row, col)

Get the mine count for the current space

Parameters

row: number, The row number for the space.

col: number, The column number for the space.

ArraySweeper.flag(row, col, state)

Get or set the flag status of the space

Parameters

row: number, The row number for the space.

col: number, The column number for the space.

state: boolean, OPTIONAL if included set the flag state for space other wise get it.

ArraySweeper.reveal(row, col)

Reveal the space

Parameters

row: number, The row number for the space.

col: number, The column number for the space.

ArraySweeper.render()

Render the board - This logs a textual representation to the console

ArraySweeper.getBoard()

Get the board object - This should not be used by players only when implementing the api DONT CHEAT :-)


Keywords

FAQs

Package last updated on 13 Jul 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc