<frame>
. The complete form of the pseudocode environment is
\begin{pseudocode}[<frame>]{<Name>}{<Parameters>} pseudocode constructs \end{pseudocode}
The possible values of <frame>
are:
shadowbox |
doublebox |
ovalbox |
Ovalbox |
framebox |
plain |
ruled |
display |
plain
is the default and adds no frame to the algorithm.
The value display
is used for displaying sections of code
without the algorithm name or parameters. Here are some examples with
input:
\begin{pseudocode}[<frame>]{SquareAndMultiply}{x,b,n} \COMMENT{ Compute $x^b \pmod{n}$}\\ z\GETS 1\\ \WHILE b > 0 \DO \BEGIN z \GETS z^2 \pmod{n} \\ \IF b\mbox{ is odd} \THEN z \GETS z \cdot x \pmod{n} \\ b \GETS \CALL{ShiftRight}{b} \END\\ \RETURN{z} \end{pseudocode}
where we give <frame>
each of the values described above.
When <frame>
is shadowbox
we obtain:
When <frame>
is doublebox
we obtain:
When <frame>
is ovalbox
we obtain:
When <frame>
is Ovalbox
we obtain:
When <frame>
is framebox
we obtain:
When <frame>
is plain
or if [<frame>]
is omitted we obtain:
When <frame>
is ruled
we obtain:
The purpose of the value display
is to allow portions of
algorithms to be displayed with out the algorithm header. Thus
for example to display the section of code in the
loop
of the
algorithm one could write
\begin{center} \begin{minipage}{2in} \begin{pseudocode}[display]{}{} z \GETS z^2 \pmod{n} \\ \IF b\mbox{ is odd} \THEN z \GETS z \cdot x \pmod{n}\\ b \GETS \CALL{ShiftRight}{b} \end{pseudocode} \end{minipage} \end{center}
which would produce the following output: