Update
Or is there a way to generate random number between 1 and 52 using lcg package, then associate it to one of the 52 cards from the pst-poker package. Which might be easier to achieve?
OP
Basically, I want to write something simple for generating random poker cards. It looks like I need expl3,xparse and lcg (random numbers). But I am not sure how to put them together.
\documentclass[a4paper,12pt]{article}
\usepackage[pdf]{pstricks} %% added for pdflatex, use pdflatex -shell-escape $(NAME_PART).tex
\usepackage[crop=off]{auto-pst-pdf} %% added for pdflatex, use pdflatex -shell-escape $(NAME_PART).tex
\usepackage{pst-poker}
%%%%%%%%%%% random %%%%%%%%%%%
\usepackage{xstring}
\usepackage{expl3}
\usepackage{lcg} % random number generator
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
\begin{postscript}
\Ks\tenh\sevd
\end{postscript}
\end{document}
This would produce some cards nicely for my purpose using pdflatex. Now I want to do something like a random card drawing.
The "random" process would be something like this
\reinitrand[first=1, last=100, counter=rand]
\rand\arabic{rand}
\reinitrand[first=1, last=13, counter=rand2]
\rand\arabic{rand2}
Then to "pick" the card suit, I would do rand Mod 4, so the values would be 0,1,2,3, and then I can assign the suits(strings) s/c/h/d, for spade,club,heart,dimond.
For rand2, it would be cards from A to K as defined in the package pst-poker-doc.
Lastly, putting the two strings togeher to generate keys like \Ks\tenh\sevd\Kc ect ...
I am sure there is an easier way to do this, but that's as far as I can go...





shuffleof the cards, I kind of just want to draw one/two or some of the cards ... – CasperYC Jan 13 '20 at 01:45