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

quoridor

Package Overview
Dependencies
Maintainers
1
Versions
58
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

quoridor - npm Package Compare versions

Comparing version 1.7.0 to 1.7.1

lib/consts.d.ts

16

lib/utils.js

@@ -10,2 +10,3 @@ "use strict";

var aStar_1 = require("./aStar");
var consts_1 = require("./consts");
var getTurn_1 = require("./getTurn");

@@ -976,2 +977,5 @@ var makeUnvalidatedMove_1 = require("./makeUnvalidatedMove");

var overlapsWall = function (game, wallMove) {
var numberOfPlacedWalls = getNumberOfPlacedWalls(game);
if (numberOfPlacedWalls === 0)
return false;
var x = exports.getHorizontalCoordinate(wallMove);

@@ -1206,2 +1210,5 @@ var y = exports.getVerticalCoordinate(wallMove);

};
var getNumberOfPlacedWalls = function (game) {
return 20 - game.playerWallCounts[1] - game.playerWallCounts[2];
};
var getValidWallMoveArray = function (game) {

@@ -1216,5 +1223,8 @@ if (game.playerWallCounts[getTurn_1.getTurn(game)] < 1) {

var allWallMoves = getAllWallMoves().map(function (moveObject) { return exports.moveObjectToMove(moveObject); });
// The first placed wall can never be invalid, so no need to check for validity
if (game.playerWallCounts[1] === 10 && game.playerWallCounts[2] === 10) {
return allWallMoves;
var numberOfPlacedWalls = getNumberOfPlacedWalls(game);
if (numberOfPlacedWalls <= 2) {
if (!consts_1.possiblyTrappedPositions[(numberOfPlacedWalls + 1)].includes(exports.moveObjectToMove(game.playerPositions[1])) &&
!consts_1.possiblyTrappedPositions[(numberOfPlacedWalls + 1)].includes(exports.moveObjectToMove(game.playerPositions[2]))) {
return allWallMoves.filter(function (wallMove) { return !overlapsWall(game, wallMove); });
}
}

@@ -1221,0 +1231,0 @@ var thisPlayersShortestPath = exports.shortestPath(game, thisTurn);

2

package.json
{
"name": "quoridor",
"version": "1.7.0",
"version": "1.7.1",
"description": "A JavaScipt Quoridor library for move validation etc.",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

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