GithubHelp home page GithubHelp logo

mahjong's Introduction

Mahjong: OCaml Version

Game Description

Riichi Mahjong (Japanese: 麻雀 or マージャン; mājan; Mandarin: 麻将; Cantonese: 蔴雀) is a traditional four-player board game in Asia. People play this grame with their friends or family members during holidays to connect with each other and to have fun. It is known for its rich hidden infomation and scoring rules (types of yaku).

Running the Game

First, make sure you have OCaml 4.09.x and Ubuntu 18.04 or later for proper functionality and graphic display. Enter sudo apt install fonts-emojione to support emoji representation of tiles.

Then, from the terminal, navigate into the folder 'Mahjong' and type the command

make play

A message like above should appear in your terminal. Follow the instruction and type

start

to start playing the game.

When you win the game, "victory" and the yaku you formed shows up:)

Actions and commands

  • Discard a tile: discard Man 1

  • Chii: chii 1

  • Skip an action: skip

  • make build: builds everything in the app

  • make test: evaluates the test cases in src/test.ml.

  • make docs: make docs generates documentation folders for the OCaml code: a doc.public for the exposed functions and a doc.private for helpers/unexposed functions.

Note:

  • our system riichi for the player and display to the tile(s) the player are waiting automatically.
  • for more information on emoji representation of tiles, please see here.

Quick Note

  • Tile: Similar to cards in Poker. There are a total of 136 tiles.

  • Wall tile: Tiles that have not been drawn.

  • Hand tile: Tiles held by players.

  • Discard tile: Tiles discarded by players.

  • Yaku(役 or 役): Winning pattern. A player wins when their hand tiles form a winning pattern.

  • Chii (吃 or チー): Players can make an open-sequential-tiles, a sequence (3 consecutive tiles in the same suit), by calling “chii” using a tile discarded by the left player, who is the prior player. This means every player can claim the left player’s discarded tile to make a sequence.

  • Riichi (立直 or リーチ): A player can declare Riichi if and only if the player needs exactly one more tile to have a winning pattern and has not Chii-ed in the game. After declaring Riichi, the player can only discard the tile they draw on that round.

Teammates

Made by Helen Wang, Tianjing Zhang, Bixin Zhang

images🀅🀇🀐🀠:

gameflow drawn by Helen!

chii

victory

mahjong's People

Contributors

zbcszr avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.