This article introduces an android game-interactive Man-Machine vs. wuziqi.

Source: Internet
Author: User

After learning about Android system development, I wrote a mini game-interactive Man-Machine vs. wuziqi to entertain myself. This is called interactive Man-Machine vs. five-game. First, you can set the start before entering the man-machine combat mode. At the same time, you can see the machine's thinking process, it can also identify the advantages and disadvantages of each sub-point. Second, it is because it can increase the game experience for the machine and make the machine smarter. Hope that those who like wuziqi can enjoy it, and it is also very suitable for entry-level exercises.

First, let's take a look at the main UI of this wuziqi game. The UI is still relatively simple due to self-entertainment games and cannot reach the product release effect. Sorry!

1. Download this wuziqi game from csdn. Download link:

Http://download.csdn.net/source/3423512

Ghost is our android five-play game program.

2. If you have an android SDK environment, first create a simulator of the 2.1 API version. Open the CMD command window and enter the tools folder in the SDK directory. For example, if your SDK directory is placed in D: \ Android-SDK-Windows, enter D: \ Android-SDK-Windows \ tools directory.

1. First, run the android list target command to view the target platform list:

The target ID of the 2.1 API is 3.

2. Run the android create AVD-N android2.1-T 3 command to create a simulator named android2.1:

3. Run the start/B android2.1 command to run the simulator in the background:

4. the Platform file is stored in the Directory D: \ Android-SDK-Windows \ platform-tools and enters the Directory D: \ Android-SDK-Windows \ platform-tools, run the ADB install renju.apkcommand to install renju.apk on the simulator:

Third, if you do not have an android SDK environment, go to Sina AIQ:

Http://ishare.iask.sina.com.cn/f/16902616.html

Http://ishare.iask.sina.com.cn/f/16902614.html

Download the android 2.1 license file.

1. Assume that the compressed package is decompressed and stored in the Directory D: \ androidemulator. Open the CMD command window, go to the D: \ androidemulator directory, and run start/B emulator.exe-Sysdir D: \ androidemulator-System Images \ system. IMG-data images \ userdata. IMG-ramdisk images \ ramdisk. the IMG-kernel images \ kernel-qemu-skindir D: \ androidemulator \ skins-skin hvga command runs the simulator in the background:

2. After the simulator runs, the Renju application has been built in, and no installation is required. If not, run the ADB install Renju \ renju.apk command to install it.

4. After completing step 1 or step 2, you have installed the interactive Man-Machine vs. Wuzi game. On the home screen, you can see the Renju application, as shown in:

5. usage.

Click the Renju icon on the home screen to open the program:

Hold down the mouse and move it on the board. A "+" icon is displayed at the mouse position following the mouse. When you open the mouse, you can select a navigation point:

There are five buttons on the main interface:

Start: Click to start man-machine combat

Shoot: when the "+" icon appears on the checker board, click the button and place a pawn in the "+" position. Renju automatically calculates whether the current game should be playing white or black.

Undo: click "regret ".

Reset: Start the game again

Annotation: displays/hides the score of each sub-point on the current Board. The first number indicates the score of the black game, and the second number indicates the score of the white game. H after the number indicates 100. For example, 5 h indicates that the score is 500. Similarly, K indicates 1000, and W indicates 10000. The higher the score, the greater the advantage of the sub-point, as shown in:

There are two program modes: manual combat mode and man-machine combat mode. When the program is opened, the default mode is Renren. Click the start button to enter the man-machine combat mode. after entering the man-machine mode, you cannot switch to Renren mode. In man-machine combat mode, the computer uses black games.

Click the menu button in the keyboard area on the right to display four menu items:

Importing opening: Import started

Exporting opening: Save the start time. Unavailable when the current Board is empty

Add to experiences: increase computer experience. When the board is empty or there is only one pawn, it cannot be used.

Manage experiences: Computer Management Experience

Click the exportingopening menu to save the start:

Enter the start name in the pop-up box and click OK.

Click the importing opening menu, and a start list is displayed. select one of them to import the start:

Click the add to experiences menu to add computer experience. For example:

Click the add to experiences menu and enter the experience name in the pop-up box:

Click OK to save the experience.
When you enter the man-machine combat mode next time, if the computer finds the current board situation as shown in:

Then a black game is automatically played on the "+" position.
Click the add to experiences menu to view the current computer experience list:

Sixth, man-machine combat principles. Simply put, it is through the method of winning the table. When it is the turn of the machine to fall into the table, find the point with the highest score in the winning table and drop the next pawn, then, use the machine to predict the next possible sub-point of the other party, simulate the next sub-item of the other party, and then determine who gets the advantage. if the machine is at a disadvantage, return to the first step, find a sub-point with a high score and place it next. Similarly, predict the next possible sub-point of the other party, simulate the next sub-point of the other party, determine who gets the advantage, and so on, this is the backtracking algorithm. Therefore, in general, the intelligence of the machine comes from the winning table + backtracking algorithm. I have time to describe it in detail. Thank you for your attention.

Welcome to exchange and cooperation, email: shyluo@gmail.com.

Lao Luo's Sina Weibo: http://weibo.com/shengyangluo. welcome to the attention!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.