사목(4목) — 온라인 4목 게임 AI·2인
Four in a Row — vs AI or 2 players
사목(4목)이란?
사목(4목)은 7열×6행 보드에 두 사람이 번갈아 원반을 떨어뜨려, 가로·세로·대각선 중 어느 방향이든 자신의 원반 4개를 먼저 연속으로 놓으면 승리하는 게임입니다. 보드 위 대결 방식에서 AI 대결(컴퓨터와 대국)과 2인 대결(한 기기에서 둘이 번갈아 두기)을 고를 수 있습니다.
게임 방법
원하는 열을 클릭하면 해당 열의 가장 아래 빈 칸으로 원반이 떨어집니다. AI 대결에서는 내가 빨간 원반을 두면 컴퓨터가 자동으로 노란 원반으로 응수하고, 2인 대결에서는 두 사람이 빨강·노랑을 번갈아 클릭해 둡니다. 어느 한쪽이든 4개를 연속으로 완성하면 즉시 게임이 종료됩니다. 무르기로 직전 수를 되돌리고(AI 대결은 두 수, 2인 대결은 한 수), 새 판으로 언제든 다시 시작할 수 있습니다. 대결 방식을 바꾸면 새 판이 시작됩니다.
컴퓨터 AI는 어떻게 두나요?
컴퓨터는 미니맥스 탐색(알파-베타 가지치기)으로 몇 수 앞을 내다보며 가장 유리한 열을 선택합니다. 난이도가 높을수록 탐색 깊이가 늘어나 더 멀리 내다보고 정확하게 대응합니다. 상대의 승리 수는 즉시 차단하고, 자신의 승리 수를 우선 완성합니다.
개인정보
대국 진행 상황은 브라우저 화면에만 표시되며, 서버로 전송되거나 저장되지 않습니다.
What is this?
Four in a Row is played on a 7×6 board where two players alternate dropping discs into columns. The first to line up 4 discs in a row — horizontally, vertically, or diagonally — wins. Use the Mode control to play vs AI (against the computer) or 2 players (two people taking turns on one device).
How to play
Click any column to drop a disc into its lowest empty cell. In vs AI you play Red and the computer replies with Yellow automatically; in 2 players both people alternate placing Red and Yellow. The game ends the moment either side completes 4 in a row. Use Undo to take back the last move (two discs vs AI, one in 2 players), or New game to restart. Changing the mode starts a new game.
How does the computer AI play?
The computer uses minimax search with alpha-beta pruning to look several moves ahead and pick the strongest column. Higher difficulty searches deeper for sharper play. It immediately blocks the opponent's winning move and prioritizes completing its own.
Privacy
Game progress is shown only in your browser and is never sent to or stored on a server.