RosettaCodeData/Task/Word-wrap/00DESCRIPTION

21 lines
988 B
Text
Raw Permalink Normal View History

2015-02-20 00:35:01 -05:00
Even today, with proportional fonts and complex layouts, there are still [[Template:Lines_too_long|cases]] where you need to wrap text at a specified column.
2016-12-05 22:15:40 +01:00
;Basic task:
2015-02-20 00:35:01 -05:00
The basic task is to wrap a paragraph of text in a simple way in your language.
If there is a way to do this that is built-in, trivial, or provided in a standard library, show that. Otherwise implement the [http://en.wikipedia.org/wiki/Word_wrap#Minimum_length minimum length greedy algorithm from Wikipedia.]
2013-04-11 01:07:29 -07:00
Show your routine working on a sample of text at two different wrap columns.
2016-12-05 22:15:40 +01:00
;Extra credit:
Wrap text using a more sophisticated algorithm such as the Knuth and Plass TeX algorithm.
2015-02-20 00:35:01 -05:00
If your language provides this, you get easy extra credit,
but you ''must reference documentation'' indicating that the algorithm
is something better than a simple minimimum length algorithm.
2013-04-11 01:07:29 -07:00
2015-02-20 00:35:01 -05:00
If you have both basic and extra credit solutions, show an example where
the two algorithms give different results.
2016-12-05 22:15:40 +01:00
<br><br>