RosettaCodeData/Task/Reverse-words-in-a-string/Yabasic/reverse-words-in-a-string.basic

27 lines
696 B
Text
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
data " ---------- Ice and Fire ------------ "
data " "
data " fire, in end will world the say Some "
data " ice. in say Some "
data " desire of tasted I've what From "
data " fire. favor who those with hold I "
data " "
data " ... elided paragraph last ... "
data " "
data " Frost Robert ----------------------- "
data ""
dim w$(1)
do
read l$
if l$ <> "" then
n = token(l$, w$(), " ")
for i = n to 1 step -1
print w$(i), " ";
next
print
else
break
end if
loop