Rank: 338358 based on 0 downloads (last 30 days) and 0 file submitted
photo

Fabián

E-mail
Company/University
University of Colorado

Personal Profile:

 

Watch this Author's files

 

Comments and Ratings by Fabián
Updated File Comments Rating
12 Jul 2011 Chess with "Greedy Edi" Play chess against "Greedy Edi". Author: Wolfgang Garn

I discovered and fixed a bug in your Greedy EDI program that prevents it from running in UNIX environments. The culprit is a line of code near line 82 of show.m where you hard-code path delimiters as \

MATLAB provides the fullfile function for constructing platform-appropriate paths. Below is the code with some original lines commented that should work on all platforms and resolve this issue:

if fig ~='x'
% directory = 'images\basic\';
name = '120px-Chess_tile_';
ext = '.png';
if color %white (attention - transparency issues)
color_letter='l';
else
color_letter='d';
end
% file_name = [directory name lower(fig) color_letter ext];
file_name = fullfile('images','basic',[name lower(fig) color_letter ext]);
[X, map, alpha] = imread(file_name);
%handle = image(pos(2)-1+[0 1],8-pos(1)+[0 1],mirrorImage(X),'AlphaData',mirrorImage(alpha));
handle = image(pos(2)-1+[.1 .9],rows-pos(1)+[.1 .9],mirrorImage(X),'AlphaData',mirrorImage(alpha));

% There are some major transparency issues!!!
set(handle,'AlphaDataMapping','direct');
end

Contact us