/SquareTrap-Game

Primary LanguageCMIT LicenseMIT

SquareTrap Game with C99

General Information

Square Trap is a strategy game played with 2 players. There are 42 squares on the playing field, formed by 7 horizontal and 8 vertical lines. The game is played with 28 white and 28 black pieces. The aim of the game is to reduce the number of opponent's pieces to 3. The player playing with white pieces starts first. The player whose turn it is tries to get a square by placing a piece at any point where the lines intersect. Players take turns placing stones until they run out of stones. No pieces can be moved or moves can be made with pieces until all pieces are placed. After all the pieces have been placed, the players count the number of squares they have obtained and remove as many opponent's pieces from the game as the number of squares they have obtained. If no player has obtained any squares, the first player (the player with the white pieces) removes one of the opponent's pieces. At any stage of the game, the squares formed during the selection of an opponent's piece to be removed cannot be disturbed. The player whose turn it is to move then tries to form a square by moving one of his/her own pieces. The empty piece can be moved horizontally or vertically as many times as desired, but in no case can the pieces be jumped over. As soon as a new square is created, a selected opponent's piece is removed. The player who reduces the number of opponent's pieces to 3, wins the game.

For an example game, see: https://youtu.be/4A1vGGDkAIg?t=178

Setting the Game

The playing field consists of at least 3 and at most 7 horizontal lines and 1 more vertical line than the number of horizontal lines. At the start, players must choose the number of horizontal lines.

Players must enter the position of their own piece that they wish to place on the playing field or the position of an opponent's piece that they wish to move out of the game, adjacent to the number ([1-7]) and the letter ([A-H]) of the horizontal line on which the respective position is located (e.g. 2D). Similarly, players must enter the current position and the target position of their own piece they wish to move, with a space between the adjacent horizontal line number and vertical line letter of the current position and the adjacent horizontal line number and vertical line letter of the target position (e.g. 3C 1C).

Example Game Board with 4 Horizontal and 5 Vertical Lines

image

Playing the Game

To play the game, you just need to download the zip file from Releases and run the exe file inside.

ENJOY THE GAME!