function display_board(state)
%Input:
% state:  a 9 element vector where 1 = X, -1 = O and
%  0 = EMPTY.  The positions are as follows:
%   1 2 3
%   4 5 6
%   7 8 9
%
% Outputs the state in normal representation

output = [];

for i = 0:2
    row = [];
    for j = 1:3
        index = i*3+j;
        
        if state(index) == 1
            row = [row, 'X '];
        elseif state(index) == -1
            row = [row, 'O '];
        else
            row = [row, '_ '];
        end
    end
    output = [output; row];
end

disp(output);