Skip to content

Commit

Permalink
Merge branch 'release/v0.4.6'
Browse files Browse the repository at this point in the history
  • Loading branch information
kobalab committed Sep 15, 2022
2 parents 5908590 + 12615de commit a8e12ac
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 22 deletions.
6 changes: 6 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
### v0.4.6 / 2022-09-15

- 九蓮宝燈形の和了形の考慮が漏れていたバグを修正
- @kobalab/majiang-core 0.2.4 → 0.2.11
- 脆弱性警告に対処(minimist 1.2.5 → 1.2.6)

### v0.4.5 / 2022-03-19

- examples を追加
Expand Down
11 changes: 6 additions & 5 deletions examples/hule_pattern.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,12 @@ function get_pattern(board, l, p, paishu) {
*/
function get_tingpai_type(shoupai, p) {
const get_type = (m)=>
m.match(/^[mpsz](\d)\1_!$/) ? 0 // 単騎
: m.match(/^[mpsz](\d)\1\1_!$/) ? 1 // 双碰
: m.match(/^[mps]\d\d_!\d$/) ? 2 // 嵌張
: m.match(/^[mps](123_!|7_!89)$/) ? 3 // 辺張
: 4; // 両面
m.match(/^[mps]\d{14}_!$/) ? -1 // 九蓮宝燈
: m.match(/^[mpsz](\d)\1_!$/) ? 0 // 単騎
: m.match(/^[mpsz](\d)\1\1_!$/) ? 1 // 双碰
: m.match(/^[mps]\d\d_!\d$/) ? 2 // 嵌張
: m.match(/^[mps](123_!|7_!89)$/) ? 3 // 辺張
: 4; // 両面
return TINGPAI_TYPE[
Math.max(... Majiang.Util.hule_mianzi(shoupai.clone().zimo(p))
.map(mm=>get_type(mm.find(m=>m.match(/\!/))))) ];
Expand Down
30 changes: 15 additions & 15 deletions package-lock.json

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

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@kobalab/majiang-analog",
"version": "0.4.5",
"version": "0.4.6",
"description": "電脳麻将牌譜解析ツール",
"publishConfig": {
"access": "public"
Expand Down Expand Up @@ -31,6 +31,6 @@
"yargs": "^17.2.1"
},
"dependencies": {
"@kobalab/majiang-core": "^0.2.4"
"@kobalab/majiang-core": "^0.2.11"
}
}

0 comments on commit a8e12ac

Please sign in to comment.