Word wrap: Difference between revisions
Content added Content deleted
(→{{header|REXX}}: added more comments in the header section. -- ~~~~) |
(+J) |
||
Line 126: | Line 126: | ||
plaything. |
plaything. |
||
</pre> |
</pre> |
||
=={{header|J}}== |
|||
'''Solution''':<lang j>ww =: 75&$: : wrap |
|||
wrap =: (] turn edges) ,&' ' |
|||
turn =: LF"_`]`[} |
|||
edges =: (_1 + ] #~ 1 ,~ 2 >/\ |) [: +/\ #;.2</lang> |
|||
'''Example''':<lang j> ww GA NB. Wrap at 75 chars by default |
|||
Four score and seven years ago, our forefathers brought forth upon this |
|||
continenent, a new nation, dedicated to the proposition that all men were |
|||
created equal. |
|||
20 ww GA NB. Specify different length |
|||
Four score and |
|||
seven years ago, our |
|||
forefathers brought |
|||
forth upon this |
|||
continenent, a new nation, |
|||
dedicated to the |
|||
proposition that all |
|||
men were created |
|||
equal.</lang> |
|||
=={{header|PARI/GP}}== |
=={{header|PARI/GP}}== |