Question
function Start = connect4game() figure('Units','normalized','Position',[.2 .2 .6 .6], 'Name','Connect Four','Color','w'); axes('Units','normalized','Position',[.1 .1 .8 .8],'Color','b','LineWidth',1,'Box','on'); set(gca, 'XTick',[],'YTick',[],'XLim',[0,160],'YLim',[0,140]); hold on; for row = 1:6 for col =
function Start = connect4game() figure('Units','normalized','Position',[.2 .2 .6 .6], 'Name','Connect Four','Color','w'); axes('Units','normalized','Position',[.1 .1 .8 .8],'Color','b','LineWidth',1,'Box','on'); set(gca, 'XTick',[],'YTick',[],'XLim',[0,160],'YLim',[0,140]); hold on; for row = 1:6 for col = 1:7 board(row,col) = plot(col*20,row*20, 'wo','MarkerSize',35,'LineWidth',1,'MarkerFaceColor',[1 1 1]','MarkerEdgeColor', [0 0 0]); end end
Could someone help me write a connect 4 game (human vs computer) that works with the above design?
It doesn't have to be anything special it just has to work for now.
The programming language that I'm using is MatLab.
Thanks!!!
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access with AI-Powered Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started