The assistant gave the audience a poker video with 52 images without any ghosts, so that the audience could have five images.
The assistant sorts 5 cards (this is the Key), then returns the first card to the audience, and the remaining 4 cards are handed over
Magician: What is the first card that the magician says?
The principle is as follows:
Two of the five cards are of the same color.
The assistant finds two cards of the same color and looks at the number of points, for example, 2 and 7. Because 7-2 = 5 <= 6, let 7 put the front.
If it is 2, 9-2 = 7> 6, put 2 in front. So that point a of the front card and point B of the back card
Satisfied (a-B + 13) % 13 <= 6, where % is the meaning of the remainder, for example, 15% 13 = 2
Among the remaining three cards, find the smallest one. The square a is the smallest and the black peach K is the largest.
Assume that the previous (a-B + 13) % 13 = C (0 <C <= 6)
In the remaining three cards, if C <4, place the smallest card in the position C; otherwise, place it in the position C-3.
The remaining two cards, if C> 3, make the front card bigger than the back card, otherwise make the front card smaller than the back card.
In this way, the order of the five cards will be arranged, and the first card will be sent back to the audience, and the remaining four cards will be given to the magician.
Then the magician held four cards, excluding the card at the beginning, to find the minimum position P (P = 1 or 2 or 3 ),
Then remove this card. If the remaining two cards are larger than the latter, add 3 to P. This is where P may be 1 ~ 6.
Then, let's look at the number B of the card at the beginning, then the number A = (B + p) % 13 of the audience's card, with the same color.
In this way, the question is 1018.a card trick in Sicily. Describes the decryption process and how to encrypt it.
And programming.
For example, the audience draws four red hearts, five plum blossoms, ten squares, and ten red hearts. Q,
In this case, the order is red-hearted 5, red-hearted Q box 10, plum blossom 10, and Square 4.
In the last three cards, the minimum number of blocks is 3rd in four rows, and the order of the other two card blocks 10 and plum 10 is reversed.
P = 3 + 3 = 6. The first card is (12 + 6) % 13 = 5. Note that Q is 12.
Of course, the sorting result is not necessarily unique.
Haha, now you can go to laruence ~~~
PS: This is my 150th question in Sicily. I upgraded it to class 5-beetle .. Before you go home ..