有哪些小游戏的java代码_求一个Java小游戏代码(鼠标点击类小游戏)最好代码里面不要有中文...
該樓層疑似違規(guī)已被系統(tǒng)折疊?隱藏此樓查看此樓
}
else{
black_count=0;
}
if(chess[i][j]==2)
{
white_count++;
if(white_count==5)
{
JOptionPane.showMessageDialog(this,"白棋勝利");
Clear_chess();
return;
}
}
else{
white_count=0;
}
}
}
for(int i=0;i<11;i++)//豎向到五個子贏棋
{
for(int j=0;j<11;j++)
{
if(chess[j][i]==1)
{
black_count++;
if(black_count==5)
{
JOptionPane.showMessageDialog(this,"黑棋勝利");
Clear_chess();
return;
}
}
else{
black_count=0;
}
if(chess[j][i]==2)
{
white_count++;
if(white_count==5)
{
JOptionPane.showMessageDialog(this,"白棋勝利");
Clear_chess();
return;
}
}
else{
white_count=0;
}
}
}
for(int i=0;i<7;i++)//左向右斜到五個子贏棋
{
for(int j=0;j<7;j++)
{
for(int k=0;k<5;k++)
{
if(chess[i+k][j+k]==1)
{
black_count++;
if(black_count==5)
{
JOptionPane.showMessageDialog(this,"黑棋贏了");
Clear_chess();
return;
}
}
else{
black_count=0;
}
if(chess[i+k][j+k]==2)
{
white_count++;
if(white_count==5)
{
JOptionPane.showMessageDialog(this,"白棋贏了");
Clear_chess();
return;
}
}
else{
white_count=0;
}
}
}
}
for(int i=4;i<11;i++)//右向左斜判斷
{
for(int j=0;j<=6;j++)
{
for(int k=0;k<5;k++)
{
if(chess[i-k][j+k]==1)
{
black_count++;
if(black_count==5)
{
JOptionPane.showMessageDialog(this,"黑棋勝利");
總結
以上是生活随笔為你收集整理的有哪些小游戏的java代码_求一个Java小游戏代码(鼠标点击类小游戏)最好代码里面不要有中文...的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: python远程执行shell 防止注入
- 下一篇: idea java8_太赞了,Intel