from
AI for a game called chomp
by abhilash harpale
this program uses the minimax algorithm for playing chomp.open the file create_tree for instrutions.
|
| tree=create_tree(m,n)
|
%Copywrite Abhilash Harpale (c) 2009.
%This is the starting function,enter m,n.
%The output will me a matrix, enter this matrix into solve_tree function.
%The output of solve_tree will be another matrix ,input this to 'play.m'
%function.
%The folder contains some already generated trees eg.('2x8 chomp') you just
%need to input them to solve_tree and the output of this to 'play.m'
%The folder contains a '3x5 chomp_solved' ,this you need to just input to 'play.m' to play a 3x5 game.
%The cells are numbered along the rows with the top left most numbered 1.
%The user must enter the number of the cell he/she wants to play.
function tree=create_tree(m,n)
current_state=1:(m*n);
i=1;
player=0.5;
tree=create_sub_tree(current_state,player,i,m,n);
end
|
|
Contact us at files@mathworks.com