tasks a-s

This commit is contained in:
Ingy döt Net 2013-04-10 23:57:08 -07:00
parent 47bf37c096
commit b83f433714
12433 changed files with 156208 additions and 123 deletions

View file

@ -0,0 +1,17 @@
#!/bin/env racket
#lang racket/base
(define (run i o)
(for ([ch (in-producer regexp-match #f #rx#"[a-zA-Z]" i 0 #f o)])
(define b (bytes-ref (car ch) 0))
(define a (if (< b 96) 65 97))
(write-byte (+ (modulo (+ 13 (- b a)) 26) a))))
(require racket/cmdline)
(command-line
#:help-labels "(\"-\" specifies standard input)"
#:args files
(for ([f (if (null? files) '("-") files)])
(if (equal? f "-")
(run (current-input-port) (current-output-port))
(call-with-input-file f ( (i) (run i (current-output-port)))))))