September Morn Update
This commit is contained in:
parent
4e2d22a71d
commit
aac6731f2c
6856 changed files with 141342 additions and 21127 deletions
1
Task/Odd-word-problem/00META.yaml
Normal file
1
Task/Odd-word-problem/00META.yaml
Normal file
|
|
@ -0,0 +1 @@
|
|||
--- {}
|
||||
31
Task/Odd-word-problem/Ol/odd-word-problem.ol
Normal file
31
Task/Odd-word-problem/Ol/odd-word-problem.ol
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
(define (odd_word_problem words)
|
||||
(letrec ((odd (lambda (s out)
|
||||
(let loop ((s s) (l '()))
|
||||
(cond
|
||||
((null? s)
|
||||
out)
|
||||
((pair? s)
|
||||
(if (<= #\a (car s) #\z)
|
||||
(loop (cdr s) (cons (car s) l))
|
||||
(even (cdr s) (cons (cons (reverse l) (car s)) out))))
|
||||
(else
|
||||
(loop (s) l))))))
|
||||
(even (lambda (s out)
|
||||
(let loop ((s s) (l '()))
|
||||
(cond
|
||||
((null? s)
|
||||
out)
|
||||
((pair? s)
|
||||
(if (<= #\a (car s) #\z)
|
||||
(loop (cdr s) (cons (car s) l))
|
||||
(odd (cdr s) (cons (cons l (car s)) out))))
|
||||
(else
|
||||
(loop (s) l)))))))
|
||||
(for-each (lambda (p)
|
||||
(display (runes->string (car p)))
|
||||
(display (string (cdr p))))
|
||||
(reverse
|
||||
(odd (str-iter words) '()))))
|
||||
(print))
|
||||
(odd_word_problem "what,is,the;meaning,of:life.")
|
||||
(odd_word_problem "we,are;not,in,kansas;any,more.")
|
||||
|
|
@ -4,7 +4,7 @@ oFID_ = 'ODDWORD.' /* " " " " "
|
|||
|
||||
do case=1 for 2; #=0 /*#: is the number of characters read.*/
|
||||
iFID=iFID_ || case /*read ODDWORD.IN1 or ODDWORD.IN2 */
|
||||
oFID=oFID_ || case /*write ODDWORD.1 o r ODDWORD.2 */
|
||||
oFID=oFID_ || case /*write ODDWORD.1 or ODDWORD.2 */
|
||||
say; say; say '════════ reading file: ' iFID "════════" /* ◄■■■■■■■■■ optional. */
|
||||
|
||||
do until x==. /* [↓] perform for "odd" words.*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue