返回遊戲大廳

人機五子棋

你執黑先行,率先連成五子

核心遊戲指南 · 規則複核於 2026-07-31

人機五子棋規則、思路與實戰要點

執黑先行,與三種難度的電腦對手爭奪五子連線。 本頁內容由 PocketJoy 測試團隊依照目前網頁版本的實際操作與勝負條件整理,並由 Long-Term New Media Limited 維護。

分類棋盤與紙牌
資料保存目前瀏覽器

對局規則與勝負判定

你執黑棋先行,與電腦在 15×15 的棋盤上輪流落子。棋子下在線的交叉點上,一旦落下就不能移動,也不能被吃掉——這是五子棋和圍棋、象棋最根本的差別,盤面只會越來越滿,局勢只會單向累積。橫向、縱向或任一斜向連成五子即獲勝,最後落下的那顆棋子會用粉色外框標示出來,方便你在 15×15 這麼大的盤面上確認電腦剛才走了哪裡。棋盤填滿而雙方都沒有連成五子則為平局,不過實際對局中極少走到這一步。電腦提供簡單、普通、困難三種難度,困難檔會主動計算雙威脅。狀態列明確顯示「輪到你落子」或「電腦正在思考…」,勝場與對局數記錄在本機。

對局策略

五子棋的核心術語是「活三」和「衝四」,理解它們等於掌握了這個遊戲的語言。活三是三子相連且兩端都空著,對手不擋就會變成活四(兩端都能成五),而活四是無解的,所以看到對手活三必須立刻處理。衝四是四子相連但只有一端可以成五,對手必須立刻擋,但擋完之後你就失去了先手——所以衝四是「借用」而不是「取勝」,只有在能接續其他威脅時才值得走。取勝的標準手法是製造「雙活三」或「四三」:同時形成兩個對手擋不完的威脅。實務上的做法是找一個交叉點,讓你的棋子同時參與兩個方向的三連可能,這種點通常在已有棋子的斜線交會處。黑棋先行有明顯優勢(在無禁手規則下,黑棋理論上必勝),開局把棋子集中在天元附近,讓每一子都同時參與多個方向的組合,不要下得太散。防守時要學會「擋在活的那一端」——如果對手的三子一端已經被堵,那是死三,威脅不大,優先處理真正的活三。

常見失誤

初學者最常犯的錯誤是只顧自己連子,等發現對手已經活三時已經來不及了。每一手落子之前,先看對手的棋形有沒有三連或跳三(中間空一格的三子),這比推進自己的攻勢更優先——跳三特別容易被漏看,因為它視覺上不連續,但威脅程度和連續的活三完全相同。第二個誤區是把棋子連成一條長直線就以為很強。單一方向的連子很容易被兩端堵死,真正有威脅的形狀是能同時往兩三個方向發展的交叉點,所以下棋時要想的是「這一子參與了幾條可能的五連」,而不是「這一子讓我的線變多長」。第三個誤區是每次都選擇擋在對手棋子的正旁邊。有時候擋在稍遠的位置(擋住對方延伸的落點而不是貼身)反而能同時發展自己的棋形,一手兼顧攻守。第四是在困難難度下仍然只算一步。電腦會計算多步組合,你如果只看眼前的三連,常常是在幫對方完成他早就設計好的雙威脅。

適合的玩家

適合喜歡下棋但時間有限的人。五子棋的規則比圍棋、象棋簡單得多,一分鐘就能學會,沒有棋子種類、沒有走法差異、沒有吃子規則,但攻防轉換極快,一手不慎就可能被連成五子,緊張感很足。它在數學上也已被解出:1993 年 Victor Allis 證明了在無禁手的自由五子棋中,先手黑棋必勝,這也是為什麼正式比賽的連珠(Renju)規則要對黑棋加上禁手限制來平衡。本作採用的是自由規則,所以你執黑時擁有理論上的優勢,能不能發揮出來就看功力。單局通常五到十分鐘,節奏比大多數棋類快。困難難度的電腦會主動計算雙威脅,對有經驗的玩家也不輕鬆。

功能亮點

電腦難度分簡單、普通、困難三檔,可在側欄隨時切換,不必重開對局。困難檔會主動計算雙威脅,而不只是被動應對你的連子。「本機戰績」面板分別累計勝場與對局數,兩個數字並列能看出長期勝率而不只是最近幾局的印象。狀態列明確顯示「輪到你落子」或「電腦正在思考…」,你永遠知道現在該不該動手,避免在電腦計算時反覆點擊。電腦每步落子後,那顆棋子會以粉色外框標示——這個設計在 15×15 的大棋盤上特別重要,沒有它你需要自己逐行掃描才能找出對方剛下在哪裡,而漏看對方的一手往往就是輸棋的原因。結果彈窗區分勝、負、平三種結局並附短評,例如落敗時提示調整策略再挑戰。「重新開局」按鈕隨時可用。

操作與對局紀錄

點擊棋盤線的交叉點即可落子,滑鼠與觸控完全一致;已有棋子的點位點了不會有反應,不會誤覆蓋。手機上棋盤會縮放至適合單手點擊的尺寸,15×15 的交叉點雖然密集,但點擊判定範圍經過調整,不易誤觸到相鄰的點。「重新開局」按鈕隨時可用,不必等到分出勝負。戰績保存在瀏覽器的本機儲存空間,關閉頁面或重新整理都不清零;沒有帳號系統,沒有任何資料上傳到伺服器,清除瀏覽器資料則會一併清除紀錄。語言按鈕可在繁體中文與英文之間即時切換,包括遊戲提示、狀態列與結算評語,切換後不需要重新整理頁面,當前對局也不會中斷。頁面載入完成後,遊戲本體不再需要網路連線。

規則細節問答

玩家執什麼顏色?

玩家執黑先行,電腦執白。

五子必須剛好五顆嗎?

本版本以連續五顆或以上判勝。

困難電腦為什麼思考更久?

困難難度會評估更多候選點及後續攻防,因此響應時間較長。

想系統學攻防,可讀《五子棋攻防:活三、衝四與雙威脅》

內容審核:PocketJoy 遊戲測試團隊 · 營運:Long-Term New Media Limited · hklongtermad@gmail.com

Core game guide · rules reviewed 2026-07-31

Gomoku vs AI: rules, tactics and practical play

Play black first and race three levels of computer opponent to five in a row. This guide reflects the controls and win conditions in the current browser build. It is reviewed by the PocketJoy game-testing team and maintained by Long-Term New Media Limited.

CategoryBoard & Cards
Save locationCurrent browser

Rules and winning conditions

You take black and move first against the computer on a 15×15 board. Stones are placed on the line intersections and, once played, can neither be moved nor captured — the fundamental difference from go and chess, since the board only fills up and the position only accumulates in one direction. Five in a row horizontally, vertically or on either diagonal wins. The most recently played stone is outlined in pink so you can always see where the computer just moved, which matters on a board this large. If the grid fills with no line of five the game is drawn, though that is rare in practice. Three computer difficulty levels are available, with the hardest actively building double threats. The status line reads either your turn or a thinking notice, and wins and games played are recorded on your device.

Match strategy

The two shapes that matter are the open three and the four, and understanding them is effectively learning the language of the game. An open three is three stones in a row with both ends free; left alone it becomes an open four, which can make five at either end and cannot be stopped, so an opponent's open three must be answered immediately. A four is four in a row with one end able to make five, which forces a block — but once blocked you have lost the initiative, so a four borrows time rather than winning, and is only worth playing when it feeds into another threat. The standard winning method is a double threat: two open threes at once, or a four and a three together, so your opponent cannot answer both. In practice you look for an intersection where a stone contributes to potential threes in two directions, usually where existing diagonals meet. Black's first move is a real advantage, so keep your early stones near the centre where each contributes to several directions, rather than scattering them. On defence, learn to block at the open end: a three already blocked at one end is a dead three and poses little danger, so prioritise genuinely open ones.

Frequent errors

Beginners typically focus on their own line and notice the opponent's open three only when it is too late. Before every move, check their shapes for a three in a row or a broken three with one gap; that scan matters more than advancing your own attack, and broken threes are especially easy to miss because they are visually discontinuous while being exactly as dangerous as a solid one. The second mistake is assuming a long straight line is strong. Stones committed to one direction are easily blocked at both ends, whereas the genuinely threatening shapes are intersections that can grow in two or three directions, so the question to ask is how many potential fives a stone participates in, not how long your line has become. The third mistake is always blocking directly beside the opponent's stones. Blocking slightly further out, at the point their line would need to extend through, sometimes develops your own shape at the same time and answers attack and defence in one move. The fourth is calculating only one move ahead on the hard setting, where the computer builds multi-move combinations and a purely local response often helps complete a double threat it planned several moves ago.

Who it's for

Well suited to people who like board games but are short on time. The rules are far simpler than chess or go and take a minute to learn — no piece types, no differing moves, no captures — yet attack and defence swap constantly and a single careless move can lose the game, which keeps the tension high. The game is also solved mathematically: in 1993 Victor Allis proved that in free-style gomoku the first player, black, wins with correct play, which is precisely why competitive renju adds forbidden-move restrictions for black to restore balance. This implementation uses free rules, so playing black gives you a theoretical advantage and the question is whether you can convert it. A game usually runs five to ten minutes, faster than most board games, and the hard difficulty actively builds double threats.

Feature highlights

Three computer difficulties can be switched from the sidebar at any time without restarting, with the hard level building double threats rather than merely responding to your lines. The record panel accumulates wins and games played separately, and having both lets you judge your long-term rate rather than your impression of the last few games. The status line always reads either your turn or a thinking notice, so you know whether to act and will not click repeatedly while the computer calculates. After each computer move its stone is outlined in pink — a design that matters especially on a 15×15 board, since without it you would have to scan the grid to find the latest play, and missing the opponent's last move is a common way to lose. The result dialog distinguishes wins, losses and draws with a brief comment, such as a suggestion to adjust your strategy after a loss. A restart button is always available.

Controls and match records

Tap an intersection on the board to place a stone, identically with mouse or touch; occupied points do not respond, so an existing stone can never be overwritten. On a phone the board scales to a comfortable one-handed size, and although 15×15 intersections sit closely together, the tap targets are tuned so neighbouring points are not caught by mistake. A restart button is available at any point rather than only once the game is decided. Your record lives in the browser's local storage and survives closing or refreshing the page; there is no account system, nothing is uploaded to any server, and clearing browser data removes the record. The language button switches everything — prompts, status line and result comments — between Traditional Chinese and English instantly, without a page reload and without interrupting the game in progress. Once the page has loaded, the game itself needs no network connection.

Rules Q&A

Which color does the player use?

The player uses Black and moves first; the computer uses White.

Must the line contain exactly five stones?

This version awards a win for a continuous line of five or more stones.

Why does Hard AI pause longer?

Hard mode evaluates more candidate points and follow-up threats before choosing a move.

For a structured look at threats, read Gomoku Threats: Open Threes, Fours and Double Attacks.

Reviewed by the PocketJoy game-testing team · Operated by Long-Term New Media Limited · hklongtermad@gmail.com