

Furthermore, you are constrained to using only the C constructs that we have covered up through the first week of class. If you have taken a course in Artificial Intelligence you are welcome to make your AI more sophisticated (e.g., Minimax), however, this is not required. That is, the AI should make some obvious choices such as chasing the achievable octagon with maximal point. The AI design is entirely up to you, however, it should be at least as smart as a 5 year old playing the game. You are required to design and implement the appropriate data structures and corresponding algorithms that will enable a human player to play against an AI player. Your primary objective is to use the C programming language to design and implement Hey’ that my Fish! game that operates according to the game play described in the previous section. For example (though a real game would probably have a longer record): When both players cannot move, output the points acquired by each player in order and announce the winner. See the example below, after the player’s last term, the AI move twice and end the game. If one of the players don’t have any achievable octagon left, print a message saying so and skip that player’s turn until both players don’t have any achievable octagon left and the game is over. See the exam below, the player/AI can move from (1, 2) to (1, 5) and from (1, 5) to (6, 5), but cannot move from (6, 5) to (3, 2). in the map) or another penguin.īoth Player and AI can move as many squares as they want, so long as it's in a straight line and there’s still a path. Here is an example of the game playing out to completion:Ī valid path: the path your penguin moves through contains no empty spot (see. Game play would then proceed in that fashion. The next move would be decided by the AI player, followed by prompting the human player again. You need to tell the player if she chooses an invalid move, like (3, 2) in this situation, and ask the player to choose another move. Notice that the player cannot choose (3, 2) since the octagon(2, 2) was taken and there’s no path from octagon(1,2) to it. For example, using the above game state, if the human player chooses (2,3) the resulting game state would be: When it is the human’s turn the game will prompt the player for which (row, column) she would like to move in the game board. In your implementation, have the human player take the first move. Both players can only select an octagon with 1 point as a starting point. Your implementation will prompt the user before game play to determine where (which octagon) player’s penguin is. If the octagon was taken, please use “.” to represent it. The number in the table(i, j) means the point of octagon at row i and column j. The rows are labeled from top to bottom starting with 1, and the columns are labeled from left to right starting with 1. The rows are labeled 1 - 6 and the columns are labeled 1 - 6. The game board is a 6-column by 6-row suspended grid. Please use ‘P’ as player’s penguin and ‘A’ to represent the AI’s penguin. In this project, you only need to implement this game for two players and each only has 1 penguin to play in this game. In your implementation you will use P (for Player) and A (for AI) characters in place of the colors. Please see the Wikipedia entry for more details. The objective of the game is to collect the most points in the game to win. The hexagons has 1-3 points and will be collected when player’s penguin move out from it. Traditionally, Hey’ that my Fish! game is a 2-4 player game in which the players first choose a color of penguins and then take turns moving one of his/her penguins in a straight line as far as he/she wishes, as long as there is a continuous line of vacant hexagons between the penguin's starting and destination hexagons.



This semester, all projects are individual work (not done in groups), unlike the challenges and labs! The focus of this project is primarily on exercising an introductory understanding of the C programming language including basic data types, looping and conditional constructs, arrays, iteration, basic I/O, formatted output, and functions. The game will be interactive and played between a human user and an AI (artificial intelligence). The goal of this project is to implement the game Hey, that’s my Fish! using the C programming language. INSTRUCTIONS TO CANDIDATES ANSWER ALL QUESTIONS C Programming The goal of this project is to implement the game Hey, that’s my Fish! using the C programming language.
