• Sat. Sep 24th, 2022

    Programming source code for urgently seeking wells (MFC format)


    Sep 23, 2022
    One thought on “Programming source code for urgently seeking wells (MFC format)”
    1. "Jingzi Chess" game (also known as "Sanzi Chess") is a very classic puzzle game. Presumably many players have played. The chessboard of "Jingzi Chess" is very simple. It is a 3 × 3 grid, which is very similar to the "well" in Chinese characters, so it is named "Jingziqi". The rules of the "Jingzi Chess" game are very similar to "Five Son Chess". The rules of "Five Son Chess" are that one party first wins the first line of the first line;

      This (English name Tic-Tac-TOE)

      The appearance of Jingzi chess is estimated to be unable to test. Westerners believe that this was invented by the ancient Romans ; But we Chinese believe that since we have all invented Go and Wuzi Chess, it is naturally not a word to invent a good word. These are pure tongue, let's not mention it for the time being.

      It thinks of playing wells in class when I was a kid, as long as a draft paper, a pen, and the same table can be played. In physical education classes, you can also play in the sand pit with branches. But I always felt that the game was too simple. Later, I came into contact with Wuzi Chess and fascinated for a while, but the level was always poor, so I didn't play.

      The first chess game is very small and great analysis

      has nine spaces, which is played by MAX and min. Putting a chess piece, whoever enables his chess pieces to form a "three sons" (the same line or column or diagonal is a chess piece of someone), whoever has won.
      The fork number represents MAX, and the circle represents MIN.

      For example, the picture on the right is the game of winning.

      In order not to generate too much game trees, it is necessary to expand only two layers each time. The valuation function is defined as follows:

      The chess game is P and the valuation function is E (P).
      (1) If P is not a position for any party, then e (p) = e (the total number of lines, columns or diagonal that is still empty) -e ( Those who are still empty, the total number of rows, columns, or diagonal)

      (2) If P is a chess game of MAX, then e (p) = ∞.

      (3) If P is a chess game of B, then e (p) =-∞.
      . For example, P as icon of the right, then e (p) = 6-4 = 2

      If attention should be taken to use the symmetry of the chessboard position. When generating the position of the successor node, the following game ending ending

      is the same chess game (in the game, the branch coefficient of Yiyu chess was small because of the symmetry at first, and then due to the reduction of the space on the chessboard). Figure 3.15 Draw a game tree generated by two searches. The static valuation is recorded under the end node, and the pushing value is recorded in the circle.
      MA, as shown in the figure on the right, should be selected as the first step of MAX (it is the best priority of MAX).
      Now we assume that Max takes this step, and MIN's step back is to put a circle directly in the space above X (for MAX, this is a bad chess, he must not adopt a good search strategy) Essence In the next step, MAX searches for two layers in the new pattern, generating a search map shown in Figure 3.16.

      MAX in the picture now has two "best" priority steps. In order to avoid immediately defeat, MIN was forced to take another step, thus generating the following chess game: MAX search again, producing the tree shown in Figure 3.17.
      It certain end nodes (such as one of them marked A) in this tree represents MIN victory, so their valuation is -∞. When these valuations are pushed back, the best and only one who can see MAX can make him avoid immediately. Now, MIN can see that Max must win in his next step, so Min had to admit defeat.
      Meramating the next word by the great minimum algorithm (the right picture, you can click on the operation). .. ..

      I we use Visual Basic to write a small game of "Jingzi Chess".

      [Design ideas]

      First of all, we must know that the "Jingzi Chess" game is a typical chess game. When the game is a computer It's a player. Therefore, there are two ways at the beginning of such games: one is the player first; the other is the computer first. This is the first question we have to consider.

      Secondly, because the computer played with the player is a computer, we need to write a process (Chuqi), which can make the program simulate the thinking and play chess (in fact, the manual of "artificial intelligence") This Chuqi process is also the key to this game software. In addition, we also have to write two processes (Lianxian and shuying). The Lianxian process is used to determine whether there are three pawns in the chessboard to form a line; the shuying process is used to determine which party is connected to the front line. That is to judge which party wins.

      The above problems are the key ideas for the "Jingzi Chess" game. ....

    Leave a Reply