Skip to content
Snippets Groups Projects
Commit 1d37aa8d authored by deuce's avatar deuce
Browse files

Minor fixups.

parent 156027af
No related branches found
No related tags found
No related merge requests found
......@@ -10,6 +10,7 @@ var piece;
var f=new File("/tmp/chesslog.txt");
var reason;
f.open("a");
f.truncate(0);
while(1) {
cmd=readln();
......@@ -22,24 +23,27 @@ f.flush();
piece=b.getPiece(parsePos(m[1]));
if(piece) {
if(piece.moveTo(m[2])) {
print('move '+m[1]+m[2]);
write('move '+m[1]+m[2]+"\n");
f.writeln("Moved "+m[1]+m[2]);
f.flush();
break;
}
else {
print('Illegal move (no worky): '+m[1]+m[2]);
write('Illegal move (no worky): '+m[1]+m[2]+"\n");
f.writeln('Illegal move (no worky): '+m[1]+m[2]);
f.flush();
}
}
else {
print('Illegal move (no such piece): '+m[1]+m[2]);
write('Illegal move (no such piece): '+m[1]+m[2]+"\n");
f.writeln('Illegal move (no such piece): '+m[1]+m[2]);
f.flush();
}
}
break;
case 'protover 2':
writeln('feature\n');
break;
case 'new':
b=new Board();
break;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment