'*************** '変数設定 '*************** var shared P(20) as string *FIRST '*************** 'タイトル表示 '*************** cls locate 25,10 print "サンプルゲーム (何かキーを押して下さい。)" 'キーが押されるまで待つ do loop while inkey$="" Y2=10 J=-60 S=0 randomize time for A=0 to 20 P(A)=" " next A *NYURYOKU1 locate 30,12 print "               "; locate 30,12 input "速さ[1速-30遅]";WAITTIME if WAITTIME<1 or WAITTIME>30 then locate 30,11 print "もう一度入力して下さい"; goto *NYURYOKU1 endif locate 30,11 print "               "; *NYURYOKU2 locate 30,13 print "               "; locate 30,13 input "難易度[1難-50易]";NANDO if NANDO<1 or NANDO>50 then locate 30,11 print "もう一度入力して下さい"; goto *NYURYOKU2 endif locate 30,11 print "               "; cls do if left$(P(Y2),1)="@" then goto *BOM endif for A=0 to 20 if int(rnd(1)*220)>NANDO+150 then B$="@" else B$=" " endif P(A)=right$(P(A),59)+B$ locate 5,A print P(A); next A K$=inkey$ if K$="8" then if Y2<=0 then exit D=Y2:Y2=Y2-1 endif if K$="2" then if Y2=>20 then exit D=Y2:Y2=Y2+1 endif if D<>-1 then locate 3,D print" " D=-1 endif locate 3,Y2 print"●" 'スコア表示 J=J+1 if J>9 then locate 60,22 S=S+1 print S;"000 点" J=0 if S>30000 then *CLEAR endif wait WAITTIME if K$="q" or inkey$="Q" or inkey$="タ" then goto *end endif loop *BOM if Y2<=0 then locate 0,Y2 print "*******"; locate 0,Y2+1 print "*******"; locate 0,Y2+2 print "*******"; goto *end endif if Y2<=1 then locate 0,Y2-1 print "*******"; locate 0,Y2 print "*******"; locate 0,Y2+1 print "*******"; locate 0,Y2+2 print "*******"; goto *end endif locate 0,Y2-2 print "*******"; locate 0,Y2-1 print "*******"; locate 0,Y2 print "*******"; locate 0,Y2+1 print "*******"; locate 0,Y2+2 print "*******"; *END locate 30,9 print "***************" locate 30,10 print "***GAME OVER***" locate 30,11 print "***************" 'キーが押されるまで待つ do loop while inkey$="" '最初に戻る goto *FIRST '30000以上になると計算できないのでクリア *CLEAR locate 30,9 print "****************" locate 30,10 print "***CLEAR***" locate 30,11 print "****************" 'キーが押されるまで待つ do loop while inkey$="" '最初に戻る goto *FIRST