! 続き2 LET a=0.45*COS(θ) DRAW koma WAIT DELAY 0 NEXT θ NEXT i END IF ELSE CALL GAMEOV0 ! 正常終了。AR0=0 CALL ack(4,10, "もう一度やりますか? ") EXIT SUB END IF LOOP END SUB
!----- SUB GAMEOV0 SET AREA COLOR 0 PLOT AREA: XL,YC-0.9; 13,YC-0.9; 13,13; XL,13 IF U(1)=0 THEN LET U(2)=64 IF U(2)=0 THEN LET U(1)=64 LET w1$="貴方" LET w2$="私" IF TB<>1 THEN swap w1$,w2$ PLOT TEXT,AT XL,YC+1:"先手:"&w1$ LET GT1=GT(TB) CALL prtime(XL+2.3,YC+1) PLOT TEXT,AT XL,YC+2:"後手:"&w2$ LET GT1=GT(3-TB) CALL prtime(XL+2.3,YC+2) PLOT TEXT,AT XL,YC+3:STR$(U(TB))&":"&STR$(U(3-TB))&" ("&STR$(ABS(U(2)-U(1)))&"石差)" IF U(1)=U(2) THEN LET w$="引分け" ELSEIF U(1)>U(2) THEN LET w$="貴方 の勝ち" ELSE LET w$="私 の勝ち" END IF PLOT TEXT,AT XL,YC+4:w$ END SUB
!----- SUB TM0(t,t0) LET GTM=IP(TIME) LET t=GTM-t0 IF t<0 THEN LET t=t+86400 END SUB
SUB clock CALL TM0( GD,GG) LET GT1=GT(t_)+GD IF t_=1 THEN CALL prtime(XL+2.3,YY) ELSE CALL prtime(XL+2.3,YC) END SUB
SUB prtime(x,y) PLOT TEXT,AT x,y:USING$("##",IP(GT1/60))&"分"&USING$("##",MOD(GT1,60))&"秒" END SUB
!---------- SUB mousexy DO LET rb=mrb LET lb=mlb MOUSE POLL mx,my,mlb,mrb IF rb<mrb THEN LET PP=-1 EXIT SUB END IF IF lb<mlb AND 0.5<mx AND mx<8.5 AND 0.5<my AND my<8.5 THEN DO LET x=ROUND(mx) LET y=ROUND(my) !----- PLOT TEXT,AT XL+1.37,YY+2 :CHR$(64+x)&CHR$(48+y) CALL sens( CCH+t_*256+y*16+x) IF AR0=0 THEN beep CALL messYOU2("そこは打てません。") EXIT DO ELSE CALL messYOU2(" ") END IF !----- CALL blink IF PP<0 THEN EXIT SUB IF NOT(0.5<mx AND mx<8.5 AND 0.5<my AND my<8.5) THEN LET AR0=0 EXIT DO END IF LOOP UNTIL mlb=1 AND x=ROUND(mx) AND y=ROUND(my) IF AR0<>0 THEN CALL pt1 EXIT SUB END IF END IF WAIT DELAY 0 CALL clock LOOP END SUB
SUB blink LET θ=0 DO LET a=0.45*COS(θ) LET θ=θ+PI/10 DRAW koma WAIT DELAY 0.02 CALL clock LET rb=mrb LET lb=mlb MOUSE POLL mx,my,mlb,mrb LOOP UNTIL lb<mlb OR rb<mrb IF rb<mrb THEN LET PP=-1 ! erase koma SET AREA COLOR 64 PLOT AREA:x-0.45,y-0.45;x+0.45,y-0.45;x+0.45,y+0.45;x-0.45,y+0.45 END SUB
SUB pt1 LET a=0.45 DRAW koma END SUB
PICTURE koma SET DRAW mode hidden !裏ページに書く SET AREA COLOR 64 PLOT AREA:x-0.45,y-0.45;x+0.45,y-0.45;x+0.45,y+0.45;x-0.45,y+0.45 SET LINE COLOR ABS(SGN(t_-TB)) DRAW circle WITH SCALE(0.45,a)*SHIFT(x,y) SET AREA COLOR 1-ABS(SGN(t_-TB)) DRAW disk WITH SCALE(0.92)*SCALE(0.45,a)*SHIFT(x,y) SET DRAW mode explicit !裏ページの表示 END PICTURE
SUB messYOU(w$) SET TEXT COLOR "red" PLOT TEXT,AT XL,YY+0.5:w$ ! 続き3
|