Html5+js "Five sub-flying" game implementation (a) Rules

Source: Internet
Author: User

For a long time did not write the article, this game has actually written for a while, has not perfected, in the new Year's occasion, to share to everyone.

The "Five sub-fly" game, not the usual everyone said "Gobang", this play is simple, is our hometown children often play a puzzle game, we first look at the board layout:

The rules are as follows:

First, black and white both sides (each other black, our white) each hold five children, respectively placed on the sides of the sideline;

Second, the pawn can only go straight line (oblique line is also), can not turn;

Third, as long as there is no pawn (either side of the) can jump lattice walk;

Four, can clamp dead each other or can pick each other two pieces (1 for sunspots, 0 for White,-blank):

    1. Clip one: Any one line, there are only two pieces each one, two pieces next to each other, at this time if we have a pawn can go through a straight line to the other side, you can put black pieces to die, replace the previous one of our pieces. Like what:
      • Originally is--10-, if the white son can walk to from the left number 2nd position -010-, then the sunspot eats: -000-
      • The original is---10, if the white son can go from the left number 3rd position--010, then eat the sunspots:--000
      • The original is--100, if the white son to go from the left number 2nd position-0100, cannot clip dead sunspots, because the right one more.
    2. Pick a pair: Any line, there are two pieces of each other, and two pieces in the middle of a blank position, at this time if we have a pawn can go through a straight line to the middle of two pieces, you can eat the other side two pieces, replaced by our pieces. Like what:
      • The original is -1-1-, if the white son can go to the middle position -101-, then the two sunspots to eat changed into white son: -000-

Five, win: the other pieces of all eat, or death can not move.

Well, the next Zhang Rivot began to use code to achieve layout, moves, eating chess and so on. Please look forward to it.

Html5+js "Five sub-flying" game implementation (a) Rules

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.