/Pentagole

In this repository, I intend to implement the game of Pentagol using the C programming language.

Primary LanguageC

Pentagole

In this repository, I intend to implement the game of Pentagol using the C programming language.

Pentago Game:

You might have heard of the Pentago game before. This game is a two-player tabletop game that is quite similar to the game Tic-Tac-Toe. In this game, each player has a set of game pieces, and the game board is a 6x6 grid. The goal is for a player to align 5 pieces in a row to win the game. However, what sets this game apart from Tic-Tac-Toe?

The game board is divided into four 3x3 squares. In their turn, each player places a piece on the board and also rotates one of these four squares (independently of the placement of the piece) either clockwise or counterclockwise. Then, the turn passes to the second player. As mentioned, the game continues until a player manages to align 5 pieces in a row (horizontally, vertically, or diagonally) unless the game board is completely filled, resulting in no winner.

For a better understanding of the gameplay, to see the game board, and to examine a sample game, you can refer to this link.

Pentagole Game:

Considering that a considerable number of students at the Faculty of Electrical and Computer Engineering are skilled in the game of Pentago and are very interested in it, we have decided to organize an advanced competition to find the best Pentago player. However, because the winning strategy of this game is widely known, we have opted to modify Pentago and replace it with Pentagole.

The only difference between Pentagole and Pentago is that instead of placing 5 marbles in a line, they should be arranged in a form resembling the movement of a knight in chess (4 marbles in a line and one on the right or left of the last marble). Here, they can also be positioned horizontally, vertically, or diagonally. Note that the distinguishing factor in the knight's movement is that it can move in both right and left directions (in the shape of "L"). The remaining rules and the condition for the end of the game are similar to before.

Preparations for the competition were underway, but unfortunately, due to the spread of the COVID-19 virus and the university's closure, the possibility of holding this competition in a physical presence became impossible. For this reason, similar to delivering courses through virtual instruction, we have decided to conduct the competition online as well. In this regard, the faculty requests that you develop programs to simulate this game.