Comment detail

文字変換表に基く文字列の変換 (Nested Flatten)

This comment is reply for 7468 U Okumura: メソッド定義を書いて、それを呼び出す形で...(文字変換表に基く文字列の変換). Go to thread root.

さっきのは基本でした。今度は拡張版で。 まだ削りようはいくらでもあるけど、とりあえずcurryが使いたかったので。

1
2
tr={e,f,t,w->w.collect{e(f).contains(it)?e(t)[e(f).indexOf(it)]:it}.join()}.curry({it[0]..it[2]})
println(tr("a-z","A-Z","typewriter"))

Index

Feed

Other

Link

Pathtraq

loading...