Find Jobs
Hire Freelancers

323079 Card game

N/A

กำลังดำเนินการ
โพสต์ เกือบ 15 ปีที่ผ่านมา

N/A

ชำระเงินเมื่อส่งงาน
1. Problem: Playing Cards 1.1 General description You are required to write a C++ program to simulate a simple card game. The rules of the game are the following: • A standard deck of 52 playing cards are dealt randomly to four players, each receives 13 cards. Cards rank from 2 (lowest) to A (highest). • Initially, one player is randomly chosen as the banker. A game runs in several rounds. • At each round, the banker plays a single card from his hand. The next player (clockwise) can choose either to “suppress” the card by playing a card with higher rank (disregarding suits) or to “pass” his turn to the next player. All players take turns until no player wants to suppress the current card (the desk card). The owner of the desk card becomes the banker of the next round. • A player wins if he finishes all his cards before any others. 1.2 Tasks and marking criteria Students who are seeking for pass grade should accomplish the following tasks: Task 1: Create a class called Card that represents a playing card. The class should include two private data items: value and suit. The member functions of the class should include, but not limited to, getValue(), setValue(int), getSuit(), setSuit(int) and displayCard() for accessing data members and display cards. Task 2: Create a class called Player to simulate a dummy player. The class should include at least two data items: playerName (string or char*) and CardsInHand (array or vector of Card objects). The class should implement at least the following member functions: setPlayerName (string or char*), getPlayerName(), addCard(Card), play(Card&). The strategy of playing a card can be as simple as giving the first available card in hand that can suppress the desk card. Task 3: Create a class called Game to simulate single game playing. The class should be able to: • Generate a deck of cards • Shuffle the deck • Deal the deck to each player • Randomly pickup one player as the banker before a game starts • Proceed with each round: collecting players' cards, updating information on the current banker and desk cards, taking turns and determining the winner and the banker. Task 4: Write an application (.cpp) to simulate game playing Note: An example program (executable file) in this level is downloadable ([login to view URL]). You do not have to follow exactly the way I did. Students who are seeking for credit grade should accomplish all the above tasks as well as the following extra tasks: Task 5: Create a class called SmartPlayer, which is a derived class of Player (inheritance). The class implements smarter playing strategies in order to win the players. Task 6: Change the application program in Task 4 to simulate multiple game playing. Set one of the players to be the SmartPlayer and play against dummy players. Your SmartPlayer should be able to win more than half of total games. Note: An example program (executable file) in this level is also downloadable ([login to view URL]). Students who are seeking for distinction grade or higher should accomplish all the above tasks 1-6 as well as the following extra tasks: Task 7: Create a class called HumanPlayer, which is also a derived class of Player. HumanPlayer allows a human user to play against computer players (simply providing an interface for the user to input the card or cards to play). Task 8: Extend your program to allow a player to play multiple cards: • Twin: two cards in same rank • Triplets: three cards in same rank • Bomb: four cards in same rank A bomb can suppress any single, twin, triplets or a bomb in lower rank. A twin can only be suppressed by another twin in higher rank. Similar rules apply to triplets.
รหัสโปรเจกต์: 2068886

เกี่ยวกับโปรเจกต์

โปรเจกต์ระยะไกล
ใช้งานอยู่ 12 ปีที่ผ่านมา

กำลังมองหาการสร้างรายได้ใช่ไหม?

ประโยชน์ของการประมูลกับ Freelancer

กำหนดงบประมาณและกรอบเวลาของคุณ
รับเงินจากการงานของคุณ
อธิบายข้อเสนอของคุณในภาพรวม
ลงทะเบียนและเสนอราคาฟรี

เกี่ยวกับลูกค้า

ปักธงของ
0.0
0
เป็นสมาชิกตั้งแต่ พ.ค. 24, 2009

การยืนยันลูกค้า

งานอื่นๆ จากลูกค้ารายนี้

322198 Programming Project 1243169115
N/A
ขอบคุณ! เราได้ส่งลิงก์สำหรับเครดิตฟรีให้คุณทางอีเมลแล้ว
เกิดข้อผิดพลาดขณะส่งอีเมลของคุณ กรุณาลองอีกครั้ง
โลโก้ Freelancer Thailand / ภาษาไทย ช่วยเหลือและสนับสนุน FreelancerประเภทโปรเจคการประกวดFreelancerองค์กรแพ็กเกจสมาชิกโครงการ Freelancer ชั้นแนวหน้าการจัดการโปรเจคงานในพื้นที่Photo Anywhereหน้าจัดแสดงผลงานAPI สำหรับนักพัฒนาได้รับการยืนยันDesktop App เกี่ยวกับเกี่ยวกับเราวิธีใช้งานความปลอดภัยนักลงทุนแผนผังเว็บไซต์เรื่องราวข่าวออกสื่อทีมรางวัลข่าวประชาสัมพันธ์ร่วมงานกับเรา ข้อกำหนดนโยบายความเป็นส่วนตัวข้อกำหนดและเงื่อนไขนโยบายลิขสิทธิ์ข้อพึงปฏิบัติค่าธรรมเนียมและค่าบริการหุ้นส่วนEscrow.comLoadshiftWarrior Forum แอปโลโก้ Apple App Store โลโก้ Google Play
ไม่สามารถคัดลอกไปยังคลิปบอร์ดได้ โปรดลองอีกครั้งหลังปรับเปลี่ยนการอนุญาต
คัดลอกไปยังคลิปบอร์ดแล้ว
ผู้ใช้ที่ลงทะเบียน งานที่มีการโพสต์ทั้งหมด
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
กำลังโหลดตัวอย่าง
ได้รับอนุญาตสำหรับตำแหน่งทางภูมิศาสตร์
เซสชั่นการเข้าสู่ระบบของคุณหมดอายุและคุณได้ออกจากระบบแล้ว กรุณาเข้าสู่ระบบอีกครั้ง