你好,欢迎来到经管之家 [登录] [注册]

设为首页 | 经管之家首页 | 收藏本站

基于MFC的五子棋软件设计_本科毕业论文范文

发布时间:2015-03-09 来源:人大经济论坛
本科毕业论文范文 基于MFC的五子棋软件设计 摘要 目前,以计算机技术和网络技术为核心的现代网络技术已在现实生活和生产中得以广泛的使用,休闲类网络游戏集趣味性,娱乐性,互动性和益智性于一体,已经成为多数人群的休闲方式。 本软件使用visaul C++语言实现,通过对SCOKET技术的理解,在此基础上建立服务器与客户端的连接,实现网络玩家之间的对弈。同时,本软件还加入了人机对弈算法从而实现了人机对弈功能。 通过对软件的编写,加深对以上知识、技术的理解和掌握。 关键词: 五子棋 流套接字 网络游戏 算法 ABSTRACT At present, taking computer technology and the network technology as the core, modern network technology is already used in the real life and the production. The leisure network game sets interest, entertainment, interaction and intelligence-development in a body, and already became the leisure mode of the most people. This software implemented with visual C++ language, and according to the understanding of SCOKET technology. Established in these foundations, the server connects with client, make game players can chess through the network. Secondly, this software also implemented the function of chess during man and machine. Through to the software compilation, deepen understanding and grasps to the technology above understanding and grasps. Key Words:gobang socket stream network game arithmetic 目录 摘要I ABSTRACTII 第一章 绪论1 1.1 五子棋介绍1 1.2 开发背景1 1.3 开发环境及运行环境1 1.3.1 开发环境1 1.3.2 运行环境2 第二章 算法分析与设计3 2.1 判断胜负3 2.2 人机对弈算法6 2.2.1 获胜组合6 2.2.2 落子后处理6 2.2.3 查找棋盘空位7 2.2.4 落子打分8 2.2.5 防守策略10 2.2.6 选取最佳落子12 第三章 软件架构13 3.1 棋盘类13 3.2 游戏模式类14 第四章 棋盘类——CTable设计与实现15 4.1 主要成员变量说明15 4.1.1 网络连接标志——m_bConnected15 4.1.2 棋盘等待标志——m_bWait与m_bOldWait15 4.1.3 网络套接字——m_sock和m_conn16 4.1.4 棋盘数据——m_data16 4.1.5 游戏模式指针——m_pGame16 4.2 主要成员函数说明17 4.2.1 套接字的回调处理——Accept、Connect、Receive17 4.2.2 清空棋盘——Clear17 4.2.3 绘制棋子——Draw17 4.2.4 左键消息——OnLButtonUp18 4.2.5 绘制棋盘——OnPaint18 4.2.6 对方落子完毕——Over18 4.2.7 设置游戏模式——SetGameMode18 4.2.8 胜负的判断——Win19 第五章 游戏模式的——CGame的设计与实现20 5.1 主要成员变量说明21 5.1.1 棋盘指针——m_pTable21 5.1.2 落子步骤——m_StepList21 5.2 主要成员函数说明21 5.2.1 悔棋操作——Back21 5.2.2 初始化操作——Init22 5.2.3 接收来自对方的消息——ReceiveMsg22 5.2.4 发送落子消息——SendStep22 5.2.5 胜利后的处理——Win23 第六章 消息机制24 6.1 消息机制的架构24 6.2 各种消息说明25 6.2.1 落子消息——MSG_PUTSTEP25 6.2.2 悔棋消息——MSG_BACK25 6.2.3 同意悔棋消息——MSG_AGREEBACK26 6.2.4 拒绝悔棋消息——MSG_REFUSEBACK26 6.2.5 和棋消息——MSG_DRAW26 6.2.6 同意和棋消息——MSG_AGREEDRAW27 6.2.7 拒绝和棋消息——MSG_REFUSEDRAW27 6.2.8 认输消息——MSG_GIVEUP27 6.2.9 聊天消息——MSG_CHAT28 6.2.10 对方信息消息——MSG_INFORMATION28 6.2.11 再次开局消息——MSG_PLAYAGAIN28 6.2.12 同意再次开局消息——MSG_AGREEAGAIN29 致谢30 参考文献31 附录32 自定义消息头文件32 Table.cpp源文件:33
经管之家“学道会”小程序
  • 扫码加入“考研学习笔记群”
推荐阅读
经济学相关文章
标签云
经管之家精彩文章推荐