[#38322] irbsh を動かしたい — Shin-ichiro HARA <sinara@...>
原です。
8 messages
2003/09/01
[#38326] Re: irbsh を動かしたい
— rubikitch <rubikitch@...>
2003/09/01
From: Shin-ichiro HARA <sinara@blade.nagaokaut.ac.jp>
[#38336] bug? ($. in Ruby 1.8.0) — Takeshi Horinouchi <horinout@...>
堀之内と申します。
4 messages
2003/09/02
[#38341] String#reverse! のバグ? — Kazuhiko <kazuhiko@...>
かずひこです。
11 messages
2003/09/03
[#38373] 正規表現オブジェクトについて — masao hamada <bunhamad@...>
8 messages
2003/09/07
[#38383] Ruby-GNOME2-0.7.0 — Masao Mutoh <mutoh@...>
むとうです。
6 messages
2003/09/07
[#38404] rnoizanmdig lteter odrer(randomizing letter order) — HASHIMUKAI Toshikatsu <hashi@...>
spamみたいなsubjectですいません。
5 messages
2003/09/17
[#38425] [ANN] 本を出しました — 堀川 久 <vzw00011@...>
こんにちは。
12 messages
2003/09/24
[#38426] Re: [ANN] 本を出しました
— matz@... (Yukihiro Matsumoto)
2003/09/24
まつもと ゆきひろです
[#38428] whenの評価の順序 — URA Takefumi <hage@...>
浦です。
8 messages
2003/09/25
[ruby-list:38404] rnoizanmdig lteter odrer(randomizing letter order)
From:
HASHIMUKAI Toshikatsu <hashi@...>
Date:
2003-09-17 22:39:52 UTC
List:
ruby-list #38404
spamみたいなsubjectですいません。
最近、下のスクリプトに関連したネタが転がっていたのですが
(Googleで"Acocdrnig elgnsih unviesitry"のキーワードで検索したら出てきます)、
このjumbleに本来の機能(文字をバラバラにする)を持たせるにはどう書けば
いいのでしょう?
--------
def jumble(word)
word.reverse
end
def do_jumble(text)
text.gsub /(\w)(\w{2,})(\w)/ do
$1 + jumble($2) + $3
end
end
<<EOT.each { |line| puts do_jumble(line) }
According to an english university study the order of letters in a word
doesn't matter, the only thing that's important is that the first and last
letter of every word is in the correct position. The rest can be jumbled and
one is still able to read the text without difficulty.
EOT
--------