開発メモ

開発用のメモです。

Ruby

各種言語の Hello World

Java class Main { public static void main (String[] args) { System.out.println("Hello World"); } } Perl #!/usr/bin/perl print "Hello World"; PHP

各種言語の if / unless

言語 if unless Java ○ × Python ○ × PHP ○ × Perl ○ ○ Ruby ○ ○

Ruby 条件( if / unless )

# type of not define inumber = 5; if inumber == 5 then puts "inumber == 5 \n"; end if inumber <= 5 then puts "inumber <= 5 \n"; end if inumber >= 5 then puts "inumber >= 5 \n"; end unless inumber < 5 then puts "! inumber < 5 \n"; end unles…

Ruby 四則演算など

puts "\n加算\n"; puts 5 + 5; puts "\n減算\n"; puts 5 - 5; puts "\n乗算\n"; puts 5 * 5; puts "\n除算\n"; puts 5 / 5; puts "\n余剰\n"; puts 5 % 5; puts "\nべき乗(pow)\n"; puts 5 ** 5;

Twitter: @asahina_alice