A Text Reverse Tool by Shoes

link:

1.http://hooopo.iteye.com/blog/377628

2.https://docs.google.com/Doc?id=dfqdhrwn_6ftmd7bqx


code:

$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
        @[email protected]
        @[email protected]_juhua
      end
    end
    
    flow do
      para "反转=>",:font=>"song"
      @text_reverse1=edit_box "把原文反转[1]",:width=>500,:margin=>10
      button "Start",:margin_top=>75 do 
        @[email protected]
        @[email protected]_i
      end
    end
    flow do
      para "反转=>",:font=>"song"
      @text_reverse2=edit_box "把原文反转[2]",:width=>500,:margin=>10
      button "Start",:margin_top=>75 do
        @[email protected]
        @[email protected]_ii
      end
    end
    flow do
      para "倒立=>",:font=>"song"
      @text_up_side_down=edit_box "小写英文字母倒立",:width=>500,:margin=>10
      button "Start",:margin_top=>75 do
        @[email protected]
        @[email protected]_side_down
      end
    end
  end
end



预览:

下载:http://www.iteye.com/topics/download/ac4013fd-44c3-3530-8b3d-b3e92ab3ce5f

 

你可能感兴趣的:(C++,c,Google,C#,UP)