private int mRow; private int mCol; private int mConn;
public void newGame() {
newBoard();
setVisible(true);
}
private void newBoard() {
setLayout(new GridLayout(mRow, mCol, 2, 2));
String title = String.format("%dx%d-%d連線遊戲 by 東吳資管", mRow, mCol, mConn);
setTitle(title);
int w = mCol * 77;
int h = mRow * 77;
setSize(w, h);
for (int k = 0; k < mRow * mCol; k++) {
JButton btn = new JButton();
add(btn);
}
}
井字遊戲(圈叉)、五子棋遊戲展示
請下載遊戲壓縮檔(使用滑鼠右鍵另存新檔),儲存於硬碟中(例如 C:\)
將壓縮檔解壓縮,產生 gogame目錄
按「開始」>「執行」
輸入 cmd
在Console 文字視窗中,輸入
cd c:\gogame
java GoGame