江西广告网

标题: Flash MX 编程深层次应用-网络连线游戏(8) (1) [打印本页]

作者: 知不知道    时间: 2009-2-5 11:12
标题: Flash MX 编程深层次应用-网络连线游戏(8) (1)
7.5 实时下棋(2) 4.检查哪方胜利的程序检查哪方胜利的程序如下: function check_win(row, col, val) { var i = col, count = 0; // 先检查行连成四子 while (_root.chess[row] == val and i>=0) { count ; i--; } if (count>=4) { return true; } i = col 1; while (_root.chess[row] == val and i<=6) { count ; i ; } if (count>=4) { return true; [color=red'] [/url] [url=/news/news001/flash/200510/20051017084212_3.html] [/url] [url=/news/news001/flash/200510/20051017084212_2.html] 7.5 实时下棋(2) 4.检查哪方胜利的程序检查哪方胜利的程序如下: function check_win(row, col, val) { var i = col, count = 0; // 先检查行连成四子 while (_root.chess[row] == val and i>=0) { count ; i--; } if (count>=4) { return true; } i = col 1; while (_root.chess[row] == val and i<=6) { count ; i ; } if (count>=4) { return true; [color=red'] [/url] [url=/news/news001/flash/200510/20051017084212_3.html] [/url] [url=/news/news001/flash/200510/20051017084212_2.html] } // 再检查列连成四子 count = 0; i = row; while (_root.chess[col] == val and i<=5) { count ; i ; } if (count>=4) { return true; } // 检查左高斜线 count = 0; i = row; j = col; while (_root.chess[j] == val and i>=0 and j>=0) { &n




欢迎光临 江西广告网 (http://bbs.jxadw.com/) Powered by Discuz! X3.2