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

2018/11/29 12:53:17

MixJuice GET URL : kidspod.club/mj/681

TYPE BASIC

IchigoJam BASIC コマンドのタイピング練習
音が鳴るので圧電サウンダを接続してください。

TYPEING SET-1 SET-2 SET-3 の3つのファイルを保存します。
事前にLOADかSAVEで保存するファイル番号を指定しておきます。
T=0で変数をクリアしてからTYPINGを実行します。

  • No registered tag exist.

SOURCE CODE

NEW

F=FILE()

10 'TYPING
20 @TOP:F=FILE():IF T=1 GOTO @TYPE
30 @INIT:VIDEO 3:CLT:CLS:X=2:Y=4
40 LOCATE X,Y-2:PRINT "TYPE BASIC"
50 LOCATE X,Y:PRINT "HIT SPACE"
60 @HS:K=INKEY():IF K<>32 GOTO @HS
70 @ST:N=25:C=0:M=0
80 @SET:LRUNF+1
90 @TYPE
100 CLS:I=0:LOCATE X,Y
110 @LP:IF [I]=0 GOTO @EX
120 PRINT CHR$([I]);:I=I+1:GOTO @LP
130 @EX:I=0:LOCATE X,Y+1
140 @KEY:K=INKEY():IF K=0 GOTO @KEY
150 IF K>=20 THEN PRINT CHR$(K);
160 IF K<>[I] PLAY"A32":LOCATE X+I,Y+1:M=M+1:GOTO @KEY
170 PLAY"<<A32":I=I+1:IF [I]<>0 GOTO @KEY
180 @EXIT:C=C+I:N=N-1
190 IF N>0 GOTO @SET
200 @END:CLS
210 LOCATE X,Y-2:PRINT "TIME:";TICK()/60
220 LOCATE X,Y-1:PRINT "TYPE:";C
230 LOCATE X,Y:PRINT "MISS:";M
240 LOCATE X,Y+2:PRINT "HIT SPACE"
250 T=0
260 @KB:K=INKEY()
270 IF K=32 GOTO @ST
280 IF K=10 THEN VIDEO 1:CLS:END
290 GOTO @KB

SAVEF

NEW

10 'SET 1
20 A=0:R=RND(77)
30 IF R=0 THEN A="LED"
40 IF R=1 THEN A="WAIT"
50 IF R=2 THEN A="RUN"
60 IF R=3 THEN A="LIST"
70 IF R=4 THEN A="GOTO"
80 IF R=5 THEN A="END"
90 IF R=6 THEN A="IF"
100 IF R=7 THEN A="THEN"
110 IF R=8 THEN A="ELSE"
120 IF R=9 THEN A="BTN"
130 IF R=10 THEN A="NEW"
140 IF R=11 THEN A="PRINT"
150 IF R=12 THEN A="LOCATE"
160 IF R=13 THEN A="CLS"
170 IF R=14 THEN A="RND"
180 IF R=15 THEN A="SAVE"
190 IF R=16 THEN A="LOAD"
200 IF R=17 THEN A="FILES"
210 IF R=18 THEN A="BEEP"
220 IF R=19 THEN A="PLAY"
230 IF R=20 THEN A="TEMPO"
240 IF R=21 THEN A="LET"
250 IF R=22 THEN A="INPUT"
260 IF R=23 THEN A="TICK"
270 IF R=24 THEN A="CLT"
280 IF R=25 THEN A="INKEY()"
290 IF R=26 THEN A="CHR$()"
300 IF R=27 THEN A="ASC()"
310 IF R=28 THEN A="SCROLL"
320 IF R=29 THEN A="SCR"
330 IF R=30 THEN A="FOR"
340 IFA=0LRUNFILE()+1
350 I=0
360 @LP:IF PEEK(A+I)=34 THEN GOTO @EX
370 [I]=PEEK(A+I):I=I+1:GOTO @LP
380 @EX:[I]=0:T=1:LRUNF

SAVEFILE()+1

NEW
10 'SET 2
20 A=0
30 IF R=31 THEN A="TO"
40 IF R=32 THEN A="STEP"
50 IF R=33 THEN A="NEXT"
60 IF R=34 THEN A="AND"
70 IF R=35 THEN A="OR"
80 IF R=36 THEN A="NOT"
90 IF R=37 THEN A="REM"
100 IF R=38 THEN A="IN"
110 IF R=39 THEN A="ANA"
120 IF R=40 THEN A="OUT"
130 IF R=41 THEN A="PWM"
140 IF R=42 THEN A="CLV"
150 IF R=43 THEN A="CLK"
160 IF R=44 THEN A="CLO"
170 IF R=45 THEN A="ABS()"
180 IF R=46 THEN A="GOSUB"
190 IF R=47 THEN A="RETURN"
200 IF R=48 THEN A="DEC$()"
210 IF R=49 THEN A="HEX$()"
220 IF R=50 THEN A="BIN$()"
230 IF R=51 THEN A="STOP"
240 IF R=52 THEN A="CONT"
250 IF R=53 THEN A="SOUND"
260 IF R=54 THEN A="FREE()"
270 IF R=55 THEN A="VER"
280 IF R=56 THEN A="LANG"
290 IF R=57 THEN A="RENUM"
300 IF R=58 THEN A="LRUN"
310 IF R=59 THEN A="FILE()"
320 IF R=60 THEN A="LINE"
330 IF R=61 THEN A="SRAND"
340 IFA=0LRUNFILE()+1
350 I=0
360 @LP:IF PEEK(A+I)=34 THEN GOTO @EX
370 [I]=PEEK(A+I):I=I+1:GOTO @LP
380 @EX:[I]=0:T=1:LRUNF

SAVEFILE()+1

NEW

10 'SET 3
20 A=0
30 IF R=62 THEN A="HELP"
40 IF R=63 THEN A="PEEK()"
50 IF R=64 THEN A="POKE"
60 IF R=65 THEN A="COPY"
70 IF R=66 THEN A="CLP"
80 IF R=67 THEN A="STR$()"
90 IF R=68 THEN A="LEN"
100 IF R=69 THEN A="VIDEO"
110 IF R=70 THEN A="RESET"
120 IF R=71 THEN A="SLEEP"
130 IF R=72 THEN A="UART"
140 IF R=73 THEN A="BPS"
150 IF R=74 THEN A="I2CR"
160 IF R=75 THEN A="I2CW"
170 IF R=76 THEN A="USR()"
180 IF A=0 THEN A="ERROR"
190 I=0
200 @LP:IF PEEK(A+I)=34 THEN GOTO @EX
210 [I]=PEEK(A+I):I=I+1:GOTO @LP
220 @EX:[I]=0:T=1:LRUNF

SAVEFILE()+1

T=0
LRUNF

COMMENT