アナログ時計の準備
do local int = math.floor -- tmには、os.date("*t")で返されるテーブルが期待されている。 _G.needle_degree = function(tm) local sec = tm.sec * 6 -- 秒針の角度 local min = int(( tm.min * 60 + tm.sec ) / 10) -- 長針の角度 local hour = int(( tm.hour * 3600 + tm.min * 60 + tm.sec ) / 240 ) -- 短針の角度 return hour, min, sec end end