! 続き1 SUB SEL(wx,wy,w$, vx,vy,v$, xs,xp,n,r) LET xe=xs+xp*ABS(n) SET LINE COLOR "red" DO WHILE NOT( 0<r AND r<=ABS(n) ) PLOT TEXT,AT vx,vy :v$ PLOT TEXT,AT wx,wy :w$ 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 MOUSE POLL mx,my,mlb,mrb LOOP UNTIL mlb=1 AND xs<mx AND mx<xe AND wy-0.5<my AND my<wy OR mrb=1 IF mlb=0 THEN STOP 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 RANDOM CALL set_WT CALL note0 DO !*START0 LET L=0 LET TB=0 CALL board !-----CIN LET AR0=oth33p( CIN,r$) CALL printA32 CALL printr ! !---- Level CALL SEL(XL,1,"Level : 1 2 3 4 5", XL,2,"レベルは、1~5 ?", XL+xc*7.4,xc2, 5,L) ! CALL RANDOM ! !---- 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) ! !----- LET AR0=oth33p( LTB+L*256+TB,r$) CALL printA32 CALL printr !----- 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 LET GG=GTM LET t_=3-TB !*Branch DO CALL clock LET GG=GTM LET GT(t_)=GT1 LET t_=3-t_ !----- LET AR0=oth33p( CFN,r$) CALL printA32 CALL printr !----- 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 ! コマの書き換え ( t_,X,Y ) !----- LET AR0=oth33p( CCHexe+t_*256+Y*16+X,r$) CALL printA32 CALL printr !----- LET U(t_)=U(t_)+AR0+1 LET U(3-t_)=U(3-t_)-AR0 ! 打コマの描画 CALL PT1 ! 獲得コマの描画、裏返す。 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 θ=0 TO PI/2 STEP PI/16 LET a=0.45*COS(θ) DRAW koma WAIT DELAY 0 ! 0.04 ! 続き2
|