Enjoy programming more!
Kidspod is a post site which supports young programmers.
First step to join us.
Register as a member
For members

2018/09/26 21:19:56

MixJuice GET URL : kidspod.club/mj/632

カレンダー(BASIC 0.8.0~)

詳細は イチゴジャム レシピ で公開しています。
「プログラムをみる」を参照して下さい。

SOURCE CODE

CLS:'

NEW

5 'Calendar
10 LET [1],31:LET [2],28:LET [3],31
20 LET [4],30:LET [5],31:LET [6],30
30 LET [7],31:LET [8],31:LET [9],30
40 LET [10],31:LET [11],30:LET [12],31
50 INPUT "Year ?",Y:INPUT "Month?",M
60 IF(Y%4==0)*((Y%100<>0)+(Y%400==0)) LET [2],[2]+1
70 IF M<3 LET Y,Y-1:LET M,M+12
80 LET O,(13*M+8)/5:LET O,(Y+Y/4-Y/100+Y/400+O+1)%7
90 IF M>12 LET M,M-12
100 LET I,O:LET J,1
110 ?:? "SunMonTueWedThuFriSat"
120 IF O<>0 ? "   ";:LET O,O-1:GOTO 120
130 ? " ";:IF J<10 ? " "; 
140 ? J;:LET I,I+1:IF I=7 ?:LET I,0
150 LET J,J+1:IF J<=[M] GOTO 120
160 ?:IF I<>0 ?

'OK

COMMENT