argonの日記: argon.age += 1 7
日記 by
argon
require 'person'
require 'worker'
class Person
include Japanese
include Work
include Are
end
person = Person.new
person.loadprofile("argon.profile")
person.daybyday do |argon|
argon.wakeup
begin
while true
now = Time.now
break unless now > Day_Time
case now
when Morning_Time, Lunch_Time, Dinner_Time
argon.eat
when Working_Time
argon.work
else
argon.play
end
argon.fallin_accident if rand < WARNING
end
rescue
raise if rand < FATAL
ensure
argon.walk
end
argon.sleep
argon.age += 1 if argon.birthday?(now)
end
require 'worker'
class Person
include Japanese
include Work
include Are
end
person = Person.new
person.loadprofile("argon.profile")
person.daybyday do |argon|
argon.wakeup
begin
while true
now = Time.now
break unless now > Day_Time
case now
when Morning_Time, Lunch_Time, Dinner_Time
argon.eat
when Working_Time
argon.work
else
argon.play
end
argon.fallin_accident if rand < WARNING
end
rescue
raise if rand < FATAL
ensure
argon.walk
end
argon.sleep
argon.age += 1 if argon.birthday?(now)
end
自分の知っている言語で (スコア:1)
Re:自分の知っている言語で (スコア:1)
ありがとうございます。
Re:自分の知っている言語で (スコア:1)
おめでとうございます。
Rubyでもおっけーっすよ。Kernel#printfがありますから。
% ruby -e 'printf( "Happy Birthday, argon!\n" );'Happy Birthday, argon!
Re:自分の知っている言語で (スコア:1)
あと、セミコロンもほとんど使わないっす。
だもんで、C か Perl だよなあと思い込みました。
ありがとうございます。
どっちだと思う? (スコア:1)
とおりすがりのものですが (スコア:1)
Re:とおりすがりのものですが (スコア:1)
いつもよりよけいに巡回しております。