I wish to indicate clearly when a block starts and ends with "enclosing lines" in addition to the indentation.
I understand that I can do it with algorithm2e like so
\begin{algorithm}[H]
\SetLine % For v3.9
%\SetAlgoLined % For previous releases [?]
\KwData{this text}
\KwResult{how to write algorithm with \LaTeX2e }
initialization\;
\While{not at end of this document}{
read current\;
\eIf{understand}{
go to next section\;
current section becomes this one\;
}{
go back to the beginning of current section\;
}
}
\caption{How to write algorithms}
\end{algorithm}
rendering as

However now, I am using algorithmicx. How may I achieve the same effect?