Peafowl

🀄️ Play Japanese Mahjong in Swift
Alternatives To Peafowl
Project NameStarsDownloadsRepos Using ThisPackages Using ThisMost Recent CommitTotal ReleasesLatest ReleaseOpen IssuesLicenseLanguage
Mahjongai110
2 years ago3gpl-3.0C#
A Japanese Mahjong AI, which can play Mahjong on two online Japanese Mahjong services. It can easily defeat other players in 一般 (Normal level) games and also plays well in 上級 (High level) games.
Peafowl90
5 years agomitSwift
:mahjong: Play Japanese Mahjong in Swift
Prefab_in_prefab39
9 years ago8C#
[deprecated]
Emacs Trr17
4 years agoEmacs Lisp
a type-writing training program on GNU Emacs
Mahjong4rl11
2 years ago5mitPython
Mahjong4RL is a project that recreates the game of Japanese Mahjong and use deep reinforcement learning to play it.
Now Playing For Google Play Music9
a year ago14mitTypeScript
#NowPlaying for YouTube Music
Mjaigym7
a year agootherPython
Aquabutton Android5
3 years agogpl-3.0Kotlin
⚓ Click to play こんあくあ
Shiritori3
5 years agoRuby
Alternatives To Peafowl
Select To Compare


Alternative Project Comparisons
Readme

Peafowl

Build Status Language Carthage compatible Platform iOS|macOS License

🀄️ Peafowl is a score calculation library to play Japanese Mahjong!

Usage

// You can define hand as an array literal.
// Last tile will be picked tile.
let hand: Hand = [二萬, 二萬, 三萬, 四萬, 四萬, 五萬, 五萬, 二索, 三索, 四索, 二筒, 三筒, 四筒, 三萬]

let context = GameContext()
let score = scoreCalculator.calculate(with: hand, context: context)
let describer = ScoreDescriber()
let scoreReport = describer.describe(score!)

Playground

You'll get score reports.

三色同順 2
一盃口 1
ツモ 1
断ヤオ 1
30符5飜 満貫 8000点

GameContext

You can define game states on GameContext struct. (e.g. prevalent wind, seat wind, dora, riichi state or others...)

let gameContext = GameContext(winningType: .selfPick, // 自摸和了、ロン和了
                              pickedSource: .wall, // 第1順, 山, 河底, 嶺上牌
                              riichiStyle: .single, // 立直, ダブル立直
                              isOneShot: false, // 一発
                              isDealer: false, // 親
                              prevalantWind: 東, // 場風
                              seatWind: 南, // 自風
                              dora: [五萬]) // ドラ

Required

  • Swift 4.2
  • Xcode 10 beta 6 (Recommended)
  • or Xcode 9.4.1 + Some Swift 4.2 toolchain

Playground

You can try Peafowl on Xcode Playground.

  1. Clone this
  2. Open Peafowl.xcworkspace
  3. Open Peafowl.xcplayground

Installation

github "giginet/Peafowl"

Known limitation

  • [ ] Pung and Chow are partially supported
  • [ ] Not support Kong system
    • [ ] Related yaku (e.g. 槍槓、三槓子, 四槓子)

Acknowledgement

Tile images are provided from here.

Popular Japanese Projects
Popular Play Framework Projects
Popular Community Categories

Get A Weekly Email With Trending Projects For These Categories
No Spam. Unsubscribe easily at any time.
Swift
Play
Xcode
Japanese