- 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; }
推薦閱讀
- Web前端開發技術:HTML、CSS、JavaScript(第3版)
- Moodle Administration Essentials
- 精通搜索分析
- Kinect for Windows SDK Programming Guide
- Mastering Android Development with Kotlin
- SSM開發實戰教程(Spring+Spring MVC+MyBatis)
- Python機器學習:預測分析核心算法
- Instant Debian:Build a Web Server
- Go語言底層原理剖析
- SQL Server 2008中文版項目教程(第3版)
- HTML+CSS+JavaScript網頁制作:從入門到精通(第4版)
- C語言程序設計
- Python程序設計教程
- 黑莓(BlackBerry)開發從入門到精通
- 從“1”開始3D編程