Odd word problem: Difference between revisions

m
(→‎{{header|FutureBasic}}: Replaced with new code that more closely follows task guidelines, using a recursive function.)
Line 1,010:
=={{header|FutureBasic}}==
<syntaxhighlight lang="futurebasic">
 
 
begin globals
short ndx : bool odd : cfstringref sequencestream
end globals
 
local fn recursion
cfstringref ch = mid( sequencestream, ndx, 1 )
if fn StringContainsString( @",;:. ", ch ) == no
ndx++
if odd then fn recursion : print ch; ¬
else print ch; : fn recursion
end if
end fn
 
local fn oddWordTask( s as cfstringref )
ndx = 0 : odd = no : sequencestream = s
print : print,sequence stream : print,
while ndx < len( sequencestream )
fn recursion : print mid( sequencestream, ndx, 1 );
odd = yes - odd : ndx++
wend
68

edits