Data update
This commit is contained in:
parent
5af6d93694
commit
796d366b97
455 changed files with 7413 additions and 1900 deletions
29
Task/Odd-word-problem/FutureBasic/odd-word-problem.basic
Normal file
29
Task/Odd-word-problem/FutureBasic/odd-word-problem.basic
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
begin globals
|
||||
short ndx : bool odd : cfstringref stream
|
||||
end globals
|
||||
|
||||
local fn recursion
|
||||
cfstringref ch = mid( stream, 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 : stream = s
|
||||
print : print, stream : print,
|
||||
while ndx < len( stream )
|
||||
fn recursion : print mid( stream, ndx, 1 );
|
||||
odd = yes - odd : ndx++
|
||||
wend
|
||||
print
|
||||
end fn
|
||||
|
||||
window 1, @"Odd word task in FutureBasic", (0,0,310,155)
|
||||
fn oddWordTask( @"what,is,the;meaning,of:life." )
|
||||
fn oddWordTask( @"we,are;not,in,kansas;any,more." )
|
||||
fn oddWordTask( @"This also works with normal spaces." )
|
||||
|
||||
HandleEvents
|
||||
Loading…
Add table
Add a link
Reference in a new issue