Tic-tac-toe games online. The top panel of buttons in the game with the computer

Under the game there is a description, instructions and rules, as well as thematic links to similar materials - we recommend that you read it.

How to play - rules and description

How well do you play tic-tac-toe? It is clear with a friend or girlfriend - you have no equal, but in the case of playing with a computer? Believe me, even if you are a pro, you cannot beat this computer! And it does not matter whether it is the electronic brain of a tablet, a weak smartphone processor or a powerful and modern PC processor. The program works like clockwork. She knows all the traps and does not give in to provocations. Maybe the future really belongs to artificial intelligence?

Ours fought for half a day and all to no avail. Or maybe someone will still be able to beat the electronics, huh? Friends, try it, maybe you can get around this car with some trick! Report the results on the "I want to say" button (below).

Can download the game tic-tac-toe with a computer on your computer, it will not take up much space, but think about whether it makes sense to do this, because here it is always available, you just need to open this page.

Take a break and play Online Games , which develop logic and imagination, allow you to have a good rest. Relax and take your mind off things!

Regulations on the competition

All are welcome - students in grades 3-8.

How to participate in the competition?

1. Register at the MetaSchool (no need to re-register).

2. Enter MetaSchool with your login and password and sign up for the competition.

3. Set up your computer to participate in the competition. After setting up, log in to MetaSchool again, go to the contest page and check the start date and time.

4. The day before the start, make sure that you know your username and password, that you know how to enter the MetaSchool.

5. 10-15 minutes before the start, enter the MetaSchool with your login and password and go to the competition page. The timer will count down to the start.

6. As soon as the competition starts, you will be asked to play tic-tac-toe with the computer on seven playing fields.

Rules of the game

  1. The field has dimensions 15x15.
  2. You play with crosses, the computer - with zeros.
  3. The task is to put five crosses in a row horizontally, vertically, or diagonally.
  4. You can't go outside the field.
  5. You can't take back.
  6. If the game is not working, you can click on the button New game and start over.
  7. In the initial position, there are already two crosses and two zeros on the field.

The timer will count down the time until the end of the contest.

7. A few minutes before the end of the contest, send your results by clicking on the Send button at the bottom of the page. You can submit results even if not all games have been played. You can submit your results only once.

8. After submitting the results, a message will appear stating that the answers have been received.

Game, training

Date and time of the contest

Competition date

Competition time - from 19 to 20 hours

for settlements located to the west of Moscow, the competition is held in Moscow time;

for settlements located in the Moscow time zone and to the east of Moscow, the competition takes place in local time.

The duration of the competition is 1 hour. During this time, each participant must try to win on seven playing fields.

Winners

The winners of the competition are the participants with the most points. One point is given for each win or draw. The list of winners will be published. The winners are awarded with diplomas.

Appeal

To file an appeal, you must log in to MetaSchool with your username and password, follow the Messages link and write to the Support Service. Appeals sent by email will not be accepted.

Competition Organizing Committee

MetaSchool. Information Technology
St. Petersburg

How to win at tic-tac-toe?

Any intellectual game not only promotes the development of thinking, it also provides an opportunity to experience the excitement and joy of victory. Even such a seemingly simple and well-known game of tic-tac-toe since childhood. Some even in adulthood continue to get involved in this game.

Tic-tac-toe, which is played on a 15x15 board and is called gomoku, even hosts international tournaments. To understand the patterns of the game, you should first consider the simplest option on a 3x3 cell field. The winner in this variant is the player who has built three figures in a row along any line.

Win algorithm

In order to learn how to win or, at least, not lose in tic-tac-toe, you need to stock up on attention and ... patience. In the absence of errors from one side or another, the game will end in a draw indefinitely. The main principle that determines how to win at tic-tac-toe is to create a situation in which, after any move by the opponent, the player will fill one of the two lines, that is, put three crosses or three zeros in a row. An example of such a situation is shown in Figure 1.

Reading publications on Habré, I found a couple of articles about gomoku game algorithms: this one and this one. In the first article, various options for solving the problem are analyzed, but there is no implementation in the form of a game, in the second - there is a game, but the computer “plays” rather weakly. I decided to make my version of gomoku with blackjack enough strong game computer. Posting about what happened. For those who love immediately into battle - the game itself.

To begin with, I want to decide on the main points. Firstly, there are many varieties of the gomoku game, I settled on this option: the playing field is 15x15, the crosses go first, the one who first builds 5 in a row wins. Secondly, for simplicity, I will call the game algorithm for calculating a move by a computer AI.

Thank you for your attention. I hope you enjoyed reading and playing as much as I did :)

P.S. A small request, if you win easily - please attach a screenshot of the game and moves (from the console logs) for analysis and improvement of the algorithm.

Update 1
1. Increased the importance of weights for attack by 10%. Now attack for AI is preferable to defense, all other things being equal. For example, if both the AI ​​and the user have 4ka, then the AI ​​will prefer to win.

2. Changed the values ​​of the weights according to the templates. With a more precise balance of weights, you can achieve the best game AI.
The weight values ​​for the templates are now:
99999 - xxxxx - five in a row (final payline)
7000 - _xxxx_ - open four
4000 - _xxxx - half-closed four (two such fours are preferable to one open, perhaps " more interesting game" will be)
2000 - _x_xxx, _xx_xx, _xxx_x - half closed four with a gap
3000 - _xxx_ - open three
1500 - _xxx - half closed three
800 - _xx_x, _x_xx - half-closed three with a gap
200 - _xx_ open deuce
Also, small weights (from 1 to 20-30) are around all moves, to create a "small move randomness".