Python代写 | COMP10001 Project 2 Game Description

本次澳洲代写主要为Python卡牌游戏制作

1 Game Description
In this project, you will implement a program that plays a game called “Phazed”, which is a variant of Phase
10, which is in turn a variant of rummy. Why a variant? Because Tim can’t help himself … or more seriously,
because Tim wanted to come up with a version that was more compatible with a computational implementation
(e.g. not too long, and suitably algorithmically complex).
We will play Phazed with two standard decks of 52 cards each (i.e. 104 cards in total). Each card has a “suit”
(Spades, Clubs, Hearts, Diamonds) as well as a “value” (numbers 2 to 10, as well as Jack, Queen, King and
Ace).
2 The Rules of Phazed
2.1 Overview
Phazed is a 4-player game where the objective is to be the first to complete a series of “phases” by placing
particular combinations of cards on the table. The game is broken down into a series of “hands”, in each of
which, the 4 players are dealt 10 cards each from a 104 card deck, and take it in turns either drawing a card
from the face-down deck, or picking up the top card from the discard pile. When they have the requisite cards
to complete a given phase, on their turn, they place those cards on the table, and optionally place any remaining
cards on any group that has been placed on the table (their own or groups of other players). For a given hand,
play continues until one of the following occurs: (1) a player places all of their cards on the table; (2) the deck is
exhausted; or (3) each player has played 50 times. At the point that one of these occurs, players tally up penalty
points based on the cards remaining in their hand. The game continues across multiple hands until either: (1) a
player has completed all of their phases; or (2) 20 hands have been completed. In the former case, the winner is
the player who completed all of their phases (or the player(s) with the lowest point score who have completed
all games, in the case of a tie); in the latter case, the player(s) with the lowest point score win.
The full details of the deal, how cards are drawn and played, and how phases work, are outlined in the following
sections.

2.2 The Deal
The sequence of play is fixed throughout the game (based on clockwise sequence between the players), but
the dealing of cards for each phase rotates between players (also clockwise, by one player per deal), and the
lead player for each phase also rotates, with the player to the left of the dealer leading. The dealer shuffles the
combined deck, deals out 10 cards to each of the 4 players, places the top card of the remaining deck face up in
the middle of the table (to form the “discard” pile), and places the remainder of the deck face down next to it.
2.3 A Single Turn
On their turn, a player performs the following actions:
1. picks up either the top card from the discard pile, or the top card from the deck
2. optionally plays cards from their hand to make up a complete phase. Note that only one phase can be
played for a given hand, and that a complete phase must be played at once (i.e. it is not possible to play
part of a phase with one play, and the remainder with a later play)

3. assuming that the player has completed their phase for the hand, optionally plays other cards on whatever
groups of cards have been played on the table (for any player, including their own groups)
4. assuming the player still has at least one card left in their hand, they place a single card face up in the
discard pile
2.4 Card Combination Types for Phases
The phases that a player must complete are made up of the following card combinations:
• a “set” ofN cards of the same value: N cards of the same value, of any suit (e.g. [‘2S’, ‘2S’, ‘2H’]
is a set of 3 cards)
• a “set” ofN cards of the same suit: N cards of the same suit, of any values (e.g. [‘2C’, ‘7C’, ‘7C’,
‘8C’, ‘JC’, ‘QC’, ‘KC’] is a set of 7 Clubs)
• a “run” of N cards: a consecutive sequence of N cards (of any combination of suits/colours), based
on value (e.g. [‘2S’, ‘3D’, ‘4C’, ‘5D’, ‘6C’, ‘7D’, ‘8H’] is a run of 7 cards); note that, for
the purpose of runs, Jacks, Queens and Kings take on the values 11, 12 and 13, resp., and runs can wrap
around from 13 to 2 (e.g. [‘KH’, ‘2S’, ‘3D’, ‘4C’, ‘5D’] is a valid run of 5 cards)
• a “run” of N cards of the same colour: a run of N cards where all cards are of the same colour, as
defined by the suit (Spades and Clubs are black, and Hearts and Diamonds are red; e.g. [‘2S’, ‘3C’,
‘4C’, ‘5S’] is a run of 4 black cards); once again, runs of the same colour can loop around from 13
to 2 (e.g. [‘KH’, ‘2S’, ‘3C’, ‘4C’, ‘5S’] is a valid run of the same colour, of length 5 cards)
• an “N-accumulation” of cards: cards of any suit/colour which add up to N in terms of their combined
value (e.g. [‘KS’, ‘0D’, ‘8C’, ‘3S’] is a 34-accumulation); for the purpose of accumulations,
Jacks, Queens and Kings take on the values 11, 12 and 13, resp., and Aces take on the value 1
• an “N-accumulation” of cards of the same colour: cards of a given colour (all red or all black) which
add up to N in terms of their combined value (e.g. [‘KS’, ‘0C’, ‘8C’, ‘3S’] is a 34-accumulation
of black cards)
To win the game, a player must complete the following phases, in the sequence indicated:

1. Phase 1: two sets of three cards of the same value (e.g. [[‘2S’, ‘2S’, ‘2H’], [‘7H’, ‘7S’,
‘7D’]])
1
2. Phase 2: one set of seven cards of the same suit (e.g. [[‘2C’, ‘7C’, ‘7C’, ‘8C’, ‘JC’, ‘QC’,
‘KC’]])
3. Phase 3: two accumulations of cards, each of value 34 (e.g. [[‘KS’, ‘0D’, ‘8C’, ‘3S’],
[‘9D’, ‘9S’, ‘9S’, ‘6C’, ‘AH’]])
4. Phase 4: two sets of four cards of the same value (e.g. [[‘2S’, ‘2S’, ‘2H’, ‘2D’], [‘7H’, ‘7S’,
‘7D’, ‘7D’]])
2
5. Phase 5: one run of eight cards (e.g. [[‘2S’, ‘3D’, ‘4C’, ‘5D’, ‘6C’, ‘7D’, ‘8H’, ‘9S’]])
6. Phase 6: two accumulations of cards of the same colour, each of value 34 (e.g. [[‘KS’, ‘0C’, ‘8C’,
‘3S’], [‘9C’, ‘9S’, ‘9S’, ‘6C’, ‘AS’]])
7. Phase 7: one run of four cards of one colour + one set of four cards of the same value (e.g. [[‘KC’, ‘2S’,
‘3C’, ‘4C’], [‘7C’, ‘7S’, ‘7D’, ‘7D’]])


程序代写代做C/C++/JAVA/安卓/PYTHON/留学生/PHP/APP开发/MATLAB


blank

本网站支持淘宝 支付宝 微信支付  paypal等等交易。如果不放心可以用淘宝交易!

E-mail: itcsdx@outlook.com  微信:itcsdx


如果您使用手机请先保存二维码,微信识别。如果用电脑,直接掏出手机果断扫描。

blank

发表评论