程序代写 Microsoft Word – Go Fish Rules.doc

Microsoft Word – Go Fish Rules.doc

Prolog Assignment 3 Represent and Implement a two-player game of Cards

Copyright By PowCoder代写 加微信 powcoder

Due Date: December 23rd, 2022

Submission instructions: Upload a short 5 minute video of your coded solution and your coded solution to
Prolog Assignment 3 Link on Moodle.

Rules of Go Fish

Objective: Be the player with the most pairs of cards at the end of the game.

1. The Computer shuffles and deals the cards:
2. Deal seven cards to each player

Place the rest of the cards face down. This is the FISH POND.

3. Players look at their cards, and place pairs of matching cards face up next to them.
4. The Human player goes first
5. Players take turns asking the other player for a card that matches one they hold. Players cannot ask

for a card if they do not hold a matching card.
6. If the player who is asked for a card has the card, that player must give it to the person who asked for it.

That player places the pair of cards face up with the other pairs and gets another turn.
7. If the player does not have the card asked for the player takes any card from the FISH POND. If that

card matches, the player places the pair with the other pairs but does not get another turn.
8. The two players take turns asking for cards. When the cards from the FISH POND are gone, play

continues, but players do not draw a new card after each turn.
9. The game ends when one player runs out of cards. The player with the most pairs wins the game.

You are required to

1. Represent a deck of cards using a set of Prolog Facts and/or Prolog Lists.
2. Shuffle the Cards and deal a specified number of cards to two players. One player being a

human, the other being the program itself.
3. When the player or the computer has two cards that match, they are shown on the screen
4. Implement the Rules specified for the card game go fish.
5. The computer should

a. Know when two cards in its hand match in a hand
b. Know what cards are matched by the human opponent
c. Know what cards are matched by the computer itself
d. The computer should remember what cards have been requested from the other player

up to a maximum of 6 previous cards (allowing realistic human like memory capacity)
e. The computer should know when the game is over
f. The computer should be able to evaluate who has won the game.

程序代写 CS代考 加微信: powcoder QQ: 1823890830 Email: powcoder@163.com