この記事は Functional Ikamusume Advent Calendar jp 2010 によって侵略されたでゲソ。
今回は Ruby を侵略したでゲソ。まずは gem をインストールするでゲソ。
$ gem install ikamusume
Hello, world でゲソ。
# coding: utf-8 # ruby examples/hello.ikamusume で実行するでゲソ # 未だに 1.8 を使ってる愚かなる人類は -Ku を付ければいいんじゃなイカ? require "ikamusume" "Hello, world!\n" <= イカ娘! "H" <= "e" <= "l" <= "l" <= "o" <= "," <= " " <= "w" <= "o" <= "r" <= "l" <= "d" <= "!" <= "\n" <= イカ娘!
$ ruby examples/hello.ikamusume Hello, world! Hello, world!
次は四角くゲソゲソ言うでゲソ。
# coding: utf-8 # based on Square.unl # see http://www.madore.org/~david/programs/unlambda/ in detail require "ikamusume" "\n" <= (侵略! <= イカ娘! <= (ゲソ <= (侵略! <= (侵略! <= (ゲソ <= ゲソ) <= (侵略! <= イカ娘!)) <= (侵略! <= (侵略! <= イカ娘! <= (ゲソ <= (侵略! <= (ゲソ <= (侵略! <= (ゲソ <= (侵略! <= ゲソ <= (侵略! <= "\n" <= (ゲソ <= "ゲソ")))))) <= イカ娘!))) <= "\n"))) <= (侵略! <= イカ娘! <= (侵略! <= イカ娘! <= (侵略! <= イカ娘! <= (侵略! <= イカ娘! <= (侵略! <= イカ娘! <= (侵略! <= イカ娘! <= (ゲソ <= (ゲソ <= イカ娘!)))))))))
$ ruby examples/square.ikamusume ゲソ ゲソゲソ ゲソゲソ ゲソゲソゲソ ゲソゲソゲソ ゲソゲソゲソ ゲソゲソゲソゲソ ゲソゲソゲソゲソ ゲソゲソゲソゲソ ゲソゲソゲソゲソ ゲソゲソゲソゲソゲソ ゲソゲソゲソゲソゲソ ゲソゲソゲソゲソゲソ ゲソゲソゲソゲソゲソ ゲソゲソゲソゲソゲソ
最後にフィボナッチの数だけゲソというでゲソ。
# coding: utf-8 # based on example probram in Unlambda document # see http://www.madore.org/~david/programs/unlambda/ in detail require "ikamusume" 侵略! <= (侵略! <= (侵略! <= イカ娘! <= イカ娘!) <= (ゲソ <= イカ娘!)) <= (ゲソ <= "ゲソ") <= (侵略! <= (侵略! <= (ゲソ <= 侵略!) <= (侵略! <= (ゲソ <= (侵略! <= (ゲソ <= 侵略!))) <= (侵略! <= (侵略! <= (ゲソ <= 侵略!) <= (侵略! <= (ゲソ <= (侵略! <= (ゲソ <= "\n"))) <= (侵略! <= (ゲソ <= (侵略! <= イカ娘!)) <= ゲソ))) <= ゲソ))) <= (ゲソ <= (侵略! <= (ゲソ <= 侵略!) <= ゲソ)))
$ ruby examples/fib.ikamusume ゲソ ゲソ ゲソゲソ ゲソゲソゲソ ゲソゲソゲソゲソゲソ ゲソゲソゲソゲソゲソゲソゲソゲソ ゲソゲソゲソゲソゲソゲソゲソゲソゲソゲソゲソゲソゲソ (略)
おまけに Unlambda も侵略しようではなイカ。
require "ikamusume" puts unlambda_to_ikamusume! <<END ```s``s``sii`ki `k.*``s``s`ks ``s`k`s`ks``s``s`ks``s`k`s`kr``s`k`sikk `k``s`ksk END