a) \begin{algorithmic}[1] \FORALL{entries $e$ on the shopping list} \STATE{$c \leftarrow \text{category of $e$}$} \STATE{Go to shelf $s$ labeled $c$} \FORALL{products $p$ on $s$} \label{alg:loopstart} \IF{$p$ matches $e$} \STATE{add $p$ to shopping basket} \STATE{break out of loop started in line \ref{alg:loopstart}} \ENDIF \ENDFOR \ENDFOR \end{algorithmic} b) \begin{algorithmic}[1] \WHILE{not at destination within forest} \STATE{break crumb of bread} \STATE{drop crumb} \STATE{take step towards destination} \ENDWHILE \WHILE{not out of forest} \IF{we see at least one crumb} \STATE{Go to the closest one} \STATE{Pick it up} \ELSE \STATE{Get eaten by a witch} \ENDIF \ENDWHILE \end{algorithmic}