Functions and variables for Othello

Variables:

Othelo % the matrix representtation of the othello board
this is true for all instances even within function

Othelo_test % the matrix representation of the othelo board surrounded by empty slots (0`s) used for testing purposes if move legal etc
this is true for all instances even within function

player % the player currently playing switches to winner at end of program

legal % true or false if the move is legal

x % the x coordinate
this is true for all instances even within function
y % the y coordinate
this is true for all instances even within function

i % i is a for loop iterator
j % j is a for loop iterator

small_Othelo % the othello board in this function

BEEG_Othelo % larger board used for testing etc

playerNum & the player currently playing

proper % true or false if the move is legal

Big_othelo % larger testing board same as othello test
this is true for all instances of Big_othello

Othelo_works % returns the larger testing board to othelo_test

Prow % is the row on the larger board that is passed through the check functions
this is true for all instances of Prow

Pcol % is the col on the larger board that in passed through the check functions
this is true for all instances of Pcol

row % row is the row that the function is checking in various check function
this is true for all instances of row

col % col is the collumn that the function is checking in various check functions
this is true for all instances of row

flip % determines whether or not to flip pieces in a check function

Othelo % Othelo is the returned larer othello board for tedsting
this is true for all instances of Othelo

newOthelo % updates the smaller board based on the larger testing board

GameOver % true or false if the game is over

count1 % the number of pices player one has
count2 % the number of pieces player two has

Board % is the matrix representing othelo game board that is passed through

player % is the player playing

______________________________________________________________________________
Functions:
function [x,y] = location(play)
% gets the location the player wants to play
play is the player within the funciton
function [proper,x,y] = is_legal(small_Othelo,BEEG_Othelo,x,y,playerNum)
%% is_legal determines if a legal move is made
function [Othelo,Othelo_test] = resetBoard()
%% sets the board ti the standard pre-game position
function [Othelo_works] = checkMoves(Big_othelo,y,x)
%% Check moves calls the the check: up down left etc function to
initiate changes to the board from capturing pices
function [Othelo] = checkUp(Big_othelo ,Prow , Pcol)
%% check the up switches
function [Othelo] = checkDown(Big_othelo ,Prow , Pcol)
%% check the down switches
function [Othelo] = checkLeft(Big_othelo ,Prow , Pcol)
%% check the left switches
function [Othelo] = checkRight(Big_othelo ,Prow , Pcol)
%% check the right switches
function [Othelo] = checkUpRight(Big_othelo ,Prow , Pcol)
%% check the up right switches
function [Othelo] = checkUpLeft(Big_othelo ,Prow , Pcol)
%% check the up left switches
function [Othelo] = checkDownLeft(Big_othelo ,Prow , Pcol)
%% check the down left switches
function [Othelo] = checkDownRight(Big_othelo ,Prow , Pcol)
%% check the down Right switches
function [newOthelo] = update(Othelo
%% update updates the othelo board based on the othelo test
function [GameOver, player] = endGame(Board, playerNum)
%% endGame determines if the game is over and if so who the winner is

Leave a Reply

Your email address will not be published. Required fields are marked *