Skip to content

Commit

Permalink
Merge branch 'release/v0.1.7'
Browse files Browse the repository at this point in the history
  • Loading branch information
kobalab committed Dec 15, 2021
2 parents bf207a1 + 0618d5b commit 4b0686b
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 9 deletions.
5 changes: 5 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
### v0.1.7 / 2021-12-16

- Majiang.Player
- 和了牌の赤牌を見逃してもフリテンにならないバグを修正

### v0.1.6 / 2021-12-15

- Majiang.Game
Expand Down
2 changes: 1 addition & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* @kobalab/majiang-core v0.1.6
* @kobalab/majiang-core v0.1.7
*
* Copyright(C) 2021 Satoshi Kobayashi
* Released under the MIT license
Expand Down
3 changes: 2 additions & 1 deletion lib/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ module.exports = class Player {
if (this.hulepai.find(p=> this.he.find(p))) this._neng_rong = false;
}
else {
if (this.hulepai.find(p=> p == dapai.p)) this._neng_rong = false;
let s = dapai.p[0], n = +dapai.p[1]||5;
if (this.hulepai.find(p=> p == s+n)) this._neng_rong = false;
}
}

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@kobalab/majiang-core",
"version": "0.1.6",
"version": "0.1.7",
"description": "麻雀基本ライブラリ",
"publishConfig": {
"access": "public"
Expand Down
8 changes: 4 additions & 4 deletions test/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ suite('Majiang.Player', ()=>{
assert.ok(! player._diyizimo);
});
test('自身の打牌に和了牌がある場合、フリテンとなること', ()=>{
const player = init_player({shoupai:'m123p456s789z11222'});
player.dapai({ l: 0, p: 'm1' });
const player = init_player({shoupai:'m123p406s789z11222'});
player.dapai({ l: 0, p: 'p0' });
assert.ok(! player._neng_rong);
});
test('自身の打牌でフリテンが解除されること', ()=>{
Expand All @@ -124,8 +124,8 @@ suite('Majiang.Player', ()=>{
assert.ok(! player._neng_rong);
});
test('和了牌を見逃した場合、フリテンとなること', ()=>{
const player = init_player({shoupai:'m123p456s789z1122'});
player.dapai({ l: 1, p: 'z1' });
const player = init_player({shoupai:'m123p46s789z11122'});
player.dapai({ l: 1, p: 'p0' });
assert.ok(! player._neng_rong);
});
});
Expand Down

0 comments on commit 4b0686b

Please sign in to comment.