-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path想界暦(想→現)_202010151401.hsp
42 lines (42 loc) · 1.76 KB
/
想界暦(想→現)_202010151401.hsp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#include "hspmath.as"
#module
#include "hspmath.as"
#defcfunc julius_i int yearI, int monthI, int day//19860401i Kara no Keika Nissuu Keisan(i=izumi)
dim monthnum,12
jday=0
monthnum=29, 29, 30, 29, 30, 29, 30, 29, 29, 30, 29, 32//12Gatsu(0Gatsu)-11Gatsu made no KakuTsuki no Nissuu
daycount=0
if monthI=12:month=0:year=yearI+1:else:month=monthI:year=yearI//12Gatsu->0Gatsu(11Gatsu HabukiBi no Taisaku)
jday=floor(354.75*(year-3))-floor(1.0*year/400)+floor(1.0*year/100)+day-703602//Tsuki igai no KeikaNissuu
repeat 12//Tsuki wo Kasan
if month=cnt:jday=jday+daycount:else:daycount=daycount+monthnum(cnt)
loop
return jday
#global
#module
#include "hspmath.as"
#defcfunc julius int yearI, int monthI, int day//ShuuseiJuliusTsuujitsu
if monthI<=2:month=monthI+12:year=yearI-1:else:month=monthI:year=yearI
jday=floor(365.25*year)+floor(1.0*year/400)-floor(1.0*year/100)+floor(30.59*(month-2))+day-678912
return jday
#global
screen 0,640,480
year_i=2021
month_i=1
day_i=1
time_i=0.0//Hiduke Shitei
elapse_i=julius_i(year_i,month_i,day_i)-julius_i(1986,4,1)+time_i;19870401e=19860401i//19860401i Kara no Keika Nissuu
elapse_e=1.0*elapse_i*85874.08/86400//Byousuu no Chigai wo Kskeru
time_e=elapse_e-floor(elapse_e)//ShousuuBu
elapse_fe=int(elapse_e)//SeisuuBu
n=elapse_fe+julius(1987,4,1)+678881
a=4*n+3+4*floor(3.0/4*floor(4*(n+1)/146097+1))
b=5*floor(1.0*(a \ 1461)/4)+2
year_e=int(1.0*a/1461)
month_e=int(1.0*b/153)+3
day_e=int(1.0*(b \ 153)/5)+1//ShuuseiJuliusTsuujitsu->Gregprian no Koushiki(Wikipedis)
if month_e>=13:year_e=year_e+1:month_e=month_e-12//3Gatsu Made no Shuusei
hour_e=int(time_e*24)
minute_e=int((time_e*24-hour_e)*60)
second_e=int(((time_e*24-hour_e)*60-minute_e)*60)//Jikan no Keisan
mes ""+year_e+"/"+month_e+"/"+day_e+"\n"+hour_e+":"+minute_e+":"+second_e