사목(4목) — 온라인 4목 게임 AI·2인

Four in a Row — vs AI or 2 players

내 차례 (빨강)Your turn (Red) Moves: 0

사목(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.

사목(4목) 규칙이 뭔가요?
7열×6행 보드에서 각 열의 최하단 빈 칸에 원반을 떨어뜨려 가로·세로·대각선 중 어느 방향이든 자신의 원반 4개를 먼저 연속으로 놓으면 승리합니다. AI 대결에서는 사람이 빨간 원반으로 먼저 두고 컴퓨터가 노란 원반으로 응수하며, 2인 대결에서는 한 기기에서 두 사람이 번갈아 둡니다.
AI 대결과 2인 대결은 어떻게 바꾸나요?
보드 위 '대결 방식'에서 AI 대결(컴퓨터와 대국)과 2인 대결(한 기기에서 둘이 번갈아 두기)을 선택할 수 있습니다. 대결 방식을 바꾸면 새 판이 시작됩니다. AI 대결일 때만 난이도(쉬움·보통·어려움)를 고를 수 있습니다.
무르기는 몇 번 할 수 있나요?
무르기 버튼을 누르면 직전 수를 되돌릴 수 있습니다(AI 대결은 내 수와 컴퓨터 응수를 함께, 2인 대결은 한 수). 횟수 제한은 없으며 대국 중 언제든 사용할 수 있습니다.
컴퓨터는 얼마나 강한가요?
알파-베타 가지치기를 적용한 미니맥스 탐색 AI로, 난이도에 따라 탐색 깊이가 달라집니다(쉬움·보통·어려움). 상대의 승리 수를 즉시 차단하고 자신의 승리 수를 우선 완성합니다.
기록이 서버에 저장되나요?
아니요. 모든 대국은 브라우저 안에서만 진행되며 어떤 데이터도 서버로 전송되지 않습니다.
What are the rules of Four in a Row?
The first player to line up 4 discs in a row — horizontally, vertically, or diagonally — wins, dropping discs into the lowest empty cell of any column. In vs AI you play Red first and the computer plays Yellow; in 2 players, two people alternate on one device.
How do I switch between vs AI and 2 players?
Use the 'Mode' control above the board to pick vs AI (against the computer) or 2 players (two people on one device). Changing the mode starts a new game. Difficulty (Easy·Normal·Hard) applies only in vs AI.
How many times can I undo?
Undo takes back the last move (two discs in vs AI, one in 2 players). There is no limit — use it as often as you like during a game.
How strong is the computer?
It's a minimax search AI with alpha-beta pruning; higher difficulty searches deeper for sharper play. It immediately blocks the opponent's winning move and prioritizes completing its own.
Is any data stored on a server?
No. The entire game runs only in your browser and no data is ever sent to a server.