% Copyright 2007 by Nathanaël COTTIN <www.ncottin.net>.
%
% This program can be redistributed and/or modified under the terms
% of the GNU Public License, version 3.

\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{algo}[2008/01/22 version 0.2.4]

\provideboolean{@french}
\DeclareOption{french}{\@frenchtrue}
\ProcessOptions\relax

\RequirePackage{algorithm}
\RequirePackage{algorithmic}

\def\algorithmiclocalvar{\textbf{Local variable(s):}}
\def\algorithmicbegin{\textbf{begin}}
\def\algorithmicenddo{\textbf{done}}
\def\algorithmicbool{\textbf{boolean}}
\def\algorithmicnull{\textbf{null}}

\if@french
	\def\algorithmiclocalvar{\textbf{variable(s) locale(s):}}
	\def\algorithmicbegin{\textbf{début}}
	\def\algorithmicenddo{\textbf{fait}}
	\def\algorithmicbool{\textbf{booléen}}
	\def\algorithmicnull{\textbf{nil}}
	
	\renewcommand{\algorithmicrequire}{\textbf{entrée(s):}}
	\renewcommand{\algorithmicensure}{\textbf{sortie:}}
	\renewcommand{\algorithmicend}{\textbf{fin}}
	\renewcommand{\algorithmicif}{\textbf{si}}
	\renewcommand{\algorithmicthen}{\textbf{alors}}
	\renewcommand{\algorithmicelse}{\textbf{sinon}}
	\renewcommand{\algorithmicfor}{\textbf{pour}}
	\renewcommand{\algorithmicforall}{\textbf{pour tout}}
	\renewcommand{\algorithmicdo}{\textbf{faire}}
	%\renewcommand{\algorithmicendfor}{\algorithmicend\ \algorithmicfor}
	\renewcommand{\algorithmicwhile}{\textbf{tant que}}
	%\renewcommand{\algorithmicendwhile}{\algorithmicend\ \algorithmicwhile}
	\renewcommand{\algorithmicloop}{\textbf{boucler}}
	\renewcommand{\algorithmicendloop}{\algorithmicend\ boucle}
	\renewcommand{\algorithmicrepeat}{\textbf{répéter}}
	\renewcommand{\algorithmicuntil}{\textbf{jusqu'à}}
	\renewcommand{\algorithmicprint}{\textbf{afficher}}
	\renewcommand{\algorithmicreturn}{\textbf{retourner}}
	\renewcommand{\algorithmictrue}{\textbf{vrai}}
	\renewcommand{\algorithmicfalse}{\textbf{faux}}
	\renewcommand{\listalgorithmname}{Liste des algorithmes}
	\floatname{algorithm}{Algorithme}
	
	\let\listofOLD\listof
	\renewcommand{\listof}[2]
		{\listofOLD{algorithm}{Liste des algorithmes}}

%	\newcommand{\algorithmicbegin}{
%		\STATE
%		\item[\textbf{Début}]
%	}
%	
%	\renewcommand{\algorithmicend}{
%		\item[\textbf{Fin}]
%	}
\fi

\newcommand{\ENDFORALL}
	{\ENDFOR}

\newcommand{\ENDDO}
	{\STATE \item[\algorithmicenddo]}

\newcommand{\FI}
	{\ENDIF}

\newcommand{\LOCALVAR}
	{\item[\algorithmiclocalvar]}

\newcommand{\BEGIN}
	{\item[\algorithmicbegin]}

\newcommand{\END}
	{\item[\algorithmicend]}

\newcommand{\ALGTRUE}
	{\algorithmictrue}

\newcommand{\ALGFALSE}
	{\algorithmicfalse}

\newcommand{\BOOL}
	{\algorithmicbool}

\providecommand*{\toclevel@algorithm}{0}

\endinput

