#!/usr/bin/env ruby require 'tk' TkRoot.new {title "Ruby is fun!" } TkLabel.new { font TkF…
@items=Hash.new puts "please input the number of your courses:" course_number=gets puts "p…
# == Synopsis # # Taobao tool all in one. # # == Author # fujun # 2011.06.01 # # == Copyri…
object.valid?
def method n a, b = 0, 1 (n-2).times {a, b = b, a + b} puts b end method 15
require 'rubygems' require 'hpricot' require 'open-uri' doc = Hpricot(open('http://www.rub…
class Integer def reverse(a = 0) n = self while n > 0 a = a * 10 + n % 10 n /= 10 end r…
def traverse_dir(file_path) if File.directory? file_path Dir.foreach(file_path) do |file| …
puts "Enter Number Of Classes" n=gets.chomp n=n.to_i puts "Enter Class Interval" h=gets.ch…
require 'yaml' configuration = { 'color' => 'blue', 'font' => 'new romain', 'font-si…
def merge_sort(a, b) if a.length > 1 temArr = split_array(a) a = merge_sort(temArr[0], …
xml = %{ <aquarium> <fish color="blue" size="small" /> <fish color="orange"…
Ruby 添加按钮和标签 (TkButton,TkLabel)