2011-04-05から1日間の記事一覧

そしてなんだこれは

require 'date' if ARGV.empty? print "Friday 13 Finder / usage: [count]\n" exit 1 end limit = ARGV.shift.to_i count = 0 year = Date.today.year month = Date.today.month while count < limit date_of_13th = Date.new(year,month,13) if date_of_13…

Rubyでも書いた

require 'date' if ARGV.empty? print "calendar / usage: [month] [year]\n" exit 1 end month = ARGV.shift.to_i year = ARGV.shift.to_i day = 1 wday = 0 print "Sun\tMon\tTue\tWed\tThu\tFri\tSat\n" while true if(Date.valid_date?(year,month,day))…

思いついたようにフルスクラッチからカレンダーを書いてみた

なんかに使おうと思ったのでPHPで書いてみた。17分くらい。時間かかりすぎやね。 ループの部分の見通しが悪いのがいかんともしがたいね。ほかの書き方も思いついたら書く。