- Test-Driven Java Development(Second Edition)
- Alex Garcia Viktor Farcic
- 73字
- 2021-06-24 18:31:55
Implementation
This implementation should be similar to the previous one. We already have horizontal verification and now we need to do the same vertically:
private boolean isWin() { int playerTotal = lastPlayer * 3; for (int i = 0; i < SIZE; i++) { if (board[0][i] + board[1][i] + board[2][i] == playerTotal) { return true; } else if (board[i][0] + board[i][1] + board[i][2] == playerTotal) { return true; } } return false; }
推薦閱讀
- 自己動(dòng)手寫(xiě)搜索引擎
- Apache Hive Essentials
- BeagleBone Media Center
- HTML5入門(mén)經(jīng)典
- 移動(dòng)互聯(lián)網(wǎng)軟件開(kāi)發(fā)實(shí)驗(yàn)指導(dǎo)
- AutoCAD 2009實(shí)訓(xùn)指導(dǎo)
- QGIS Python Programming Cookbook(Second Edition)
- Cocos2d-x Game Development Blueprints
- Java 9 Programming By Example
- Julia數(shù)據(jù)科學(xué)應(yīng)用
- Python 3 Object:oriented Programming(Second Edition)
- After Effects CC案例設(shè)計(jì)與經(jīng)典插件(視頻教學(xué)版)
- Unreal Engine Game Development Cookbook
- C語(yǔ)言程序設(shè)計(jì)實(shí)驗(yàn)指導(dǎo)教程
- Mastering Vim