Update all new Tasks

This commit is contained in:
Ingy döt Net 2015-02-20 09:02:09 -05:00
parent 00a190b0a6
commit 91df62d461
5697 changed files with 93386 additions and 804 deletions

View file

@ -0,0 +1,22 @@
procedure main()
every OddWord(!["what,is,the;meaning,of:life.",
"we,are;not,in,kansas;any,more."])
end
procedure OddWord(stream) #: wrapper for demonstration
write("Input stream: ",stream)
writes("Output stream: ") & eWord(create !stream,'.,;:') & write()
end
procedure eWord(stream,marks) #: handle even words
repeat {
repeat
writes(@stream) ? if ="." then return else if any(marks) then break
if writes(oWord(stream,marks)) == '.' then return
}
end
procedure oWord(stream,marks) #: handle odd words (reverse)
if any(marks,s := @stream) then return s
return 1(oWord(stream,marks), writes(s))
end

View file

@ -0,0 +1,10 @@
procedure main(A)
repeat (while writes((any(&letters, c := reads(&input,1)),c))) |
(writes(c) ~== "." ~== writes(rWord())) | break write()
end
procedure rWord(c)
c1 := rWord((any(&letters, c1 := reads(&input,1)),c1))
writes(\c)
return c1
end