[go: up one dir, main page]

0% found this document useful (1 vote)
209 views3 pages

The Algorithm Design Manual

The document discusses using a division procedure to solve a card matching problem. It mentions that the most important procedure created is to name the cards, suits, color, and test for a pair. It then provides examples of using the division procedure to get the row, suit, and color for different card numbers. It concludes that you have a pair if the remainders from the division procedures are equal.

Uploaded by

Steve
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (1 vote)
209 views3 pages

The Algorithm Design Manual

The document discusses using a division procedure to solve a card matching problem. It mentions that the most important procedure created is to name the cards, suits, color, and test for a pair. It then provides examples of using the division procedure to get the row, suit, and color for different card numbers. It concludes that you have a pair if the remainders from the division procedures are equal.

Uploaded by

Steve
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Is there a trick for the cards???

Hint, what do you think the most important procedure is, that we created, to use in the
problem.

Division procedure

Namely, the one to name the cards, suits, color and test for a pair

38/13 3 r 9 for row 3 the suit spades and the color


black card would be Jack

35/13 = 2 r 9 for row 2 hearts and the color is red Jack

These is a pair if the remainders are equal

Do I need an if for the color ? color array


black,red,red,black 54 54/13 = r is 2 4 of some thing
54/4 = r =2 red hearts
Suits club, diam, hearts, spade
Array Cardcolor dword black,red,red, black

emainder == oldremainder) the you have a pair

You might also like