Game Development 6 min read

How to Play Ratel: Command‑Line Dou Dizhu Game in Minutes

Ratel is a command‑line Dou Dizhu game that you can run locally or connect to a public server, clone from GitHub, launch via Java client or JAR, set your nickname, create or join rooms, and use simple text commands to play, with full card alias mappings and examples.

Programmer DD
Programmer DD
Programmer DD
How to Play Ratel: Command‑Line Dou Dizhu Game in Minutes

What is Ratel?

Ratel is a command‑line implementation of the Chinese card game Dou Dizhu. Below is a screenshot of the game interface:

How to start?

Ratel consists of a client and a server. You can either run a local server and let friends connect, or connect directly to the public server at IP 39.105.65.8 port 1024.

To get the source, clone the repository: git clone https://github.com/ainilili/ratel.git Then open the landlords-client module and run the SimpleClient class.

Alternatively, download the released JAR files and start them with:

java -jar landlords-server/target/landlords-server-#{version}.jar -p 1024
java -jar landlords-client/target/landlords-client-#{version}.jar -p 1024 -h 39.105.65.8

The -p flag sets the port, and -h specifies the host address.

Playing the game

After connecting, the client prompts you to set a nickname:

Connection to server successful, welcome to ratel !!
Please set your nickname
[ratel@nickname]$ Nico

Then you enter the options menu:

Options:
1. Create Room
2. Room List
3. Join Room
Please enter the number of options

To create a room, type 1:

You have been create room with id 2
Please wait for other players to join !

When three players have joined, the game starts. Cards are ordered from 3 up to the big joker, as shown below:

To play a straight, input the sequence of card numbers, e.g., 7890j or 789tj. To play a bomb (both jokers), input sx.

The full card alias mapping is:

poker-> │3|4|5|6|7|8|9|10|J|Q|K|A|2|S|X
alias-> │3|4|5|6|7|8|9|T t|0|J j|Q q|K k|A a|1|2|S s|X x

If you do not want to play a card this turn, type pass. To quit the game, type exit.

Enjoy a quick game of Ratel during a break, and find the project at:

https://github.com/ainilili/ratel

Javacommand-linedou dizhugame tutorialRatel
Programmer DD
Written by

Programmer DD

A tinkering programmer and author of "Spring Cloud Microservices in Action"

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.