A very nice article on magic tricks in late 16th century Milan by the present-day magician Vanni Bossi is at
https://books.google.com/books?id=cU3NB ... si&f=false
It is about Luca Paciola's
De Viribus Quantitas, never published (until 1998) but written c. 1500, in Milan and Florence, the contents of which in some form or other were apparently much used by magicians after that. The article cites a 19th century authority to the effect that most of the card tricks to be seen in the book were the invention of Leonardo da Vinci. He also cites a Professor Augusto Marinoni, an authority on Leonardo, that he "had an interest in conjuring and performed some tricks" (p. 125). Paciola was a Franciscan monk and Professor, I presume of mathematics, in Milan 1406-1499, where he and Leonardo became friends and, according to biographers, co-authored a book "Of Divine Proportion" with him before writing De Viribus (see p. 119 of the same book, also about Paciola by a different author). Leonardo and Paciola went from Milan to Florence at the same time (1499, it says on p. 119), where Paciola taught at the Universities of Florence and Milan. Although members of religious orders were discouraged from doing magic tricks, Paciola justified his performances on the grounds that he was using them to teach "the power of numbers in an easily comprehensible way" (p. 124)/
In relation to the card, I find four things of interest.
1. Magic tricks were not just the province of low-lifes, if Leonardo da Vinci performed them for others (one of his tricks is reported in the article) and also a Franciscan monk who was a professor at various universities and an author of numerous books on mathematics and other subjects. Bossi's article also relates that a performer of magic tricks, one Jasonne da Ferrara, and his assistant (a boy) were invited into "gentlemen's houses" where Paciola was in attendance (p. 127). Bossi also states that "we can also suppose" Paciola shared his secrets with "street conjurers or court performers". So they were accepted at court. The reason it can be "supposed" are because it would have been an exchange whereby he could increase his store of tricks, and also the principles explained are those behind tricks that appear in later booklets that have survived.
2. Previously there were books explaining how to do tricks based on mathematical principles using coins and dice. This is the first book known that includes cards as well, even mentioning "trionphi". That is because theprinciples are similar, all based on quantitative considerations. It is thus like the sortilege-books, first dice and then cards, in a similar fashion.
3. The verbal patter that went with the tricks is that of the same mind-reading or seeing the cards "divined" in his mind that we are familiar with in the 19th and 20th century (an example is in the preceding article). It is the apparent use of one method to distract from and disguise the use of another. Paciola emphasizes the effect of astonishing the audience. The other article on Paciola in the book (in a part not given in Google Books, by Singmaster) even uses the term "divining" for ascertaining what another person is thinking of (p. 102); I would suppose that the Latin is the similar cognate term (as in Cicero's "De Divinatione"), but I don't know. Here is the paragraph (p. 102) by Singmaster.
The first western Binary Divination- Ff. 114r-116r = Uri 256-260 = Peirani 161-162, C(apitolo). LX1X. a trovare una tnoneta jra 16 pensala (To find a coin thought of among 16)—divides 16 coins in half four times, corresponding to the value of the binary digits. Pacioli doesn't describe the second stage clearly, but Agostini makes it clear. This idea is supposed to have been common in Japan from the 14th century or earlier, but I haven't seen examples. Pacioli gives many other simple divinations, some based on the Chinese Remainder Theorem and the classic problem of divining a permutation of three items.
I am not sure who Agostini is, I assume some later writer on mathematical puzzles and tricks.
4. That Leonardo was interested in magic tricks tends to show the close relationship between the art of painting and the art of the conjurer, both creating illusions for the purpose of astonishing and delighting their audience. The article relates that Paciola taught Leonardo about perspective, one method by which the painter creates the illusion of real three dimensional space in his work. It is a comparison Plato also made in The Republic, to the detriment of both.