SketchBook

6二銀の邪魔をする囲碁

var X=[];
var Y=[];

var ginx
var giny

var x
var y

function setup(){
createCanvas(1000,1000);

for (var i = 0; i < 10; i = i + 1) {
   X[i] =  i * 100;
}
for (var i = 0; i < 10; i = i + 1) {
   Y[i] =  i * 100;
}

ginx=160;
giny=130;

x=0
y=0

}


function draw(){
background(225,225,225)

for (var i = 0; i < 10; i = i + 1) {
line(50+X[i],50,50+X[i],950)
}
for (var i = 0; i < 10; i = i + 1) {
line(50,50+Y[i],950,50+Y[i])
}

textSize(70)
text("玉",260,930)

textSize(70)
text("金",260,830)

textSize(70)
text("金",360,830)

textSize(70)
text("桂",360,930)

textSize(70)
text("銀",260,730)

textSize(70)
text("竜",260,230)

textSize(70)
text("歩",160,730)

textSize(70)
text("歩",60,530)

textSize(70)
text("歩",360,630)

textSize(70)
text("桂",560,630)

textSize(70)
text("銀",660,730)

textSize(70)
text("歩",860,730)

textSize(70)
text("香",860,930)

textSize(70)
text("桂",760,930)

textSize(70)
text("と",760,130)

textSize(70)
text("歩",460,430)


ellipse(400,200,80);//6二銀


fill(255,255,255)
ellipse(600,400,80);

fill(255,0,0)
//藤井聡太の立場

ginx=ginx+x
giny=giny+y

if(ginx==160 && giny==130){
y=1
x=0
}

if(ginx==160 && giny==330){
y=0
x=1
}

if(ginx==460 && giny==330){
y=-1
x=0
}

if(ginx==460 && giny==130){
y=0
x=-1
}

textSize(97)
text("銀",ginx,giny)

textSize(70);
text("歩",160,430);

textSize(70);
text("歩",360,430);

textSize(70);
text("歩",560,230);

textSize(70);
text("王",560,330);

textSize(70);
text("銀",660,430);

textSize(70);
text("歩",860,330);

textSize(70);
text("香",860,130);

textSize(70);
text("香",60,130);

textSize(70);
text("と",60,730);

textSize(70);
text("竜",460,930);

textSize(70);
text("馬",560,930);
fill(0,0,0);

textSize(28);
text("一",960,100);

textSize(28);
text("二",960,200);

textSize(28);
text("三",960,300);

textSize(28);
text("四",960,400);

textSize(28);
text("五",960,500);

textSize(28);
text("六",960,600);

textSize(28);
text("七",960,700);

textSize(28);
text("八",960,800);

textSize(28);
text("九",960,900);

for (var i = 1; i < 10; i = i + 1) {
textSize(20)
text([i],980-X[i],30)
}


}