Skip to content

This project is AI project which declared at artificial intelligence course of Shahid-Beheshti_University

Notifications You must be signed in to change notification settings

farbodfld/Hive_Game

Repository files navigation

Hive_Game

This project is AI project which declared at artificial intelligence course of Shahid-Beheshti_University.

It simiulate the Hive board game which has two player. The player which siege the queen pawn of second player is wiiner.

Preparation: Each player takes the corresponding colored pieces and places them on the table (or on the floor) in front of her so that the image of the insect on them is visible.

Start of the game: The game starts by placing a piece in the middle of the table (playing field) by one of the players. Then the next player must place one of his pieces on the table right next to one of the edges of the opponent's piece. From now on, the game goes to The turn continues by placing a new piece or moving any of the existing pieces.

Place the beads: You cannot place the new piece you enter into the game right next to the opponent's piece: (the first piece of each player at the beginning of the game is an exception)

Arrival of the queen bee: Each player must enter his bee piece into the game no later than the fourth round. In other words, the first, second, third or fourth piece you put on the table should be your bee.

moving: After your bee has entered the game, you can either enter another checker on each turn, or move one of your checkers. But before the bee enters the game, you don't have the right to move any of the pieces. Each insect has its own way of moving. And unlike the checker placement stage, now you are allowed to move your checkers so that they are next to your opponent's checkers. Note: Each piece must be in contact with at least one of the other pieces, either the opponent or the insider. So, if a bead is the only intermediary between two parts of the hive, you do not have the right to move it.

Insect movements: queen bee A bee can only move one space around itself per turn.

Beetle Like the bee, the cockroach can only move around one house per turn, but unlike other insects, the cockroach can climb up other vertebrae. The piece on which the beetle is placed, whether it is its own or the opponent's piece, is not allowed to move at all. The beetle can also move from one vertebra to another vertebra or return to the ground. The only way to stop a cockroach is to put another cockroach on top of it. Note: When you enter the beetle into the game, you cannot place it directly on another piece, but this movement is possible from the next rounds and through displacement.

grasshopper The grasshopper cannot move around like the other pieces of a house, but instead it can jump over the other pieces as many houses as possible! But note that this movement can only be straight, and there should not be an empty space in the path of this jump. Spider The spider can move up to three spaces per turn. No less and no more.

ant The ant can move to any point it wants, unless its movement violates one of the movement restriction rules. This way of moving has turned the ant into one of the most valuable pieces in the game.

Movement restriction rules: Law of single hive: the community of all beads stuck together forms the shape of a beehive. This shape must remain as "one" hive throughout the game. Therefore, any movement that causes the hive to be divided into two or three separate parts or leaves even one insect unconnected from the entire hive is prohibited. Keeping this rule in mind, you can use strategic moves to put some of your opponent's pieces in a position where they are unable to move.

It is forbidden to separate a part of the hive, even for a moment. This means that if the bead you move is supposed to be in a position that re-establishes the connection between the hive, you are still not allowed to move it, because during the movement, a part of the hive is separated (and to The term "hive collapses". The rule of crawling (sliding). You can only remove the grasshopper piece from the table to jump, and the beetle when climbing another piece. So the other usual movements of all the pieces are only through They slide back and forth, so you can't move a bead that's so encircled that it practically can't move by crawling.

Note: The above rule only applies to moving pieces, not to placing a new piece on the board. Therefore, if you want to enter a piece into the game for the first time, you can place it in a position that is completely surrounded by its own pieces. If you find yourself in a situation where you can neither add a new insect nor move a piece, it is your opponent's turn. This procedure goes until the condition of movement is provided for you; Or the queen bee is completely surrounded and the game ends.

End of the game: As soon as a player's bee is surrounded on all sides, the game is over and he is considered a loser. But if placing the last piece that encircles the opponent's bee also encircles the own bee, the game is declared equal.

About

This project is AI project which declared at artificial intelligence course of Shahid-Beheshti_University

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages