Creating a structure of a deck of cards with three fields: suit, card, and card value

조회 수: 3 (최근 30일)
I am trying to fill a structure array with fields suit, card, and cardValue. My structure is supposed to have 52 cards which have a string value that indicates their suit, a string value that indicated the card(Ace, King, 2, 7, etc.) and a value for that card(2,3,...,13,14 for 2,3,King,Ace). I am having trouble population my structure and would appreciate any help! Thank you
  댓글 수: 1
Bob Thompson
Bob Thompson 2019년 11월 5일
What kind of trouble are you having? Are you running into specific errors? What does your code look like so far?
I would think this would generally be fairly easy. You could index the different cards within the structure fairly easily, but entering them would probably be a pretty manuel job unless you had some kind of array which contains all the information already (even if it's not actually in Matlab).

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Card games에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by