Reverse words in a string: Difference between revisions

m (→‎{{header|Tailspin}}: syntax update)
Line 2,039:
""
"----------------------- Robert Frost"</pre>
 
=={{header|MiniScript}}==
<lang MiniScript>lines = ["==========================================",
"| ---------- Ice and Fire ------------ |",
"| |",
"| fire, in end will world the say Some |",
"| ice. in say Some |",
"| desire of tasted I've what From |",
"| fire. favor who those with hold I |",
"| |",
"| ... elided paragraph last ... |",
"| |",
"| Frost Robert ----------------------- |",
"=========================================="]
for line in lines
oldLine = line.split
newLine = []
while oldLine
// the line below line retains the outer box format
newLine.push oldLine.pop
// alternate format, replace above line with below two lines below to strip all superfluous spaces
// word = oldLine.pop
// if word != "" then newLine.push word
end while
print newLine.join
end for</lang>
{{out}}
<pre>
==========================================
| ------------ Fire and Ice ---------- |
| |
| Some say the world will end in fire, |
| Some say in ice. |
| From what I've tasted of desire |
| I hold with those who favor fire. |
| |
| ... last paragraph elided ... |
| |
| ----------------------- Robert Frost |
==========================================
</pre>
 
=={{header|Modula-2}}==