Word wrap: Difference between revisions
Content added Content deleted
(→{{header|Ada}}: Added Ada version) |
m (→{{header|Ada}}) |
||
Line 136: | Line 136: | ||
Output, set to 72 lines (with input picked by cut-and-paste from the task description): |
Output, set to 72 lines (with input picked by cut-and-paste from the task description): |
||
<pre>Even today, with proportional fonts and complex layouts, there are still |
<pre>Even today, with proportional fonts and complex layouts, there are still |
||
cases where you need to wrap text at a specified column. The basic task |
cases where you need to wrap text at a specified column. The basic task |
||
Line 157: | Line 155: | ||
the two algorithms give different results.</pre> |
the two algorithms give different results.</pre> |
||
Note that this solution properly deals with multi-paragraph inputs. |
|||
⚫ | |||
For more sophisticated algorithms (the extra credit), one could derive |
|||
⚫ | |||
=={{header|AWK}}== |
=={{header|AWK}}== |