So in this scenario I have an array with multiple cards within a deck. These cards in each index are ranked S1R1, S1R2, S1R3, S2R1, S2R2, S2R3. I need to be able to extract both numbers from each index position and multiply them together and eventually add them up.
For example,
position 0 would be 1 * 1 = 1
position 1 would be 1 * 2 = 2
position 2 would be 1 * 3 = 3
etc. etc.
The code for this example changes based on user input so it's tough to give you the code to work with.
public void createDeckofCards() {
SizeOfDeck = NumberOfRanks * NumberOfSuits;
Cards newCard = new Cards();
newCard.setCards ( NumberOfRanks, NumberOfSuits );
newDeck = new String [ SizeOfDeck ];
int counter = 0;
for (int whatSuit = 1; whatSuit <= NumberOfSuits; whatSuit++) {
for (int rank = 1; rank <= NumberOfRanks; rank++) {
newDeck[counter++] = newCard.createCard(rank, whatSuit);
}
}
}
This is what calls upon method createCard() which creates each card based on how many cards the user inputs. So newDeck[] contains all these cards that I need to break into numbers and summarize eventually. (Making a histogram of 100,000 hands of cards)
Thank you for your time, and I appreciate any input
