Code covered by the BSD License  

Highlights from
Connect Four

Be the first to rate this file! 8 Downloads (last 30 days) File Size: 5.23 KB File ID: #33187
image thumbnail

Connect Four

by Mathias Benedek

 

08 Oct 2011 (Updated 21 Oct 2011)

The classic game connect four can be played on a 7x7 board against a computer-opponent at 3 levels.

| Watch this File

File Information
Description

Start game by entering: connect4_start

The game is played by two players each of which can be human or computer. You can choose between 3 levels corresponding to the depth of evaluation by the program. The program plays far from optimal but it may still be challenging to some casual players.

The program uses a minimax algorithm and employs a brute-force search of the search tree. Evaluation of positions follows the simple tactic of maximizing the weighted amount of same-color pieces in empty arrays of 4.
The actual depth of search (usually 2-3) corresponds to the depth reached after computing a predefined minimum number of available moves. Despite the usage of only one simple tactic the program appears to show some reasonable or even intelligent behavior.

At each move, the figure title gives information on the round-nr, computed depth, nr of computed moves, assessment of current position, and
evaluation of the best-possible position at computed depth. Positive/negative values indicate an assumed advantage for player 1/2.

MATLAB release MATLAB 7.6 (R2008a)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Please login to add a comment or rating.
Updates
21 Oct 2011

Program description (help) updated

Tag Activity for this File
Tag Applied By Date/Time
game Mathias Benedek 10 Oct 2011 11:04:40
algorithm Mathias Benedek 24 Oct 2011 10:34:53
minimax Mathias Benedek 24 Oct 2011 10:34:53
brute force Mathias Benedek 24 Oct 2011 10:34:53
connect four Mathias Benedek 24 Oct 2011 10:34:53

Contact us at files@mathworks.com