Update all new Tasks
This commit is contained in:
parent
00a190b0a6
commit
91df62d461
5697 changed files with 93386 additions and 804 deletions
26
Task/Odd-word-problem/J/odd-word-problem-1.j
Normal file
26
Task/Odd-word-problem/J/odd-word-problem-1.j
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
putch=: 4 :0 NB. coroutine verb
|
||||
outch y
|
||||
return x
|
||||
)
|
||||
|
||||
isletter=: toupper ~: tolower
|
||||
|
||||
do_char=: 3 :0 NB. coroutine verb
|
||||
ch=. getch''
|
||||
if. isletter ch do.
|
||||
if. odd do.
|
||||
putch&ch yield do_char '' return.
|
||||
end.
|
||||
else.
|
||||
odd=: -. odd
|
||||
end.
|
||||
return ch
|
||||
)
|
||||
|
||||
evenodd=: 3 :0
|
||||
clear_outstream begin_instream y
|
||||
odd=: 0
|
||||
whilst. '.'~:char do.
|
||||
outch char=. do_char coroutine ''
|
||||
end.
|
||||
)
|
||||
4
Task/Odd-word-problem/J/odd-word-problem-2.j
Normal file
4
Task/Odd-word-problem/J/odd-word-problem-2.j
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
evenodd 'what,is,the;meaning,of:life.'
|
||||
what,si,the;gninaem,of:efil.
|
||||
evenodd 'we,are;not,in,kansas;any,more.'
|
||||
we,era;not,ni,kansas;yna,more.
|
||||
Loading…
Add table
Add a link
Reference in a new issue