浏览 1744 次
精华帖 (0) :: 良好帖 (2) :: 新手帖 (0) :: 隐藏帖 (0)
|
|
---|---|
作者 | 正文 |
发表时间:2009-05-01
link: 1.http://hooopo.iteye.com/blog/377628 2.https://docs.google.com/Doc?id=dfqdhrwn_6ftmd7bqx
$KCODE="u" require'jcode' Shoes.app(:title=>"TextReverseTool--By Hooopo",:width=>660,:height=>650) do String.class_eval do def to_juhua self.gsub(/\B/,"\322\211") end def reverse_i self.each_char.reverse.join end def up_side_down table={} foo="abcdefghijklmnopqrstuvwxyz:;,.!?" bar="ɐqɔpǝɟƃɥıɾʞlɯuodbɹsʇnʌʍxʎz:؛'˙¡¿" arr_foo=foo.each_char arr_bar=bar.each_char (0..31).each do |i| table[arr_foo[i]]=arr_bar[i] end self.each_char.map{|c| table[c] ? table[c] : c}.join end def reverse_ii "\342\200\256"<<self end end stack do background rgb(255, 248, 220) flow do para "原文=>" , :font=>"song" @text=edit_box "输入你要转换的文字",:width=>500,:margin=>10 end flow do para "菊花=>" , :font=>"song" @text_juhua=edit_box "把原文转换成菊花文",:width=>500,:margin=>10 button "Start",:margin_top=>75 do @tmp=@text.text @text_juhua.text=@tmp.to_juhua end end flow do para "反转=>",:font=>"song" @text_reverse1=edit_box "把原文反转[1]",:width=>500,:margin=>10 button "Start",:margin_top=>75 do @tmp=@text.text @text_reverse1.text=@tmp.reverse_i end end flow do para "反转=>",:font=>"song" @text_reverse2=edit_box "把原文反转[2]",:width=>500,:margin=>10 button "Start",:margin_top=>75 do @tmp=@text.text @text_reverse2.text=@tmp.reverse_ii end end flow do para "倒立=>",:font=>"song" @text_up_side_down=edit_box "小写英文字母倒立",:width=>500,:margin=>10 button "Start",:margin_top=>75 do @tmp=@text.text @text_up_side_down.text=@tmp.up_side_down end end end end
声明:ITeye文章版权属于作者,受法律保护。没有作者书面许可不得转载。
推荐链接
|
|
返回顶楼 | |