求高手帮忙写个毕业设计 - 已解决 - 搜搜问问

来源:百度文库 编辑:神马文学网 时间:2024/10/02 20:32:01

求高手帮忙写个毕业设计

300[ 标签:毕业,设计 ] 求个高手帮我写个毕业设计,关于计算机方面的。五子棋应用软件类,重赏之下有勇夫么?
问题补充  2010-03-24 21:24
VC++6.0版本开发出来的匿名 回答:3 人气:3 解决时间:2010-03-25 15:48

满意答案

好评率:0%

效果图:

主要代码如下:(如不会贴代码,给我邮箱我给你发整个工程)

#include "stdafx.h"
#include "五子棋.h"
#include "五子棋Dlg.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
const int MAX=12;
int a[MAX][MAX];
/////////////////////////////////////////////////////////////////////////////
// CAboutDlg dialog used for App About

class CAboutDlg : public CDialog
{
public:
 CAboutDlg();

// Dialog Data
 //{{AFX_DATA(CAboutDlg)
 enum { IDD = IDD_ABOUTBOX };
 //}}AFX_DATA

 // ClassWizard generated virtual function overrides
 //{{AFX_VIRTUAL(CAboutDlg)
 protected:
 virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
 //}}AFX_VIRTUAL

// Implementation
protected:
 //{{AFX_MSG(CAboutDlg)
 //}}AFX_MSG
 DECLARE_MESSAGE_MAP()
};

CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
{
 //{{AFX_DATA_INIT(CAboutDlg)
 //}}AFX_DATA_INIT 
}

void CAboutDlg::DoDataExchange(CDataExchange* pDX)
{
 CDialog::DoDataExchange(pDX);
 //{{AFX_DATA_MAP(CAboutDlg)
 //}}AFX_DATA_MAP
}

BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
 //{{AFX_MSG_MAP(CAboutDlg)
  // No message handlers
 //}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CMyDlg dialog

CMyDlg::CMyDlg(CWnd* pParent /*=NULL*/)
 : CDialog(CMyDlg::IDD, pParent)
{
 //{{AFX_DATA_INIT(CMyDlg)
  // NOTE: the ClassWizard will add member initialization here
 //}}AFX_DATA_INIT
 // Note that LoadIcon does not require a subsequent DestroyIcon in Win32
 m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
}

void CMyDlg::DoDataExchange(CDataExchange* pDX)
{
 CDialog::DoDataExchange(pDX);
 //{{AFX_DATA_MAP(CMyDlg)
  // NOTE: the ClassWizard will add DDX and DDV calls here
 //}}AFX_DATA_MAP
}

BEGIN_MESSAGE_MAP(CMyDlg, CDialog)
 //{{AFX_MSG_MAP(CMyDlg)
 ON_WM_SYSCOMMAND()
 ON_WM_DESTROY()
 ON_WM_PAINT()
 ON_WM_QUERYDRAGICON()
 ON_WM_LBUTTONDOWN()
 //}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CMyDlg message handlers

BOOL CMyDlg::OnInitDialog()
{
 CDialog::OnInitDialog();

 // Add "About..." menu item to system menu.

 // IDM_ABOUTBOX must be in the system command range.
 ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
 ASSERT(IDM_ABOUTBOX < 0xF000);

 CMenu* pSysMenu = GetSystemMenu(FALSE);
 if (pSysMenu != NULL)
 {
  CString strAboutMenu;
  strAboutMenu.LoadString(IDS_ABOUTBOX);
  if (!strAboutMenu.IsEmpty())
  {
   pSysMenu->AppendMenu(MF_SEPARATOR);
   pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
  }
 }

 // Set the icon for this dialog.  The framework does this automatically
 //  when the application's main window is not a dialog
 SetIcon(m_hIcon, TRUE);   // Set big icon
 SetIcon(m_hIcon, FALSE);  // Set small icon
 
 // TODO: Add extra initialization here
 
 return TRUE;  // return TRUE  unless you set the focus to a control
}

void CMyDlg::OnSysCommand(UINT nID, LPARAM lParam)
{
 if ((nID & 0xFFF0) == IDM_ABOUTBOX)
 {
  CAboutDlg dlgAbout;
  dlgAbout.DoModal();
 }
 else
 {
  CDialog::OnSysCommand(nID, lParam);
 }
}

void CMyDlg::OnDestroy()
{
 WinHelp(0L, HELP_QUIT);
 CDialog::OnDestroy();
}

// If you add a minimize button to your dialog, you will need the code below
//  to draw the icon.  For MFC applications using the document/view model,
//  this is automatically done for you by the framework.

void CMyDlg::OnPaint()
{
 HPEN hpen;
 HDC hdc;
 hdc=::GetDC(m_hWnd);
 hpen=(HPEN)SelectObject(hdc,GetStockObject(BLACK_PEN));
 for(int i=0;i<=12;i++){  
  MoveToEx(hdc,i*40+17,17,NULL);  
  LineTo(hdc,i*40+17,12*40+17);
 }  
 for(i=0;i<=12;i++){
  MoveToEx(hdc,17,i*40+17,NULL);
  LineTo(hdc,12*40+17,i*40+17);
 }
 DeleteObject(hpen);
 ::ReleaseDC(m_hWnd,hdc);
 if (IsIconic())
 {
  CPaintDC dc(this); // device context for painting

  SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);

  // Center icon in client rectangle
  int cxIcon = GetSystemMetrics(SM_CXICON);
  int cyIcon = GetSystemMetrics(SM_CYICON);
  CRect rect;
  GetClientRect(&rect);
  int x = (rect.Width() - cxIcon + 1) / 2;
  int y = (rect.Height() - cyIcon + 1) / 2;

  // Draw the icon
  dc.DrawIcon(x, y, m_hIcon);
  
 }
 else
 {
  CDialog::OnPaint();
 }
}

// The system calls this to obtain the cursor to display while the user drags
//  the minimized window.
HCURSOR CMyDlg::OnQueryDragIcon()
{
 return (HCURSOR) m_hIcon;
}

void CMyDlg::OnLButtonDown(UINT nFlags, CPoint point)
{
 // TODO: Add your message handler code here and/or call default
 HDC hdc;    //声明一个hdc
 HBRUSH hbr;
 CPoint pot;
 int x,y,i,j,cntX,cntY,cntXY,cntYX;
 static int clrBru;
 x=point.x/40;
 pot.x=x*40+17; 
 y=point.y/40;
 pot.y=y*40+17;
 if(a[x][y]==0){
  hdc=::GetDC(m_hWnd);  
  hbr=(HBRUSH)SelectObject(hdc,GetStockObject(clrBru=!clrBru));
  a[x][y]=clrBru+1;
  Ellipse(hdc,pot.x-16,pot.y-16,pot.x+16,pot.y+16);  
  for(i=x-1,cntX=0;a[i][y]==a[x][y]&&i>=0;i--)cntX++;
  for(i=x+1;a[i][y]==a[x][y]&&i>=0;i++)cntX++;  
  for(i=y-1,cntY=0;a[x][i]==a[x][y]&&i>=0;i--)cntY++;
  for(i=y+1;a[x][i]==a[x][y]&&i>=0;i++)cntY++;  
  for(i=x-1,j=y-1,cntXY=0;a[i][j]==a[x][y]&&i>=0;i--,j--)cntXY++;
  for(i=x+1,j=y+1;a[i][j]==a[x][y]&&i>=0;i++,j++)cntXY++;  
  for(i=x-1,j=y+1,cntYX=0;a[i][j]==a[x][y]&&i>=0;i--,j++)cntYX++;
  for(i=x+1,j=y-1;a[i][j]==a[x][y]&&i>=0;i++,j--)cntYX++;
  if(cntX>=4||cntY>=4||cntXY>=4||cntYX>=4){
   if(clrBru)AfxMessageBox("黑胜");else AfxMessageBox("白胜");
   HPEN hpen;
   hpen=(HPEN)SelectObject(hdc,GetStockObject(NULL_PEN));
   hbr=(HBRUSH)CreateSolidBrush (RGB(0xEC,0xE9,0xD8));
   SelectObject(hdc,hbr);
   Rectangle(hdc,0,0,12*40+34,12*40+34);
   hpen=(HPEN)SelectObject(hdc,GetStockObject(BLACK_PEN));
   for(i=0;i<=12;i++){
    MoveToEx(hdc,i*40+17,17,NULL);
    LineTo(hdc,i*40+17,12*40+17);
   }   
   for(i=0;i<=12;i++){
    MoveToEx(hdc,17,i*40+17,NULL);
    LineTo(hdc,12*40+17,i*40+17);    
   }   
   memset(a,0,sizeof(a));
   DeleteObject(hpen);   
  }
  DeleteObject(hbr);
  ::ReleaseDC(m_hWnd,hdc);
 }
 CDialog::OnLButtonDown(nFlags, point);
}

 

提问人的追问   2010-03-25 15:48

好是蛮好,就是少了点 勉强算行

评价答案
  • 您已经评价过! 好:0
  • 您已经评价过! 一般:5
  • 您已经评价过! 不好:0
  • 您已经评价过! 原创:0
  • 您已经评价过! 非原创:0
01010010 回答采纳率:83.2% 2010-03-25 12:58 我有更好的回答 收藏转载到QQ空间

相关内容

  • 喷绘用rgb还是cmyk
  • 各种颜色的rgb值
  • rgb颜色表
  • rgb颜色代码表
  • rgb颜色对照表
  • rgb是什么意思
  • rgb颜色查询对照表
  • rgb转cmyk

其他答案

我这里有中国象棋的..用VC6.0开发的,带界面...包括单击对弈和网络对弈....
提问人的追问   2010-03-24 21:21

大致也行

      不过最好能帮我改成五子棋的  VC++6.0的

回答人的补充   2010-03-24 21:30

呵呵..那算了...我没那么多时间..

CoolFighter 回答采纳率:48.9% 2010-03-24 21:19

ewfew

根据我搜集的一些网站来看,建议看看这个,要做毕业论文以及毕业设计的,推荐一个网站 http://www.lw54.com ,里面的毕业设计什么的全是优秀的,因为精挑细选的,网上很少有,都是相当不错的毕业论文和毕业设计,对毕业论文的写作有很大的参考价值,希望对你有所帮助。


别的相关范文很多的,推荐一些比较好的范文写作网站,希望对你有帮助,这些精选的范文网站,里面有大量的范文,也有各种文章写作方法,注意事项,应该有适合你的,自己动手找一下,可不要照搬啊,参考一下,用自己的语言写出来那才是自己的。

如果你不是校园网的话,请在下面的网站找:
毕业论文网: http://www.wsdxs.cn 分类很细 栏目很多
毕业论文: http://www.lw54.com
毕业设计: http://www.wsdxs.cn/html/sf/lw/2009/0928/146347.html
开题报告: http://www.wsdxs.cn/html/lunwenzhidao/kaitibaogao
实习论文: http://www.wsdxs.cn/html/shixi
写作指导: http://www.wsdxs.cn/html/lunwenzhidao

问问团队论文武士共1人编辑答案