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

acey-deucey-game-engine

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

acey-deucey-game-engine - npm Package Compare versions

Comparing version 1.1.0 to 1.1.1

6

lib/is-valid-move.js

@@ -25,6 +25,10 @@ "use strict";

if (activePlayer.barPieces && proposedMove.isBar === false) {
if (activePlayer.barPieces && !proposedMove.isBar) {
return false;
}
if (!activePlayer.barPieces && proposedMove.isBar) {
return false;
}
if ((isPlayerOne && proposedSpaceIndex > lastBoardSpace) ||

@@ -31,0 +35,0 @@ (!isPlayerOne && proposedSpaceIndex < firstBoardSpace)

2

package.json
{
"name": "acey-deucey-game-engine",
"version": "1.1.0",
"version": "1.1.1",
"description": "a game engine for the backgammon variant acey deucey",

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

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

const gameState = getInitialGameState();
gameState.playerOne.barPieces = 1;
const diceRoll = [5, 2];

@@ -105,2 +106,3 @@

gameState.isPlayerOne = false;
gameState.playerTwo.barPieces = 1;
const diceRoll = [5, 2];

@@ -107,0 +109,0 @@

@@ -295,3 +295,3 @@ "use strict";

t.test("player 1", t => {
t.plan(2);
t.plan(3);

@@ -319,7 +319,16 @@ const gameState = getInitialGameState();

"the move is not valid when player 1 has a piece on the bar but does not move it"
);
);
gameState.playerOne.barPieces = 0;
gameState.playerOne.initialPieces = 15;
t.equal(
isValidMove(gameState, proposedMoveFromBar),
false,
"the move is not valid when player 1 has no bar piece"
);
});
t.test("player 2", t => {
t.plan(2);
t.plan(3);

@@ -349,2 +358,11 @@ const gameState = getInitialGameState();

);
gameState.playerTwo.barPieces = 0;
gameState.playerTwo.initialPieces = 15;
t.equal(
isValidMove(gameState, proposedMoveFromBar),
false,
"the move is not valid when player 2 has no bar piece"
);
});

@@ -351,0 +369,0 @@

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