function connect4 (rows, cols)
% Play connect4 on a board with given number of rows and columns.

% Set up the window
close all                   % Close all previous figure windows
hold on                     % Allow multiple plots on the same set of axes
axis equal                  % X- and Y-axis use the scale
axis([1, cols+1, 1, rows+1])% X-axis limits and Y-axis limits
title('Click within the graph area below')

% Initialize game
grid = zeros(cols, rows);   % grid(x, y) = token at position (x, y)
                            % grid(x, y) = 0 implies no token
player = 1;                 % Current player (1 or 2)

%Draw the board
for x = 1:cols+1
    plot([x x], [1 rows+1], 'k');   % Vertical black lines
end
for y = 1:rows+1
    plot([1 cols+1], [y y], 'k');   % Horizontal black lines
end

%Enter Code Below
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Loop as long as no victory and grid is not full











%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Enter Code Above

winner = checkvictory(grid);
if winner == 1
    title('Blue player wins!!')
elseif winner == 2
    title('Red player wins!!')
else
    title('Draw! The game is tied!')
end 

hold off            % New plots will now erase any current plots

