! 続き1 FOR i=xs TO xe-xp/2 STEP xp PLOT LINES: i,wy; i+xp,wy; i+xp,wy-0.5; i,wy-0.5; i,wy NEXT i DO WAIT DELAY 0.04 LET rb=mrb LET lb=mlb MOUSE POLL mx,my,mlb,mrb LOOP UNTIL lb<mlb AND xs<mx AND mx<xe AND wy-0.5<my AND my<wy OR rb<mrb IF mlb=0 THEN LET PP=-1 EXIT SUB END IF LET r=INT((mx-xs)/xp)+1 PLOT TEXT,AT vx,vy :REPEAT$(" ",LEN(v$)) SET AREA COLOR 0 PLOT AREA: wx,wy; xe,wy; xe,wy-0.5; wx,wy-0.5 LOOP IF 0<n THEN PLOT TEXT,AT wx,wy :w$ LET i=xs+r*xp PLOT LINES: i,wy; i-xp,wy; i-xp,wy-0.5; i,wy-0.5; i,wy END IF SET LINE COLOR 1 END SUB
CALL set_WT CALL note0 !----- DO CALL GAME00 IF PP<0 THEN CALL ack(4,10, "始めから、やり直します。") LOOP
SUB GAME00 CALL RANDOM LET PP=0 LET L=0 LET TB=0 CALL board !-----CIN CALL sens( CIN) ! !---- Level CALL SEL(XL,1,"Level : 1 2 3 4 5", XL,2,"レベルは、1~5 ?", XL+xc*7.4,xc2, 5,L) IF PP<0 THEN EXIT SUB ! !---- TB(先手番号)=1or2( 1=YOU 2=COMP ) LET t_=TB-1 ! T<>TB 白、後手。(打者番号t_:1=YOU 2=COMPUTER) LET x=4 LET y=4 CALL pt1 LET x=5 LET y=5 CALL pt1 LET t_=TB ! t_=TB 黒、先手。(打者番号t_:1=YOU 2=COMPUTER) LET x=4 LET y=5 CALL pt1 LET x=5 LET y=4 CALL pt1 ! CALL SEL(XL,YY-1,"先手(黒)は 貴方 私", XL,YY,"どちらにしますか ?", XL+xc*11,xc4, -2,TB) IF PP<0 THEN EXIT SUB ! !----- CALL sens( LTB+L*256+TB) !----- LET t_=2 LET x=XL+3.5 LET y=YC+1 CALL pt1 ! COMP コマのサンプル描画 LET t_=1 LET x=XL+3.5 LET y=YY+1 CALL pt1 ! YOU コマのサンプル描画 LET K=0 LET U(1)=2 LET U(2)=2 LET GT(1)=0 LET GT(2)=0 CALL TM0( GG,0) LET t_=3-TB ! !----- DO CALL clock LET GG=GTM LET GT(t_)=GT1 LET t_=3-t_ !----- CALL sens( CFN) !----- IF AR0<>0 THEN SET TEXT COLOR 64 PLOT TEXT,AT XL+0.4,YY+3:"第"&STR$(U(1)+U(2)-3)&"手目" SET TEXT COLOR 1 !----- IF t_=1 THEN SET COLOR MIX(0) 0.5,1,1 PLOT TEXT,AT XL,YY :"* 貴方 *" SET COLOR MIX(0) 1,1,1 PLOT TEXT,AT XL,YC :"* 私 *" CALL YOU0 ELSE SET COLOR MIX(0) 0.5,1,1 PLOT TEXT,AT XL,YC :"* 私 *" SET COLOR MIX(0) 1,1,1 PLOT TEXT,AT XL,YY :"* 貴方 *" CALL COMP0 END IF IF PP<0 THEN EXIT SUB ! 放棄終了。 IF PP>0 THEN ! コマの書き換え ( t_,X,Y ) !----- CALL sens( CCHexe+t_*256+Y*16+X) !----- LET U(t_)=U(t_)+AR0+1 LET U(3-t_)=U(3-t_)-AR0 ! 打コマの描画 CALL PT1 ! 獲得コマの描画、裏返す。 IF fast=1 THEN LET stp=PI/2 ELSE LET stp=PI/16 FOR i=1 TO AR0 LET Z=ORD(mid$(r$,20+i,1)) LET Y=IP(Z/16) LET X=MOD(Z,16) LET t_=3-t_ FOR θ=stp TO PI/2+0.001 STEP stp LET a=0.45*COS(θ) DRAW koma WAIT DELAY 0 NEXT θ LET t_=3-t_ FOR θ=PI/2-stp TO -0.001 STEP -stp ! 続き2
|