SPEED card game card class setup help

I`m having trouble setting up this class. please help
Cards Class
  1. Properties: Suits (string), Values (string)
  2. 52 Objects (one for each card)
  3. Methods: Shuffle Cards/Split Cards into Two Piles (Creates 52 Card Objects and returns two string arrays), Pick a Card/Remove it from the Player’s Pile (returns a card object and updates the GUI table that displays the cards played)

6 件のコメント

Steven Lord
Steven Lord 2021 年 11 月 24 日
This sounds like a homework assignment. If it is, show us the code you've written to try to solve the problem and ask a specific question about where you're having difficulty and we may be able to provide some guidance.
If you aren't sure where to start because you're not familiar with how to write MATLAB code, I suggest you start with the MATLAB Onramp tutorial (https://www.mathworks.com/support/learn-with-matlab-tutorials.html) to quickly learn the essentials of MATLAB.
Yulisa Posada
Yulisa Posada 2021 年 11 月 24 日
this is my class code so far
Walter Roberson
Walter Roberson 2021 年 11 月 24 日
Your card_values should be ["A', "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K"]
Walter Roberson
Walter Roberson 2021 年 11 月 24 日
Hint: if you have a number 1 to 52 then think about
mod(NUMBER-1, 13) + 1
Yulisa Posada
Yulisa Posada 2021 年 11 月 24 日
How do i implement the objects in a class. Does that go in my function?
So lost on creating the 52 objects for each card
Walter Roberson
Walter Roberson 2021 年 11 月 24 日
What properties does an individual card has? What methods can you apply to a card? As opposed to what properties a "deck" has.
A card obviously has Rank and Suit. Does it also have inherent Position, or is Position something associated with desks? Does an individual card have a "face up" / "face down" property? Does an individual card have a "undealt", "in a deck", "discarded" property ?

サインインしてコメントする。

回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeCard games についてさらに検索

タグ

質問済み:

2021 年 11 月 24 日

コメント済み:

2021 年 11 月 24 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by