Data update
This commit is contained in:
parent
5150844a7d
commit
4bb20c9b71
7735 changed files with 38060 additions and 199180 deletions
|
|
@ -3,18 +3,18 @@
|
|||
(let loop ((char (read-char port)) (word '()) (result '(())))
|
||||
(cond
|
||||
((eof-object? char)
|
||||
(reverse (map (lambda (word) (apply string word)) result)))
|
||||
(reverse (map (lambda (word) (apply string word)) result)))
|
||||
((eq? #\newline char)
|
||||
(loop (read-char port) '()
|
||||
(let ((best-length (length (car result))) (word-length (length word)))
|
||||
(cond
|
||||
((or (< word-length best-length) (not (apply char>=? word))) result)
|
||||
((> word-length best-length) (list (reverse word)))
|
||||
(else (cons (reverse word) result))))))
|
||||
(loop (read-char port) '()
|
||||
(let ((best-length (length (car result))) (word-length (length word)))
|
||||
(cond
|
||||
((or (< word-length best-length) (not (apply char>=? word))) result)
|
||||
((> word-length best-length) (list (reverse word)))
|
||||
(else (cons (reverse word) result))))))
|
||||
(else (loop (read-char port) (cons char word) result))))))
|
||||
|
||||
(map (lambda (x)
|
||||
(begin
|
||||
(display x)
|
||||
(newline)))
|
||||
(display x)
|
||||
(newline)))
|
||||
sorted-words)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue