image thumbnail


version (28.4 KB) by Steven Terrana


Updated 26 Mar 2015

View License

Play Connect 4!
A two player version of connect 4.
drag your marker around the figure window and click over a column to drop it in!
This was created using version 2014b.
If you want to edit the board colors, you may input your own.
Acceptable Input Properties:
Acceptable Inputs are the standard color strings or RGB color vectors.
white -- 'w'
black -- 'k'
yellow -- 'y'
magenta -- 'm'
cyan -- 'c'
red -- 'r'
green -- 'g'
blue -- 'b'
You may also turn off:
The physical dynamics by specifying, 'Bounce','off'
The game board reset animation by specifying, 'AnimateDrop','off'

Cite As

Steven Terrana (2022). connect4(varargin) (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2014b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!