Word ladder: Difference between revisions
Content added Content deleted
(→{{header|Haskell}}: added alternative solution) |
m (→Breadth-first search: fixed a typo) |
||
Line 259: | Line 259: | ||
=={{header|Haskell}}== |
=={{header|Haskell}}== |
||
=== Breadth-first search=== |
=== Breadth-first search=== |
||
The function first expands a ball around the starting word in the space of possible words, until the ball surface touches the goal (if ever). After that it performs depth-first path-finding from the goal back to the center. |
|||
<lang haskell>import System.IO (readFile) |
<lang haskell>import System.IO (readFile) |