Add tasks for all the new languages

This commit is contained in:
Tina Müller 2016-12-05 23:44:36 +01:00
parent 9dc3c2bb62
commit bba7bfd280
13208 changed files with 134745 additions and 0 deletions

View file

@ -0,0 +1,30 @@
(lib 'sequences)
(define input-stream null)
(define output-stream "")
;;---------------------------
;; character I/O simulation
;; --------------------------
(define (read-char) (next input-stream)) ;; #f if EOF
(define (write-char c) (when c (set! output-stream (string-append output-stream c))))
(define (init-streams sentence)
(set! input-stream (procrastinator sentence))
(set! output-stream ""))
;;---------------------------------
;; task , using read-char/write-char
;;----------------------------------
(define (flop) ; reverses, and returns first non-alpha after word, or EOF
(define c (read-char))
(if (string-alphabetic? c) (begin0 (flop) (write-char c)) c))
(define (flip)
(define c (read-char))
(if (string-alphabetic? c) (begin (write-char c) (flip)) c))
(define (task sentence)
(init-streams sentence)
(while (and (write-char (flip)) (write-char (flop))))
output-stream )

View file

@ -0,0 +1,5 @@
(task "what,is,the;meaning,of:life.")
→ "what,si,the;gninaem,of:efil."
; check diacritical
(task "Longtemps,je me suis couché,héhé,hôhô,de bonne heure.")
→ "Longtemps,ej me sius couché,éhéh,hôhô,ed bonne erueh."