{"_id":"@anarchy_zzh/goboard","_rev":"2-351e5fb5626c9da6ec9f400179057b46","name":"@anarchy_zzh/goboard","dist-tags":{"latest":"0.1.1"},"versions":{"0.1.0":{"version":"0.1.0","license":"MIT","main":"dist/index.js","typings":"dist/index.d.ts","engines":{"node":">=10"},"scripts":{"start":"tsdx watch","build":"tsdx build","test":"tsdx test","lint":"tsdx lint","prepare":"tsdx build","size":"size-limit","analyze":"size-limit --why"},"peerDependencies":{},"husky":{"hooks":{"pre-commit":"tsdx lint"}},"prettier":{"printWidth":80,"semi":false,"singleQuote":false,"trailingComma":"es5"},"name":"@anarchy_zzh/goboard","author":{"name":"zzh"},"module":"dist/goboard.esm.js","size-limit":[{"path":"dist/goboard.cjs.production.min.js","limit":"10 KB"},{"path":"dist/goboard.esm.js","limit":"10 KB"}],"devDependencies":{"@size-limit/preset-small-lib":"^4.9.2","husky":"^5.0.9","size-limit":"^4.9.2","tsdx":"^0.14.1","tslib":"^2.1.0","typescript":"^4.1.5"},"description":"Congrats! You just saved yourself hours of work by bootstrapping this project with TSDX. Let’s get you oriented with what’s here and how to use it.","_id":"@anarchy_zzh/goboard@0.1.0","_nodeVersion":"12.18.1","_npmVersion":"6.14.5","dist":{"integrity":"sha512-kuzaSpe1JLSDAGbOnr6Sbk4gZexNy2akyKSzMxxrOltscCMHGdbIw4TiV0cnBVPOsQDao0iZ6T4b6QmrLQrDNg==","shasum":"a3321dffbf65d7706ce3158dc9fc32174adda0f8","tarball":"https://registry.npmjs.org/@anarchy_zzh/goboard/-/goboard-0.1.0.tgz","fileCount":14,"unpackedSize":47337,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgJN6BCRA9TVsSAnZWagAA6tgP/1gqYB5cTG5aKsUskp08\nxKzjHtYgpZPPvnvtmYm5bs8pZDWbgbt67xDALEc0GyC2ogS4EGr0Z1aY8AEN\nSaPgEqDqPLhcDl5hfNiuxwzopKdqtPHDIIRkK2yU6bUxMzs8UKP59oaWTvg4\nEByC5YnmpzaGOzC4F1vbfM+gKxF9MRB6b2PXdMpfTA1braNSMZT0KT5yUL+s\nmYS9Gau7OwW9CBcqA10QvbXVYfXA3yLbwkwtamqL2/Skge29Y3TFDaVJPcD4\nsJtw//iCicI9Hztik2uHXJSxhHXGsbrsVQ7cMmSf4QRPmzBAOE7HM+xHjAWO\nU5wBgiJpWke4iY3geGp2CpxzmARrce1Z/rO5xGVdd1VDBt3Pk6O9VnJXVypB\nB8G6QBjCeq9H/WwAF7Acv0En4otgEOPcZroKr2yjSl0jsR0WvwG5Fr8MAhld\nGBzK26UDAZHxrVXRxs8hnVszSRcIA4m8MftmajXKYBZQ3CicKQptswgD8Y4H\nd3RzjDH/n3OEqd1VE7/Bb+Bv3fl5KUbBVyj38F43Sa73Ma5H7PmZQGYNKkkR\n3Ri4oACPCXnRVmp6IfQ/zDdbhHJadxqKUiTDgkFpdFpav4y2bA0Jd7tYQnsO\nvBeJEp2Ny3NX5c9p63F2hfD0I/O7ESyo/A/93y/C15zw1aXgN3mw0YcMc5ts\nYmRR\r\n=uMVY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAezlTwRrJanrrWdw48/ZuqwBP2TdeFm9qXyll3LQXpZAiBjTYM0NkBSNQP/6gezkB1QhUSu3AP7X2/zcSsdisepKA=="}]},"_npmUser":{"name":"anarchy_zzh","email":"951202500@qq.com"},"directories":{},"maintainers":[{"name":"anarchy_zzh","email":"951202500@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/goboard_0.1.0_1613028992731_0.20031727077722605"},"_hasShrinkwrap":false},"0.1.1":{"version":"0.1.1","license":"MIT","main":"dist/index.js","typings":"dist/index.d.ts","engines":{"node":">=10"},"scripts":{"start":"tsdx watch","build":"tsdx build","test":"tsdx test","lint":"tsdx lint","prepare":"tsdx build","size":"size-limit","analyze":"size-limit --why"},"peerDependencies":{},"husky":{"hooks":{"pre-commit":"tsdx lint"}},"prettier":{"printWidth":80,"semi":false,"singleQuote":false,"trailingComma":"es5"},"name":"@anarchy_zzh/goboard","author":{"name":"zzh"},"module":"dist/goboard.esm.js","size-limit":[{"path":"dist/goboard.cjs.production.min.js","limit":"10 KB"},{"path":"dist/goboard.esm.js","limit":"10 KB"}],"devDependencies":{"@size-limit/preset-small-lib":"^4.9.2","husky":"^5.0.9","size-limit":"^4.9.2","tsdx":"^0.14.1","tslib":"^2.1.0","typescript":"^4.1.5"},"gitHead":"b21283fc1cf836e7ae96b5f30e92813f02284c45","description":"A Go board data type.","_id":"@anarchy_zzh/goboard@0.1.1","_nodeVersion":"12.18.1","_npmVersion":"6.14.5","dist":{"integrity":"sha512-R7KhCOycKucNyyWxieHSNbm2BA1Yrh8gef2njRAIY9IJBm7Jgb7672b55JhX3y13OnSq8n7pBEusVUCUjbJ+iw==","shasum":"47d2d5ae4e2d8611633457ebf80b74fbeed41ae5","tarball":"https://registry.npmjs.org/@anarchy_zzh/goboard/-/goboard-0.1.1.tgz","fileCount":14,"unpackedSize":47495,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgJOQlCRA9TVsSAnZWagAAHRsP/1MrZyZcwM7DGezKykiE\n8umzNrEb+irr4+7HTmjit6GpbBu/AlNs5Gux1MRliFiYLgmgwWrFsd1pciA6\nKemgxBqnCsufW1PlBP/8PJXB08bMjP4YG0+l4dmAuUCZvYNAtCZjxop7D9AH\nJLlTz7MuXIiE4qrYaXU2ohCDZArgM3/bePgfB5sA6lyIUQG6WyeuySgH63AJ\neO4D++M+7ZK7+pkDzRQ1LvWFpPd1K/ANYlHW3llUzK6d5OH2reetaLKnYhAT\nRF8GV22RwWF94jv+yQMtdvsRnIgL/aTFM49fkPSPeJORnLAmoTYDhBKO9n7U\nlhwo8exFX2HjpBL3sEJXLtuRNXawESeDYQHWuI7LuAJ2gK851ROXgobjPaPg\nb6iN0h/DkhLj2MXRLu9BsVVRjFWM8Pl+ZPxELbglZfJL8WaHzXksAoMtLXf7\nuy7OuO+/W7uKPykh+DjJaCPEZADCoBGBuscJDJp4vc3u6WmGvnMw73+jvAKb\nktvacEFhOU8FCUIw3KKRHWqDPSUkrG71btUqEaQQtVDyZHe6qGecVWxQAPFt\n+OuPa+6kY6sixGJjchyI6NAmOQJ6hmXUqMUYOp+23c3SNSwtIyCVFNhPyVcW\n8cOiKGO3ZL5G1ABKHlSpCyp44NJKPWPpt5GK6lJ6UaYTP9rZ3rfIAIBi5BDJ\nV1ry\r\n=kvQR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEtbd+LtRk+Qxi+RgFeo0rFCu0gjmrzA7LWgW2Ch1oDbAiEAhvBGTyMudAeZe3/FAgfOmWJeoDxvspZBuCbROAIXn+I="}]},"_npmUser":{"name":"anarchy_zzh","email":"951202500@qq.com"},"directories":{},"maintainers":[{"name":"anarchy_zzh","email":"951202500@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/goboard_0.1.1_1613030436756_0.8197107894451767"},"_hasShrinkwrap":false}},"time":{"created":"2021-02-11T07:36:32.667Z","0.1.0":"2021-02-11T07:36:32.846Z","modified":"2022-04-04T13:55:28.811Z","0.1.1":"2021-02-11T08:00:36.890Z"},"maintainers":[{"name":"anarchy_zzh","email":"951202500@qq.com"}],"description":"A Go board data type.","author":{"name":"zzh"},"license":"MIT","readme":"# @anarchy_zzh/goboard\n\nA Go board data type.\n\n## Installation\n\nUse npm to install:\n\n~~~\n$ npm install @anarchy_zzh/goboard\n~~~\n\n## Usage\n\n~~~js\nconst goBoard = require('@anarchy_zzh/goboard')\nlet board = new Board([\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-1,-1, 1, 1, 1, 1,-1,-1,-1],\n    [ 0, 0, 1, 1,-1, 1, 1,-1, 0,-1,-1, 1, 1, 1, 1, 0, 1,-1, 1],\n    [ 0, 0, 0, 1,-1,-1,-1,-1,-1, 0,-1,-1, 1, 1, 0, 1, 1, 1, 0]\n])\nlet move = board.putChess([9, 4], 1)\n~~~\n\n## API\n\n### board\n\nThe board arrangement is represented by an array of arrays. Each of those subarrays represent one row, all containing the same number of integers. `-1` denotes a white stone, `1` a black stone, and `0` represents an empty vertex.\n\n#### Example\n\n~~~js\n[[ 0, 0, 1, 0,-1,-1, 1, 0, 0],\n [ 1, 0, 1,-1,-1, 1, 1, 1, 0],\n [ 0, 0, 1,-1, 0, 1,-1,-1, 0],\n [ 1, 1, 1,-1,-1,-1, 1,-1, 0],\n [ 1,-1, 1, 1,-1, 1, 1, 1, 0],\n [-1,-1,-1,-1,-1, 1, 0, 0, 0],\n [ 0,-1,-1, 0,-1, 1, 1, 1, 1],\n [ 0, 0, 0, 0, 0,-1,-1,-1, 1],\n [ 0, 0, 0, 0, 0, 0, 0,-1, 0]]\n~~~\n\n### Vertex\n\nBoard positions are represented by a vertex, i.e. an array of the form `[x, y]` where `x` and `y` are non-negative integers, zero-based coordinates. `[0, 0]` denotes the upper left position of the board.\n\n---\n\n### `class goBoard`\n\n#### Constructors\n\n##### `new Board(size, [signMap])`\n\n- `signMap` [`<BoardArr>`](#sign-map) *(optional)* - Default: `[]`\n\n\n#### Properties\n\n##### `board.board`\n\n[`<BoardArr>`](#sign-map) - The underlying sign map of the board.\n\n\n#### Stone Arrangement Functions\n\n##### `board.get(vertex)`\n\n- `vertex` [`<Vertex>`](#vertex)\n\nReturns the sign at the given `vertex`.\n\n##### `board.set(vertex, sign)`\n\n- `vertex` [`<Vertex>`](#vertex)\n- `sign` `<Integer>` - One of `-1`, `0`, or `1`\n\nSets the sign at the given `vertex`. No validity checks will be made. This function mutates the board and returns `this` to enable chaining.\n\n##### `board.has(vertex)`\n\n- `vertex` [`<Vertex>`](#vertex)\n\nReturns a boolean whether the given `vertex` is valid or can be found on the board.\n\n##### `board.putChess(vertex, sign)`\n\n- `sign` `<Integer>` - One of `-1`, `0`, or `1`\n- `vertex` [`<Vertex>`](#vertex)\n\nReturns a new board instance that represents the board state after the player who corresponds to the given `sign` makes a move at `vertex`. The capture count will also be updated correctly. If `board` is [valid](#boardisvalid) then the new returned board instance will also be valid. This function will not mutate `board`. If `sign` is `0` or `vertex` not valid, this function will be equivalent to [`clone()`](#boardclone).\n\n\n","readmeFilename":"README.md"}