Print arguments of a macro in a random order

I have the following (simplified) LaTeX code that simply prints all its arguments.

\newcommand{\mm}[4]{#1 #2 #3 #4} 

Now, I would like the arguments to be printed in a random order, e.g., #2 #1 #4 #3. Is this possible? If yes, how?

Replay

It seems this code is doing what I want:

\documentclass{article}
\usepackage{xstring}
\input random
\newcount\randnum
\newcommand\argrandom[4]{%
    \def\listarg{{#1}{#2}{#3}{#4}}%
    \setrannum\randnum{1}{4}%
    \StrChar{\listarg}{\randnum}[\mychar]
    \StrDel{\listarg}{\mychar}[\listarg]\mychar\
    \setrannum\randnum{1}{3}%
    \StrChar{\listarg}{\randnum}[\mychar]\mychar\
    \StrDel{\listarg}{\mychar}[\listarg]%
    \setrannum\randnum{1}{2}%
    \StrChar{\listarg}{\randnum}[\mychar]\mychar\
    \StrDel{\listarg}{\mychar}%
}
\begin{document}
\argrandom{un}{deux}{trois}{quatre}
\end{document}

Thanks to nino_ras on this link for answering my question.

Category: macros Time: 2013-11-10 Views: 2

Related post

iOS development

Android development

Python development

JAVA development

Development language

PHP development

Ruby development

search

Front-end development

Database

development tools

Open Platform

Javascript development

.NET development

cloud computing

server

Copyright (C) avrocks.com, All Rights Reserved.

processed in 0.195 (s). 12 q(s)