Odd word problem: Difference between revisions
m
→{{header|FutureBasic}}
(→{{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
end globals
local fn recursion
cfstringref ch = mid(
if fn StringContainsString( @",;:. ", ch ) == no
ndx++
if odd then fn recursion : print ch; ¬
end if
end fn
local fn oddWordTask( s as cfstringref )
ndx = 0 : odd = no :
print : print,
while ndx < len(
fn recursion : print mid(
odd = yes - odd : ndx++
wend
|