Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to realize the fight against landlords in java command line version

2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article introduces the relevant knowledge of "how to realize java command-line version of fighting landlords". In the actual case operation process, many people will encounter such difficulties. Next, let Xiaobian lead you to learn how to deal with these situations! I hope you can read carefully and learn something!

I. Foreword

I believe that everyone has played the landlord game, or in reality or on the computer and mobile phone, but have you ever thought of using the command line interface to fight the landlord?

Let's take a picture and experience it first:

Do you think it's interesting? Let's take everyone to play together ~

Second, the deployment of command line version of the landlord 2.1 environmental preparation

The project is java based and therefore requires deployment of java runtime environment and maven.

2.1.1 This experiment takes CentOS 7.5 machine as an example

[root@qll252 ~]# cat /etc/redhat-release CentOS Linux release 7.5.1804 (Core)

2.1.2 Deployment of jdk

1. Install JDK with yum (it can also be installed through source package, but this article is not about deploying JVM environment)[root@qll252 ~]# yum install java-1.8.0-openjdk* -y 2. Verify that jdk [root@qll252 ~]# java -version openjdk version "1.8.0_262"...

2.1.3 Installing maven

1. Download the maven source package to the local [root@qll252 ~]# wget https://mirror.bit.edu.cn/apache/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.tar.gz 2. Extract [root@qll252 ~]# tar -zxvf apache-maven-3.6.3-bin.tar.gz 3. Move the source package to/usr/local/mvn [root@qll252 ~]# mv apache-maven-3.6.3 /usr/local/mvn 4. Configure the maven profile environment variable vim /etc/maven #export MAVEN_HOME=/usr/local/mvn export PATH=$MAVEN_HOME/bin: $PATH 5. Reload the system configuration file source /etc/profile 6. Execute mvn -v Verify that [root@qll252 ~]# mvn -v Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f) Maven home: /usr/local/mvn...

2.2 Download the game source code

Clone Ratel project locally [root@qll252 ~]# git clone https://github.com/ainilili/ratel.git

Note:

If the above problem occurs, it means that the git tool is not installed, and it can be installed as follows:

[root@qll252 ~]# yum -y install git

2.3 Build Ratel Project

1. Enter the folder [root@qll252 ~]# cd ratel/ 2. Package deployment [root@qll252 ratel]# mvn install package

After ten minutes of waiting, the construction was complete. See below how to start it.

2.4 start the client

Rules of the game: the same rules of the game, such as support for three with one, four with two, straight, aircraft, Wang fried, but no points doubled. You can create a private server to fight landlords with friends, or join the public server 39.105.65.8 , using the parameter-h to specify the corresponding server.

#Start client [root@qll252 ratel]# java -jar landlords-client/target/landlords-client-1.2.2.jar -p 8888

2.5 Start fighting the landlord

The client has been activated, entering the entertainment segment.

1)First select the server you want to connect to, we can select the first one.

2)Set Nickname

The first thing to do after connecting to the server is to set up a nickname, in this case cnLinuxer.

3)After setting nickname, enter game menu

PvP: Three people are required to join the room to start.

Man-Machine Mode (PvE): One person joins, the other two are machines.

Setting: You can set the card display style.

Here we take the PVE pattern as an example

4)Next, choose the difficulty of the game.

Choose simple mode ~

5)Okay, the game is officially on.

Ask them if they have stolen property. yes or no ?

Note: "10" is represented by 0, and 'Big and Small King' is represented by XS.

This card type must grab the landlord ah.

6)Fight the Landlord

...

7)game over

If you think the card mode is too ostentatious, you can't play happily. Try several other models.

"How to achieve java command line version of the landlord" content is introduced here, thank you for reading. If you want to know more about industry-related knowledge, you can pay attention to the website. Xiaobian will output more high-quality practical articles for everyone!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report