How to wrap lines correctly inside algorithmic
algorithmicx
obviously wasn't intended to manage paragraph-style text as part of pseudo code. You're going to have to do some of your own legwork in order for it to replicate your requirements:
\documentclass{article}
\usepackage{algorithm,algpseudocode}
\makeatletter
\newcommand{\algmargin}{\the\ALG@thistlm}
\makeatother
\newlength{\whilewidth}
\settowidth{\whilewidth}{\algorithmicwhile\ }
\algdef{SE}[parWHILE]{parWhile}{EndparWhile}[1]
{\parbox[t]{\dimexpr\linewidth-\algmargin}{%
\hangindent\whilewidth\strut\algorithmicwhile\ #1\ \algorithmicdo\strut}}{\algorithmicend\ \algorithmicwhile}%
\algnewcommand{\parState}[1]{\State%
\parbox[t]{\dimexpr\linewidth-\algmargin}{\strut #1\strut}}
\begin{document}
\begin{algorithm}
\caption{My pseudo code.}
\begin{algorithmic}[1]
\While{this line is sooooooooooo long and boring and too much for algorithmic to handle}
\State look at this state, this state is just too long for algorithmic to display it properly
\While{again this line is sooooooooooo long and boring and too much for algorithmic too handle}
\State look at this state again, this state is just too long for algorithmic to handle, I'm just going to switch to Word
\EndWhile
\EndWhile
\State
\parWhile{this line is sooooooooooo long and boring and too much for algorithmic to handle}
\parState{%
look at this state, this state is just too long for algorithmic to display it properly}
\parWhile{again this line is sooooooooooo long and boring and too much for algorithmic too handle}
\parState{%
look at this state again, this state is just too long for algorithmic to handle, I'm just going to switch to Word}
\EndparWhile
\EndparWhile
\end{algorithmic}
\end{algorithm}
\end{document}
In the above code, \parWhile
and \parState
define the paragraph-style pseudo-code macros that you're after.