vb60五子棋代码.docx

上传人:牧羊曲112 文档编号:3168349 上传时间:2023-03-11 格式:DOCX 页数:5 大小:37.17KB
返回 下载 相关 举报
vb60五子棋代码.docx_第1页
第1页 / 共5页
vb60五子棋代码.docx_第2页
第2页 / 共5页
vb60五子棋代码.docx_第3页
第3页 / 共5页
vb60五子棋代码.docx_第4页
第4页 / 共5页
vb60五子棋代码.docx_第5页
第5页 / 共5页
亲,该文档总共5页,全部预览完了,如果喜欢就下载吧!
资源描述

《vb60五子棋代码.docx》由会员分享,可在线阅读,更多相关《vb60五子棋代码.docx(5页珍藏版)》请在三一办公上搜索。

1、vb60五子棋代码option explicitconsult subwidth=400 定义画五子棋表格的每个长度和宽度private P2playcolor as integer实现黑白棋子的交替进行private mycolor as integer表示是否胜利private ifsucceed as booleanconsult pi=3.14159定义字符常量private centerx as single private centery as singleprivate radius as singleprivate dataArray(14,14) as integer 保存棋

2、盘中棋子的位置信息private sumtime as integer记录总时间来判断谁超时private ifstarteasy as boolean标记简单难度下计时功能是否可以开启private ifstartnormal as boolean标记中等难度下计时功能是否可以开启private sub picqipan_mousedown(button as integer,shift as integer, x as integer,x as single, y as single)dim x as integerdim y as integerdim i as integerdim j

3、 as integerif x<subwidth or y>14.5*subwidth then msgbox超出棋盘界限,请重新下。exit subend ifif abs(int(x/subwidth)-x/subwidth)<0.5 thenx0=int(x/subwidth)elsex0=int(x/subwidth)+1end ifend subif dataarray(x0,y0)<>3 thenmsgbox当前位置已经有棋子了,请重新走。,vbcritical,NOTE!exit subend ifsumtime=-1call remenbercrossdat

4、a(x0,y0) 记录棋子信息call whowin 判断谁赢判断是否开启相应难度计时功能if ifstarteasy=true thentimer2.enabled=trueqipan.fillcolor=vbblackend ifif ifstartnormal=true thentimer3.enabled=trueend if if ifstarthard=true thentimer4.enabled=trueend if end sub画棋子private sub drawpill(xx as ineger.yy as integer)if p2playcolor thenpicq

5、ipan.forecolor=vbwhitedoecentspicqipan.fillcolor=vbwhitepicqipan.fillstyle=0mycolor=0elsepicqipan.forecolor=vbblackdoeventspicqipan.fillstyle=0mycolor=1end ifp2playcolor=not p2playcolorpicqipan.circle(xx0*subwidth.y0*subwidth),subwidth*0.5end sub以下ABC三个事件共同实现下棋的同时听音乐功能Aprivate sub dir1_chagne(0file1

6、.path=dir1.pathend subBprivate sub drv_changedir1.path=drv.driveend subCprivatessub qipanstylefurA_clickpicqipan.backcolor=$HCOFFFFcall cmdstart_clickend subprivate sub qipanstylefurB_clickpicqipan.backcolor=&HC0C000call cmdstart_clickend subprivate sub qipanstylelefurD_clickpicqipan.backcolor=&H8080FFcall cmdstart_clickend sub添加四种背景音乐

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 生活休闲 > 在线阅读


备案号:宁ICP备20000045号-2

经营许可证:宁B2-20210002

宁公网安备 64010402000987号