Skip to content

Instantly share code, notes, and snippets.

@machuoka
Created October 23, 2014 15:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save machuoka/2293c980282ed1f330f6 to your computer and use it in GitHub Desktop.
Save machuoka/2293c980282ed1f330f6 to your computer and use it in GitHub Desktop.
カレンダープログラミング for IchigoJam
10 INPUT"YEAR:",Y:INPUT"MONTH:",M
20 IF M=2 THEN L=28+((Y%4=0)*(((Y%100<>0)+(Y%400=0))>0)):GOTO 40
30 L=31-((M=4)+(M=6)+(M=9)+(M=11))
40 IF M<3 THEN Y=Y-1:M=M+12
50 S=(Y+Y/4-Y/100+Y/400+(M*13+8)/5+1)%7
60 IF M>12 THEN Y=Y+1:M=M-12
70 I=S:D=1
80 PRINT:PRINT" ";Y;" / ";M
90 PRINT:PRINT"S M Tu W Th F S"
100 IF I=0 GOTO 120
110 PRINT" ";:I=I-1:GOTO 100
120 IF D<10 THEN PRINT" ";
130 PRINT D;" ";
140 IF D=L GOTO 170
150 IF (D+S)%7=0 THEN PRINT
160 D=D+1:GOTO 120
170 PRINT:PRINT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment