2011-06-01から1ヶ月間の記事一覧

Ruby覚え書き

#introRuby #コメント #実行 ruby -e 'puts ("hello, world")' #変数の文字列内展開 var = "world" puts "hello #{var}" > hello world #条件分岐 i = 1 if i < 0 puts "負" elsif i > 0 puts "正" else puts "零" end > 正 if i % 2 == 1 : puts "奇数です…