[ List Earliest Comments Only For Pages | Games | Rated Pages | Rated Games | Subjects of Discussion ]
Comments/Ratings for a Single Item
I am guessing that the Period in .rf prevents the function friend to determine if it islower.
Yes, it does. The islower function returns true only when all characters in the string are lowercase.
I would suggest making a distinction between your notation and the piece labels. .rf is a piece label, but it should not be used for notation. Use completely alphabetic notation, and test the case of the notation rather than the case of the label. See the fairychess include file tutorial for details.
2 comments displayed
Permalink to the exact comments currently displayed.
if fn friend $moved:
set msg join join $moved #codename " is friend";
echo #msg;
elseif fn enemy $moved:
set msg join join $moved #codename " is enemy ";
echo #msg;
else:
set msg join join join $moved #codename " is not friend or foe " $moved;
echo #msg;
endif;
I need advice on programming. I have a piece that is .rf, it appears to me the function friend / enemy is not working. That function friend is using isupper or islower. I am guessing that the Period in .rf prevents the function friend to determine if it islower.
Any suggestions how I can add .rf to the function friend?