偶数行だけを抜き出してみる
30分プログラム、その635。anarchy golf - even linesにインスパイアされました。
ボクのコードは改行を削っても130バイトだけど、Golfでやると37バイトになってしまうらしい。おそろしい話ですね。
使い方
$ gseq 0 10 | gosh 635-evenline.scm 0 2 4 6 8 10
ソースコード
#! /opt/local/bin/gosh ;; -*- mode:scheme; coding:utf-8 -*- ;; ;; evenline.scm - ;; ;; Copyright(C) 2009 by mzp ;; Author: MIZUNO Hiroki / mzpppp at gmail dot com ;; http://howdyworld.org ;; ;; Timestamp: 2009/08/08 21:52:13 ;; ;; This program is free software; you can redistribute it and/or ;; modify it under MIT Lincence. ;; (use srfi-1) (for-each print (map cdr (filter car (map cons (circular-list #t #f) (port->string-list (standard-input-port))))))