!<その5> SUB edit ! 盤面編集モード LET edit_on=1 ! 編集中 DRAW button01(1,ground,"EDIT",bth,ground) WITH SCALE(bw,bh)*SHIFT(ex,ey) BEEP WAIT DELAY 0.5 DRAW button01(0,3,"戻る",bth,ground) WITH SCALE(bw,bh)*SHIFT(ex,ey) PLOT TEXT ,AT ex+0.4,ey+0.8:"左:"& cc$(b) PLOT TEXT ,AT ex+0.4,ey+1.15:"右:"& cc$(w) PLOT TEXT ,AT ex+0.4,ey+1.5:" W:消" DO DO DO CALL mouse.operation(cli,x,y,xx,yy) ! マウス操作 LOOP UNTIL cli=2 OR cli=3 OR cli=4 IF cli=4 AND x>=ex AND x<=ex+bw AND y>=ey AND y<=ey+bh THEN DRAW button01(1,ground,"戻る",bth,ground) WITH SCALE(bw,bh)*SHIFT(ex,ey) BEEP WAIT DELAY 0.5 DRAW rect(ground) WITH SCALE(1,1.8)*SHIFT(ex,ey) DRAW button01(0,3,"EDIT",bth,ground) WITH SCALE(bw,bh)*SHIFT(ex,ey) DRAW turn(c) LET edit_on=0 CALL scan DRAW counter EXIT SUB END IF IF cli=4 AND x>=sx AND x<=sx+bw AND y>=sy AND y<=sy+bh THEN CALL program_stop ! 終了 LET x=INT(x) LET y=INT(y) LOOP UNTIL x>=1 AND x<=m AND y>=1 AND y<=n SELECT CASE cli CASE 4 LET col=b CASE 2 LET col=w CASE 3 LET col=board END SELECT DRAW put(x,y,col) WAIT DELAY 0.3 CALL scan DRAW counter LOOP END SUB ! editの終端 PICTURE gameset ! 終局処理 BEEP IF countb>countw THEN LET winc=b LET win$=cc$(b)&"勝利" ELSEIF countw>countb THEN LET winc=w LET win$=cc$(w)&"勝利" ELSE LET winc=board LET win$="引分け" END IF SET DRAW MODE HIDDEN DRAW rect(ground) WITH SCALE(0.95,n)*SHIFT(m+1.05,1) SET LINE COLOR winc SET LINE WIDTH LW PLOT LINES:m+1.1,n-1;m+1.9,n-1;m+1.9,n+0.5;m+1.1,n+0.5;m+1.1,n-1 FOR i=1 TO 3 PLOT TEXT ,AT m+1.5,n-1+0.1+1.3/6*(2*i-1):win$(i:i) NEXT i SET AREA COLOR winc DRAW DISK WITH SCALE(0.2)*SHIFT(m+1.5,n+0.75) PLOT TEXT ,AT m/2+1,0.3 :"終了ボタンをクリック" SET DRAW MODE EXPLICIT SET LINE COLOR 1 LET gameset_on=1 END PICTURE PICTURE gameset_off ! 終局面からの復帰 LET gameset_on=0 SET DRAW MODE HIDDEN DRAW rect(ground) WITH SCALE(0.9,2.1)*SHIFT(m+1.05,n-1.05) DRAW turn(c) DRAW rect(ground) WITH SCALE(m,0.5)*SHIFT(1,0) SET DRAW MODE EXPLICIT END PICTURE !<その6>に続く
|