Computer Chess Club Archives


Search

Terms

Messages

Subject: The smallest and Winboard compatible chess program ;-)

Author: Pham Minh Tri

Date: 20:03:16 04/11/02

Go up one level in this thread


>I thought he meant chess program.
>I doubt if this program can play chess ;).

The shortest one is here. It can play chess and compatible with Winboard

/*
 Freeware :)
*/
#include <stdio.h>
int main(void) {
printf("THE SMALLEST CHESS PROGRAM - ver 1.0\nWinboard compatibility\n");
while(1) {
  char s[256], c[256];
  if (!fgets(s, 256, stdin)) return 0;
  sscanf(s, "%s", c);
  if (!strcmp(c, "quit")) return 0;
  if (isalpha(c[0]) && isdigit(c[1])) { // anything looks like a move ;)
    printf("resign\n"); fflush(stdout);
  }
}
}

Any improvement/suggestion?
Have fun!




This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.