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 - npm Package Compare versions

Comparing version 0.0.5 to 0.0.6

26

index.js

@@ -6,3 +6,3 @@ // This just supports loading in any enviroment

* A module for creating an array based minesweeper game.
* @module ArraySweeper
* @module Arraysweeper
*/

@@ -13,7 +13,7 @@ define( [], factory );

} else {
root.ArraySweeper = factory();
root.Arraysweeper = factory();
}
}( this, function() {
/**
* @alias module:ArraySweeper
* @alias module:Arraysweeper
* @param {number} height - Height of the board to create.

@@ -23,3 +23,3 @@ * @param {number} width - Width of the board to create.

*/
var ArraySweeper = function( height, width, count ) {
var Arraysweeper = function( height, width, count ) {
this.height = height;

@@ -131,8 +131,12 @@ this.width = width;

for ( var r = row - 1 > 0 ? row - 1 : 0; r <= row + 1; r++ ) {
for ( var c = col - 1 > 0 ? col - 1 : 0; c <= col + 1; c++ ) {
for ( var r = row - 1 > 0 ? row - 1 : 0; r <= row + 1 && r < this.width; r++ ) {
for ( var c = col - 1 > 0 ? col - 1 : 0; c <= col + 1 && c < this.width; c++ ) {
console.log( row + ":" + col + " - " + r + "," + c );
console.log( col + 1 );
if ( r >= 0 && c >= 0 && r < this.height && c < this.width &&
this._board[ r ][ c ].count === 0 &&
this._board[ r ][ c ].state !== "revealed" &&
!this._board[ r ][ c ].bomb && pending.indexOf( r + "," + c ) === -1 ) {
!this._board[ r ][ c ].bomb &&
pending.indexOf( r + "," + c ) === -1 &&
( r !== row || c!== col ) ) {
this._board[ r ][ c ].state = "";

@@ -146,4 +150,4 @@ pending.push( r + "," + c );

this._reveal(
parts[ 0 ],
parts[ 1 ],
parseFloat( parts[ 0 ], 10 ),
parseFloat( parts[ 1 ], 10 ),
pending,

@@ -189,7 +193,7 @@ current + 1

for ( var i = 0; i < keys.length; i++ ) {
ArraySweeper.prototype[ keys[ i ] ] = arraysweeper[ keys[ i ] ];
Arraysweeper.prototype[ keys[ i ] ] = arraysweeper[ keys[ i ] ];
}
return ArraySweeper;
return Arraysweeper;
} ) );
{
"name": "arraysweeper",
"description": "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.",
"version": "0.0.5",
"version": "0.0.6",
"author": {

@@ -6,0 +6,0 @@ "name": "Alex Schmitz",

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