Socket
Socket
Sign inDemoInstall

chessboard-engine

Package Overview
Dependencies
0
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.0.8 to 0.0.9

5

main.js

@@ -256,5 +256,6 @@ "use strict";

field: target,
coords: [i, gameInstance.board[rows[i]].length - target[1]]
coords: [i, gameInstance.board[rows[i]].length - target[1]],
hit: getPiece(move.to)
}
result[relation == "targets" ? "hit" : "attacker"] = relation == "targets" ? (getPiece(move.to) === "empty" ? false : getPiece(move.to)) : getPiece(move.from)
if (relation === "attacks") result = getPiece(move.from)
targets.push(result)

@@ -261,0 +262,0 @@ }

2

package.json
{
"name": "chessboard-engine",
"version": "0.0.8",
"version": "0.0.9",
"description": "Chessboard controller",

@@ -5,0 +5,0 @@ "keywords": [

@@ -51,32 +51,32 @@ # Chessboard

pieces: [
{ type: "farmer", color: "black" }, // ID: 0
{ type: "farmer", color: "black" }, // ID: 1
{ type: "farmer", color: "black" }, // ID: 2
{ type: "farmer", color: "black" }, // ID: 3
{ type: "farmer", color: "black" }, // ID: ...
{ type: "farmer", color: "black" }, // ...
{ type: "farmer", color: "black" },
{ type: "farmer", color: "black" },
{ type: "tower", color: "black" },
{ type: "tower", color: "black" },
{ type: "jumper", color: "black" },
{ type: "jumper", color: "black" },
{ type: "runner", color: "black" },
{ type: "runner", color: "black" },
{ type: "pawn", color: "black" }, // ID: 0
{ type: "pawn", color: "black" }, // ID: 1
{ type: "pawn", color: "black" }, // ID: 2
{ type: "pawn", color: "black" }, // ID: 3
{ type: "pawn", color: "black" }, // ID: ...
{ type: "pawn", color: "black" }, // ...
{ type: "pawn", color: "black" },
{ type: "pawn", color: "black" },
{ type: "rook", color: "black" },
{ type: "rook", color: "black" },
{ type: "knight", color: "black" },
{ type: "knight", color: "black" },
{ type: "bishop", color: "black" },
{ type: "bishop", color: "black" },
{ type: "king", color: "black" },
{ type: "queen", color: "black" },
{ type: "farmer", color: "white" },
{ type: "farmer", color: "white" },
{ type: "farmer", color: "white" },
{ type: "farmer", color: "white" },
{ type: "farmer", color: "white" },
{ type: "farmer", color: "white" },
{ type: "farmer", color: "white" },
{ type: "farmer", color: "white" },
{ type: "tower", color: "white" },
{ type: "tower", color: "white" },
{ type: "jumper", color: "white" },
{ type: "jumper", color: "white" },
{ type: "runner", color: "white" },
{ type: "runner", color: "white" },
{ type: "pawn", color: "white" },
{ type: "pawn", color: "white" },
{ type: "pawn", color: "white" },
{ type: "pawn", color: "white" },
{ type: "pawn", color: "white" },
{ type: "pawn", color: "white" },
{ type: "pawn", color: "white" },
{ type: "pawn", color: "white" },
{ type: "rook", color: "white" },
{ type: "rook", color: "white" },
{ type: "knight", color: "white" },
{ type: "knight", color: "white" },
{ type: "bishop", color: "white" },
{ type: "bishop", color: "white" },
{ type: "king", color: "white" },

@@ -95,3 +95,3 @@ { type: "queen", color: "white" },

rules: {
farmer: {
pawn: {
directions: ["forward"],

@@ -102,3 +102,3 @@ ratio: [0],

},
tower: {
rook: {
directions: ["forward", "backward", "left", "right"],

@@ -109,3 +109,3 @@ ratio: [0],

},
jumper: {
knight: {
directions: ["forward", "backward", "left", "right"],

@@ -116,3 +116,3 @@ ratio: [0.5, 2],

},
runner: {
bishop: {
directions: ["forward", "backward", "left", "right"],

@@ -144,4 +144,4 @@ ratio: [1],

directions: [Array], // All allowed directions for the movement. | "forward" || "backward" || "left" || "right"
ratio: [Array], // All allowed ratios (X / Y proportion) | 0 = straight into one direction (Tower) | 1 = bidirectional (Runner) | 0.5/2 = Jumper
max: [Number], // Maximum amount of steps to go | Farmer = 1 | King = 1 | Jumper = 2
ratio: [Array], // All allowed ratios (X / Y proportion) | 0 = straight into one direction (rook) | 1 = bidirectional (bishop) | 0.5/2 = knight
max: [Number], // Maximum amount of steps to go | pawn = 1 | King = 1 | knight = 2
jump: [Boolean], // If jumping is allowed | Means that it's not necessary if the way to the target field is clear

@@ -148,0 +148,0 @@ special: [Array] // Containing special functions to control a complex kind of rule. You'll find more information about the way how this functions work below

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc