Chess Master

Simple logic, easy to understand code, well commented 4 beginners, must try once.
4.4K Downloads
Updated 22 Mar 2011

View License

Its a two player game, i am working on developing artificial intelligence based computer player.
American Chess rules are applied.
A 2D array is updated by the position of the chess pieces which are numbered (each piece corresponding to a number)
As the player selects a piece the corresponding number is checked for all possible places where it can move, then the program waits for the second place where it has to be moved.
After each turn the program calls the function "wholoses.m" which will see whether the king is there or not. I am working to change this logic as it should check for CHECK MATE also.

The main function to run is CHESS_on_MATLAB.m
that will call its fig itself
the main m file just calls function "playerturn.m" as the input is given by the user.
this function then calls different functions to check the position of the piece, win loss, etc
"checkfp.m" checks whether the position desired is possible or not, and gives the message if not possible.
Currently the winner has to kill the king while i realized that it should not be the case, it should detect the checkmate condition, so dont worry i am gonna update this in few coming days.

Cite As

Suleman Shafqat (2024). Chess Master (https://www.mathworks.com/matlabcentral/fileexchange/30594-chess-master), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2009b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Categories
Find more on Board games in Help Center and MATLAB Answers

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes
1.4.0.0

Description

1.1.0.0

Summary
Description
Tags

1.0.0.0