VC语言

本类阅读TOP10

·VC++ 学习笔记(二)
·用Visual C++打造IE浏览器(1)
·每个开发人员现在应该下载的十种必备工具
·教你用VC6做QQ对对碰外挂程序
·Netmsg 局域网聊天程序
·Windows消息大全
·VC++下使用ADO编写数据库程序
·VC++学习笔记(四)
·非法探取密码的原理及其防范
·怎样在VC++中访问、修改注册表

分类导航
VC语言Delphi
VB语言ASP
PerlJava
Script数据库
其他语言游戏开发
文件格式网站制作
软件工程.NET开发
极趣五子棋软件及其源代码.(老玩童@_@)

作者:未知 来源:月光软件站 加入时间:2005-2-28 月光软件站

极趣五子棋软件及其源代码.

片断:

void CFiveXPDlg::TwoInSix(int m, int n, int p)
{
 file://there are 2 chesses in a contigous 6 dots, and 2 blank every side, 2 blank inside
 int m_count,a,b;
 int m_six;     file://must be 6 times

 for (i=0;i<=14;i++)
 {
  for (j=0;j<=14;j++)
  {
   m_count=0;
   for (a=i,b=j,m_six=0; (b<=14) && (b>=0) && (a<=14) && (a>=0) && ( (b!=j+6*n)||(a!=i+6*m) ); a=a+m,b=b+n,m_six++)
    m_count=m_count + m_array[a][b];

   if ( (m_count==p) && (m_six==6) ) file://if m_five!=6 , then maybe no blank beyond the 3 chesses...
   {         file://p==2 or p==20 
    if ( (m_array[i][j]==0) && (m_array[i+5*m][j+5*n]==0) )
    {
/*     for (a=i+m,b=j+n; (b!=j+5*n)||(a!=i+5*m) ; a=a+m,b=b+n)
      if (  m_array[a][b]==0 )
      {
       if (p==2)
        m_2Iin6.Add( (m+1)*100000 + (n+1)*10000 + a*100+ b);
       else
        m_2Pin6.Add( (m+1)*100000 + (n+1)*10000 + a*100+ b);
      }*/
      for (a=i+m,b=j+n; (b!=j+5*n)||(a!=i+5*m) ; a=a+m,b=b+n)
      if (  m_array[a][b]!=0 )
      {
       if (m_array[a-m][b-n]==0)
       {
        if (p==2)
         m_2Iin6.Add( (m+1)*100000 + (n+1)*10000 + (a-m)*100+ (b-n) );
        else
         m_2Pin6.Add( (m+1)*100000 + (n+1)*10000 + (a-m)*100+ (b-n) );
       }
       if (m_array[a+m][b+n]==0);
       {
        if (p==2)
         m_2Iin6.Add( (m+1)*100000 + (n+1)*10000 + (a+m)*100+ (b+n) );
        else
         m_2Pin6.Add( (m+1)*100000 + (n+1)*10000 + (a+m)*100+ (b+n) );
       }
      }
    }//need change
   }
  }
 }
}

连接:

都必须下载的




相关文章

相关软件