\documentclass[12pt]{article}\usepackage{aymar}\usepackage[french,vlined,boxed]{algorithm2e}
\begin{document}


\newcommand{\returnline}{\psset{unit=8pt}
\begin{pspicture}(0,0)(1,1)
\psline(0.8,0.9)(0.8,0.3)(0.2,0.3)
\psline(0.4,0.1)(0.2,0.3)(0.5,0.5)
\end{pspicture}}

\newcommand{\casiotrig}{\psset{unit=10pt}
\begin{pspicture}(0,0)(0.5,1)
\pspolygon[fillstyle=solid,fillcolor=black](0,0)(0.5,0)(0.5,0.5)
\end{pspicture}}
\newcommand{\sto}{$\rightarrow$}



\sectionblack{Commandes}
\begin{center}
\begin{tabular}{|l|l|l|}
\hline
\hfill COMMANDES & \hfill CASIO & \hfill TEXAS \\[5pt] \hline
Exécution, Création, Édition & 
%casio
Menu PRGM  & 
%texas
\parbox{4.5cm}{\vspace{0.2cm} PRGM : \scalebox{0.7}{\fbox{PRGM}}} \\[5pt]  \hline
Saisir, Afficher & 
%casio afficher
\parbox{4.5cm}{\vspace{0.2cm}\scalebox{0.7}{\fbox{SHIFT}}+\scalebox{0.7}{\fbox{VARS}} \\ saisir :~? \\  afficher : \casiotrig \\ pour afficher du texte, encadrer le avec `` : \scalebox{0.7}{\fbox{SHIFT}} \scalebox{0.7}{\fbox{ALPHA}}\\} &
%texas afficher
\parbox{4.5cm}{\vspace{0.2cm}PRGM -- I/O  : \scalebox{0.7}{\fbox{PRGM}} \\ saisir : Prompt \\ afficher : Disp \\ pour afficher du texte, disp et encadrer le avec `` : \scalebox{0.7}{\fbox{ALPHA}} \scalebox{0.7}{\fbox{+}}} \\[5pt] \hline
Affectation dans variable &
%casio
\parbox{4.5cm}{\vspace{0.2cm}\scalebox{0.7}{\fbox{$\rightarrow$}}} &
%texas
\parbox{4.5cm}{\vspace{0.2cm}\scalebox{0.7}{\fbox{sto$\rightarrow$}}}\\[5pt] \hline
Séparateur instruction & 
%casio
\parbox{4.5cm}{\vspace{0.2cm}\scalebox{0.7}{\fbox{SHIFT}}+\scalebox{0.7}{\fbox{VARS}} > \scalebox{0.7}{\fbox{F6}} > \scalebox{0.7}{\fbox{F1}} :\\} &
%texas
\\[5pt]\hline
\end{tabular}
\end{center}

\bigskip
\sectionblack{Boucles conditionnelles}
\begin{center}
\begin{tabular}{|l|l|l|}
\hline
\hfill COMMANDES & \hfill CASIO & \hfill TEXAS \\[5pt] \hline
Condition &
%casio boucle
\parbox{4.5cm}{\vspace {0.2cm} PRGM -- COM  \\ \scalebox{0.7}{\fbox{SHIFT}}+\scalebox{0.7}{\fbox{VARS}} > \scalebox{0.7}{\fbox{F1}}\\}&
%texas boucle
\parbox{4.5cm}{\vspace{0.2cm} PRGM -- CTL \\ \scalebox{0.7}{\fbox{PRGM}}\\} \\[5pt] \hline
Test ($=$, $<$, \dots)&
%casio rel logique
\parbox{4.5cm}{\vspace{0.2cm} PRGM -- REL \\ \scalebox{0.7}{\fbox{SHIFT}}+\scalebox{0.7}{\fbox{VARS}} > \scalebox{0.7}{\fbox{F6}} > \scalebox{0.7}{\fbox{F3}}\\} &
%texas rel logique
\parbox{4.5cm}{\vspace{0.2cm} TEST \\ \scalebox{0.7}{\fbox{2nde}}+\scalebox{0.7}{\fbox{MATH}}\\}\\[5pt]\hline
Opérateur logique ( OU ; ET )&
%casio condition
\parbox{4.5cm}{\vspace{0.2cm} OPTION -- LOGIQUE : \\ \scalebox{0.7}{\fbox{OPTN}} > \scalebox{0.7}{\fbox{F6}} > \scalebox{0.7}{\fbox{F6}} > \scalebox{0.7}{\fbox{F4}}\\} & 
%texas condition
\parbox{4.5cm}{\vspace{0.2cm} LOGIC \\ \scalebox{0.7}{\fbox{2nde}}+\scalebox{0.7}{\fbox{MATH}}\\}\\[5pt]\hline
\end{tabular}
\end{center}
Les boucles conditionnelles s'écrivent sous la forme :\\
if \textsl{condition} : then \textsl{instruction(s)} : else \textsl{instruction(s)} : End


\bigskip
\sectionblack{Exemples}


\begin{center}
\begin{tabular}{|c|c|c|}
\hline
\rowcolor{lightgray} Algorithme & Casio & Texas \\ \hline
\parbox{6cm}{
\incmargin{1em}
\begin{algorithm}[H]
%\caption{ }
%\Variable{deux nombres $A$ et $B$}
\Entree{saisir $A$, $B$}
\Deb{$C$ prend la valeur de $A$ \;
$A$ prend la valeur de $B$ \;
$B$ prend la valeur de $C$ \;
afficher $A$,$B$.}
\end{algorithm}
\decmargin{1em}
}
&
\parbox{3cm}{\tt
?\sto A\returnline\\
?\sto B\returnline\\
A\sto C\returnline\\
B\sto A\returnline\\
C\sto B\returnline\\
``A=''\hspace*{-5pt}:A\casiotrig\\
``B=''\hspace*{-5pt}:B\returnline}
&
\parbox{3cm}{\tt
:Prompt A\\
:Prompt B\\
:A\sto C\\
:B\sto A\\
:C\sto B\\
:Disp``A='',A\\
:Disp``B='',B
}\\
\hline
\end{tabular}
\end{center}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%SAUT DE  PUCE%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newpage
\sectionblack{Algorithme : SAUT DE PUCE}
\begin{center}
\begin{tabular}{|c|c|c|}
\hline
\rowcolor{lightgray} Algorithme & Casio & Texas \\ \hline
\parbox{7cm}{
\incmargin{1em}
\begin{algorithm}[H]
  %\SetLine
  \Variable{$x$, $i$ entiers}
  \Entree{$x$ prend la valeur $0$\;$i$ prend la valeur $0$\;}
  \Deb{
  \Tq{$i$ est inférieur à $3$}{
    \eSi{alea < $0,5$}{
      	$x$ prend la valeur $x-1$\;
      	}{
      	$x$ prend la valeur $x+1$\;
      	}
	$i$ devient $i+1$\;
	}
   Afficher l'entier $x$}
\end{algorithm}
\decmargin{1em}
}
&
\parbox{3cm}{\tt
0\sto X\returnline\\
0\sto I\returnline\\
While I<3\returnline\\
If rand<0.5\returnline\\
Then X+1\sto X\returnline\\
Else X-1\sto X\returnline\\
IfEnd\returnline\\
I+1\sto I\returnline\\
WhileEnd\returnline\\
Disp X
}
&
\parbox{3cm}{\tt
:0\sto X\\
:0\sto I\\
:While I<3 \\
:If rand<0.5\\
:Then\\
:X+1\sto X\\
:Else\\
:X-1\sto X\\
:End\\
:I+1\sto I\\
:End\\
:Disp X
}\\
\hline
\end{tabular}
\end{center}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%FAMILLE%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%\newpage
\sectionblack{Algorithme : POLITIQUE NATALISTE}
\begin{center}
\begin{tabular}{|c|c|c|}
\hline
\rowcolor{lightgray} Algorithme & Casio & Texas \\ \hline
\parbox{7cm}{
\incmargin{1em}
\begin{algorithm}[H]
  %\SetLine
  \Variable{$x$, $i$, $f$ entiers, $L$ liste}
  \Entree{Vider la liste $L$\; $x$ prend la valeur $0$\; $i$ prend la valeur $1$\;$f$ prend la valeur $0$\;}
  \Deb{
  \Tq{$x$ est différent de $1$ et $i$ plus petit que $5$}{
    \eSi{alea < $0,5$}{
      	$x$ prend la valeur $0$\;
	$f$ prend la valeur $f+1$\;
      	}{
      	$x$ prend la valeur $1$\;
      	}
      	$L(i)$ prend la valeur x\;
	$i$ prend la valeur $i+1$\;
	}
   Afficher la liste $L$\;
   Afficher $f$\;}
\end{algorithm}

\decmargin{1em}
}
&
\parbox{4.15cm}{\tt
\{3,3,3,3\}\sto List 1\returnline\\
0\sto X\returnline\\
1\sto I\returnline\\
0\sto F\returnline\\
While I$\neq$1 and I<5\returnline\\
If rand<0.5\returnline\\
Then 0\sto X\returnline\\
F+1\sto I\returnline\\
Else 1\sto X\returnline\\
IfEnd\returnline\\
X\sto L1[I]\returnline\\
I+1\sto I\returnline\\
WhileEnd\returnline\\
List 1\returnline\\
F\returnline
}
&
\parbox{4.15cm}{\tt
:ClrList L1\\
:0\sto X\\
:1\sto I\\
:0\sto F\\
:While I$\neq$1 and I<5 \\
:If rand<0.5\\
:Then\\
:0\sto X\\
:F+1\sto I\\
:Else\\
:1\sto X\\
:End\\
:X\sto L1(I)\\
:I+1\sto I\\
:End\\
:Disp L1\\
:Disp F
}\\
\hline
\end{tabular}
\end{center}
\end{document}

