加勒比久久综合,国产精品伦一区二区,66精品视频在线观看,一区二区电影

合肥生活安徽新聞合肥交通合肥房產生活服務合肥教育合肥招聘合肥旅游文化藝術合肥美食合肥地圖合肥社保合肥醫院企業服務合肥法律

代寫COMP282 程序、C++設計編程代做

時間:2024-05-07  來源:合肥網hfw.cc  作者:hfw.cc 我要糾錯



. Overview 
Create a basic GUI card game using C++ with Qt and organise the game structure using OOP methods. 
Royalty-free card images will be available for you to download from the COMP282 Canvas page for you to use in the application if you choose. These will consist of 52 PNG images of standard playing cards. 
If you are not familiar with the standard 52 card deck of playing cards, Wikipedia goes into lots of detail here: https://en.wikipedia.org/wiki/Standard_52-card_deck which you may find informative. 
 
Our game is based loosely on the hands of the classic card game, Poker. We will define the rules of the game as follows: 
1.Objective: The objective of the game is to beat a computer opponent with combinations of 5 cards (known as a Hand) worth the highest value.  
2.Card Value:  
a.Cards have a value of 1 to 14 and a suit chosen from Hearts (♥), Diamonds (♦), Spades (♠) and Clubs (♣). There are 52 cards in a Deck consisting of 13 cards in each suit. There are no other cards (such as Jokers) needed in the game, and only one deck is used. 
b.Value ranges from 1 (low Ace) through the numbered cards worth 2 – 10 then 11 (Jack), 12 (Queen), 13 (King) and 14 (high Ace). Note that the Ace can be chosen to be worth 1 or 14 as desired to match with other held cards, this is useful for straight hands.  
c.The value of cards is used to determine the winner when hands have the same rank (more on ranks and categories later), e.g. both players have One Pair. If the value of the rank cards are the same, the values of the remaining cards are used, e.g.: Player has a pair of 10s, Computer has a pair of 7s, so Player wins. 
Player has a hand of |10♠|10♥|2♣|3♣|5♦| and Computer has a hand of 
|10♦|10♠|9♣|6♥|4♠| 
In this case both players have One Pair of the same value (10). So we determine the 
value of the remaining cards, which are 10 for Player (2+3+5) and 19 for Computer (9+6+4), so Computer wins. 
d.The suit is only used when determining a Flush (all cards the same suit). 
e.No suit has a higher value than another. E.g. a Flush of hearts and a flush of clubs with the same numerical cards are worth the same. 
3.The rank and name of the combinations are as follows, with the highest values being statistically less likely to occur and which automatically beats any card combination from a lower category. E.g. any Straight Flush beats any Four-of-a-Kind:  
Rank 
(1=highest)     Category     Example Hand     Explanation 
1     Straight Flush          Flush and 
Straight at the same time. 
 
2     Four Of A Kind          Four cards with the same value – in this example four cards of value 5. 
3     Full House          Three of one the same value and two of another. 
4     Flush          All cards are the same suit – in this example all Diamonds. The value and order of the cards does not matter 
5     Straight          All cards are in numerical order, suit doesn’t matter. 
6     Three Of A Kind          Three cards with the same 
value – in this example Queens. 
7     Two Pair         Two separate matched pairs of different 
values, in the example above 
            two Jacks and two 3s 
8     One Pair          A single matched pair of the same value, in the example above a pair of 10s. 
9     Highest Card          All cards are different for both players and there is not a straight or flush 
 
4.If both players have a Straight Flush the one with the highest card wins, otherwise it is a draw. 
5.If both players have Four-of-a-Kind the higher card wins, e.g. four 8s would beat four 5s. It is not possible for both players to have the same 4 cards so the winner can always be found by comparing these. 
6.If both players have Full House the higher card of the group of three wins, e.g. three 4s and two Queens would beat three 2s and two kings. It is not possible for both players to have three cards of the same value so the winner can always be found by comparing these. 
7.If both players have a Flush the highest card wins, in this example a Jack. If both players have a flush and the same highest cards the next highest are compared, e.g. K, 10, 8, 7, 5 would beat K, 10, 8, 7, 3.  If the cards are still same the same, e.g. both players have 10, 8, 5, 4 and 2 in different suits it’s a draw. 
8.Examples of Straights are A-5, 2-6, 3-7, 4-8, 5-9, 6-10 (as example), 7-J, 8-Q, 9-K, 10-A. 
Note that the Ace can be worth both 1 or 14 giving two possible straights that include it, e.g. (A, 2, 3, 4, 5) or (10, J, Q, K, A). In all other situations the Ace is always worth 14. If both players get a Straight the highest card of each wins, e.g. 9-Q would beat 3-7. If the high card of both straight is the same, it’s a draw. 
9.If both players have Three-of-a-Kind the higher card wins, e.g. three Jacks would beat three 8s. It is not possible for both players to have three cards of the same value so the winner can always be found by comparing these. 
10.If both players have Two Pair the highest pair wins, e.g. a pair of queens and a pair of 3s beats a pair of 10s and a pair of 9s. If both pairs are the same for each player the highest fifth card determines the winner, e.g. J, J, 8, 8, A beats J, J, 8, 8, 10 with deciding Ace being worth 14 not 1. A draw is possible. 
11.If both players have One Pair the highest pair wins, e.g. a pair of 7s beats a pair of 2s. If the pair is the same for each player the highest of the remaining three cards determines the winner. A draw is possible. 
12.The High Card result is determined by the highest card and continues until the last card. E.g. Q, 8, 5, 4, 3 beats Q, 8, 5, 4, 2. A draw is possible. 
 
      
5. Basic Gameplay (45 marks) 
1.There should be a ‘start’ (or ‘deal’) button on the game window. When this button is clicked, the game starts. 
2.The cards are shuffled before each game. 
3.For each Round, 10 cards taken from the shuffled Deck and distributed to the Player and the Computer, making two hands with 5 cards each. 
4.When a card has been used in a hand, it cannot be used again during that game (but bear in mind the ‘advanced gameplay’ sections below). 
5.Each game consists of rounds. When a new round is started but there are less than 10 cards left in the deck, the game ends (since we cannot deal full hands to the players).  
6.At the start of each round, the game window should display a representation of the player’s hand (5 cards) and the computer’s hand (5 cards). This can be text-based, but you will get marks for using images. Under each card, it should say the name of the card (e.g. ‘6 of Spades’ or ‘6♠’). 
7.The game should work out the categories (and therefore the rank) of each of the hands. Above the cards, there should be a label that displays the category of the hand (e.g. ‘Full House’). 
8.Based on those ranks, the game should determine who has the strongest hand. This should also be displayed. 
9.There should be a button marked ‘Next Round’ which will move the game on to the next round. If there are no more rounds, the button should be marked ‘Finish Game’. 
10.A score should be displayed and updated at the start of each round, that shows the player’s score and the computer’s score. The scores represent the number of hands won in the game. 
11.After the 5 rounds have been played, the winner should be announced (or a draw declared if applicable), and the player should be able to play another game if they wish to. 
6. Advanced gameplay (10 marks) 
In rounds **4, allow the player to swap up to three cards from their hand with cards from the deck.  It’s up to you how to implement the interface for this (perhaps ‘Swap’ buttons, or perhaps by clicking the card, or another method of your choosing). Don’t allow swapping in Round 5 (because in Round 5 there will be only 2 cards left in the deck). The cards that are swapped out of the player’s hand can still remain in the game (i.e. they are replaced in the Deck at a random location). 
7. Even more advanced gameplay (10 marks) 
If the player swaps a card, the computer has the opportunity to swap a card from its deck too. The computer will have to determine whether or not it is advantageous to swap a card (if the computer has a Straight Flush hand, it won’t be worth swapping, for example, but if it has 1 pair it may want to swap one of the other cards to attempt to improve the hand).  
This can be as basic or complex as you like. A basic version may just scan a hand for groups of two, three or four cards of the same value and swap any remaining cards to try to improve this. A more advanced system may calculate the probabilities of getting a straight or flush hand. 
6. Suggested Classes/Objects and Methods in the game 
 
You are free to code the game as you like. But please ensure that you have classes called: 
 Game, Player, Card, Deck, Hand.  
 
There are some suggested structures and methods below which you may find helpful.  
Game class: Consists of two Players. Once the game has been completed the winner (or a draw) is declared. Game state is shown in a game window as text and/or graphics of cards held with buttons for triggering methods. 
Player class: A class representing a player with a name and a score of hands won. Each Player has a Hand of five Cards. Assume that both players can see each other’s cards and the result is based purely on getting a strong hand of cards. 
Card class: Has a value and a suit (e.g. 7 of Hearts).  
Methods: 
Card::getValue() returns the value as an integer, (e.g. 7). Aces are always worth 14 except when used as start of a straight. 
Card::getSuit() returns the suit name as a QString, e.g. “Clubs”, “Diamonds”, “Hearts” or “Spades”.  
Card::getName() returns the card name as a QString, e.g. “Jack of Clubs”, “Two of Hearts”. Card::getNumber() returns the card type as an integer (see the section on Hand::setHand method to see how the system works). E.g. 9 of Diamonds would return 209. 
 
Deck class: Consists of a complete standard pack of 52 cards with one of each value 2-10 and Jack, Queen, King and Ace in each suit (4 * 13 cards).  
 
Methods: 
Deck::createDeck() generates a complete pack correctly as stated above in any order. Each card is a Card object.  
 
Deck::shuffle() randomly puts the cards in a random order, e.g. before a game begins or after the last card is dealt.  
 
Deck::dealCard() returns the first card in deck and continues until the entire deck has been dealt. When the last card has been dealt the entire deck is automatically shuffled so dealing can continue indefinitely. 
 
 
Hand class: Holds five cards for a player, with methods to replace and order cards within it. Each player has one opportunity per round of the game (in rounds **4) to swap up to three cards to improve their hand. After this, the winner (or a draw) is determined. 
Hand::dealHand(Deck& deck): Creates a new hand of five cards from a deck, replacing any existing cards in the hand. 
Hand::sortValue(): Sorts cards in value order from smallest to largest.  
E.g., a hand with cards 8, Q, 2, A, 2 would be sorted to 2, 2, 8, Q, A, considering A as 14 when not part of a straight. 
Hand::sortGroup() : sorts the cards in a hand based on the frequency of each card's value, placing the most frequent values first. For example, a hand containing the cards 2, 7, 7, 2, 7 would be rearranged to 7, 7, 7, 2, 2, grouping all 7s together followed by the 2s due to the higher frequency of 7s. If there are groups of equal size, such as two pairs or two triples, the groups are ordered by the card value in ascending order. For instance, a hand with cards 6, King, 8, 6, King (where King represents a higher value, typically 13) would be sorted to 6, 6, King, King, 8. This is because both pairs (6s and Kings) have the same frequency, and 6 is numerically smaller than King. In cases where no multiples are present, meaning all cards have unique values, the method defaults to sorting by individual card values in ascending order. This functionality is achieved by calling the `sortValue()` method, which organises cards from lowest to highest value. 
 
Hand::getBest(): Calculates the highest value in the hand as shown above and returns, from highest to lowest value, a four-character QString: "stfl", "four", "full", "flsh", "strt", "trio", "twop", "pair", "high". 
Hand::setHand(const QVector<int>& cardValues): 
Sets a hand to specific cards defined in a five-element integer QVector.  
The first digit (s) of each integer is the suit in alphabetical order:  
1 = club, 2 = diamond, 3 = heart, 4 = spade.  
The next two digits (vv) are the value of the card:  
01 = Ace, 02-10 = number card, 11 = Jack, 12 = Queen, 13 = King.  
These values define Card objects representing the correct card which then replaces the existing hand.  
 
Example:  
Hand::setHand({111, 311, 411, 201, 308})  
defines the hand: Jack of Clubs, Jack of Hearts, Jack of Spades, Ace of Diamonds, Eight of Hearts. 
For Advanced Gameplay tasks: 
Hand::swapCard(const QVector<int>& cardIndices, Deck& deck): Replaces up to three specified cards with the next card in the deck.  
 
Examples: 
myHand.swapCard({1, 3}, myDeck); replaces the first and third cards in deck ‘myDeck’. 
myHand.swapCard({3, 4, 5}, myDeck); replaces the third, fourth, and fifth cards in deck ‘myDeck’. 
myHand.swapCard({1, 3, 1}, myDeck); replaces the first and third cards and ignores the duplication of the first card. 
myHand.swapCard({1, 3, 4, 5}, myDeck); replaces cards 1, 3, and 4; the fourth value is ignored. 
myHand.swapCard({}, myDeck); does nothing. 
Order does not matter, e.g., myHand.swapCard({3, 4, 5}, myDeck); is the same as myHand.swapCard({5, 3, 4}, myDeck);  
      
請加QQ:99515681  郵箱:99515681@qq.com   WX:codinghelp

















 

掃一掃在手機打開當前頁
  • 上一篇:COM 5140代做、c/c++程序設計代寫
  • 下一篇:COMP1039代做、代寫Java程序語言
  • 無相關信息
    合肥生活資訊

    合肥圖文信息
    2025年10月份更新拼多多改銷助手小象助手多多出評軟件
    2025年10月份更新拼多多改銷助手小象助手多
    有限元分析 CAE仿真分析服務-企業/產品研發/客戶要求/設計優化
    有限元分析 CAE仿真分析服務-企業/產品研發
    急尋熱仿真分析?代做熱仿真服務+熱設計優化
    急尋熱仿真分析?代做熱仿真服務+熱設計優化
    出評 開團工具
    出評 開團工具
    挖掘機濾芯提升發動機性能
    挖掘機濾芯提升發動機性能
    海信羅馬假日洗衣機亮相AWE  復古美學與現代科技完美結合
    海信羅馬假日洗衣機亮相AWE 復古美學與現代
    合肥機場巴士4號線
    合肥機場巴士4號線
    合肥機場巴士3號線
    合肥機場巴士3號線
  • 短信驗證碼 目錄網 排行網

    關于我們 | 打賞支持 | 廣告服務 | 聯系我們 | 網站地圖 | 免責聲明 | 幫助中心 | 友情鏈接 |

    Copyright © 2025 hfw.cc Inc. All Rights Reserved. 合肥網 版權所有
    ICP備06013414號-3 公安備 42010502001045

    66精品视频在线观看| 欧美精品高清| 卡一精品卡二卡三网站乱码| 另类中文字幕网| 超碰国产一区| 亚洲激情网址| 女一区二区三区| 亚洲自拍电影| 麻豆一区二区三| 免费一二一二在线视频| 欧美日韩国内| 欧美xxxx在线| 日韩一区网站| 精品一区二区三区在线观看视频 | 国产剧情一区| 日韩精品电影在线观看| 欧美三级精品| 国产高潮在线| 先锋亚洲精品| 欧美另类专区| 亚洲二区在线| 台湾亚洲精品一区二区tv| 五月天亚洲一区| 欧美影院在线| 欧美日本一区| 日韩综合小视频| 国产精品99精品一区二区三区∴| 欧美激情成人| 蜜臀国产一区二区三区在线播放| 黄色成人91| 在线视频观看日韩| 第九色区aⅴ天堂久久香| 日韩av电影免费观看高清完整版| 国产精品一区二区三区av| 日韩精品成人一区二区在线| 精品久久在线| 国产精品.xx视频.xxtv| 成人精品国产| 欧美天堂在线| 欧美黄色网络| 日韩精品福利网| 老司机免费视频一区二区| 一区二区高清| 欧美aaa在线| 亚洲毛片视频| 国产精品免费精品自在线观看| 国产精品草草| 国产美女精品视频免费播放软件| 91麻豆精品国产综合久久久| 日韩高清中文字幕一区| 欧美a级理论片| 亚洲国产黄色| 国产成人黄色| 日本高清久久| 大色综合视频网站在线播放| 韩国精品福利一区二区三区| 国内精品麻豆美女在线播放视频 | 久久91导航| 深夜福利亚洲| 麻豆精品新av中文字幕| 国内一区二区三区| 精品一区二区三区四区五区| 亚洲午夜久久| 国偷自产av一区二区三区 | 欧洲毛片在线视频免费观看| 91成人精品视频| 毛片一区二区| av高清不卡| 国产欧美一区二区色老头| 欧美精品二区| 视频二区欧美| 欧美69wwwcom| 六月婷婷一区| 国模视频一区| 亚洲五月综合| 亚洲超碰在线观看| 欧美理论视频| 93在线视频精品免费观看| 欧美天堂一区二区| 91精品福利观看| 亚洲网址在线观看| 激情五月综合网| 人禽交欧美网站| 成人交换视频| www.久久久久爱免| 欧美国产不卡| 亚洲欧美成人| 欧美日韩视频免费观看| 日韩国产欧美在线观看| 日韩精品导航| 欧美va亚洲va日韩∨a综合色| 国产精品美女久久久浪潮软件| 亚洲精品**中文毛片| 麻豆免费看一区二区三区| 久久九九精品视频| 午夜精品视频| 亚洲国产天堂| 日韩精品福利一区二区三区| 亚洲午夜在线| 日韩大片在线| 国产不卡av一区二区| 99久久99视频只有精品| 成人影院天天5g天天爽无毒影院| 久久精品国产精品亚洲综合| 日韩激情一区二区| 伊人久久综合| 久久精品国产福利| 日韩中文字幕无砖| 亚洲欧美视频| 日本美女一区二区| 人人香蕉久久| 中文字幕在线视频网站| 在线不卡一区| 激情欧美丁香| 亚洲国产综合在线观看| 日韩理论电影中文字幕| 最新亚洲视频| 久久精品国产久精国产爱| 日韩丝袜视频| 人人精品人人爱| 一区二区三区四区在线观看国产日韩| 黄色欧美在线| 亚洲人体视频| 日韩av电影一区| 人人狠狠综合久久亚洲| 高清一区二区中文字幕| 欧美 日韩 国产 一区| 亚洲成人毛片| 美女网站色精品尤物极品姐弟| sm性调教片在线观看| 欧美精品第一区| 久久亚洲视频| 综合亚洲自拍| 日韩中文字幕麻豆| 综合亚洲色图| 男女男精品视频| 国产亚洲一区| 日韩影院免费视频| 亚洲系列另类av| 97精品国产| 中文字幕一区二区三区四区久久| аⅴ资源天堂资源库在线| 日韩av一区二区在线影视| 日韩不卡一区| 一区二区三区四区精品视频 | 日韩一级免费| 久久国产乱子精品免费女| 欧美巨大xxxx| 精品美女一区| 久久一区二区中文字幕| 国产日韩欧美| 久久精品国产免费看久久精品| 香港久久久电影| 黄色亚洲网站| 红杏视频成人| 国产成人免费精品| 欧美不卡在线| 亚洲影视一区| 视频一区二区欧美| 一本一道久久a久久| 日韩欧美精品综合| 久久精品观看| 国内精品久久久久久久影视麻豆 | 国产调教一区二区三区| 噜噜噜91成人网| 女人香蕉久久**毛片精品| 97精品97| 中日韩免视频上线全都免费| 亚洲3区在线| 国产不卡av一区二区| 久久综合影视| 视频一区国产| 国产精品第一| 亚洲欧洲一区二区天堂久久| 国产成人免费视频网站视频社区| 欧美在线综合| 婷婷视频一区二区三区| 国产成人福利夜色影视| 亚洲精品2区| 日韩二区三区在线观看| 主播大秀视频在线观看一区二区| 欧美日韩在线观看视频小说| 国内精品久久久久久久97牛牛| 免费观看30秒视频久久| 欧美三区美女| 日本va欧美va精品发布| 三区四区不卡| 亚洲高清毛片| 日韩精选在线| 麻豆91在线播放免费| 首页综合国产亚洲丝袜| 红杏视频成人| 一区二区三区四区日韩| 日韩免费看片| 99香蕉国产精品偷在线观看| 国产成人aa在线观看网站站| 中文在线播放一区二区| 欧美羞羞视频| 噜噜噜91成人网| 久久一级电影|