.
, .
. , , . \CASELINE. \CASE \ENDCASE. .
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% The following definitions are to extend the LaTeX algorithmic
%% package with SWITCH statements and one-line structures.
%% The extension is by
%% Prof. Farn Wang
%% Dept. of Electrical Engineering,
%% National Taiwan University.
%%
\newcommand{\SWITCH}[1]{\STATE \textbf{switch} (
\newcommand{\ENDSWITCH}{\STATE \textbf{end switch}}
\newcommand{\CASE}[1]{\STATE \textbf{case}
\newcommand{\ENDCASE}{\end{ALC@g}}
\newcommand{\CASELINE}[1]{\STATE \textbf{case}
\newcommand{\DEFAULT}{\STATE \textbf{default:} \begin{ALC@g}}
\newcommand{\ENDDEFAULT}{\end{ALC@g}}
\newcommand{\DEFAULTLINE}[1]{\STATE \textbf{default:} }
%%
%% End of the LaTeX algorithmic package extension.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
.
\SWITCH {$\theta$}
\CASE {1}
\STATE Hello
\ENDCASE
\CASELINE {2}
\STATE Good-bye
\DEFAULT
\STATE Again ?
\ENDDEFAULT
\ENDSWITCH
.