diff --git a/src/as/o/blt.1 b/src/as/o/blt.1 new file mode 100644 index 00000000..5e8e9f2f --- /dev/null +++ b/src/as/o/blt.1 @@ -0,0 +1,19 @@ +; +; BLT +; + +RELOCATABLE +TITLE BLT +.INSRT C;NC INSERT +.INSRT C;NM INSERT + +CENTRY BLT,[FROM,TO,NUM] + + HRRZ A,TO + HRRZI B,-1(A) + ADD B,NUM + HRL A,FROM + BLT A,(B) + RETURN + +END diff --git a/src/as/o/blt.rel b/src/as/o/blt.rel new file mode 100644 index 00000000..a12daf6f Binary files /dev/null and b/src/as/o/blt.rel differ diff --git a/src/as/o/ismov1.midas b/src/as/o/ismov1.midas new file mode 100644 index 00000000..629a3381 --- /dev/null +++ b/src/as/o/ismov1.midas @@ -0,0 +1,35 @@ +; +; ISMOV1 +; +RELOCATABLE +TITLE ISMOV1 +.INSRT C;NC INSERT +.INSRT C;NM INSERT + +CENTRY ISMOV1,[BB,CC,P1] + +DD==3 +P2==2 +K==5 + + MOVEI DD,ZDIRLI" ; DIRECTION LIST +NXTDIR: MOVE D,(DD) ; NEXT DIRECTION + ADDI DD,1 ; REST OF LIST + JUMPE D,LOSE ; IF NO MORE DIRECTIONS + MOVE P2,P1 ; INITIAL POSITION + SETZ K, ; COUNTER +NXTPOS: ADD P2,D ; MOVE 1 STEP + SKIPG ZSQVAL"(P2) ; STILL ON THE BOARD? + GO NXTDIR ; NO + MOVE A,BB ; THE BOARD + ADDI A,(P2) ; ADDRESS OF SQUARE AT P2 + MOVE A,(A) ; CONTENTS OF SQUARE AT P2 + JUMPE A,NXTDIR ; IT'S EMPTY + CAME A,CC ; IS IT OUR COLOR? + AOJA K,NXTPOS ; NO, COUNT TOKEN AND GO TO NEXT POSITION + JUMPE K,NXTDIR ; DID NOT PASS OVER ANY OPPONENT + MOVEI A,1 ; WIN! +RET: RETURN +LOSE: MOVEI A,0 + GO RET +END diff --git a/src/as/o/ismov1.rel b/src/as/o/ismov1.rel new file mode 100644 index 00000000..b01658ce Binary files /dev/null and b/src/as/o/ismov1.rel differ diff --git a/src/as/o/o.h b/src/as/o/o.h new file mode 100644 index 00000000..b7480ac2 --- /dev/null +++ b/src/as/o/o.h @@ -0,0 +1,122 @@ +# ifdef unix +# include +# endif +# define TRUE 1 +# define FALSE 0 + +/* colors */ + +# define EMPTY 0 /* - */ +# define WHITE 1 /* @ */ +# define BLACK 2 /* * */ + +/* commands */ + +# define ANALYZ 'a' +# define PBOARD 'b' +# define HCAP 'h' +# define LISTM 'l' +# define MANUAL 'm' +# define OPTCOM 'o' +# define QUIT 'q' +# define RESIGN 'r' +# define READCM 'B' +# define SCORE 's' +# define TREECM 't' +# define WRITCM 'w' +# define XCOM 'x' +# define HELP '?' +# define SHELL '!' + +/* internal commands */ + +# define ERROR 0 +# define MOVE 'M' +# define DONE 'D' +# define RETRY 'R' + +/* answers */ + +# define YES 'y' +# define NO 'n' + +# ifndef unix +# define fastchar int +# endif +# ifdef unix +# define fastchar char +# endif + +extern fastchar sqval[100], ssqval[100]; +extern int endgame; + +typedef fastchar board[100]; +typedef int position; +typedef int direction; +typedef int color; + +# define oppcolor(c) ((c)^3) +# define bscore(b,c) (b[c]) + +# define ismove(b,c,p) ((b[p] == EMPTY) && ismov1(b,c,p)) + +struct mt { + position p; + int c; + int s; + }; + +# define NORTH (-10) +# define EAST 1 +# define SOUTH 10 +# define WEST (-1) +# define NORTHEAST (-9) +# define NORTHWEST (-11) +# define SOUTHEAST 11 +# define SOUTHWEST 9 + +# define CORNERVALUE 7 +# define EDGEVALUE 6 +# define HEDGEVALUE 5 +# define INTERIORVALUE 4 + +# define CORNERSCORE 30 +# define EDGESCORE 15 +# define POINTSCORE 4 +# define INTERIORSCORE 3 +# define DANGERSCORE 2 + +# define MIDDLEMOVE 27 +# define ENDGAMEMOVE 27 + +# define sqscore(p) (endgame ? 1 : ssqval[p]) + +# define valid(p) (sqval[p]>0) +# define edge(p) (ssqval[p]>=EDGESCORE) +# define corner(p) (sqval[p]>=CORNERVALUE) +# define horizedge(p) ((p)<19||(p)>80) +# define adjedge(p) (sqval[p]==2) +# define adjdiag(p) (sqval[p]==1) +# define adjcorner(p) (sqval[p]<=2) + +# define forallpos(p) for(p=11;p<89;++p) if(valid(p)) +# define nextpos(p,d) (p=+(d)) +# define abs(a) ((a)<0?-(a):(a)) +# define oppdir(d) (-(d)) +# define posx(p) (((p)/10)-1) +# define posy(p) (((p)%10)-1) +# define pos(x,y) ((x)*10+(y)+11) + +# ifndef unix +# define FILE int +# define NULL 0 +# define EOF -1 +# define BUFSIZ 512 +extern int stdin, stdout; +# define fopen flopen +# define time nowtime +# endif + +# ifndef unix +# define cpybrd(a,b) (blt((b),(a),100)) +# endif diff --git a/src/as/o/o.maktap b/src/as/o/o.maktap new file mode 100644 index 00000000..297bf224 --- /dev/null +++ b/src/as/o/o.maktap @@ -0,0 +1,11 @@ +u +u 9 2 +a o.h +a o1.c +a o2.c +a o3.c +a o4.c +a o5.c +a o6.c + + \ No newline at end of file diff --git a/src/as/o/o.notes b/src/as/o/o.notes new file mode 100644 index 00000000..6276bacb --- /dev/null +++ b/src/as/o/o.notes @@ -0,0 +1,62 @@ +perhaps should count edges against, in order to save edge spaces + for later + +----- + +randomize strategy for confusing humans + +----- + +bug: rates * - @ + * @ - + - @ M * @ * + + for * even though * loses the corner + +----- + +an obscure point: sometimes too eager to run along the edge when + about to lose a corner, e.g. + + - - - + - @ - + @ - * + @ - - + * * - + ? * - really shouldn't take this + @ - - + - - - + +----- + +need an algorithm for determining which corner to give up and when to + play X moves + +----- + +perhaps should rate takeback on edge higher, e.g. X * @ for @ + along the edge is better than a random edge-taking move + when the opponent can also take an edge +really need a better transition analysis so that the program will + prefer to take a super-safe edge even if it is going to + lose a corner anyway; perhaps need a category for super-safe + edge; would need a prevents-losing-corner category + +----- + +this position good for *: - * - @ @ - * - + +----- + +these moves not so bad for *, * not likely to get those anyway: + + - - @ ? ? @ - - + +----- + +these moves are bad for *, they lose the ability to later move in + 2 or 7: + + - - ? @ @ ? - - + + \ No newline at end of file diff --git a/src/as/o/o.old b/src/as/o/o.old new file mode 100644 index 00000000..0c14b92c --- /dev/null +++ b/src/as/o/o.old @@ -0,0 +1,221 @@ + +#define FHOLE 1 +#define FCORNER 2 + +/* + * hole - does the position resulting from a move at P by C contain a + * hole for O? If so, what value square is given up? + * + */ + +hole(b,c,o,p) + board b; + color c, o; + position p; + + {register int h; + if (horizedge (p)) + h = hole1 (b,c,o,p,EAST) | hole1 (b,c,o,p,WEST); + else + h = hole1 (b,c,o,p,NORTH) | hole1 (b,c,o,p,SOUTH); + if (h == (FHOLE+FCORNER)) return (CORNERVALUE); + if (h & FHOLE) return (EDGEVALUE); + return (0); + } + +/* + * [_ X = FCORNER + * [_ c+ o* X = FCORNER -- this seems wrong + * + */ + +hole1(b,c,o,p,d) + board b; + color c, o; + register position p; + direction d; + + {int n, m; + n = 0; + while (b[p] == o) + if (!valid (nextpos (p, d))) return (0); + else ++n; + m = 0; + while (b[p] == c) + if (!valid (nextpos (p, d))) return (0); + else ++m; + if (corner (p)) + {if (b[p] == EMPTY) + {if (n == 0) return (FCORNER); + if (m > 0) return (FCORNER); + } + return (0); + } + while (b[p] == o) if (!valid (nextpos (p, d))) return (0); + if (b[p] == c) return (0); + if (corner (p)) return (0); + n = 0; + while (b[p] == EMPTY) + {++n; + if (!valid (nextpos (p, d))) return (0); + } + if ((n & 1) == 0) return (0); + while (b[p] == o) if (!valid (nextpos (p, d))) return (FHOLE); + if (b[p] != c) return (0); + while (b[p] == c) if (!valid (nextpos (p, d))) return (FHOLE); + if (b[p] == o) return (FHOLE); + if (corner (p)) return (FHOLE+FCORNER); + return (FHOLE); + } + + +takeback(b,c,o,p) + board b; + color c, o; + position p; + + {return (takb1(b,c,o,p,NORTH) || + takb1(b,c,o,p,NORTHEAST) || + takb1(b,c,o,p,EAST) || + takb1(b,c,o,p,SOUTHEAST)); + } + +takb1(b,c,o,p,d) + board b; + color c, o; + position p; + direction d; + + {register int c1, c2; + c1 = takb2(b,c,o,p,d); + c2 = takb2(b,c,o,p,oppdir(d)); + return(c1==o&&c2==EMPTY || c1==EMPTY&&c2==o); + } + +takb2(b,c,o,p,d) + board b; + color c, o; + register position p; + direction d; + + {nextpos (p, d); + if (valid (p)) + {while (b[p] == o) + {nextpos (p, d); + if (!valid (p) || b[p]==EMPTY) return (o); + } + } + while (valid (p) && b[p] == c) nextpos (p, d); + if (!valid (p)) return (c); + return (b[p]); + } + +int trydepth; + +int tryedge (oldb,b,c,o,p,d) /* return score from O's point of view */ + board oldb, b; + color c, o; + position p; + direction d; + + {int s1, s2, rc; + + ++trydepth; + if (eflag) + {putn (trydepth); + printf ("tryedge (%c, %d%d):\n", pcolor[c], + posx(p)+1, posy(p)+1); + } + s1 = try1edge (oldb,b,c,o,p,d); + s2 = try1edge (oldb,b,c,o,p,oppdir(d)); + if (s1 == 0) + {if (s2 == 0) rc = 1; + else rc = -s2; + } + else if (s2 == 0) rc = -s1; + else + {if (s2>s1) s1=s2; + rc = -s1; + } + if (eflag) + {putn (trydepth); + printf ("tryedge (%c, %d%d) = %d\n", pcolor[c], + posx(p)+1, posy(p)+1, rc); + } + --trydepth; + return (rc); + } + +int try1edge (oldb,b,c,o,p,d) /* return score from C's point of view */ + board oldb, b; + color c, o; + position p; + direction d; + + {position p1; + int rc; + + ++trydepth; + if (eflag) + {putn (trydepth); + printf ("try1edge (%c, %d%d, %d):\n", pcolor[c], + posx(p)+1, posy(p)+1, d); + } + + rc = 0; + p1 = p; + while (valid (nextpos (p, d))) + {if (b[p] == EMPTY) + {if (ismove (b,c,p)) + {board a; + cpybrd (a,b); + putmov (a,c,p); + /* if (a[p1]==o) {rc = -1; break;} */ + if (corner(p)) + {if (ismove (oldb,c,p)) rc = 1; + else rc = 2; + break; + } + rc = tryedge (oldb,a,o,c,p,d); + if (rc<0 && !ismove(b,o,p)) + rc = 1; /* C need not move */ + break; + } + if (ismove (b,o,p)) /* C can't move, but O can */ + {rc = -try1edge (oldb,b,o,c,p1,d); + if (rc > 0) rc = 0; /* O need not move */ + break; + } + break; + } + } + if (eflag) + {putn (trydepth); + printf ("try1edge (%c, %d%d, %d) = %d\n", pcolor[c], + posx(p)+1, posy(p)+1, d, rc); + } + --trydepth; + return (rc); + } + +/* + else + {struct mt t[64], *tp[64]; + register struct mt **mp; + register int k; + k = pmvgen (a,o,c,tp,t,movnum>=MIDDLEMOVE); + mp = tp; + while (--k >= 0) + {position q; + register int temp; + q = (*mp++)->p; + temp = -meval(a,o,c,q,-minmove); + if (temp1) options (argv[1]); + if (display) clrscreen (); + prnews (); + } + setrand (); +# ifndef unix + if (debug>0) +# endif + mcolor = WHITE; +# ifndef unix + else mcolor = (rand () & 1 ? WHITE : BLACK); +# endif + manmode = 0; + while (playgame () && (superself || ask(stdin,"Another game") == YES)); +# ifdef unix + if (ask(stdin,"Delete saved game") == YES) + unlink (svgame); +# endif + exit(0); + } + +options (s) + char *s; + + {register fastchar c; + explain = debug = eflag = 0; + while (c = lower (*s++)) switch (c) { + case 'x': if (wizard || explain==0) ++explain; continue; + case 'd': if (wizard) ++debug; continue; + case 'e': if (wizard) ++eflag; continue; + case 'm': if (wizard) mvnhack = !mvnhack; continue; + } + if (debug>0) explain=2; + } + +playgame () + + {board b; + int i; + + settime(); + clrbrd(b); +# ifndef unix + gamefile = copen (gambuf, 'w', "s"); +# endif +# ifdef unix + if (superself) gamefile = fopen (svgame, "a"); + else gamefile = fopen (svgame, "w"); + if (gamefile == NULL) + {printf ("Can't create %s\n", svgame); + return (0); + } +# endif + if (superself) fprintf (gamefile, "----------\n"); + +# ifdef unix + else prgame (gamefile); +# endif + + i = game(b); + if (i != QUIT && i != EOF) + {putc ('\n', gamefile); + prtscr (b, gamefile, FALSE); + putc ('\n', gamefile); + if (n_inhibit == 0) inhibit (); + if (!superself && i != RESIGN) shwscore (b); + if (!manmode) wrstat (b, i==RESIGN); + } + fclose (gamefile); +# ifndef unix + if (i != QUIT && i != EOF) + {if (!superself && !manmode && cntbrd(b,oppcolor(mcolor))>=50 + && handicap==0) + {FILE *f; + f = fopen (recfile, "a"); + if (f != NULL) + {prgame (f); + putc ('\p', f); + fclose (f); + } + } + } +# endif + uninhibit (); +# ifndef unix + if (superself || (movnum > MVNREAL && ask (stdin, "Save game")==YES)) + {FILE *f; + if (superself) f = fopen ("o.game", "a"); + else f = fopen ("ogame", "w"); + if (f == NULL) printf ("Can't open file\n"); + else + {prgame (f); + fclose (f); + } + } +# endif + mcolor = oppcolor (mcolor); + return (i != EOF); + } + +prgame (f) + + {fprintf (f, "%s (", username); + if (manmode) + fprintf (f, "manual"); + else putcolor (oppcolor (mcolor), f); + fprintf (f, ") %s\n", timestring); + fprintf (f, "%s", gambuf); + } + +shwscore (b) + board b; + + {int i; + printf("\n"); + i = prtscr(b,stdout,TRUE); + putchar (' '); + if (i!=0) + {if (!manmode) + {if (i > 0) printf("You won by %d\n",i); + else printf("You lost by %d\n",-i); + } + else + {if (i > 0) printf ("* won by %d\n", i); + else printf ("@ won by %d\n", -i); + } + } + else printf("A draw\n"); + } + +wrstat (b, resigned) + board b; + + {FILE *f; + if (debug) + {wrfstat (b, resigned, stdout); + if (ask(stdin,"Write stat file")==NO) return; + } + if ((f = fopen(log,"a"))!=NULL) + {wrfstat (b, resigned, f); + fclose (f); + } + } + +wrfstat (b, resigned, f) + board b; + FILE *f; + + {if (superself) putc ('O', f); + else fprintf (f, "%s", username); + putc('\t',f); + prtscr(b,f,TRUE); + putc ('\t', f); + putcolor (oppcolor(mcolor), f); + if (resigned) putc ('r', f); + else if (nanalyze>10) putc ('a', f); + fprintf (f, "%d\t%d+%d\t%s", + handicap,fcnt[oppcolor(mcolor)],fcnt[mcolor],timestring); + } + +settime () + + {int tv[2]; + time (tv); + timestring = ctime(tv); + } + +game (b) + board b; + + {handicap = fcnt[BLACK] = fcnt[WHITE] = 0; + endgame = -1000; + setmov (b, 1); + machine[mcolor] = TRUE; + machine[oppcolor(mcolor)] = superself; + player = BLACK; + bk_clear (BLACK); + selfplay = superself; + nanalyze = 0; + if (!superself && machine[player] && display) dpyempty (); + for (;;) + {position p; + int mtime; + mtime = -1; + if (cntbrd(b,EMPTY) == 0) break; + if (!anymvs (b, player)) + {if (!anymvs (b, oppcolor(player))) break; + p = -1; + ++fcnt[player]; + bk_flush (); + if (!machine[player]) + {do_inhibit (); + if (explain) + {prtbrd (b); + printf ("Forfeit. "); + pause (); + } + } + } + else + {if (machine[player]) + {if (explain) + if (explain>1) + {int temp; + temp = debug; + debug = 0; + analyze(b,player,oppcolor(player)); + debug = temp; + } + else auxbrd(b); + mtime = cputm (); + p = my_mov(b,player,oppcolor(player)); + if (mtime) mtime = cputm () - mtime; + else mtime = -1; + } + else + {fastchar c; + p = onemov (b, player); + if (p >= 0) + {do_inhibit (); + if (explain) + {prtbrd (b); + printf ("The only legal move is "); + printf ("%d-%d. ", + posx(p)+1, posy(p)+1); + pause (); + } + } + else + {uninhibit (); + if (player==WHITE) putchar ('\n'); + switch (c = getmov(b,stdin,&p)) { + + case RESIGN: if (ask (stdin, + "You really want to resign") != YES) + continue; + if (movnum <= MVNREAL) return (QUIT); + p = -2; + break; + case QUIT: if (movnum>MVNREAL && ask (stdin, + "Would you rather resign") == YES) + {p = -2; break;} + if (movnum>MVNREAL) return (EOF); + /* penalize quitters */ + case EOF: return (c); + case RETRY: continue; + case MOVE: break; + } + } + } + bk_move (p); + putmov(b,player,p); + } + if (player==BLACK) mprint ("%d. ", movnum); + else mprint ("..."); + if (p == -1) mprint ("Forfeit"); + else if (p == -2) mprint ("Resign"); + else + {mprint("%d-%d", posx(p)+1, posy(p)+1); + if (machine[player] && mtime>=0) + {int ntenths, nsec; + nsec = mtime / 60; + ntenths = mtime % 60; + ntenths = (ntenths+5)/6; + if (ntenths==10) {ntenths=0;++nsec;} + mprint (" (%d.%d)", nsec, ntenths); + } + } + if (player == WHITE) + {mprint ("\n"); + setmov (b, movnum+1); + } + else if (machine[player]) + tyo_flush (); + player = oppcolor (player); + if (p == -2) + {if (player == WHITE) mprint ("\n"); + return (RESIGN); + } + } + if (!superself) shwbrd(b); + return (DONE); + } + +do_inhibit () + + {if (!debug && !eflag && n_inhibit==0 && !manmode) inhibit (); + } + +setmov (b, n) + board b; + + {int nend; + nend = (n >= ENDGAMEMOVE); + movnum = n; + if (nend != endgame) + {endgame = nend; + fixbrd (b); + } + } + +getmov (b, f, pp) + board b; + FILE *f; + position *pp; + + {int pflag; + + pflag = 1; + for (;;) + {int c, p, i; + + if (pflag && !superself) + {if (pflag>1 && display) + {clrscreen (); + redisplay (); + tyoflush(); + } + else if (movnum>=2 || !machine[BLACK]) prtbrd (b); + else shwbrd (b); + } + pflag = 0; + c = command(stdin,&p); + *pp = p; + switch (c) { + +case HELP: printf ("%s", helpmsg); + continue; +case MANUAL: bk_flush (); + machine[BLACK] = machine[WHITE] = 0; + manmode = TRUE; + continue; +case PBOARD: pflag = 2; + continue; +case READCM: bk_flush (); + if (readbd (b, buf)) return (RETRY); + printf ("no file\n"); + continue; +case WRITCM: if (!writbd (b, buf)) printf ("can't\n"); + continue; +case TREECM: dotree (b,player,oppcolor(player),p,stdout); + continue; +case OPTCOM: options (buf); + continue; +case XCOM: explain = !explain; + continue; +case SCORE: i = prtscr(b,stdout,TRUE); + if (!manmode) + {if (i > 0) printf(" You're winning."); + else if (i < 0) printf(" You're losing!"); + } + else + {if (i > 0) printf (" * is winning."); + else if (i < 0) printf (" @ is winning."); + } + putchar('\n'); + continue; +case QUIT: +case RESIGN: +case EOF: return (c); +case HCAP: if (handicap==0 && movnum==1) + {for (i=0; p!=0; ++i) + {b[h[i]] = p>0 ? player : oppcolor(player); + handicap =+ p>0? 1: -1; + p =+ p>0? -1 : 1; + pflag = 1; + } + if (handicap!=0) + {printf ("Warning: this game will not be "); + printf ("counted in the statistics.\n"); + } + } + else printf("Too late!\n"); + continue; +case LISTM: lstmvs (b,player); + continue; +case ANALYZ: printf (" (%d)\n", ++nanalyze); + analyze(b,player,oppcolor(player)); + continue; +case MOVE: if (ismove(b,player,p)) return (c); + printf("Illegal!\n"); + continue; + } + } + } + +prtscr(b,f,reverse) + board b; + FILE *f; + + {register int i, j; + i = cntbrd (b, BLACK); + j = cntbrd (b, WHITE); + if (reverse && machine[BLACK]) + {int temp; + temp = i; + i = j; + j = temp; + } + fprintf(f,"%d-%d",i,j); + return (i-j); + } + +onemov (b,c) + board b; + color c; + + {register position p; + position p1; + int nmoves; + + p1 = -1; + nmoves = 0; + forallpos (p) if (ismove (b,c,p)) + {p1 = p; + if (++nmoves>1) return (-1); + } + return (p1); + } + +analyze(b,c,o) + board b; + color c, o; + + {board a, omb; + register position p; + int omvnhack; + + omvnhack = mvnhack; + if (!machine[c]) mvnhack = 0; + else sethack (b, c); + cpybrd(a,b); + filmvs(b,o,omb); + forallpos (p) if (ismove (b,c,p)) + a[p] = s_move(b,c,o,p,omb); + auxbrd(a); + mvnhack = omvnhack; + } + +lstmvs(b,c) + board b; + color c; + + {board a; + + filmvs(b,c,a); + auxbrd(a); + } + +filmvs(b,c,a) + board b,a; + color c; + + {register position p; + cpybrd(a,b); + forallpos (p) if (ismove (b,c,p)) + a[p] = '?'; + } + +command(f,pp) + FILE *f; + position *pp; + + {fastchar a, c; + char *s; + int x, y; + + for (;;) + {putcolor (player, stdout); + printf (" to move: "); + switch (c = lower (skipbl(f))) { + +#ifdef unix + + case SHELL: unix(); + continue; + +#endif + + case RESIGN: + c = lower (getc (f)); + if (c == '\n') return (RESIGN); + if (c != 'b') goto flush; + a = READCM; + goto rdname; + + case OPTCOM: if (!wizard) goto flush; + a = OPTCOM; + goto rdname; + + case WRITCM: c = lower (getc (f)); + if (c == '\n') goto flushnl; + if (c != 'b') goto flush; + a = WRITCM; + + rdname: s = buf; + c = getc (f); + if (c != '\n') + {if (c != ' ') goto flush; + c = skipbl (f); + while (c != '\n') + {*s++ = c; + c = getc (f); + } + } + *s++ = 0; + return (a); + + case PBOARD: + case SCORE: + case QUIT: + case ANALYZ: + case LISTM: + case MANUAL: + case XCOM: + case HELP: + a = c; + if ((c = skipbl(f)) != '\n') goto flush; + return (a); + case HCAP: if ((a = c = skipbl(f)) == '-') c = getc(f); + if (c < '1' || c > '4' || skipbl(f) != '\n') + goto flush; + *pp = a=='-'? -(c-'0'):(c-'0'); + return (HCAP); + case TREECM: a = c; + c = skipbl(f); + if (c < '1' || c > '9') goto flush; + if (!wizard) goto flush; + *pp = c-'0'; + while (c = skipbl(f)) + {if (c == '\n') return (a); + if (c < '0' || c > '9') goto flush; + *pp = (*pp * 10) + (c - '0'); + } + goto flush; + case EOF: return (c); + default: if (c < '1' || c > '8') goto flush; + x = c - '1'; + c = skipbl(f); + if (c < '1' || c > '8') goto flush; + y = c - '1'; + if ((c = skipbl(f)) == '\n') + {*pp = pos(x,y); + return (MOVE); + } + flush: while (c != '\n' && c != EOF) c = getc(f); + if (c == EOF) return (c); + case '\n': + flushnl: printf ("Huh?\n"); + } + } + } + +skipbl(f) + register FILE *f; + + {register fastchar c; + while ((c = getc(f)) == ' ' || c == '\t'); + return (c); + } + +mprint (f, a, b, c, d, e) + {fprintf (gamefile, f, a, b, c, d, e); + if (!superself) printf (f, a, b, c, d, e); + } + +getuser () + + {char *s; + getpw(getuid(),username); + s = username; + while (*s) if (*s == ':') {*s = 0; break;} else ++s; + if (username[0]==0) exit(255); + s = username; + while (*s) {if (*s == ' ') *s = '_'; ++s;} + setwizard (); + } + +#ifndef unix +#include "c/its.bits" +# include "c/c.defs" +isdisplay () + {extern int cout; + return (istty (cout) && (status (itschan (cout)) & 077) == 2); + } + +setsuper () + + {if (rsuset (UXJNAME) == csto6 ("OO")) ++superself;} + +checkuser () + {while (!validuser ()) + {char nambuf[40]; + int n; + printf ("Enter your user name (6 or fewer letters): "); + gets (nambuf); + n = csto6 (nambuf); + if (n == csto6 ("AS")) n = 0; + c6tos (n, username); + wsuset (UXUNAME, n); + } + } + +validuser () + {int n, loser, guest, foo; + loser = csto6 ("BERN"); + guest = csto6 ("GUEST"); + foo = csto6 ("FOO"); + n = rsuset (UXUNAME); + if (n == 0) return (FALSE); + if ((n | 0777777) == -1) return (FALSE); + if (n == guest || n == foo) return (FALSE); + if (n == loser) + return (ask (stdin, "Is your name really BERN") == YES); + while (n) + {int c; + c = ((n >> 30) & 077); + n = n << 6; + if (c < ('A'-32) || c > ('Z'-32)) return (FALSE); + } + return (TRUE); + } + +setwizard () + {if (stcmp (username, "AS")) wizard=TRUE; + } + +prnews () + + {int f; + f = copen ("c/_oo.news"); + if (f != OPENLOSS) + {int c; + while (c = getc (f)) putchar (c); + putchar ('\n'); + cclose (f); + pause (); + if (display) clrscreen (); + } + } + +pause () + + {tyos ("Type anything... "); + utyi (); + putchar ('\n'); + } + +ask(f,s) + + {while (1) + {tyos (s); + tyos (" (Y or N)? "); + while (1) + {switch (lower (utyi ())) { + case 'y': tyos ("yes\r"); return ('y'); + case EOF: + case 'n': tyos ("no\r"); return ('n'); + case '\014': tyo ('\r'); break; + default: tyo (007); continue; + } + break; + } + } + } + +inhibit () + + {if (++n_inhibit == 1) + {int b[3], ch; + ttyget (ch = tyiopn (), b); + b[2] =| 02000000; + ttyset (ch, b); + } + } + +uninhibit () + + {if (n_inhibit == 0) return; + if (--n_inhibit == 0) + {int b[3], ch; + ttyget (ch = tyiopn (), b); + b[2] =& ~02000000; + ttyset (ch, b); + } + } + +setrand () + {int tv[2], x; + time (tv); + x = tv[1]; + x =^ cputm (); + srand (x); + x = 20; + while (--x >= 0) rand(); + } + +#endif + +#ifdef unix +checkuser () {;} +spctty (c) {;} +stdio () {nice(12);} +lower (c) {if (c>='A' && c<='Z') return (c+32); return (c);} +isdisplay () + {struct {char ispeed,ospeed;int x,y;} ttt; + gtty (1,&ttt); + return (ttt.ospeed >= 11); + } + +setsuper () {;} +setwizard () + {if (username[0] == 's' && + username[1] == 'n') wizard = TRUE; + } + +prnews () {;} + +pause () + + {fastchar c; + printf ("Type NL..."); + while ((c = getchar ()) != '\n' && c != EOF); + } + +ask(f,s) + register FILE *f; + register char *s; + + {fastchar a, c; + printf("%s? ", s); + c = a = skipbl(f); + while (c != '\n' && c != EOF) c = getc(f); + return (lower (a)); + } + +cputm() + + {struct tbuffer { long user,system,childu,childs; } xxx; + int i; + + times(&xxx); i = xxx.user; + return(i); + } + +inhibit () {;} +uninhibit () {;} + +#define SIGINT 2 +#define SIGQIT 3 +unix() + + {int rc, status, unixpid; + if ((unixpid=fork())==0) + {execl("/bin/sh","sh","-t",0); + exit(255); + } + else if (unixpid == -1) return(0); + else {while ((rc = wait(&status)) != unixpid && rc != -1); + return(1); + } + } + +setrand () + {int tv[2]; + time (tv); + srand (tv[1]); + } + +tyo_flush () + {;} + +#endif + \ No newline at end of file diff --git a/src/as/o/o1.rel b/src/as/o/o1.rel new file mode 100644 index 00000000..f8534903 Binary files /dev/null and b/src/as/o/o1.rel differ diff --git a/src/as/o/o2.c b/src/as/o/o2.c new file mode 100644 index 00000000..331f8399 --- /dev/null +++ b/src/as/o/o2.c @@ -0,0 +1,630 @@ +#include "o.h" + +extern int eflag; + +/********************************************************************** + + EDGEVAL - Evaluate C's taking the edge square at P? + + * + * Scores: + * + * +4 = win 2 corners + * +2 = win 1 corner + * +1 = no corners taken, moved last + * 0 = each won 1 corner + * + * + +**********************************************************************/ + +int edepth, ddepth; +color ecolor; + +int edgeval (b,c,o,p) + board b; + color c, o; + position p; + + {direction d; + board a; + + ecolor = c; + if (eflag) + {printf ("\n *** edgeval ("); + putcolor (c, stdout); + printf (", "); + putpos (p, stdout); + printf ("):\n"); + } + if (horizedge(p)) d=WEST; else d=NORTH; + cpybrd (a,b); + putmov (a,c,p); + return (-eeval (b,a,o,c,p,d,TRUE)); + } + +int eeval (oldb,b,c,o,p,d,pass_ok) /* return score from C's point of view */ + board oldb, b; + color c, o; + position p; + direction d; + int pass_ok; + + /* + * Pass_ok is set to false when we are evaluating + * the result of O not moving on this edge on the + * previous turn. In this case, C can always not + * move and get 1 point for moving last. + * + */ + + {int s; /* best score for C */ + int t; /* temporary score for C */ + + if (edepth > 4 && c==ecolor) return (1); + ++edepth; + if (eflag) + {putn (edepth); + printf ("eeval ("); + putcolor (c, stdout); + printf (", "); + putdir (d, stdout); + printf ("):\n"); + } + if (pass_ok) s = -100; else s = 1; + t = e1move (oldb, b, c, o, p, d); + if (t>s) s = t; + t = e1move (oldb, b, c, o, p, oppdir(d)); + if (t>s) s = t; + if (pass_ok && edepth < 4) + {t = -eeval (oldb, b, o, c, p, d, FALSE); + if (t>s) s = t; + } + if (s == -100) s = -1; + if (eflag) + {putn (edepth); + printf ("eeval ("); + putcolor (c, stdout); + printf (", "); + putdir (d, stdout); + printf (") = %d\n", s); + } + --edepth; + return (s); + } + +int e1move (oldb,b,c,o,p,d) /* return score from C's point of view */ + board oldb, b; + color c, o; + position p; + direction d; + + {position findempty (); + int rc; + + rc = -100; + ++edepth; + if (eflag) + {putn (edepth); + printf ("e1move ("); + putcolor (c, stdout); + printf (", "); + putdir (d, stdout); + printf (") "); + } + p = findempty (b, p, d); + if (valid (p) && ismove (b, c, p)) + {int s, t; + board a; + cpybrd (a, b); + putmov (a, c, p); + if (eflag) + {printf ("move at "); + putpos (p, stdout); + printf ("\n"); + } + t = 0; + if (corner(p) && !ismove (oldb, c, p)) t = 2; + s = -eeval (oldb,a,o,c,p,d,TRUE); + if (t==0 || s<-1 || s>1) + t =+ s; + /* only count 1 pt. if no corners */ + rc = t; + } + else if (eflag) printf ("no move\n"); + --edepth; + return (rc); + } + +position findempty (b, p, d) + board b; + position p; + direction d; + + {while (valid (nextpos (p, d)) && b[p] != EMPTY); + return (p); + } + +putn (n) + {printf ("%2d", n); + while (--n>=0) {putchar (' '); putchar (' ');} + } + +/********************************************************************** + + DEFEDGE - Does the move at edge P have defensive value? + + (Move has not yet been made.) + + An edge move has defensive value if it prevents the opponent + from capturing along an edge. + + look for: ~o X o+ c+ _ + where the _ is not a bad move (W,X,Y,Z) for O + look for: o c* X c* o + where there is a hole + +**********************************************************************/ + +int defedge (b,c,o,p) + board b; + color c, o; + position p; + + {direction d; + position p1; + int rc; + p1 = p; + if (ddepth>0) return (FALSE); /* avoid useless recursion */ + ++ddepth; + if (horizedge(p)) d=WEST; else d=NORTH; + rc = def1edge (b,c,o,p,d) || + def1edge (b,c,o,p,oppdir(d)) || + def2edge (b,c,o,p,d); + --ddepth; + return (rc); + } + +int def1edge (b,c,o,p,d) + board b; + color c, o; + position p; + direction d; + + {position p1; + direction d1; + d1 = oppdir (d); + p1 = p; + if (valid (nextpos (p1, d1)) && b[p1]==o) return (FALSE); + if (!valid (nextpos (p, d))) return (FALSE); + if (b[p] != o) return (FALSE); + while (b[p] == o) if (!valid (nextpos (p, d))) return (FALSE); + if (b[p] != c) return (FALSE); + while (b[p] == c) if (!valid (nextpos (p, d))) return (FALSE); + if (b[p] != EMPTY) return (FALSE); + return (s_move (b,o,c,p,b) < 'W'); + } + +int def2edge (b,c,o,p,d) + board b; + color c, o; + position p; + direction d; + + {if (!def3edge (b,c,o,p,d)) return (FALSE); + if (!def3edge (b,c,o,p,oppdir(d))) return (FALSE); + while (b[p] != o) if (!valid (nextpos (p, d))) return (FALSE); + return (hole (b,o,c,p)); + } + +int def3edge (b,c,o,p,d) + board b; + color c, o; + position p; + direction d; + + {if (!valid (nextpos (p, d))) return (FALSE); + while (b[p] == c) if (!valid (nextpos (p, d))) return (FALSE); + return (b[p] == o); + } + +/********************************************************************** + + SAFEDGE - Is the move at edge P safe? + + (Move must have been made.) + + An edge move is considered safe if neither of the nearest + empty edge squares can be taken by the opponent and + (if not a corner) have defensive value for the opponent. + + Return TRUE if the move is safe. + +**********************************************************************/ + +int safedge (b,c,o,p) + board b; + color c, o; + position p; + + {direction d; + if (horizedge(p)) d=WEST; else d=NORTH; + return (saf1edge (b,c,o,p,d) && saf1edge (b,c,o,p,oppdir(d))); + } + +int saf1edge (b,c,o,p,d) + board b; + color c, o; + position p; + direction d; + + {p = findempty (b, p, d); + if (valid (p) && ismove (b, o, p)) + return (!(corner(p) || defedge (b, o, c, p))); + else return (TRUE); + } + +#define FHOLE 1 +#define FCORNER 2 + +/* + * hole - does the position resulting from a move at P by C contain a + * hole for O? If so, what value square is given up? + * + * (The move has already been made.) + * + */ + +hole(b,c,o,p) + board b; + color c, o; + position p; + + {register int h; + if (horizedge (p)) + h = hole1 (b,c,o,p,EAST) | hole1 (b,c,o,p,WEST); + else + h = hole1 (b,c,o,p,NORTH) | hole1 (b,c,o,p,SOUTH); + if (h > FHOLE) return (CORNERVALUE); + if (h == FHOLE) return (EDGEVALUE); + return (0); + } + +/* + * case 1: _ c* X c* _ c+ _ + * + * case 2: _ c* X c* o+ _ c+ _ + * o c* X c* o+ _ c+ _ + * + * case 3: _ c* X c* _ o+ c+ _ + * _ c* X c* _ o+ c+ o + * + * case 4: ... c+ o+ c+ + * can be ignored since it will + * be picked up by edgeval + * + * In all cases, inner _ may be any odd number of _s. + * In all cases, outer _ may be [ or ]. + * In all cases, outer _ are the squares given up, + * plus the inner edge square. + * + */ + +hole1(b,c,o,p,d) + board b; + color c, o; + register position p; + direction d; + + {int n_o_left, n_o_right, n_spaces; + position p1; + direction d1; + + p1 = p; + d1 = oppdir (d); + nextpos (p1, d1); + while (valid (p1) && b[p1] == c) nextpos (p1, d1); + + if (!valid (nextpos (p, d))) return (0); + while (b[p] == c) if (!valid (nextpos (p, d))) return (0); + n_o_left = 0; + while (b[p] == o) + {if (!valid (nextpos (p, d))) return (0); + ++n_o_left; + } + if (b[p] != EMPTY) return (0); + n_spaces = 0; + while (b[p] == EMPTY) + {if (!valid (nextpos (p, d))) return (0); + ++n_spaces; + } + if ((n_spaces & 1) == 0) return (0); + n_o_right = 0; + while (b[p] == o) + {if (!valid (nextpos (p, d))) return (0); + ++n_o_right; + } + if (b[p] != c) return (0); + while (b[p] == c) + if (!valid (nextpos (p, d))) break; + if (valid (p1) && b[p1] == o && n_o_left == 0) return (0); + if (valid (p) && b[p] == o && n_o_right == 0) return (0); + if (valid (p) && corner (p)) return (FCORNER); + if (valid (p1) && corner (p1)) return (FCORNER); + return (FHOLE); + } + +/* + * trap1 - look to see if moving on the edge adjacent to a corner + * is safe + * + * bad if: it turns over an opponent's piece on the adjacent diagonal + * bad if: [_ X c* _ o* _ _ + * (unless the last _ is a corner or adjacent to a corner) + * bad if: [_ X c* _ o* _ c* o + * + */ + +trap1 (b, c, o, p) + board b; + color c, o; + position p; + + {direction d, d1; + position p1; + extern fastchar quadrant[]; + + switch (quadrant[p]) { + case 1: d = EAST; d1 = SOUTH; break; + case 2: d = WEST; d1 = SOUTH; break; + case 3: d = EAST; d1 = NORTH; break; + case 4: d = WEST; d1 = NORTH; break; + } + if (!horizedge (p)) + {direction temp; + temp = d; + d = d1; + d1 = temp; + } + p1 = p; + nextpos (p1, d1); + if (b[p1] == o) + {while (b[p1] == o) if (!valid (nextpos (p1, d1))) break; + if (valid (p1) && b[p1] == c) return (TRUE); + } + nextpos (p, d); + while (b[p] == c) if (!valid (nextpos (p, d))) return (FALSE); + if (b[p] != EMPTY) return (FALSE); + if (!valid (nextpos (p, d))) return (FALSE); + while (b[p] == o) if (!valid (nextpos (p, d))) return (TRUE); + if (b[p] != EMPTY) return (TRUE); + if (!valid (nextpos (p, d))) return (FALSE); + if (b[p] == EMPTY) return (sqval[p] == EDGEVALUE); + while (b[p] == c) if (!valid (nextpos (p, d))) return (FALSE); + return (b[p] == o); + } + +/* + * trap2 - look to see if move on edge, which can be taken back, + * is actually safe. Return CORNERVALUE if it results in taking + * a corner, EDGEVALUE if it is otherwise safe, 0 if it is unsafe. + * + * CORNERVALUE if: [_ o+ X c* _ c+ ~o + * CORNERVALUE if: [_ o+ X c* _ o+ c+ + * EDGEVALUE if: _ o+ X c* _ c+ ~o + * EDGEVALUE if: _ o+ X c* _ o+ c+ + * EDGEVALUE if: c+ o+ c+ X _ _ + * EDGEVALUE if: _ o+ _ o+ X _ _ + * + */ + +trap2 (b, c, o, p) + board b; + color c, o; + position p; + + {direction d; + int v; + if (horizedge (p)) d = EAST; + else d = NORTH; + if ((v = trp2a (b, c, o, p, d)) > 0) return (v); + if ((v = trp2a (b, c, o, p, oppdir(d))) > 0) return (v); + if (trp2b (b, c, o, p, d) || trp2b (b, c, o, p, oppdir(d))) + return (EDGEVALUE); + return (0); + } + +trp2a (b, c, o, p, d) + board b; + color c, o; + position p; + direction d; + + {direction od; + position ip; + int v, n; + + ip = p; + od = oppdir(d); + if (!valid (nextpos (p, od))) return (0); + if (b[p] != o) return (0); + while (b[p] == o) if (!valid (nextpos (p, od))) return (0); + if (b[p] != EMPTY) return (0); + if (corner (p)) v = CORNERVALUE; else v = EDGEVALUE; + p = ip; + if (!valid (nextpos (p, d))) return (0); + while (b[p] == c) if (!valid (nextpos (p, d))) return (0); + if (b[p] != EMPTY) return (0); + if (!valid (nextpos (p, d))) return (0); + n = 0; + while (b[p] == o) + if (!valid (nextpos (p, d))) return (0); + else ++n; + if (b[p] != c) return (0); + if (n > 0) return (v); + while (b[p] == c) if (!valid (nextpos (p, d))) return (v); + if (b[p] == EMPTY) return (v); + return (0); + } + +trp2b (b, c, o, p, d) + board b; + color c, o; + position p; + direction d; + + {direction od; + position ip; + + ip = p; + od = oppdir (d); + if (!valid (nextpos (p, od))) return (FALSE); + if (b[p] != EMPTY) return (FALSE); + if (!valid (nextpos (p, od))) return (FALSE); + if (b[p] != EMPTY) return (FALSE); + p = ip; + if (!valid (nextpos (p, d))) return (FALSE); + if (b[p] != c) + {if (b[p] != o) return (FALSE); + while (b[p] == o) if (!valid (nextpos (p, d))) return (FALSE); + if (b[p] != EMPTY) return (FALSE); + if (!valid (nextpos (p, d))) return (FALSE); + if (b[p] != o) return (FALSE); + while (b[p] == o) if (!valid (nextpos (p, d))) return (TRUE); + return (b[p] == EMPTY); + } + while (b[p] == c) if (!valid (nextpos (p, d))) return (FALSE); + if (b[p] != o) return (FALSE); + while (b[p] == o) if (!valid (nextpos (p, d))) return (FALSE); + return (b[p] == c); + } + +/* + * trap3 - look to see if move on edge, which cannot be taken back, + * actually wins the corner + * + * look for: [_ o+ X c* o + * + */ + +trap3 (b, c, o, p) + board b; + color c, o; + position p; + + {direction d; + if (horizedge (p)) d = EAST; + else d = NORTH; + return (trp3a (b, c, o, p, d) || trp3a (b, c, o, p, oppdir(d))); + } + +trp3a (b, c, o, p, d) + board b; + color c, o; + position p; + direction d; + + {direction od; + position ip; + + ip = p; + od = oppdir(d); + if (!valid (nextpos (p, od))) return (FALSE); + if (b[p] != o) return (FALSE); + while (b[p] == o) if (!valid (nextpos (p, od))) return (FALSE); + if (b[p] != EMPTY) return (FALSE); + if (!corner (p)) return (FALSE); + p = ip; + if (!valid (nextpos (p, d))) return (FALSE); + while (b[p] == c) if (!valid (nextpos (p, d))) return (TRUE); + return (b[p] == o); + } + +/* + * trap4 - look to see if move on edge, which creates a hole, + * actually wins the corner + * + * look for: [_ o _ c _ X _ _ + * [_ o _ X _ c _ _ + * + */ + +trap4 (b, c, o, p) + board b; + color c, o; + position p; + + {int x, y; + x = posx (p); + y = posy (p); + if (x == 2) return (trp4a (b, c, o, p, SOUTH)); + if (x == 5) return (trp4a (b, c, o, p, NORTH)); + if (y == 2) return (trp4a (b, c, o, p, EAST)); + if (y == 5) return (trp4a (b, c, o, p, WEST)); + if (x == 3) return (trp4b (b, c, o, p, NORTH)); + if (x == 4) return (trp4b (b, c, o, p, SOUTH)); + if (y == 3) return (trp4b (b, c, o, p, WEST)); + if (y == 4) return (trp4b (b, c, o, p, EAST)); + return (FALSE); + } + +trp4a (b, c, o, p, d) + board b; + color c, o; + position p; + direction d; + + /* look for: [_ o _ c _ X _ _ */ + + {position p1; + + p1 = p; + nextpos (p, d); + if (b[p] != EMPTY) return (FALSE); + nextpos (p, d); + if (b[p] != c) return (FALSE); + nextpos (p, d); + if (b[p] != EMPTY) return (FALSE); + nextpos (p, d); + if (b[p] != o) return (FALSE); + nextpos (p, d); + if (b[p] != EMPTY) return (FALSE); + p = p1; + d = oppdir (d); + nextpos (p, d); + if (b[p] != EMPTY) return (FALSE); + nextpos (p, d); + if (b[p] != EMPTY) return (FALSE); + return (TRUE); + } + +trp4b (b, c, o, p, d) + board b; + color c, o; + position p; + direction d; + + /* look for: [_ o _ X _ c _ _ */ + + {position p1; + + p1 = p; + nextpos (p, d); + if (b[p] != EMPTY) return (FALSE); + nextpos (p, d); + if (b[p] != o) return (FALSE); + nextpos (p, d); + if (b[p] != EMPTY) return (FALSE); + p = p1; + d = oppdir (d); + nextpos (p, d); + if (b[p] != EMPTY) return (FALSE); + nextpos (p, d); + if (b[p] != c) return (FALSE); + nextpos (p, d); + if (b[p] != EMPTY) return (FALSE); + nextpos (p, d); + if (b[p] != EMPTY) return (FALSE); + return (TRUE); + } + \ No newline at end of file diff --git a/src/as/o/o2.rel b/src/as/o/o2.rel new file mode 100644 index 00000000..a5e76fc9 Binary files /dev/null and b/src/as/o/o2.rel differ diff --git a/src/as/o/o3.c b/src/as/o/o3.c new file mode 100644 index 00000000..89b26400 --- /dev/null +++ b/src/as/o/o3.c @@ -0,0 +1,637 @@ +# include "o.h" + +extern int mvnhack; +extern fastchar quadrant[100]; +int danger; + +/********************************************************************** + + RELSCORE maps two values representing what I get and + what my opponent gets into a letter score. The input + values are: + + 0 - unsafe edge (can be taken back) + 1 - move that may give away corner + 2 - no move + 3 - adjacent to edge + 4 - interior + 5 - hole-making edge + 6 - safe edge + 7 - corner + + note: A = move that wipes out opponent + B = move that saves corner + H = defensive taking of edge + +**********************************************************************/ + +# define GOODSCORE 'H' /* scores worse than this => movnum hack */ +# define BADSCORE 'U' /* scores better than this => movnum hack */ + +fastchar relscore[8][8] { + 'X', 'X', 'X', 'X', 'X', '?', 'X', 'Z', + 'Y', 'Y', 'Y', 'Y', 'Y', '?', 'Y', 'Z', + '?', '?', '?', '?', '?', '?', '?', '?', + 'E', 'E', 'E', 'Q', 'R', '?', 'T', 'Z', + 'E', 'E', 'E', 'P', 'P', '?', 'S', 'Z', + '?', '?', '?', '?', '?', '?', 'V', 'Z', + 'D', 'D', 'D', 'J', 'K', '?', 'N', 'Z', + 'C', 'C', 'C', 'C', 'C', '?', 'F', 'U', + }; + +/********************************************************************** + + MY_MOV - Select a move from the set of best moves. + +**********************************************************************/ + +position my_mov (b,c,o) + board b; + color c, o; + + {struct mt t[64], *tp[64]; + register int k; + + k = bk_lookup (t, tp); + if (k > 0) + {position p; + p = tp[0]->p; + if (k > 1) p = tp[(rand() & 017777) % k]->p; + if (ismove (b,c,p)) return (p); + cprint ("Book returns illegal move.\n"); + } + k = getcandidates (b,c,o,tp,t); + if (k==0) return (0); + if (k==1) return (tp[0]->p); + k = (rand() & 017777) % k; + return (tp[k]->p); + } + +/********************************************************************** + + GETCANDIDATES - Get all best moves. + +**********************************************************************/ + +int getcandidates (b,c,o,tp,t) + board b; + color c, o; + struct mt *tp[], t[]; + + {extern int movnum; + int k, omvnhack; + + omvnhack = mvnhack; + sethack (b, c); + k = igetcandidates (b,c,o,tp,t,movnum>=MIDDLEMOVE); + if (movnum0 && tp[0]->c <= -80) + {mvnhack = 0; + k = igetcandidates (b,c,o,tp,t,'V'); + if (tp[0]->c <= -80) + {k = igetcandidates (b,c,o,tp,t,'X'); + if (tp[0]->c <= -85) + k = igetcandidates (b,c,o,tp,t,1); + } + } + mvnhack = omvnhack; + return (k); + } + +/********************************************************************** + + SETHACK - Determine if we are in danger of being + wiped out. + +**********************************************************************/ + +int sethack (b, c) + board b; + color c; + + {int ccount, ocount; + extern int handicap; + ccount = cntbrd (b, c); + ocount = cntbrd (b, oppcolor(c)); + if (handicap < 0) ccount =+ handicap; + danger = ccount<6; + if (movnum >= MIDDLEMOVE) mvnhack=0; + } + +/********************************************************************** + + IGETBEST - Get best (letterwise) moves + +**********************************************************************/ + +int igetbest (b,c,o,tp,t,tryall) + board b; + color c, o; + struct mt *tp[], t[]; + int tryall; + + {extern int mmdepth; + int k, best; + + mmdepth = 2; + k = pmvgen (b,c,o,tp,t,tryall==1,tryall!=1); + if (k==0) return (0); + best = tp[0]->s; + if (tryall > 1 && best < tryall) k = exprange (tp, t, tryall); + else if (tryall == 0) + {if (best == 'P' && !mvnhack) + {int oldk; + oldk = k; + k = exprange (tp, t, 'S'); + if (k > oldk) ++mmdepth; + } + } + return (k); + } + +/********************************************************************** + + IGETCANDIDATES - Get possible moves. + + tryall == 0: use normal selection + tryall == 1: try all moves + other value: try all moves <= value + +**********************************************************************/ + +int igetcandidates (b,c,o,tp,t,tryall) + board b; + color c, o; + struct mt *tp[], t[]; + int tryall; + + {register int k; + + k = igetbest (b,c,o,tp,t,tryall); + if (k==0) return (0); + if (k==1 && !danger) + {tp[0]->c = -1000; + return (1); + } + return (dosearch (b,c,o,tp,t,k,tryall)); + } + +/********************************************************************** + + DOSEARCH + +**********************************************************************/ + +int dosearch (b,c,o,tp,t,k,tryall) + board b; + color c, o; + struct mt *tp[], t[]; + int tryall; + + {extern int debug, mmdepth, movnum; + register struct mt **bp, **mp, **ep; + int best; + + ep = tp + k; + bp = tp; + mp = tp; + + best = tp[0]->s; + if (mvnhack && !danger && best < 'V' && best != 'B') + {while (mp < ep) + {struct mt *p; + p = *mp++; + p->c = -1000; + } + return (k); + } + + if (best >= 'X') + {mmdepth = 4; + mvnhack = 0; + } + else if (best >= 'V') mmdepth = 3; + if (movnum>=ENDGAMEMOVE) mmdepth = 6; + else if (movnum>=MIDDLEMOVE) + {if (k<=3) mmdepth = 6; + else mmdepth = 4; + } + else if (movnum>=16) + {if (k<=3) mmdepth = 4;} + else if (movnum>=4) + {if (k==2) mmdepth = 4;} + + if (danger && mmdepth<4) mmdepth=4; + + if (debug>0) printf ("\nsearch depth %d\n", mmdepth); + tp[0]->c = -1000; + while (mp < ep) + {struct mt *p; + p = *mp++; + p->c = meval (b,c,o,p->p,tp[0]->c); + if (debug>0) printf (" %d-%d %c %d\n", posx(p->p)+1, + posy(p->p)+1, p->s, p->c); + if (p->c > tp[0]->c) {bp = tp; *bp++ = p;} + else if (p->c == tp[0]->c) *bp++ = p; + } + return (bp-tp); + } + +/********************************************************************** + + EXPRANGE - Return all moves in an already-computed set that + are not worse than a given LETTER score + +**********************************************************************/ + +int exprange (tp,t,letter) + struct mt *tp[], t[]; + + {register struct mt **bp, *mp; + mp = t; + bp = tp; + while (mp->p >= 0) + {if (mp->s <= letter) *bp++ = mp; + ++mp; + } + return (bp-tp); + } + +/********************************************************************** + + PMVGEN - Probable Move Generator + +**********************************************************************/ + +int pmvgen (b,c,o,tp,t,allmoves,wantscores) + board b; + color c,o; + struct mt *tp[],t[]; + + {struct mt *ep; + register struct mt **bp, *mp; + int k; + + k = fillmt(b,c,o,t,wantscores); + if (k==0) return (0); + if (k==1) {tp[0] = t; return (1);} + ep = t+k; + mp = t; + bp = tp; + *bp++ = mp; + while (++mp < ep) + if (allmoves) *bp++ = mp; + else + {if (mp->s < tp[0]->s) {bp = tp; *bp++ = mp;} + else if (mp->s == tp[0]->s) *bp++ = mp; + } + return (bp-tp); + } + +/********************************************************************** + + FILLMT - Legal Move Generator + +**********************************************************************/ + +fillmt(b,c,o,t,wantscores) + board b; + color c, o; + struct mt t[64]; + + {register position p; + register struct mt *tp; + board omb; + + filmvs(b,o,omb); + tp = t; + forallpos (p) if (ismove (b,c,p)) + {tp->p = p; + tp->s = (wantscores ? s_move(b,c,o,p,omb) : 'O'); + ++tp; + } + tp->p = -1; + return (tp-t); + } + +/********************************************************************** + + S_MOVE - Simple Move Evaluator + + OMB is a board where all of O's moves are marked with + a printing character. + +**********************************************************************/ + +s_move(b,c,o,p,omb) + board b, omb; + color c, o; + position p; + + {board a; /* board after move */ + register int myscore, hisscore; + int nmoves, nsaves; + extern int machine[], ddepth; + + cpybrd (a, b); + putmov (a, c, p); + if (bscore (a, o) == 0 && cntbrd (a, o) == 0) return ('A'); + if (debug>0 && ddepth==0) + {printf ("\n"); + putpos (p, stdout); + } + hisscore = aeval (a, p, o, c, omb, &nmoves, &nsaves); + myscore = sqeval (b,c,o,p); + if (ddepth == 0) + {if (debug>0) + {printf (" "); + putcolor (c, stdout); + printf ("=%d ", myscore); + putcolor (o, stdout); + printf ("=%d (", hisscore); + putletter (relscore[myscore][hisscore]); + printf (")"); + } + if (edge (p) && !corner (p)) + {int escore; + escore = edgeval (b, c, o, p); + if (escore > 1) myscore = CORNERVALUE; + else if (escore < -1) hisscore = CORNERVALUE; + else if (escore == 0) myscore = hisscore = CORNERVALUE; + else if (myscore < CORNERVALUE) + {register int temp; + if (escore < 0 && myscore == EDGEVALUE) myscore = 0; + temp = hole (a,c,o,p); + if (temp>0 && trap4 (b, c, o, p)) + myscore = CORNERVALUE; + else + {if (temp>hisscore) hisscore=temp; + if (temp>0 && + (myscore>=HEDGEVALUE || myscore==0)) + myscore = HEDGEVALUE; + } + } + } + } + myscore = relscore[myscore][hisscore]; + if (ddepth == 0) + {if (!corner (p) && edge (p) && + myscore>GOODSCORE && (myscoreGOODSCORE && + (myscore0 && myscore<'Z') myscore='B'; + return (myscore); + } + +/********************************************************************** + + MVNEVAL + +**********************************************************************/ + +int mvneval (myscore, a, c, o, nmoves) + board a; + color c, o; + + {int nmymoves, bias; + if (myscore=='X') bias = 3; else bias = 0; + nmymoves = cntokmoves (a, c); + myscore=(GOODSCORE+10)+nmoves-nmymoves+bias; + if (nmymoves<6) myscore =+ (6-nmymoves)*2; + if (debug>0) + {printf ("; "); + putcolor (c, stdout); + printf ("=%d ", nmymoves); + putcolor (o, stdout); + printf ("=%d sum=%d score=%d", nmoves, + nmoves-nmymoves, myscore - (GOODSCORE+1)); + } + if (myscore>(GOODSCORE+3)) + myscore = (GOODSCORE+3) + (myscore-(GOODSCORE+3))/4; + if (myscore>=BADSCORE) myscore = BADSCORE-1; + else if (myscore<=GOODSCORE) myscore = GOODSCORE+1; + return (myscore); + } + +/********************************************************************** + + AEVAL - Evaluate replies + +**********************************************************************/ + +aeval (b, oldp, c, o, omb, pnmoves, pnsaves) + board b, omb; + position oldp; + color c, o; + int *pnmoves, *pnsaves; + + {register int s; + register position p; + position bestp; + int nmoves, nsaves; + + s = -1; + nmoves = nsaves = 0; + if (debug>0 && ddepth == 0) printf (" ["); + forallpos (p) + {if (ismove (b,c,p)) + {register int temp; + ++nmoves; + if (danger && ddepth==0) + {board a; + cpybrd (a, b); + putmov (a, c, p); + if (bscore (a, o) == 0 && cntbrd (a, o) == 0) + return (CORNERVALUE); + } + temp = sqeval (b,c,o,p); + if (temp > 2 && temp != 5) /* count only good moves */ + {++nmoves; + if (edge (p)) nmoves=+2; /* count edges higher */ + } + if (omb[p] >= ' ') /* can already move there */ + {if (temp>INTERIORVALUE && corner (p) + && !adjedge(oldp)) + temp = INTERIORVALUE; + } + if (debug>1 && ddepth == 0) + {putpos (p, stdout); + printf (":%d ", temp); + } + if (temp>s) {s=temp; bestp = p;} + } + else + {if ((omb[p] >= ' ') && corner(p)) ++nsaves;} + } + *pnmoves = nmoves; + *pnsaves = nsaves; + if (debug>0 && ddepth == 0) + {if (s<0) printf ("no reply"); + else + {printf ("best reply is "); + putpos (bestp, stdout); + } + printf ("]"); + } + if (s<0) return (2); + return (s); + } + +/********************************************************************** + + CNTOKMOVES - Count non-possibly-corner-losing-moves by C + +**********************************************************************/ + +cntokmoves (b, c) + board b; + color c; + + {register position p; + register int nmoves; + + nmoves = 0; + forallpos (p) + if (ismove (b,c,p) && !adjcorner(p)) ++nmoves; + return (nmoves); + } + +/********************************************************************** + + SQEVAL - Simple Square Evaluator + +**********************************************************************/ + +sqeval (b, c, o, p) + board b; + color c, o; + position p; + + {register int val; + extern fastchar selfplay; + extern int movnum, machine[]; + + val = sqval[p]; + if (adjcorner (p)) /* adjacent to corner on edge or diagonal */ + {register position cp; + cp = nrcorner (p); /* the corner */ + if (adjdiag (p)) val = INTERIORVALUE; + else val = EDGEVALUE; + if (b[cp] == EMPTY) + {if (adjdiag(p)) val = 1; + else if (machine[c] && trap1 (b, c, o, p)) val = 1; + /* this move bad only for the machine + since the machine is not particularly + good at taking advantage of it */ + } + } + if (val == EDGEVALUE) + {board a; + cpybrd (a,b); + putmov (a,c,p); /* try move */ + if (safedge (a,c,o,p)) + {if (trap3 (b,c,o,p)) val = CORNERVALUE; + } + else + {int v; + if ((v = trap2 (a,c,o,p)) > 0) val = v; + else val = 0; + } + } + return (val); + } + +/********************************************************************** + + NRCORNER - Return position of nearest corner + +**********************************************************************/ + +position nrcorner(p) + position p; + + {switch (quadrant [p]) { + case 1: return (pos(0,0)); + case 2: return (pos(0,7)); + case 3: return (pos(7,0)); + case 4: return (pos(7,7)); + } + return (0); + } + +/********************************************************************** + + DOTREE - Print tree of possible future machine play. + +**********************************************************************/ + +static int treedepth 0; + +dotree (b, c, o, depth, fd) + board b; + color c, o; + + { +#ifdef unix + struct mt t[32], *tp[32]; + board a; +#endif +#ifndef unix + struct mt *t, **tp; + board *a; +#endif + register int k, n; + +#ifndef unix + {int *ip; + ip = salloc (100+64+64); + t = ip; + tp = ip + 64; + a = ip + (64 + 64); + } +# endif + + ++treedepth; + k = getcandidates (b,c,o,tp,t); + if (k>10) k=10; + if (k == 0) + {treindent (fd); + if (anymvs (b,o)) + {fprintf (fd, "Forfeit\n"); + dotree (b,o,c,depth,fd); + } + else fprintf (fd, "(%d-%d)\n", cntbrd(b,c),cntbrd(b,o)); + } + else for (n=0;np; + fprintf (fd, "%d-%d %c", posx(p)+1, posy(p)+1, tp[n]->s); + if (tp[n]->c != -1000) fprintf (fd, " %d", tp[n]->c); + putc ('\n', fd); + if (treedepth < depth) + {cpybrd (a,b); + putmov (a,c,p); + dotree (a,o,c,depth,fd); + } + } + --treedepth; + +# ifndef unix + sfree (t); +# endif + } + +treindent (fd) + + {register int n; + n = treedepth; + fprintf (fd, "%2d", treedepth); + putc ('\t', fd); + while (n >= 8) {putc ('\t', fd); n =- 8;} + while (--n >= 0) putc (' ', fd); + } + \ No newline at end of file diff --git a/src/as/o/o3.rel b/src/as/o/o3.rel new file mode 100644 index 00000000..bb6aecc0 Binary files /dev/null and b/src/as/o/o3.rel differ diff --git a/src/as/o/o4.c b/src/as/o/o4.c new file mode 100644 index 00000000..3b27d0a2 --- /dev/null +++ b/src/as/o/o4.c @@ -0,0 +1,104 @@ +# include "o.h" + +/* + * o5 - static evaluator and minimax + * + */ + +extern int debug, movnum, mvnhack; + +/********************************************************************** + + SEVAL - Static Evaluator + +**********************************************************************/ + +int mmquantile 100; + +int seval (b, c, o) + board b; + color c, o; + + {register int ccount, ocount; + + ccount = bscore (b, c); + ocount = bscore (b, o); + return (((ccount - ocount) * mmquantile) / (ccount + ocount)); + } + +/********************************************************************** + + MEVAL - minimax move evaluator + +**********************************************************************/ + +int mdepth 0; +int mmdepth; + +int meval (b,c,o,p,alpha) + + {board a; + int minmove; + + cpybrd (a,b); + putmov (a,c,p); + if (++mdepth == mmdepth) minmove = seval (a,c,o); + else + {minmove = 1000; + {register position *qq, q; + extern position trymov[]; + qq = trymov; + while ((q = *qq++) >= 0) if (ismove (a,o,q)) + {register int temp; + temp = -meval(a,o,c,q,-minmove); + if (temp= 0) if (ismove (a,c,q)) + {register int temp; + temp = meval(a,c,o,q,minmove); + if (temp>minmove) minmove=temp; + } + } + if (minmove == -1000) /* c forfeits */ + minmove = seval(a,c,o); + } + } + --mdepth; + if (debug>1) + {printf ("%2d ", mdepth); + putn (mdepth); + putpos (p, stdout); + printf (" %d\n", minmove); + } + return (minmove); + } + +# define C CORNERSCORE +# define E EDGESCORE +# define P POINTSCORE +# define I INTERIORSCORE +# define D DANGERSCORE + +fastchar ssqval[100] { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, C, E, E, E, E, E, E, C, 0, + 0, E, D, D, D, D, D, D, E, 0, + 0, E, D, P, I, I, P, D, E, 0, + 0, E, D, I, I, I, I, D, E, 0, + 0, E, D, I, I, I, I, D, E, 0, + 0, E, D, P, I, I, P, D, E, 0, + 0, E, D, D, D, D, D, D, E, 0, + 0, C, E, E, E, E, E, E, C, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }; + + \ No newline at end of file diff --git a/src/as/o/o4.rel b/src/as/o/o4.rel new file mode 100644 index 00000000..91223a53 Binary files /dev/null and b/src/as/o/o4.rel differ diff --git a/src/as/o/o5.c b/src/as/o/o5.c new file mode 100644 index 00000000..ae383e57 --- /dev/null +++ b/src/as/o/o5.c @@ -0,0 +1,196 @@ +#include "o.h" + +fastchar pcolor[] {'-', '@', '*'}; + +fastchar quadrant[100] { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1, 1, 1, 1, 2, 2, 2, 2, 0, + 0, 1, 1, 1, 1, 2, 2, 2, 2, 0, + 0, 1, 1, 1, 1, 2, 2, 2, 2, 0, + 0, 1, 1, 1, 1, 2, 2, 2, 2, 0, + 0, 3, 3, 3, 3, 4, 4, 4, 4, 0, + 0, 3, 3, 3, 3, 4, 4, 4, 4, 0, + 0, 3, 3, 3, 3, 4, 4, 4, 4, 0, + 0, 3, 3, 3, 3, 4, 4, 4, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }; + +position trymov[] { + pos(0,0), pos(0,7), pos(7,0), pos(7,7), + pos(0,1), pos(0,2), pos(0,3), pos(0,4), + pos(0,5), pos(0,6), pos(1,0), pos(1,7), + pos(2,0), pos(2,7), pos(3,0), pos(3,7), + pos(4,0), pos(4,7), pos(5,0), pos(5,7), + pos(6,0), pos(6,7), pos(7,1), pos(7,2), + pos(7,3), pos(7,4), pos(7,5), pos(7,6), + pos(2,2), pos(2,5), pos(5,2), pos(5,5), + pos(2,3), pos(2,4), pos(3,2), pos(3,5), + pos(4,2), pos(4,5), pos(5,3), pos(5,4), + pos(1,2), pos(1,3), pos(1,4), pos(1,5), + pos(2,1), pos(2,6), pos(3,1), pos(3,6), + pos(4,1), pos(4,6), pos(5,1), pos(5,6), + pos(6,2), pos(6,3), pos(6,4), pos(6,5), + pos(1,1), pos(1,6), pos(6,1), pos(6,6), + pos(3,3), pos(3,4), pos(4,3), pos(4,4), + -1 + }; + +clrbrd(b) + board b; + + {register int i; + i = 100; + while (--i>=0) b[i] = EMPTY; + b[pos(3,3)] = b[pos(4,4)] = WHITE; + b[pos(4,3)] = b[pos(3,4)] = BLACK; + b[WHITE] = b[BLACK] = 2; + } + +#ifdef unix +cpybrd (a,b) + register fastchar *a, *b; + + {register int i; + i = 100; + while (--i>=0) *a++ = *b++; + } +#endif + +cntbrd (b,c) + board b; + color c; + + {register position p; + int count; + count = 0; + forallpos (p) {if (b[p] == c) ++count;} + return (count); + } + +anymvs(b,c) + board b; + color c; + + {register position p; + forallpos (p) {if (ismove (b,c,p)) return (TRUE);} + return (FALSE); + } + +direction dirlist[] + {NORTH, EAST, SOUTH, WEST, + NORTHEAST, NORTHWEST, SOUTHEAST, SOUTHWEST, + 0}; + +# ifdef unix +ismov1(b,c,p1) + board b; + color c; + position p1; + + {register direction d; + direction *dd; + dd = dirlist; + while (d = *dd++) + {register position p; + int k; + p = p1; + k = 0; + while (valid (nextpos (p, d))) + {register color x; + if ((x = b[p]) == EMPTY) break; + if (x == c) + {if (k) return (TRUE); + break; + } + ++k; + } + } + return (FALSE); + } +# endif + +putmov(b,c,p1) + board b; + color c; + position p1; + + {register direction d; + direction *dd; + color o; + + b[p1] = c; + b[c] =+ sqscore (p1); + o = oppcolor (c); + dd = dirlist; + while (d = *dd++) + {register position p; + int k; + p = p1; + k = 0; + while (valid (nextpos (p, d))) + {{register color x; + if ((x = b[p]) == EMPTY) break; + if (x != c) {++k; continue;} + } + if (k==0) break; + p = p1; + while (valid (nextpos (p, d))) + {register int sscore; + if (b[p] != o) break; + b[p] = c; + b[c] =+ (sscore = sqscore (p)); + b[o] =- sscore; + } + break; + } + } + } + +putpos (p, fd) + position p; + FILE *fd; + + {fprintf(fd, "%d-%d",posx(p)+1,posy(p)+1); + } + +putcolor (c, fd) + color c; + FILE *fd; + + {if (c>=0 && c<=2) putc (pcolor[c], fd); + else putc ('?', fd); + } + +putdir (d, fd) + direction d; + FILE *fd; + + {char *s; + if (d==NORTH) s="NORTH"; + else if (d==SOUTH) s="SOUTH"; + else if (d==EAST) s="EAST"; + else if (d==WEST) s="WEST"; + else if (d==NORTHEAST) s="NORTHEAST"; + else if (d==NORTHWEST) s="NORTHWEST"; + else if (d==SOUTHEAST) s="SOUTHEAST"; + else if (d==SOUTHWEST) s="SOUTHWEST"; + else s="?"; + fprintf (fd, "%s", s); + } + +# define C CORNERVALUE +# define E EDGEVALUE +# define I INTERIORVALUE + +fastchar sqval[100] { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, C, 2, E, E, E, E, 2, C, 0, + 0, 2, 1, 3, 3, 3, 3, 1, 2, 0, + 0, E, 3, I, I, I, I, 3, E, 0, + 0, E, 3, I, I, I, I, 3, E, 0, + 0, E, 3, I, I, I, I, 3, E, 0, + 0, E, 3, I, I, I, I, 3, E, 0, + 0, 2, 1, 3, 3, 3, 3, 1, 2, 0, + 0, C, 2, E, E, E, E, 2, C, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }; diff --git a/src/as/o/o5.rel b/src/as/o/o5.rel new file mode 100644 index 00000000..95d17c34 Binary files /dev/null and b/src/as/o/o5.rel differ diff --git a/src/as/o/o6.c b/src/as/o/o6.c new file mode 100644 index 00000000..29d796a3 --- /dev/null +++ b/src/as/o/o6.c @@ -0,0 +1,334 @@ +#include "o.h" + +extern int display, explain; +extern fastchar pcolor[]; + +# define LEFT 0 +# define RIGHT 1 +# define TYOSIZ 1000 + +static board leftb, rightb; +static int cboard; +static int left_exists, right_exists; +static char tyobuf[TYOSIZ], *ctyop {tyobuf}; + +# define tyo(c) *ctyop++ = (c) + +# ifndef unix +# rename tyochn "TYOCHN" +extern int tyochn; +# define tyocrlf() (tyo('\r')) +# define down() (tyo(16),tyo('D')) +# define top() (tyo(16),tyo('T')) +# define horiz(n) (tyo(16),tyo('H'),tyo(8+(n))) +# define vertical(n) (tyo(16),tyo('V'),tyo(8+(n))) +# define erasechar() (tyo(16),tyo('K')) +# define eraseline() (tyo(16),tyo('L')) +# define erasescreen() (tyo(16),tyo('E')) +clrscreen () {spctty ('C');} +# define savepos() (tyo(16),tyo('S')) +# define rstrpos() (tyo(16),tyo('R')) +# endif + +# ifdef unix +static int hpos, vpos, svhpos, svvpos; +static char cmm[] {0, 10, 0, 11, 0377, 0377}; +getpos () + {ttymod (1, cmm); + vpos = cmm[0]; + hpos = cmm[2]; + vpos=11; + hpos=0; + } +# define tyocrlf() (++vpos,hpos=0,tyo('\n'),eraseline()) +# define down() (++vpos, tyo(033), tyo('B')) +# define tyoreset() (tyo(033),tyo('Y'),tyo(vpos+040),tyo(hpos+040)) +# define top() (vpos=0,hpos=0,tyoreset()) +# define horiz(n) (hpos=(n),tyoreset()) +# define vertical(n) (vpos=(n),tyoreset()) +# define erasechar() +# define eraseline() (tyo(033),tyo('K')) +# define erasescreen() (tyo(033),tyo('J')) +clrscreen () {top();erasescreen();} +# define savepos() (getpos(),svhpos=hpos,svvpos=vpos) +# define rstrpos() (hpos=svhpos,vpos=svvpos,tyoreset(),erasescreen()) +# endif + +# ifndef unix +tyoflush () + {int ptr; + if (ctyop > tyobuf) + {ptr = tyobuf; + ptr =| 0444400000000; + siot (tyochn, ptr, ctyop-tyobuf); + ctyop = tyobuf; + } + } +# endif +# ifdef unix +tyoflush () + {if (ctyop > tyobuf) + {write (1, tyobuf, ctyop-tyobuf); + ctyop = tyobuf; + } + } +# endif + +styo (s) + char *s; + {int c; + while (c = *s++) tyo(c); + } + +dpyempty () + + { + right_exists = 0; + left_exists = 0; + vertical (11); + erasescreen (); + tyoflush (); + } + +prtbrd (b) + board b; + + { + if (display) + {if (cboard == LEFT || !explain) right_exists = 0; + cpybrd (leftb,b); + cboard = LEFT; + erasescreen(); + newleft (); + left_exists = TRUE; + eraseline(); + tyoflush(); + } + else + outbrd (b); + } + +auxbrd(b) + board b; + + { + if (display) + {cboard = RIGHT; + cpybrd (rightb,b); + savepos(); + newright (); + right_exists = TRUE; + rstrpos (); + tyoflush(); + } + else + outbrd (b); + } + +shwbrd(b) + board b; + + { + if (display) + {if (cboard == LEFT || !explain) right_exists = 0; + cpybrd (leftb,b); + cboard = LEFT; + savepos (); + newleft (); + rstrpos (); + left_exists = TRUE; + tyoflush(); + } + else + outbrd (b); + } + +newleft () + + { + register int x, y; + if (!right_exists || !left_exists) {redisplay (); return;} + top(); + eraseline(); + horiz (0); + down(); + down(); + for (x=0; x<8; ++x) + {horiz (1); + for (y=0; y<8; ++y) dpysq (leftb,x,y); + horiz (0); + down(); + } + } + + +newright () + + {register int x, y; + if (!left_exists) {redisplay (); return;} + top(); + eraseline(); + horiz (0); + down(); + if (!right_exists) + {horiz (32); + styo (" 1 2 3 4 5 6 7 8"); + horiz (0); + } + down(); + for (x=0; x<8; ++x) + {horiz (32); + eraseline(); + tyo (x+'1'); + for (y=0; y<8; ++y) tyosq (rightb,x,y); + horiz (0); + down (); + } + } + +redisplay () + + { + register int x, y; + top(); + eraseline(); + tyocrlf (); + styo(" 1 2 3 4 5 6 7 8"); + if (right_exists) styo ("\t\t 1 2 3 4 5 6 7 8"); + tyocrlf (); + for (x=0; x<8; ++x) + {tyo (x+'1'); + for (y=0; y<8; ++y) tyosq (leftb,x,y); + if (right_exists) + {styo ("\t\t"); + tyo (x+'1'); + for (y=0; y<8; ++y) tyosq (rightb,x,y); + } + tyocrlf(); + } + } + +tyosq (b, x, y) + board b; + position x, y; + + {register int z; + tyo(' '); + z = b[pos(x,y)]; + if (z<=2) tyo(pcolor[z]); + else tyoletter(z); + } + +dpysq (b, x, y) + board b; + position x, y; + + {register int z; + tyo (' '); + z = b[pos(x,y)]; + erasechar (); + if (z<=2) tyo(pcolor[z]); + else tyoletter(z); + } + +tyoletter (c) + {tyo(c); + } + +outbrd (b) + board b; + + {register int x, y; + printf("\n 1 2 3 4 5 6 7 8\n"); + for (x=0; x<8; ++x) + {printf("%1d",x+1); + for (y=0; y<8; ++y) outsq (b,x,y); + putchar('\n'); + } + } + +outsq (b, x, y) + board b; + position x, y; + + {register int z; + putchar(' '); + z = b[pos(x,y)]; + if (z<=2) putchar(pcolor[z]); + else putletter(z); + } + +putletter (c) + {putchar(c); + } + +extern char gambuf[]; +extern FILE *gamefile; + +writbd(b, s) + board b; + char *s; + + {register int x, y; + register FILE *f; + char *e; + + if (s[0] == 0) s = "o.save"; + if ((f = fopen (s, "w")) == NULL) return (0); + for (x=0; x<8; ++x) + {for (y=0; y<8; ++y) putc(pcolor[b[pos(x,y)]], f); + putc('\n', f); + } +# ifndef unix + putc ('\n', f); + s = gambuf; + e = cclose (gamefile); + while (s < e) putc (*s++, f); + gamefile = copen (e, 'w', "s"); +# endif + fclose (f); + return (1); + } + +readbd(b, s) + board b; + char *s; + + {register int x, y; + register FILE *f; + extern int fcnt[], handicap; + if (s[0] == 0) s = "o.save"; + if ((f = fopen (s, "r")) == NULL) return (0); + for (x=0; x<8; ++x) + {for (y=0; y<8; ++y) switch (getc (f)) { + case '*': b[pos(x,y)] = BLACK; continue; + case '@': b[pos(x,y)] = WHITE; continue; + default: b[pos(x,y)] = EMPTY; continue; + } + getc(f); + } +# ifndef unix + getc (f); + cclose (gamefile); + gamefile = copen (gambuf, 'w', "s"); + while ((x = getc (f)) > 0) putc (x, gamefile); +# endif + fclose (f); + endgame = -1000; + setmov (b, (cntbrd (b,WHITE) + cntbrd (b,BLACK) - 1)/2); + fcnt[WHITE] = fcnt[BLACK] = handicap = 0; + right_exists = FALSE; + return (1); + } + +fixbrd (b) + board b; + + {register position p; + b[0] = b[1] = b[2] = 0; + forallpos (p) + {register color c; + if ((c = b[p]) != EMPTY) b[c] =+ sqscore (p); + } + } + \ No newline at end of file diff --git a/src/as/o/o6.rel b/src/as/o/o6.rel new file mode 100644 index 00000000..30422a9b Binary files /dev/null and b/src/as/o/o6.rel differ diff --git a/src/as/o/o7.c b/src/as/o/o7.c new file mode 100644 index 00000000..75d228cb --- /dev/null +++ b/src/as/o/o7.c @@ -0,0 +1,2 @@ +#include "obk.code" + \ No newline at end of file diff --git a/src/as/o/o7.rel b/src/as/o/o7.rel new file mode 100644 index 00000000..3d391a3d Binary files /dev/null and b/src/as/o/o7.rel differ diff --git a/src/as/o/o8.c b/src/as/o/o8.c new file mode 100644 index 00000000..6ae2dc04 --- /dev/null +++ b/src/as/o/o8.c @@ -0,0 +1,429 @@ +int book[] {0, 1, 4, 4522016, 5701671, 7405605, 8585250, +2, 3, 4325424, 4587584, 7012432, +3, 4, 4194560, 5701904, 7340320, 8519984, +4, 5, 3408048, 4784320, 6029520, 7340256, 8650992, +5, 5, 8126560, 8257648, 8388736, 8585360, 8716448, +6, 5, 3146928, 4326592, 4588752, 4785376, 6817008, +7, 3, 4326528, 4654224, 9569440, +8, 4, 4326464, 4654160, 9569376, 9831536, +9, 5, 3146736, 4588544, 4719632, 7406624, 9962544, +10, 4, 3146672, 4588480, 4719568, 7406560, +11, 6, 3015504, 3277664, 4391792, 5702528, 6947728, 8324000, +12, 3, 3277600, 4326192, 7013184, +13, 4, 4391648, 4850416, 6947584, 7471888, +14, 3, 4391600, 6947520, 8520400, +15, 6, 3015248, 4391520, 5636720, 6947456, 8258192, 8520352, +16, 5, 3146240, 4653584, 6029856, 6947376, 8389184, +17, 2, 4653536, 7012839, +18, 5, 3146128, 4653472, 6029744, 8389056, 8651216, +19, 5, 3146048, 4653392, 6029664, 8388976, 8651136, +20, 3, 1906912, 3021056, 5642512, +21, 4, 3086496, 3152048, 3283136, 5707984, +22, 5, 4266048, 4593744, 4724832, 4855920, 7346304, +23, 6, 4199536, 5642208, 7018480, 8263680, 9574416, 9705504, +24, 4, 4200384, 5707399, 7411333, 8787906, +25, 3, 1906560, 3020704, 5642160, +26, 4, 3086160, 3150352, 3282784, 5707632, +27, 4, 4200208, 4658976, 4724528, 4855616, +28, 6, 4200096, 5641904, 7018176, 8263376, 9574112, 9705200, +29, 4, 4200048, 5707392, 8590981, 9967221, +30, 8, 3085824, 3151376, 3282464, 3413552, 4724288, 6033680, 7345744, 8656480, +32, 8, 1905968, 1971520, 3085648, 4592992, 5707120, 7345536, 8525200, 8656288, +33, 3, 4787952, 7410960, 8656160, +34, 3, 4723936, 7410928, 8656128, +35, 5, 5706912, 8259424, 8393904, 8524992, 8721616, +36, 5, 5706832, 8262752, 8524912, 8656000, 9704592, +37, 5, 3150864, 3281952, 3411600, 4789296, 6034496, +38, 5, 3150784, 3281872, 3412960, 4789232, 6034432, +39, 6, 3281744, 4199264, 4330352, 4789120, 6820752, 7345056, +40, 5, 3281664, 4330256, 4789024, 6820656, 7344960, +41, 7, 3281568, 3411136, 4788912, 6034112, 6951632, 7344864, 8393456, +42, 6, 3412544, 4723280, 6034016, 7410288, 8393344, 9966224, +43, 4, 3084800, 3150352, 3281440, 3412528, +44, 5, 3281328, 4395456, 4723152, 5638807, 6820320, +45, 6, 3412304, 4723040, 6099312, 8655232, 9703824, 9965984, +46, 7, 3084512, 3150064, 3281152, 5640464, 7344416, 8393008, 8524096, +47, 7, 3281008, 3412096, 4788368, 6164640, 7344304, 8523968, 8655056, +48, 7, 3149824, 3280912, 4788256, 5640240, 8261696, 8392784, 8523872, +49, 7, 3280784, 3411872, 4788144, 6164416, 7344080, 8523744, 8654832, +50, 6, 1838896, 2101056, 3411792, 6098784, 7343984, 8720256, +51, 5, 4198128, 5638007, 7016192, 7343888, 8523552, +52, 5, 8130208, 8261296, 8392384, 8589008, 8720096, +53, 7, 3149360, 4329024, 4787792, 6032992, 7343728, 8523392, 8654480, +54, 6, 2100688, 3149280, 4787696, 6032896, 7343632, 8654368, +55, 5, 4197760, 4787600, 6950304, 7343536, 8523200, +56, 6, 4197664, 4721968, 6819136, 6950224, 7343456, 8588656, +57, 6, 6032592, 7408864, 8127888, 8391920, 8523008, 8654096, +58, 5, 6098048, 7343248, 8391840, 8522928, 8654016, +59, 5, 3083312, 4328512, 5639248, 6818912, 8260720, +60, 7, 3279808, 4328400, 4787168, 5639152, 6818816, 8260624, 8391712, +61, 6, 4655984, 6032256, 6818704, 7343008, 8127872, 8391600, +62, 6, 6032160, 8129328, 8260416, 8391504, 8587728, 8784736, +63, 5, 3017424, 4393696, 5638896, 6818560, 8260368, +64, 7, 3279456, 4393584, 4721280, 5638800, 6818464, 8260272, 8391360, +65, 7, 4590064, 5638656, 6031888, 6818336, 7408176, 8129088, 8391248, +66, 7, 5638528, 6162832, 8128928, 8260016, 8391104, 8718800, 8784352, +67, 5, 6818096, 8194368, 8259920, 8391008, 9832816, +68, 7, 4196544, 5507280, 5703904, 6031600, 6818048, 7342352, 8522016, +69, 5, 4786288, 5507200, 6031504, 6817952, 7342256, +70, 6, 6817808, 7407648, 8128560, 8521792, 8652880, 9701472, +71, 6, 6817712, 7407552, 8128464, 8521696, 8718320, 9701376, +72, 5, 4196192, 5703536, 6817664, 7341968, 8521632, +73, 4, 4785952, 5703472, 6817600, 7341904, +74, 5, 6817472, 7341776, 8128224, 8521456, 8718080, +75, 6, 3081824, 4589168, 5637760, 7341712, 8259232, 8521392, +76, 7, 4195824, 4654592, 5637648, 7341600, 8259120, 8390208, 8521296, +77, 6, 3409296, 4720032, 6030768, 7407040, 8390096, 8652256, +78, 4, 6096208, 7341408, 8390000, 8652160, +79, 5, 5506304, 8324368, 8389920, 8521008, 8652096, +80, 6, 4653056, 4325376, 4718592, 4063232, 6684672, 3145728, +81, 4, 4653056, 4325376, 9568256, 9699328, +82, 4, 4653056, 4325376, 9568256, 9830400, +83, 5, 4587520, 7340032, 4784128, 3145728, 10027008, +84, 4, 4587520, 7340032, 4784128, 3145728, +85, 6, 4653056, 7340032, 4325376, 3145728, 4849664, 6815744, +86, 1, 8323072, +87, 6, 5701632, 4325376, 8257536, 3014656, 6815744, 9568256, +88, 6, 5701632, 7340032, 8519680, 3014656, 3145728, 6815744, +89, 6, 5636096, 4390912, 3014656, 3145728, 3276800, 6815744, +90, 6, 5701632, 4325376, 3014656, 3145728, 3276800, 6815744, +91, 6, 4325376, 4784128, 3145728, 4849664, 6815744, 7471104, +92, 2, 8585216, 4325376, +93, 6, 5636096, 4390912, 8257536, 3014656, 6815744, 9568256, +94, 7, 5636096, 7340032, 8519680, 4390912, 3080192, 3145728, 6815744, +95, 5, 4653056, 6029312, 4784128, 3145728, 6815744, +96, 4, 4784128, 3145728, 3276800, 6815744, +97, 6, 4587520, 4718592, 8323079, 3145728, 4194304, 6815744, +98, 5, 4587520, 6094848, 8388608, 8650752, 3145728, +99, 5, 4653056, 6029312, 8388608, 3145728, 6815744, +100, 3, 4653056, 6815744, 9568256, +101, 8, 4587520, 6094848, 7340032, 4718592, 8650754, 3145728, 6815744, 9961472, +102, 4, 4653056, 6029312, 4784128, 6815744, +103, 6, 6029312, 7340032, 4325376, 4784128, 3276800, 6815744, +104, 6, 4653056, 7340032, 4325376, 4718592, 4194304, 6815744, +105, 4, 6029312, 8388608, 8716288, 8781824, +106, 5, 4587520, 6029312, 7340032, 8454144, 6815744, +107, 6, 6094848, 7340032, 4784128, 8716290, 6815744, 9961472, +108, 6, 4587520, 5636096, 4325376, 4784128, 5373952, 6684672, +109, 3, 4653056, 4718592, 7471104, +110, 7, 4587520, 5636096, 4325376, 4784128, 6684672, 7995392, 6815744, +111, 3, 4587520, 7405568, 4784128, +112, 3, 4653056, 7405568, 4784128, +114, 6, 6094848, 8388608, 3145728, 3276800, 3473408, 9568256, +115, 7, 8454144, 4325376, 3080192, 3145728, 5505024, 6815744, 8126464, +116, 6, 8388608, 4325376, 6684672, 3080192, 3145728, 8126464, +117, 8, 6029312, 8388608, 8585216, 4390912, 8650752, 3145728, 7471104, 9568256, +118, 5, 4587520, 6029312, 8454144, 3145728, 9568256, +119, 3, 4653056, 6815744, 9568263, +120, 6, 4653056, 6029312, 8388608, 6684672, 3145728, 8126464, +121, 7, 4653056, 6029312, 8454144, 8650757, 3145728, 7471104, 9568256, +122, 7, 4653056, 6029312, 7340032, 8454144, 8650754, 3145728, 9568256, +123, 5, 4653056, 4325376, 6684672, 3145728, 5505024, +124, 4, 4653056, 6094848, 3145728, 7471104, +125, 5, 4653056, 4325376, 3145728, 5505024, 6815744, +126, 5, 4587520, 6029312, 7340032, 8716288, 3145728, +127, 5, 4587520, 6029312, 7405568, 3145728, 7471104, +128, 3, 4653056, 4325376, 9568256, +129, 5, 4653056, 4325376, 6684672, 3145728, 5505024, +130, 4, 4653056, 6094848, 3145728, 7471104, +131, 6, 4653056, 4325376, 6684672, 3145728, 5505024, 6815744, +132, 5, 4587520, 6029312, 7340032, 8716288, 3145728, +133, 4, 4587520, 6094848, 7405568, 3145728, +134, 3, 4653056, 4325376, 9830400, +135, 7, 6094848, 3145728, 3276800, 3407872, 9568256, 9699328, 9830400, +136, 8, 4325376, 8257536, 3014656, 3145728, 6815744, 8192000, 9568256, 9699328, +137, 11, 7340032, 8519680, 4325376, 8323072, 8650752, 3014656, 3145728, 6160384, 7471104, 9699328, 9830400, +138, 8, 4325376, 8257536, 6684672, 3014656, 3145728, 8192000, 9568256, 9699328, +139, 8, 6094848, 8585216, 4325376, 8650752, 3145728, 7471104, 9699328, 9830400, +140, 6, 4653056, 6029312, 3145728, 9568256, 9699328, 9830400, +141, 8, 4653056, 6094848, 6684672, 3145728, 6815744, 8126464, 9568256, 9699328, +142, 3, 4653056, 9568256, 9830400, +143, 7, 4653056, 7340032, 8650752, 3145728, 6160384, 9699328, 9830400, +144, 7, 4653056, 6029312, 6684672, 3145728, 8126464, 9568256, 9699328, +145, 7, 4587520, 6094848, 8650757, 3145728, 7471104, 9699328, 9830400, +146, 7, 4653056, 6094848, 7340032, 8716290, 3145728, 9699328, 9830400, +147, 2, 4587520, 5701632, +148, 5, 4587520, 7340032, 4784128, 3145728, 6815744, +149, 4, 4653056, 5636096, 7340032, 9568256, +150, 5, 4587520, 5636096, 7340032, 8323072, 9830400, +151, 5, 4653056, 7340032, 4718592, 3145728, 9699328, +152, 5, 4587520, 4390912, 3014656, 9699328, 9830400, +153, 7, 4653056, 4325376, 4718592, 3145728, 7471104, 9830400, 9961472, +154, 9, 4653056, 4325376, 4718592, 3014656, 3145728, 6815744, 9699328, 9830400, 9961472, +155, 6, 4653056, 4325376, 3014656, 9568256, 9699328, 9830400, +156, 6, 4653056, 4325376, 3014656, 9568256, 9699328, 9830400, +157, 6, 4587520, 4718592, 3014656, 3145728, 9699328, 10027008, +158, 7, 4653056, 4325376, 4718592, 3145728, 7471104, 9830400, 9961472, +159, 5, 7340032, 4325376, 3145728, 3407872, 10027008, +160, 7, 4587520, 7340032, 4390912, 8257536, 3014656, 5505024, 9830400, +161, 4, 4587520, 7405568, 3145728, 9961472, +162, 4, 5636096, 8323072, 3014656, 9830400, +163, 4, 4653056, 3145728, 7471104, 9961472, +164, 7, 5701632, 7340032, 3014656, 3145728, 6815744, 9830400, 9961472, +165, 6, 4587520, 5701632, 7340032, 8257536, 3014656, 9830400, +166, 7, 6029312, 7340032, 4784128, 8650752, 3145728, 3407872, 9961472, +167, 6, 7340032, 4718592, 3145728, 4194304, 9830400, 10027008, +168, 6, 6094848, 7340032, 8716288, 3145728, 3407872, 9961472, +169, 3, 7340032, 4390912, 9830400, +170, 7, 6029312, 8388608, 4390912, 8650752, 3145728, 8126464, 9830400, +171, 8, 6029312, 7340032, 8388608, 4390912, 8650752, 3145728, 9568256, 9830400, +172, 3, 7340032, 4390912, 9830400, +173, 5, 6094848, 7340032, 4718592, 8716288, 9961472, +174, 6, 4653056, 7340032, 4784128, 4194304, 5505024, 9961472, +175, 5, 4587520, 7340032, 8388608, 4390912, 6815744, +176, 5, 6029312, 7340032, 8388608, 8650752, 8192000, +177, 5, 6029312, 7340032, 8388608, 8716288, 9568256, +178, 6, 4587520, 4325376, 4784128, 3145728, 4849664, 7471104, +179, 7, 4587520, 4325376, 4718592, 3080192, 3145728, 6815744, 9961472, +180, 5, 4653056, 4325376, 3014656, 9568256, 9961472, +181, 6, 4653056, 4325376, 3014656, 9568256, 9830400, 9961472, +182, 5, 4653056, 4325376, 4718592, 3145728, 7471104, +183, 4, 7340032, 4325376, 3145728, 3473408, +184, 3, 4587520, 7405568, 3145728, +185, 4, 5636096, 8519680, 8323072, 3014656, +186, 3, 4653056, 3145728, 7471104, +187, 7, 4653056, 5636096, 7340032, 8519680, 8257536, 3014656, 9830400, +188, 5, 6094848, 7340032, 4784128, 3145728, 3407872, +189, 5, 7340032, 8585216, 4784128, 3145728, 4194304, +190, 4, 6029312, 7340032, 3145728, 3473408, +191, 6, 7340032, 8585216, 4390912, 4784128, 3145728, 4259840, +192, 6, 6029312, 8388608, 8585216, 4390912, 3145728, 8126464, +193, 7, 6029312, 7340032, 8454144, 8519680, 4390912, 3145728, 9568256, +194, 4, 7340032, 8585216, 4325376, 9830400, +195, 3, 6094848, 7340032, 4784128, +196, 5, 4587520, 7405568, 4718592, 4194304, 5505024, +197, 6, 4587520, 7340032, 4390912, 4718592, 4194304, 6815744, +198, 4, 6094848, 7340032, 8388608, 8192000, +199, 4, 6029312, 7405568, 8388608, 9568256, +200, 5, 4390912, 4784128, 3145728, 3276800, 4915200, +201, 5, 4325376, 4784128, 3145728, 3276800, 7471104, +202, 7, 5636096, 7012352, 8519680, 4325376, 3014656, 3276800, 9568256, +203, 4, 7405568, 4784128, 3145728, 9961472, +204, 6, 5636096, 7340032, 8585216, 3014656, 3145728, 3276800, +205, 5, 4325376, 4718592, 3145728, 3276800, 4915200, +206, 5, 4325376, 4784128, 3145728, 3276800, 7471104, +207, 7, 5636096, 4325376, 8323072, 3014656, 3276800, 9568256, 9830400, +208, 4, 7340032, 4718592, 3145728, 10027008, +209, 6, 5636096, 7340032, 8585216, 3014656, 3145728, 3276800, +210, 7, 6946816, 8388608, 8323072, 3014656, 3145728, 3276800, 5505024, +211, 6, 6029312, 6946816, 8454144, 8519680, 3145728, 3276800, +212, 7, 6946816, 8388608, 8323072, 3014656, 3145728, 3276800, 5505024, +213, 6, 8519680, 4390912, 8257536, 3014656, 3276800, 6815744, +214, 6, 6029312, 8454144, 8519680, 8650752, 3145728, 3276800, +215, 6, 6094848, 8454144, 8650752, 3145728, 3276800, 9961472, +216, 6, 6946816, 8454144, 8323072, 3014656, 3145728, 3276800, +217, 6, 6094848, 6946816, 8388608, 3145728, 3276800, 4849664, +218, 6, 5701632, 4718592, 8257536, 3014656, 3276800, 6815744, +219, 5, 6094848, 8388608, 4718592, 8650752, 3145728, +220, 5, 6094848, 8454144, 4784128, 8650752, 3145728, +221, 6, 5636096, 6946816, 4325376, 8323072, 1966080, 3014656, +222, 7, 5636096, 6946816, 4390912, 8257536, 1703936, 1966080, 3080192, +223, 4, 5701632, 6946816, 4325376, 6160384, +224, 5, 5701632, 6946816, 4325376, 4849664, 7471104, +225, 4, 5636096, 6946816, 8519680, 4390912, +226, 6, 5636096, 6946816, 8519680, 4390912, 8257536, 3014656, +227, 5, 5701632, 6946816, 4390912, 8257536, 3276800, +228, 4, 5701632, 6946816, 8257536, 3276800, +229, 6, 6946816, 7340032, 8388608, 4390912, 3276800, 4849664, +230, 7, 6946816, 7340032, 8388608, 4325376, 4784128, 3276800, 4849664, +231, 7, 5636096, 8388608, 8519680, 4784128, 8257536, 3276800, 8781824, +232, 3, 7340032, 8388608, 4784128, +233, 6, 5636096, 8388608, 8519680, 4784128, 8257536, 3276800, +234, 4, 4390912, 3145728, 3276800, 6815744, +235, 4, 4325376, 3276800, 3473408, 9568256, +236, 5, 4325376, 3276800, 3473408, 9568256, 9830400, +237, 4, 7405568, 3145728, 3407872, 9961472, +238, 3, 7405568, 3145728, 3473408, +239, 6, 6094848, 6946816, 8388608, 3145728, 3342336, 3407872, +240, 3, 3276800, 4915200, 6815744, +241, 6, 6094848, 8388608, 8650757, 3145728, 3407872, 4849664, +242, 6, 6094848, 8388608, 8650754, 3145728, 3407872, 4849664, +243, 7, 5701632, 6946816, 4325376, 8257536, 1966080, 3014656, 4849664, +244, 7, 5701632, 6946816, 4325376, 8257536, 1966080, 3014656, 4849664, +245, 6, 5636096, 6946816, 4390912, 8257536, 3014656, 6160384, +246, 6, 5636096, 6946816, 4390912, 4849664, 6160384, 7471104, +247, 6, 5636096, 7012352, 8519680, 4325376, 4849664, 6160384, +248, 8, 5636096, 7012352, 8519680, 4325376, 8257536, 3014656, 4849664, 6160384, +249, 5, 5636096, 6946816, 4390912, 1966080, 3145728, +250, 5, 5701632, 6946816, 4325376, 3145728, 3276800, +251, 6, 5701632, 6946816, 4325376, 3145728, 3276800, 3407872, +252, 3, 6946816, 4390912, 4849664, +253, 6, 5636096, 6946816, 8388608, 8519680, 4325376, 8716288, +254, 5, 5701632, 6946816, 8388608, 4325376, 9830400, +255, 6, 5636096, 6946816, 8388608, 8519680, 4390912, 9830400, +256, 6, 4718592, 1835008, 3276800, 3407872, 4915200, 6160384, +257, 6, 4718592, 1966080, 3145728, 3407872, 4915200, 6160384, +258, 5, 3145728, 3276800, 3407872, 4849664, 6225920, +259, 6, 4390912, 4718592, 3145728, 4194304, 4849664, 7471104, +260, 7, 8454144, 4390912, 3145728, 4849664, 6160384, 7471104, 9568256, +261, 5, 7340032, 8519680, 4390912, 7471104, 9830400, +262, 9, 7340032, 4390912, 4718592, 8650754, 3145728, 6160384, 7471104, 9830400, 9961472, +263, 5, 5701632, 7012352, 4325376, 1966080, 3145728, +264, 6, 5636096, 7012352, 4325376, 1966080, 3145728, 3276800, +265, 6, 5701632, 6946816, 4325376, 3145728, 3276800, 3407872, +266, 3, 7012352, 4390912, 7471104, +267, 6, 5636096, 6946816, 8388608, 8519680, 4325376, 8716288, +268, 5, 5636096, 6946816, 8388608, 4390912, 9830400, +269, 5, 5636096, 6946816, 8388608, 8519680, 4390912, +270, 7, 7012352, 8388608, 1769472, 3145728, 4849664, 6160384, 7471104, +271, 5, 6946816, 4784128, 1966080, 3276800, 4849664, +272, 9, 7012352, 7340032, 8388608, 4784128, 1966080, 2097152, 3473408, 4849664, 6160384, +273, 6, 7012352, 7340032, 8388608, 4849664, 6815744, 7471104, +274, 6, 8454144, 8519680, 8650757, 6160384, 7471104, 8781824, +275, 6, 7405568, 8585216, 8716288, 6160384, 7471104, 9699328, +276, 6, 7340032, 8454144, 8650754, 6160384, 7471104, 9830400, +277, 9, 5636096, 6946816, 4390912, 8257536, 3014656, 3276800, 6160384, 7471104, 8781824, +278, 6, 5636096, 6946816, 4390912, 3276800, 6160384, 7471104, +279, 6, 5636096, 6946816, 4390912, 4849664, 6160384, 7471104, +280, 7, 5636096, 7012352, 4325376, 8257536, 3014656, 6160384, 8781824, +281, 8, 5701632, 6946816, 4390912, 8257536, 3014656, 7471104, 8781824, 9830400, +282, 8, 5701632, 6946816, 4325376, 8257536, 3014656, 7471104, 8781824, 9830400, +283, 6, 6094848, 8388608, 8716288, 3145728, 3407872, 7471104, +284, 3, 8585216, 4194304, 7471104, +285, 6, 6094848, 8388608, 8650752, 3145728, 3407872, 7471104, +286, 7, 6029312, 8388608, 8585216, 4325376, 8650752, 3145728, 8126464, +288, 4, 6946816, 8519680, 8716288, 1769472, +289, 5, 6946816, 8519680, 8716288, 1703936, 1966080, +290, 5, 8388608, 4718592, 8716288, 2097152, 8781824, +291, 4, 8388608, 4784128, 8650752, 8781824, +292, 7, 5636096, 6946816, 4325376, 8323072, 3014656, 3276800, 8781824, +293, 5, 5701632, 6946816, 4325376, 3276800, 8781824, +294, 6, 5701632, 6946816, 4325376, 4849664, 7471104, 8781824, +295, 5, 5701632, 6946816, 4390912, 6160384, 8781824, +296, 7, 5701632, 6946816, 4325376, 8323072, 3014656, 9568256, 9830400, +297, 6, 5701632, 6946816, 4325376, 8257536, 3014656, 9830400, +298, 3, 7405568, 4718592, 3145728, +299, 6, 5636096, 7340032, 8585216, 3014656, 3145728, 3276800, +300, 7, 3145728, 4325376, 4718592, 6946816, 7405568, 7471104, 8519680, +301, 5, 3014656, 4390912, 5636096, 8126464, 8519680, +302, 6, 3145728, 4325376, 4784128, 6946816, 7471104, 8519680, +303, 5, 3014656, 4325376, 5636096, 7012352, 8519680, +304, 5, 3145728, 3407872, 6029312, 7405568, 8454144, +305, 6, 3014656, 4194304, 5701632, 7340032, 8257536, 8519680, +306, 5, 3145728, 3407872, 6094848, 7340032, 8454144, +307, 7, 3080192, 3145728, 4390912, 8192000, 8323072, 8454144, 8585216, +308, 6, 3145728, 4325376, 6029312, 7471104, 8388608, 8585216, +309, 6, 2097152, 3145728, 3407872, 6094848, 8454144, 8585216, +310, 7, 3014656, 3145728, 4390912, 5505024, 8257536, 8388608, 8519680, +311, 6, 3014656, 3276800, 4194304, 7012352, 8257536, 8519680, +312, 6, 3145728, 3276800, 3473408, 6094848, 8388608, 8519680, +313, 7, 3014656, 3145728, 4390912, 5505024, 8323072, 8388608, 8519680, +314, 6, 3145728, 3276800, 4390912, 6029312, 8388608, 8519680, +316, 7, 1703936, 1966080, 3014656, 5636096, 7012352, 8257536, 8519680, +317, 4, 2097152, 4784128, 7340032, 8454144, +318, 6, 3276800, 4718592, 5701632, 8257536, 8388608, 8519680, +319, 5, 4849664, 6946816, 7405568, 8388608, 8585216, +320, 5, 6946816, 7405568, 7471104, 8388608, 8519680, +321, 7, 1703936, 3276800, 4390912, 5636096, 6946816, 8257536, 8519680, +322, 4, 2097152, 4784128, 7340032, 8388608, +323, 5, 4849664, 6946816, 7340032, 8388608, 8585216, +324, 5, 6946816, 7405568, 7471104, 8388608, 8519680, +325, 3, 3145728, 4653056, 4784128, +326, 5, 3145728, 4587520, 6029312, 7012352, 8126464, +327, 6, 3145728, 4784128, 6029312, 7405568, 8650752, 9961472, +328, 4, 3145728, 4718592, 6094848, 7340032, +329, 3, 4587520, 6946816, 9633792, +330, 4, 3014663, 3145728, 4653056, 4718592, +331, 3, 4653056, 9633792, 9830400, +332, 6, 3145728, 4784128, 6029312, 7340032, 8716288, 9961472, +333, 4, 3145728, 4653056, 4784128, 7405568, +334, 5, 3145728, 3407872, 4653056, 6946816, 8388608, +335, 3, 3145728, 8388608, 8716288, +336, 5, 3014656, 5636096, 8323072, 8388608, 8519680, +337, 6, 3145728, 4128768, 6094848, 8388608, 8585216, 8650752, +338, 6, 3014656, 4063232, 5701632, 6946816, 8257536, 8519680, +339, 2, 4653056, 7012352, +340, 7, 1835008, 4063232, 4653056, 6029312, 6946816, 7340032, 8388608, +341, 5, 4653056, 5505024, 6029312, 6946816, 8388608, +342, 6, 3342336, 3407872, 5505024, 6094848, 6946816, 8388608, +343, 7, 4063232, 4587520, 5505024, 6815744, 6946816, 7405568, 8388608, +344, 6, 4128768, 5505024, 6029312, 8388608, 8650752, 8781824, +345, 6, 4128768, 5505024, 6029312, 7340032, 8388608, 8650752, +346, 4, 4128768, 5505024, 7340032, 8388608, +352, 6, 4194304, 5505024, 6815744, 6946816, 8323072, 8454144, +353, 6, 1703936, 1966080, 3014656, 5505024, 7012352, 8257536, +354, 5, 1966080, 3080192, 5570560, 7012352, 8323072, +355, 7, 3276800, 4784128, 5505024, 6815744, 6946816, 8257536, 8388608, +356, 5, 4849664, 6815744, 7012352, 7340032, 8388608, +357, 8, 5505024, 6815744, 6946816, 8323072, 8388608, 8519680, 8650752, 8781824, +358, 6, 5505024, 6881280, 7012352, 8257536, 8388608, 8519680, +359, 6, 3145728, 4587520, 6094848, 6946816, 7471104, 8388608, +360, 4, 4587520, 6094848, 6946816, 7471104, +362, 5, 3145728, 4784128, 6094848, 7471104, 8650752, +363, 8, 3145728, 4194304, 4587520, 4718592, 6029312, 7012352, 7471104, 8650752, +364, 6, 3145728, 4653056, 5505024, 6094848, 8126464, 8716288, +365, 5, 3145728, 4587520, 6094848, 8126464, 8650752, +366, 7, 3145728, 4587520, 4784128, 6029312, 7471104, 8650752, 9699328, +367, 2, 4587520, 8716288, +369, 7, 3014656, 3145728, 8257536, 8388608, 8519680, 8716288, 8781824, +370, 5, 3145728, 3407872, 4784128, 8388608, 8650752, +371, 5, 3145728, 4653056, 6160384, 8388608, 8650752, +372, 9, 3014656, 3145728, 4653056, 6160384, 8257536, 8454144, 8519680, 8650752, 8781824, +373, 6, 1769472, 3145728, 6094848, 8388608, 8519680, 8650752, +374, 7, 2097152, 3407872, 4718592, 6029312, 8388608, 8716288, 8847360, +375, 6, 6815744, 7012359, 8388608, 8519680, 8650757, 8781824, +376, 3, 1966080, 4587520, 8716288, +378, 5, 1769472, 4587520, 6029312, 8388608, 8650752, +379, 5, 6815744, 7012352, 8388608, 8650752, 8781824, +380, 6, 3145728, 4587520, 6029312, 7012352, 8388608, 9830400, +382, 5, 3145728, 4587520, 6029312, 7012352, 8650752, +383, 6, 3145728, 4653056, 5505024, 6029312, 8126464, 8650752, +384, 5, 3145728, 4653056, 6029312, 8650752, 9699328, +385, 8, 3145728, 4587520, 4784128, 6094848, 7340032, 8650752, 9699328, 9961472, +386, 2, 4587520, 8716288, +388, 6, 3080192, 3145728, 8323072, 8388608, 8650752, 9830400, +389, 5, 3145728, 3407872, 4784128, 8388608, 8650752, +390, 5, 3145728, 3407872, 4653056, 8388608, 8650752, +391, 8, 3014656, 3145728, 4653056, 6160384, 8257536, 8388608, 8650752, 9830400, +392, 4, 3145728, 4653056, 8388608, 8650752, +394, 6, 1769472, 3145728, 6029312, 8388608, 8650752, 9830400, +395, 5, 1703936, 1966080, 6946816, 8716288, 9830400, +396, 7, 2097152, 3407872, 4784128, 6029312, 7405568, 8388608, 8716288, +397, 6, 6815744, 7012352, 7340032, 8388608, 8650752, 9830400, +398, 3, 2031616, 4587520, 8716288, +400, 5, 1769472, 4587520, 6029312, 8388608, 8650752, +401, 5, 6815744, 7012352, 7340032, 8388608, 8650752, +}; +int *bnlist[] {0, 1, 7, 12, 18, 25, 32, 39, 44, 50, 57, +63, 71, 76, 82, 87, 95, 102, 106, 113, 120, +125, 131, 138, 146, 152, 157, 163, 169, 177, 183, +0, 193, 203, 208, 213, 220, 227, 234, 241, 249, +256, 265, 273, 279, 286, 294, 303, 312, 321, 330, +338, 345, 352, 361, 369, 376, 384, 392, 399, 406, +415, 423, 431, 438, 447, 456, 465, 472, 481, 488, +496, 504, 511, 517, 524, 532, 541, 549, 555, 562, +570, 576, 582, 589, 595, 603, 606, 614, 622, 630, +638, 646, 650, 658, 667, 674, 680, 688, 695, 702, +707, 717, 723, 731, 739, 745, 752, 760, 768, 773, +782, 787, 0, 792, 800, 809, 817, 827, 834, 839, +847, 856, 865, 872, 878, 885, 892, 899, 904, 911, +917, 925, 932, 938, 943, 952, 962, 975, 985, 995, +1003, 1013, 1018, 1027, 1036, 1045, 1054, 1058, 1065, 1071, +1078, 1085, 1092, 1101, 1112, 1120, 1128, 1136, 1145, 1152, +1161, 1167, 1173, 1179, 1188, 1196, 1205, 1213, 1221, 1226, +1235, 1245, 1250, 1257, 1265, 1272, 1279, 1286, 1294, 1303, +1310, 1318, 1325, 1331, 1336, 1342, 1347, 1356, 1363, 1370, +1376, 1384, 1392, 1401, 1407, 1412, 1419, 1427, 1433, 1439, +1446, 1453, 1462, 1468, 1476, 1483, 1490, 1499, 1505, 1513, +1522, 1530, 1539, 1547, 1555, 1563, 1571, 1579, 1587, 1594, +1601, 1609, 1618, 1624, 1631, 1637, 1645, 1652, 1658, 1666, +1675, 1684, 1689, 1697, 1703, 1709, 1716, 1722, 1727, 1735, +1740, 1748, 1756, 1765, 1774, 1782, 1790, 1798, 1808, 1815, +1822, 1830, 1835, 1843, 1850, 1858, 1866, 1874, 1881, 1889, +1898, 1905, 1916, 1923, 1931, 1939, 1944, 1952, 1959, 1966, +1975, 1982, 1993, 2001, 2009, 2017, 2025, 2036, 2044, 2052, +2061, 2071, 2081, 2089, 2094, 2102, 0, 2111, 2117, 2124, +2131, 2137, 2146, 2153, 2161, 2168, 2177, 2185, 2190, 2198, +2207, 2214, 2222, 2229, 2236, 2244, 2251, 2260, 2268, 2276, +2285, 2293, 2301, 2310, 0, 2318, 2327, 2333, 2341, 2348, +2355, 2364, 2370, 2377, 2384, 2389, 2396, 2404, 2410, 2415, +2421, 2426, 2434, 2440, 2447, 2452, 2459, 2467, 2475, 2479, +2488, 2495, 2503, 2512, 2520, 2528, 0, 0, 0, 0, +0, 2534, 2542, 2550, 2557, 2566, 2573, 2583, 2591, 2599, +0, 2605, 2612, 2622, 2630, 2637, 2646, 0, 2650, 2659, +2666, 2673, 2684, 2692, 2701, 2709, 0, 2714, 2721, 2728, +0, 2736, 2743, 2751, 2758, 2768, 0, 2772, 2780, 2787, +2794, 2804, 0, 2810, 2818, 2825, 2834, 2842, 0, 2847, +2854}; +int nnodes {401}; + \ No newline at end of file diff --git a/src/as/o/o8.record b/src/as/o/o8.record new file mode 100644 index 00000000..ae982fcc --- /dev/null +++ b/src/as/o/o8.record @@ -0,0 +1,1511 @@ +AS Nov 7 1977 18:07:21 + +1. 3-5...3-6 (0.3) +2. 3-7...3-4 (0.4) +3. 5-3...3-8 (0.3) +4. 4-6...6-4 (1.2) +5. 4-7...4-8 (0.4) +6. 7-5...7-3 (0.3) +7. 5-6...6-6 (0.4) +8. 7-4...8-4 (0.3) +9. 8-6...7-6 (0.2) +10. 8-2...4-2 (0.2) +11. 3-1...5-2 (0.2) +12. 6-2...5-1 (0.2) +13. 5-7...3-3 (0.3) +14. 2-4...2-5 (0.7) +15. 3-2...4-3 (0.9) +16. 6-3...2-3 (1.5) +17. 4-1...2-1 (0.8) +18. 6-5...5-8 (0.7) +19. 8-7...6-7 (0.5) +20. 7-1...8-5 (0.5) +21. 8-3...7-2 (0.3) +22. 1-5...1-3 (0.6) +23. 8-1...1-4 (1.6) +24. 6-1...1-6 (0.2) +25. 1-1...2-2 (0.1) +26. 1-2...Forfeit +27. 6-8...7-7 (1.2) +28. 1-7...7-8 (0.1) +29. 8-8...Forfeit +30. 2-6...Forfeit +31. 2-7...2-8 (0.1) +32. 1-8 +56-8 + AS Nov 8 1977 19:07:27 + +1. ...3-4 (0.4) +2. 3-3...3-2 (0.5) +3. 4-6...6-6 (0.2) +4. 4-3...5-2 (0.3) +5. 4-2...5-3 (0.4) +6. 6-4...5-6 (0.5) +7. 2-4...3-5 (0.8) +8. 6-2...6-1 (1.2) +9. 2-6...2-5 (1.1) +10. 5-7...5-8 (1.9) +11. 7-6...6-7 (3.0) +12. 4-8...3-8 (2.3) +13. 5-1...4-1 (1.9) +14. 7-8...6-5 (1.7) +15. 7-4...6-3 (1.9) +16. 2-3...1-4 (2.0) +17. 1-5...1-6 (1.4) +18. 1-2...3-6 (1.4) +19. 7-3...7-5 (1.3) +20. 4-7...1-3 (1.4) +21. 1-7...8-6 (0.9) +22. 8-5...8-4 (0.7) +23. 8-2...8-7 (0.4) +24. 3-7...6-8 (0.3) +25. 2-8...7-2 (0.6) +26. 8-1...7-1 (0.5) +27. 8-3...2-7 (0.1) +28. 8-8...Forfeit +29. 1-8...Forfeit +30. 7-7...Forfeit +31. 2-2...3-1 (0.1) +32. 2-1...1-1 (0.1) + +56-8 + URGW Nov 8 1977 23:24:38 + +1. ...5-6 (0.4) +2. 6-6...7-6 (0.7) +3. 5-3...5-2 (0.7) +4. 6-4...6-3 (0.4) +5. 4-6...3-3 (0.5) +6. 8-6...7-4 (0.6) +7. 4-3...3-2 (0.4) +8. 5-1...4-1 (0.6) +9. 3-1...3-4 (0.4) +10. 4-2...3-6 (0.3) +11. 6-1...6-5 (0.4) +12. 6-2...7-3 (0.5) +13. 2-1...7-5 (0.5) +14. 8-3...8-4 (0.4) +15. 8-5...5-7 (0.3) +16. 5-8...7-7 (7.3) +17. 3-5...2-2 (2.6) +18. 6-7...6-8 (0.5) +19. 2-4...8-7 (0.8) +20. 8-8...7-8 (0.6) +21. 1-1...4-8 (0.4) +22. 3-8...4-7 (0.3) +23. 3-7...1-4 (1.6) +24. 1-3...1-2 (0.3) +25. 1-5...2-5 (0.2) +26. 1-6...2-3 (0.2) +27. 2-6...2-8 (1.1) +28. 1-8...8-2 (0.3) +29. 8-1...2-7 (0.1) +30. 1-7...7-2 (0.1) +31. 7-1 +50-14 + BERN Nov 9 1977 04:40:13 + +1. ...3-4 (0.3) +2. 3-3...3-2 (0.5) +3. 3-5...3-6 (0.4) +4. 4-6...6-5 (0.3) +5. 6-4...6-6 (0.4) +6. 5-6...6-7 (0.3) +7. 6-8...5-3 (0.4) +8. 4-3...6-3 (0.5) +9. 2-1...5-2 (0.6) +10. 2-4...1-4 (0.8) +11. 4-2...2-5 (1.4) +12. 5-1...6-1 (1.6) +13. 7-1...6-2 (1.4) +14. 1-6...2-3 (1.5) +15. 1-2...1-3 (0.8) +16. 1-5...3-1 (0.6) +17. 4-1...4-7 (0.4) +18. 3-8...5-7 (0.4) +19. 3-7...2-6 (0.4) +20. 1-7...4-8 (0.5) +21. 5-8...2-7 (5.3) +22. 7-3...7-2 (2.0) +23. 7-4...2-8 (0.4) +24. 1-8...8-2 (3.4) +25. 8-1...8-4 (0.2) +26. 8-3...7-7 (1.4) +27. 8-8...7-6 (1.9) +28. 8-6...8-5 (0.4) +29. 8-7...7-5 (0.1) +30. 7-8...2-2 (0.1) +31. 1-1 +57-7 + BERN Nov 9 1977 05:33:00 + +1. ...5-6 (0.3) +2. 6-6...7-6 (0.6) +3. 3-5...3-3 (0.2) +4. 4-3...3-4 (0.3) +5. 6-5...2-6 (0.5) +6. 8-7...8-6 (0.4) +7. 8-5...4-6 (0.4) +8. 3-6...6-7 (7.9) +9. 6-8...4-2 (0.6) +10. 4-1...5-3 (7.8) +11. 1-6...3-1 (0.6) +12. 2-1...7-4 (0.4) +13. 6-4...7-5 (0.6) +14. 8-4...5-2 (0.6) +15. 2-5...8-3 (0.5) +16. 8-2...1-5 (0.5) +17. 1-4...5-1 (0.5) +18. 6-1...3-2 (0.5) +19. 2-3...6-3 (0.5) +20. 7-3...1-2 (0.4) +21. 2-4...6-2 (0.4) +22. 7-1...4-7 (0.4) +23. 4-8...3-7 (0.4) +24. 3-8...2-7 (0.3) +25. 1-7...5-8 (0.2) +26. 7-2...7-7 (0.4) +27. 8-8...7-8 (0.6) +28. 2-2...1-3 (0.2) +29. 1-1...2-8 (0.1) +30. 1-8...Forfeit +31. 5-7 +57-6 + CLR Nov 9 1977 22:59:26 + +1. ...4-3 (0.3) +2. 5-3...6-3 (0.5) +3. 3-5...3-6 (0.3) +4. 3-7...5-6 (0.3) +5. 6-2...5-2 (0.3) +6. 6-6...6-5 (0.5) +7. 6-4...7-6 (0.6) +8. 6-7...5-8 (0.8) +9. 8-6...7-3 (1.1) +10. 7-4...7-5 (1.5) +11. 4-6...3-4 (1.7) +12. 3-2...3-3 (1.7) +13. 2-4...1-4 (2.7) +14. 4-2...6-1 (3.2) +15. 8-3...8-5 (4.3) +16. 8-4...3-1 (2.9) +17. 5-7...2-5 (1.9) +18. 2-6...1-7 (2.9) +19. 2-3...6-8 (3.1) +20. 4-7...2-8 (2.6) +21. 8-7...5-1 (2.5) +22. 4-1...1-3 (0.9) +23. 7-2...7-7 (0.5) +24. 4-8...3-8 (0.4) +25. 8-8...7-1 (0.6) +26. 7-8...8-2 (0.2) +27. 8-1...2-2 (0.1) +28. 1-8...Forfeit +29. 2-7...Forfeit +30. 1-6...1-5 (0.1) +31. 1-1...1-2 (0.1) +32. 2-1 +52-12 + BERN Nov 9 1977 23:45:38 + +1. 5-3...6-3 (0.2) +2. 6-4...4-3 (0.2) +3. 3-4...6-5 (1.2) +4. 4-6...3-6 (0.4) +5. 5-6...3-5 (0.4) +6. 2-4...2-6 (0.5) +7. 1-6...3-7 (0.6) +8. 5-7...3-3 (0.7) +9. 2-3...1-4 (0.8) +10. 2-5...1-5 (0.7) +11. 1-3...6-7 (0.5) +12. 3-8...5-8 (0.5) +13. 6-6...4-7 (0.7) +14. 4-8...2-8 (0.5) +15. 7-8...7-6 (0.2) +16. 1-7...2-2 (0.2) +17. 1-2...2-7 (0.9) +18. 8-6...7-5 (0.3) +19. 1-8...8-5 (0.2) +20. 6-8...8-7 (0.1) +21. 4-2...3-2 (0.4) +22. 1-1...2-1 (0.4) +23. 3-1...5-1 (0.2) +24. 7-3...8-2 (0.3) +25. 4-1...5-2 (0.2) +26. 6-1...6-2 (0.1) +27. 7-1...Forfeit +28. 7-7...Forfeit +29. 8-3...7-2 (0.2) +30. 8-1...Forfeit +31. 8-4...7-4 (0.0) +32. 8-8 +53-11 + JSK Nov 10 1977 01:07:52 + +1. 4-6...3-6 (0.2) +2. 3-5...3-4 (0.2) +3. 5-3...5-6 (1.1) +4. 3-3...4-3 (0.4) +5. 5-7...6-7 (0.5) +6. 3-2...6-8 (0.6) +7. 5-8...4-8 (0.6) +8. 4-7...3-7 (0.5) +9. 2-8...3-8 (0.6) +10. 7-8...3-1 (0.4) +11. 6-6...6-2 (0.4) +12. 6-3...5-2 (0.4) +13. 5-1...7-3 (0.4) +14. 8-4...7-1 (0.4) +15. 7-4...6-4 (0.5) +16. 6-5...7-5 (0.7) +17. 4-2...8-5 (0.8) +18. 8-6...8-2 (0.5) +19. 7-6...7-7 (1.4) +20. 8-7...4-1 (0.5) +21. 6-1...7-2 (0.1) +22. 8-1...Forfeit +23. 8-3...Forfeit +24. 2-1...2-2 (0.1) +25. 2-4...2-6 (0.2) +26. 8-8...2-3 (0.2) +27. 1-1...2-5 (7.1) +28. 1-2...1-4 (1.0) +29. 1-3...Forfeit +30. 1-5...1-6 (0.1) +31. 1-7...2-7 (0.1) +32. 1-8 +52-12 + AS Nov 10 1977 16:07:26 + +1. 3-5...3-6 (0.2) +2. 4-6...3-4 (0.2) +3. 2-6...5-6 (0.6) +4. 6-6...3-7 (0.4) +5. 4-8...3-8 (0.5) +6. 2-8...5-7 (0.5) +7. 6-4...6-5 (0.5) +8. 4-3...3-2 (0.7) +9. 7-5...8-5 (0.6) +10. 4-2...4-1 (1.4) +11. 2-4...2-5 (1.3) +12. 5-8...6-3 (1.5) +13. 5-3...6-7 (1.7) +14. 3-3...5-2 (1.5) +15. 1-5...1-6 (1.1) +16. 1-7...4-7 (1.0) +17. 6-8...2-3 (0.5) +18. 1-4...2-7 (0.2) +19. 7-8...7-7 (0.2) +20. 1-8...Forfeit +21. 1-3...Forfeit +22. 1-2...2-2 (0.2) +23. 8-7...8-8 (0.2) +24. 8-6...Forfeit +25. 7-6...Forfeit +26. 2-1...1-1 (0.2) +27. 3-1...7-3 (3.2) +28. 7-4...5-1 (0.1) +29. 6-2...Forfeit +30. 8-3...8-2 (0.4) +31. 8-4...6-1 (0.1) +32. 8-1...Forfeit +33. 7-1...Forfeit +34. 7-2 +59-5 + RRA Nov 11 1977 14:43:59 + +1. 5-3...6-3 (0.3) +2. 6-4...4-3 (0.3) +3. 3-3...6-5 (1.2) +4. 6-6...5-6 (0.4) +5. 4-6...2-3 (0.5) +6. 4-2...3-2 (0.7) +7. 5-2...3-1 (0.9) +8. 3-4...3-6 (0.9) +9. 1-3...3-7 (1.0) +10. 5-1...4-1 (0.9) +11. 2-1...2-5 (0.5) +12. 3-5...2-4 (0.6) +13. 3-8...2-6 (0.5) +14. 6-1...6-2 (0.6) +15. 1-4...4-8 (0.6) +16. 5-8...4-7 (0.4) +17. 5-7...7-6 (0.5) +18. 7-1...6-8 (0.6) +19. 7-8...1-5 (0.4) +20. 1-6...7-2 (2.2) +21. 2-8...2-7 (2.0) +22. 1-7...1-2 (0.8) +23. 1-8...2-2 (0.1) +24. 1-1...Forfeit +25. 8-1...7-4 (0.2) +26. 6-7...7-5 (0.2) +27. 7-3...8-2 (1.0) +28. 8-3...8-5 (0.5) +29. 8-4...8-6 (0.1) +30. 8-7...7-7 (0.1) +31. 8-8 +52-12 + RRA Nov 11 1977 15:10:40 + +1. 5-3...6-3 (0.2) +2. 6-4...4-3 (0.2) +3. 3-3...6-5 (0.9) +4. 6-6...3-4 (0.3) +5. 3-5...3-6 (0.4) +6. 5-6...4-6 (0.5) +7. 5-2...3-2 (0.6) +8. 2-3...1-3 (0.9) +9. 3-1...2-4 (1.0) +10. 1-5...6-7 (0.9) +11. 2-5...5-1 (0.7) +12. 7-5...7-4 (1.1) +13. 4-2...7-3 (1.2) +14. 8-4...8-3 (1.2) +15. 8-2...1-4 (0.9) +16. 1-2...2-6 (0.6) +17. 1-6...6-2 (0.5) +18. 6-1...7-1 (0.5) +19. 8-5...8-6 (0.3) +20. 8-7...2-2 (0.2) +21. 4-1...2-1 (0.1) +22. 3-7...3-8 (0.3) +23. 1-1...5-7 (0.3) +24. 8-1...7-2 (0.2) +25. 7-6...1-7 (0.4) +26. 1-8...2-7 (0.1) +27. 2-8...4-7 (0.1) +28. 4-8...5-8 (0.2) +29. 6-8...7-8 (0.1) +30. 8-8...7-7 (0.0) + +50-14 + RRA Nov 12 1977 18:21:09 + +1. 5-3...6-3 (0.2) +2. 6-4...6-5 (0.2) +3. 6-6...4-3 (0.8) +4. 3-3...5-6 (0.3) +5. 4-6...3-6 (0.4) +6. 3-4...3-5 (0.5) +7. 4-2...3-2 (0.5) +8. 2-6...6-7 (0.7) +9. 3-1...2-4 (0.6) +10. 7-5...7-4 (1.1) +11. 5-7...5-8 (1.4) +12. 6-2...6-1 (3.1) +13. 7-6...4-7 (2.2) +14. 1-4...2-3 (2.3) +15. 8-4...5-1 (2.8) +16. 5-2...7-3 (2.8) +17. 3-8...8-6 (2.0) +18. 2-5...1-6 (2.2) +19. 4-1...2-1 (1.4) +20. 1-3...8-5 (1.3) +21. 8-7...3-7 (0.6) +22. 8-3...1-5 (0.6) +23. 1-7...7-2 (0.4) +24. 4-8...2-8 (0.3) +25. 7-8...7-7 (0.7) +26. 8-8...2-7 (0.6) +27. 6-8...2-2 (2.1) +28. 1-2...Forfeit +29. 1-8...Forfeit +30. 1-1...Forfeit +31. 7-1...8-1 (0.1) +32. 8-2 +52-12 + RRA Nov 12 1977 20:14:38 + +1. ...5-6 (0.3) +2. 6-6...7-6 (0.6) +3. 5-3...5-2 (0.6) +4. 6-4...6-3 (0.3) +5. 4-6...3-3 (0.4) +6. 6-5...7-4 (0.3) +7. 4-3...3-5 (0.3) +8. 8-6...6-7 (0.5) +9. 2-4...2-6 (0.6) +10. 2-3...8-5 (0.6) +11. 8-4...3-4 (0.5) +12. 3-6...2-5 (0.6) +13. 1-6...1-4 (0.7) +14. 1-3...1-2 (0.5) +15. 7-5...4-7 (0.6) +16. 6-8...5-8 (0.7) +17. 4-8...3-2 (0.4) +18. 5-7...3-7 (0.4) +19. 1-5...1-7 (0.2) +20. 7-8...7-7 (0.1) +21. 8-7...Forfeit +22. 3-8...Forfeit +23. 5-1...4-1 (0.4) +24. 8-8...6-1 (0.3) +25. 2-8...6-2 (0.2) +26. 4-2...2-7 (0.1) +27. 1-8...7-3 (0.1) +28. 8-3...3-1 (1.3) +29. 1-1...2-2 (0.4) +30. 2-1...8-2 (0.1) +31. 8-1...Forfeit +32. 7-1...7-2 (0.0) + +50-14 + RRA Nov 12 1977 20:32:32 + +1. ...4-3 (0.3) +2. 3-3...2-3 (0.5) +3. 4-6...4-7 (0.8) +4. 5-3...6-3 (0.3) +5. 3-5...3-6 (0.3) +6. 5-2...6-2 (0.6) +7. 3-4...4-2 (0.7) +8. 5-6...6-7 (0.5) +9. 3-2...2-5 (0.7) +10. 5-1...4-1 (0.6) +11. 3-1...6-5 (0.3) +12. 1-3...2-2 (0.2) +13. 4-8...1-4 (0.7) +14. 1-1...3-7 (0.5) +15. 1-2...5-7 (0.5) +16. 2-1...2-4 (0.1) +17. 1-5...1-6 (0.2) +18. 1-7...2-6 (0.1) +19. 3-8...2-7 (0.2) +20. 5-8...6-6 (0.2) +21. 1-8...6-4 (0.2) +22. 7-5...7-3 (0.4) +23. 7-4...8-3 (0.6) +24. 2-8...7-6 (0.2) +25. 6-8...7-8 (0.1) +26. 8-8...Forfeit +27. 7-7...Forfeit +28. 8-7...8-6 (0.1) +29. 8-4...8-5 (0.6) +30. 8-2...7-1 (0.1) +31. 6-1...7-2 (0.1) +32. 8-1 +55-9 + JSK Nov 13 1977 14:44:46 + +1. ...3-4 (0.3) +2. 5-3...6-6 (0.7) +3. 5-6...4-6 (0.9) +4. 3-3...3-2 (0.9) +5. 3-6...4-3 (0.3) +6. 3-5...6-4 (0.4) +7. 6-5...7-6 (0.5) +8. 6-3...5-2 (0.5) +9. 3-1...2-5 (0.6) +10. 8-6...5-7 (0.7) +11. 1-4...1-6 (0.8) +12. 4-8...6-8 (0.8) +13. 4-1...6-1 (1.1) +14. Forfeit...6-7 (0.6) +15. 7-5...5-8 (1.9) +16. 7-8...2-3 (1.5) +17. 2-4...4-7 (1.5) +18. 1-3...4-2 (1.2) +19. 6-2...7-3 (0.8) +20. 8-3...5-1 (0.8) +21. 7-1...2-6 (0.8) +22. 7-4...8-4 (0.7) +23. 8-5...2-2 (1.0) +24. 2-1...7-2 (0.7) +25. 3-8...3-7 (0.2) +26. 2-8...2-7 (0.2) +27. 1-5...8-7 (3.8) +28. 8-8...1-2 (1.3) +29. 1-1...1-7 (0.1) +30. 1-8...Forfeit +31. 7-7...Forfeit +32. 8-1...8-2 (0.1) + +53-11 + AS Nov 13 1977 15:56:37 + +1. ...3-4 (0.4) +2. 3-3...3-2 (0.5) +3. 3-5...3-6 (0.4) +4. 4-6...6-5 (0.3) +5. 6-4...6-6 (0.4) +6. 5-6...4-7 (0.3) +7. 5-7...7-3 (0.5) +8. 3-7...3-8 (0.6) +9. 7-6...7-5 (0.5) +10. 7-4...8-3 (1.1) +11. 8-4...8-5 (0.9) +12. 8-6...8-7 (0.7) +13. 6-7...4-8 (0.7) +14. 5-8...6-8 (0.4) +15. 2-3...5-3 (0.4) +16. 3-1...6-3 (0.2) +17. 4-3...2-4 (0.4) +18. 6-2...1-3 (0.7) +19. 4-2...6-1 (0.8) +20. 1-5...4-1 (0.5) +21. 5-1...2-1 (0.3) +22. 2-6...1-7 (0.3) +23. 2-2...1-2 (0.2) +24. 7-7...2-5 (0.3) +25. 5-2...7-8 (0.1) +26. 8-8...Forfeit +27. 1-4...1-6 (0.1) +28. 2-8...2-7 (0.1) +29. 1-8...Forfeit +30. 1-1...Forfeit +31. 7-2...7-1 (0.1) +32. 8-2...Forfeit +33. 8-1 +50-14 + MMH Nov 14 1977 17:20:12 + +1. ...6-5 (0.3) +2. 6-6...6-7 (0.6) +3. 5-3...3-3 (0.2) +4. 3-6...3-5 (0.3) +5. 3-4...4-3 (0.3) +6. 5-6...6-4 (0.5) +7. 7-3...6-3 (0.6) +8. 7-4...8-3 (0.6) +9. 6-8...4-6 (0.6) +10. 5-7...8-4 (0.7) +11. 5-2...5-1 (1.2) +12. 6-1...7-1 (1.3) +13. 6-2...4-1 (1.2) +14. 4-2...3-2 (1.0) +15. 2-1...7-5 (0.9) +16. 8-6...7-6 (1.0) +17. 8-7...4-7 (0.6) +18. 5-8...3-8 (0.5) +19. 3-7...2-8 (0.4) +20. 2-3...2-5 (0.6) +21. 1-4...2-6 (0.6) +22. 1-7...2-4 (0.7) +23. 1-3...1-6 (0.6) +24. 1-5...7-7 (1.5) +25. 8-8...1-2 (0.9) +26. 1-1...7-8 (0.9) +27. 3-1...2-2 (1.7) +28. 8-1...4-8 (0.7) +29. 1-8...7-2 (0.1) +30. 8-2...Forfeit +31. 8-5...Forfeit +32. 2-7 +58-6 + RRA Nov 14 1977 18:20:42 + +1. 5-3...6-3 (0.2) +2. 6-4...6-5 (0.2) +3. 6-6...4-3 (0.9) +4. 3-3...5-6 (0.3) +5. 4-6...3-6 (0.5) +6. 3-4...3-5 (0.5) +7. 5-2...3-7 (0.6) +8. 3-8...3-2 (0.8) +9. 3-1...4-2 (0.9) +10. 5-7...4-7 (1.1) +11. 6-7...5-8 (1.3) +12. 4-1...6-8 (1.4) +13. 7-3...2-5 (1.0) +14. 7-6...8-6 (1.5) +15. 1-5...2-3 (1.3) +16. 1-3...6-1 (1.7) +17. 6-2...7-5 (1.7) +18. 7-4...2-4 (1.9) +19. 1-4...7-1 (1.5) +20. 8-5...8-4 (1.5) +21. 8-2...8-3 (0.8) +22. 8-7...4-8 (1.0) +23. 7-8...1-6 (0.5) +24. 1-7...2-7 (0.4) +25. 2-8...1-2 (0.8) +26. 1-1...2-2 (0.2) +27. 2-1...7-7 (0.1) +28. 8-8...Forfeit +29. 5-1...7-2 (0.1) +30. 8-1...Forfeit +31. 2-6...1-8 (0.1) + +52-12 + RRA Nov 14 1977 19:26:06 + +1. 5-3...6-3 (0.2) +2. 6-4...4-3 (0.2) +3. 3-4...6-5 (1.2) +4. 4-6...3-5 (0.4) +5. 3-6...2-3 (0.4) +6. 3-3...2-4 (0.4) +7. 6-6...5-6 (0.5) +8. 1-4...2-5 (0.4) +9. 1-3...2-6 (0.5) +10. 5-7...4-7 (0.6) +11. 1-5...7-6 (0.7) +12. 5-8...3-7 (0.7) +13. 3-8...4-8 (0.6) +14. 1-6...6-8 (0.4) +15. 7-8...3-2 (0.2) +16. 6-7...7-7 (0.1) +17. 5-2...5-1 (0.6) +18. 3-1...2-2 (0.3) +19. 4-2...1-2 (0.4) +20. 1-1...4-1 (0.3) +21. 8-8...2-1 (0.3) +22. 6-1...8-7 (0.2) +23. 2-8...7-5 (0.2) +24. 6-2...7-4 (0.2) +25. 8-6...8-4 (0.3) +26. 8-5...7-3 (0.2) +27. 8-3...7-1 (1.2) +28. 8-1...7-2 (0.3) +29. 8-2...2-7 (0.1) +30. 1-7...1-8 (0.1) + +50-14 + RRA Nov 14 1977 19:34:24 + +1. ...5-6 (0.3) +2. 6-6...7-6 (0.7) +3. 5-3...5-2 (0.7) +4. 6-4...6-3 (0.4) +5. 4-6...3-3 (0.5) +6. 6-5...7-4 (0.4) +7. 4-3...3-5 (0.4) +8. 8-6...6-7 (0.6) +9. 7-3...6-2 (1.0) +10. 7-5...8-5 (1.1) +11. 8-4...3-4 (0.8) +12. 5-8...8-2 (0.8) +13. 5-7...3-6 (0.6) +14. 6-1...6-8 (0.8) +15. 7-8...5-1 (0.5) +16. 4-1...4-2 (0.3) +17. 8-3...8-7 (0.2) +18. 4-8...7-2 (0.8) +19. 3-1...3-2 (0.1) +20. 7-1...7-7 (0.1) +21. 4-7...3-8 (0.2) +22. 8-8...3-7 (0.1) +23. 8-1...Forfeit +24. 2-8...2-7 (0.1) +25. 1-8...1-7 (0.2) +26. 1-6...2-6 (0.1) +27. 1-5...Forfeit +28. 2-5...2-4 (1.3) +29. 1-4...2-3 (0.5) +30. 1-3...1-2 (0.1) +31. 1-1...Forfeit +32. 2-1...2-2 (0.1) + +51-13 + RRA Nov 14 1977 21:05:48 + +1. ...6-5 (0.3) +2. 6-6...6-7 (0.6) +3. 3-5...2-5 (0.6) +4. 6-4...6-3 (0.3) +5. 7-4...7-3 (0.4) +6. 5-6...4-6 (0.6) +7. 6-8...3-3 (0.7) +8. 3-4...4-3 (0.6) +9. 3-6...4-7 (0.7) +10. 3-8...7-6 (0.7) +11. 6-2...8-3 (1.0) +12. 8-6...6-1 (0.7) +13. 1-4...1-6 (0.5) +14. 2-3...2-4 (0.8) +15. 5-3...2-6 (1.4) +16. 7-5...8-5 (1.2) +17. 3-7...1-2 (2.0) +18. 3-2...3-1 (2.4) +19. 8-4...8-7 (2.3) +20. 5-2...4-2 (1.9) +21. 4-1...5-1 (1.6) +22. 7-1...5-7 (1.2) +23. 2-1...4-8 (0.9) +24. 5-8...7-2 (1.3) +25. 8-1...7-8 (1.4) +26. 8-2...1-3 (0.7) +27. 8-8...1-5 (1.1) +28. 7-7...2-7 (0.6) +29. 2-8...2-2 (0.1) +30. 1-8...Forfeit +31. 1-7...Forfeit +32. 1-1 +54-10 + JSK Nov 14 1977 23:19:16 + +1. ...3-4 (0.3) +2. 3-3...3-2 (0.5) +3. 3-5...3-6 (0.4) +4. 4-6...6-5 (0.3) +5. 6-6...6-7 (0.4) +6. 5-3...6-3 (0.4) +7. 6-4...7-4 (0.3) +8. 4-3...6-2 (0.4) +9. 5-2...6-1 (0.5) +10. 4-2...3-1 (0.5) +11. 5-1...4-1 (0.4) +12. 8-4...7-5 (0.4) +13. 5-6...7-6 (0.5) +14. 8-5...3-7 (0.4) +15. 8-6...5-7 (0.2) +16. 6-8...8-3 (0.3) +17. 8-2...7-8 (1.5) +18. 4-8...8-7 (0.3) +19. 8-8...5-8 (0.2) +20. 7-7...3-8 (0.1) +21. 4-7...Forfeit +22. 7-3...Forfeit +23. 2-8...Forfeit +24. 2-6...2-7 (0.7) +25. 2-5...2-4 (0.4) +26. 1-8...Forfeit +27. 1-7...Forfeit +28. 1-4...2-3 (3.6) +29. 1-3...1-5 (1.3) +30. 1-6...7-2 (0.9) +31. 8-1...2-2 (0.1) +32. 7-1...Forfeit +33. 2-1...1-1 (0.1) +34. 1-2 +59-5 + WJL Nov 7 1977 15:08:19 + +1. 5-3...6-3 (0.3) +2. 6-4...6-5 (0.2) +3. 6-6...4-3 (1.0) +4. 3-5...5-6 (0.4) +5. 4-6...4-7 (0.4) +6. 3-6...3-7 (0.4) +7. 3-8...2-5 (0.5) +8. 3-4...2-6 (0.7) +9. 3-3...5-8 (0.7) +10. 1-7...2-4 (0.8) +11. 5-7...6-8 (0.8) +12. 1-4...7-5 (0.9) +13. 6-7...7-8 (0.8) +14. 1-3...3-2 (0.5) +15. 8-5...7-4 (0.7) +16. 8-4...2-3 (0.5) +17. 3-1...8-6 (2.8) +18. 8-7...7-3 (0.7) +19. 7-6...1-6 (1.8) +20. 1-5...4-1 (0.4) +21. 5-1...7-7 (2.0) +22. 1-2...2-2 (0.3) +23. 8-3...4-2 (0.4) +24. 1-1...6-2 (0.3) +25. 2-1...4-8 (0.3) +26. 8-8...8-2 (0.7) +27. 8-1...2-8 (1.4) +28. 5-2...7-2 (0.4) +29. 6-1...7-1 (0.1) +30. 2-7...1-8 (0.1) + +52-12 + RAMESH Nov 7 1977 17:08:22 + +1. 3-5...3-6 (0.2) +2. 3-7...5-6 (0.4) +3. 6-3...5-3 (0.3) +4. 6-4...7-3 (0.9) +5. 6-6...3-4 (0.3) +6. 3-3...6-5 (0.5) +7. 4-6...2-5 (0.5) +8. 1-4...3-8 (0.7) +9. 2-4...7-6 (0.7) +10. 4-7...2-6 (0.5) +11. 4-3...4-2 (0.7) +12. 4-1...3-2 (0.8) +13. 1-7...4-8 (1.0) +14. 8-6...6-7 (1.3) +15. 2-3...1-6 (4.7) +16. 1-5...1-2 (1.0) +17. 5-2...5-1 (4.1) +18. 6-1...2-1 (1.0) +19. 6-2...8-5 (0.8) +20. 8-4...8-2 (0.9) +21. 5-7...7-1 (1.5) +22. 8-1...5-8 (1.6) +23. 8-3...1-3 (0.2) +24. 1-1...Forfeit +25. 7-2...Forfeit +26. 7-4...7-5 (0.1) +27. 8-7...7-7 (0.1) +28. 8-8...7-8 (0.1) +29. 6-8...Forfeit +30. 3-1...Forfeit +31. 2-2...Forfeit +32. 2-7...Forfeit +33. 2-8 +59-4 + RAMESH Nov 7 1977 19:57:50 + +1. ...4-3 (0.3) +2. 3-3...2-3 (0.5) +3. 4-6...4-7 (0.8) +4. 3-7...5-6 (0.3) +5. 4-8...3-6 (0.2) +6. 3-5...2-4 (0.5) +7. 3-4...2-5 (0.4) +8. 6-4...6-5 (0.6) +9. 6-6...6-7 (0.8) +10. 1-5...5-7 (0.7) +11. 5-8...7-3 (1.0) +12. 5-3...6-3 (1.1) +13. 1-4...2-8 (0.9) +14. 6-8...7-5 (0.7) +15. 8-5...7-6 (0.8) +16. 8-6...2-6 (0.6) +17. 1-6...2-7 (2.3) +18. 1-3...7-7 (0.3) +19. 1-7...7-4 (0.3) +20. 7-8...Forfeit +21. 1-2...2-2 (0.1) +22. 8-2...8-3 (0.2) +23. 8-4...Forfeit +24. 5-2...7-2 (0.3) +25. 4-2...6-2 (0.5) +26. 1-1...3-1 (0.6) +27. 3-2...4-1 (6.0) +28. 5-1...2-1 (2.0) +29. 1-8...7-1 (0.9) +30. 3-8...6-1 (0.1) +31. 8-1...Forfeit +32. 8-8...Forfeit +33. 8-7 +54-10 + RAMESH Nov 8 1977 13:03:25 + +1. ...5-6 (0.3) +2. 6-6...7-6 (0.7) +3. 5-3...5-2 (0.6) +4. 6-2...4-3 (0.3) +5. 5-1...6-3 (0.3) +6. 6-4...6-1 (0.5) +7. 7-1...7-5 (0.3) +8. 4-1...7-3 (0.2) +9. 8-4...8-3 (0.2) +10. 8-2...Forfeit +11. 7-4...7-2 (0.1) +12. 6-5...4-2 (0.1) +13. 8-1...8-5 (0.1) +14. 8-6...Forfeit +15. 8-7...7-7 (0.1) +16. 3-1...3-2 (0.1) +17. 2-1...3-3 (0.2) +18. 3-4...2-4 (0.2) +19. 1-4...3-5 (0.2) +20. 2-3...1-5 (0.4) +21. 1-6...1-3 (0.3) +22. 1-2...2-2 (0.1) +23. 3-6...4-6 (0.2) +24. 1-1...3-7 (0.2) +25. 2-5...2-6 (0.1) +26. 1-7...Forfeit +27. 8-8...5-7 (8.0) +28. 5-8...7-8 (4.7) +29. 6-8...4-8 (0.1) +30. 6-7...Forfeit +31. 3-8...2-7 (0.1) +32. 1-8...2-8 (0.1) +33. 4-7 +60-4 + RAMESH Nov 8 1977 16:39:28 + +1. ...6-5 (0.3) +2. 6-6...6-7 (0.7) +3. 3-5...2-5 (0.6) +4. 2-6...3-4 (0.3) +5. 1-5...3-6 (0.3) +6. 4-6...1-6 (0.5) +7. 1-7...5-7 (0.2) +8. 3-3...4-7 (0.3) +9. 5-6...2-3 (0.4) +10. 4-8...2-4 (0.6) +11. 1-4...3-8 (0.4) +12. 2-8...3-7 (0.3) +13. 1-3...4-2 (0.3) +14. 5-8...2-7 (2.0) +15. 6-8...2-2 (0.1) +16. 5-1...4-3 (0.2) +17. 5-2...3-2 (0.3) +18. 7-8...4-1 (0.4) +19. 1-8...6-1 (0.3) +20. 1-2...7-7 (0.1) +21. 6-4...5-3 (0.4) +22. 8-8...8-7 (0.3) +23. 1-1...2-1 (0.3) +24. 3-1...6-2 (0.2) +25. 8-6...7-6 (0.2) +26. 8-5...6-3 (0.2) +27. 7-1...7-2 (0.1) +28. 7-5...7-3 (0.6) +29. 8-1...8-2 (0.2) +30. 8-3...7-4 (0.1) +31. 8-4 +51-13 + RAMESH Nov 8 1977 19:16:28 + +1. ...3-4 (0.3) +2. 3-3...3-2 (0.5) +3. 6-4...7-4 (0.9) +4. 7-3...6-5 (0.3) +5. 8-4...6-3 (0.3) +6. 5-3...8-3 (0.5) +7. 8-2...4-2 (0.3) +8. 6-6...5-2 (0.3) +9. 4-3...5-6 (0.4) +10. 8-5...7-6 (0.4) +11. 5-1...6-1 (0.4) +12. 7-1...6-2 (0.2) +13. 4-1...7-2 (0.1) +14. 3-5...7-5 (0.2) +15. 8-6...2-5 (0.2) +16. 3-1...Forfeit +17. 1-6...2-3 (0.3) +18. 8-7...1-5 (0.2) +19. 1-4...1-3 (0.3) +20. 1-2...7-7 (1.3) +21. 8-1...2-1 (0.1) +22. 1-1...Forfeit +23. 2-2...Forfeit +24. 2-4...Forfeit +25. 2-6...Forfeit +26. 8-8...4-6 (0.2) +27. 3-6...6-7 (7.3) +28. 5-8...5-7 (3.4) +29. 4-8...4-7 (0.9) +30. 3-8...6-8 (1.1) +31. 7-8...3-7 (0.4) +32. 2-8...1-7 (0.1) +33. 1-8...2-7 (0.1) + +52-12 + RAMESH Nov 8 1977 19:28:03 + +1. ...6-5 (0.3) +2. 6-6...6-7 (0.7) +3. 3-5...2-5 (0.6) +4. 2-6...3-4 (0.3) +5. 1-5...3-6 (0.3) +6. 4-6...1-6 (0.5) +7. 1-7...5-7 (0.3) +8. 1-4...3-7 (0.2) +9. 5-6...4-7 (0.2) +10. 3-8...2-7 (0.2) +11. 4-8...2-4 (0.2) +12. 5-8...2-8 (0.1) +13. 1-8...Forfeit +14. 6-3...6-4 (0.2) +15. 6-8...7-3 (0.3) +16. 8-2...7-4 (0.3) +17. 5-3...4-3 (0.5) +18. 1-3...8-3 (0.5) +19. 8-4...8-5 (0.2) +20. 8-6...7-5 (0.2) +21. 7-6...8-7 (1.2) +22. 8-8...7-8 (0.1) +23. 7-7...Forfeit +24. 3-3...2-3 (0.2) +25. 1-2...6-2 (0.2) +26. 6-1...7-2 (1.8) +27. 8-1...7-1 (4.6) +28. Forfeit...4-2 (1.7) +29. 3-1...5-2 (0.9) +30. 4-1...5-1 (0.3) +31. Forfeit...3-2 (0.1) +32. 2-2...2-1 (0.1) +33. 1-1 +57-7 + WJL Nov 9 1977 16:22:47 + +1. ...6-5 (0.3) +2. 6-6...6-7 (0.7) +3. 3-5...2-5 (0.6) +4. 2-6...3-4 (0.3) +5. 1-5...3-6 (0.3) +6. 4-6...1-6 (0.5) +7. 1-7...4-7 (0.2) +8. 5-6...5-7 (0.2) +9. 1-4...3-7 (0.2) +10. 5-8...4-8 (0.3) +11. 3-8...2-7 (0.1) +12. 4-3...2-3 (0.3) +13. 2-4...3-3 (0.3) +14. 1-3...3-2 (0.3) +15. 3-1...2-8 (0.3) +16. 1-8...2-2 (0.2) +17. 6-4...1-2 (0.3) +18. 6-8...2-1 (0.5) +19. 1-1...5-3 (0.3) +20. 4-1...7-3 (0.2) +21. 4-2...5-2 (0.3) +22. 5-1...7-8 (3.0) +23. 8-8...6-1 (0.2) +24. 7-1...6-3 (0.2) +25. 6-2...7-4 (0.2) +26. 8-2...8-3 (0.2) +27. 8-4...8-5 (1.6) +28. 8-6...7-5 (0.5) +29. 7-7...7-2 (0.1) +30. 8-1...7-6 (0.1) +31. 8-7 +55-9 + RAMESH Nov 10 1977 11:46:01 + +1. ...3-4 (0.3) +2. 3-3...3-2 (0.5) +3. 6-4...7-4 (0.9) +4. 7-3...6-5 (0.3) +5. 8-4...6-3 (0.3) +6. 5-3...8-3 (0.5) +7. 8-2...5-2 (0.2) +8. 4-3...6-2 (0.2) +9. 5-1...4-2 (0.3) +10. 6-6...5-6 (0.4) +11. 8-5...6-1 (0.5) +12. 7-1...6-7 (0.2) +13. 4-1...7-2 (0.1) +14. 6-8...7-5 (0.2) +15. 8-1...7-6 (0.2) +16. 3-6...5-8 (0.3) +17. 4-8...4-6 (0.2) +18. 8-6...5-7 (0.3) +19. 4-7...3-5 (0.3) +20. 3-7...2-6 (0.3) +21. 1-6...3-8 (0.3) +22. 2-8...7-7 (0.2) +23. 3-1...2-2 (0.3) +24. 2-3...2-1 (0.3) +25. 1-1...2-4 (0.4) +26. 1-4...1-2 (0.3) +27. 1-3...2-7 (2.5) +28. 8-7...2-5 (1.1) +29. 1-5...Forfeit +30. 1-8...1-7 (0.1) +31. 7-8...8-8 (0.1) + +51-13 + WJL Nov 10 1977 15:31:23 + +1. ...4-3 (0.3) +2. 3-3...2-3 (0.5) +3. 4-6...4-7 (0.8) +4. 3-5...3-6 (0.4) +5. 3-7...2-5 (0.4) +6. 4-8...5-7 (0.5) +7. 3-4...2-4 (0.8) +8. 5-6...6-7 (0.7) +9. 1-5...3-8 (0.6) +10. 2-8...6-5 (0.5) +11. 5-8...2-6 (0.3) +12. 1-4...1-6 (0.2) +13. 1-7...2-7 (0.1) +14. 6-6...6-8 (0.2) +15. 7-8...7-6 (0.2) +16. 1-8...7-7 (0.1) +17. 6-4...1-3 (0.3) +18. 8-8...8-7 (0.3) +19. 8-6...5-3 (0.2) +20. 1-2...8-5 (0.2) +21. 8-4...7-3 (0.2) +22. 7-5...7-4 (0.1) +23. 8-3...2-2 (0.1) +24. 8-2...6-3 (0.1) +25. 6-2...5-2 (0.1) +26. 1-1...2-1 (0.2) +27. 3-1...7-1 (1.3) +28. 3-2...4-2 (0.3) +29. 4-1...5-1 (0.1) +30. 6-1...7-2 (0.1) +31. 8-1 +56-8 + DJE Nov 11 1977 09:08:55 + +1. ...4-3 (0.3) +2. 3-5...3-6 (0.8) +3. 5-3...6-3 (0.3) +4. 4-6...3-4 (0.6) +5. 3-3...4-7 (0.4) +6. 2-5...2-6 (0.6) +7. 4-8...5-7 (0.8) +8. 6-6...6-8 (0.8) +9. 4-2...4-1 (1.2) +10. 5-2...2-3 (1.5) +11. 2-4...1-6 (1.7) +12. 1-4...6-4 (1.1) +13. 5-6...5-1 (1.8) +14. 6-5...3-7 (1.0) +15. 3-8...6-7 (0.9) +16. 7-5...7-6 (1.3) +17. 2-8...1-5 (1.4) +18. 8-6...1-3 (0.8) +19. 7-3...5-8 (0.6) +20. 7-8...8-4 (0.7) +21. 3-2...7-4 (1.1) +22. 8-5...8-7 (1.0) +23. 3-1...2-1 (0.4) +24. 6-2...6-1 (0.4) +25. 8-3...8-2 (0.2) +26. 7-2...2-7 (0.4) +27. 1-8...1-7 (1.1) +28. 2-2...1-1 (0.5) +29. 1-2...7-1 (0.1) +30. 8-1...Forfeit +31. 8-8...Forfeit +32. 7-7 +51-13 + RAMESH Nov 11 1977 10:53:59 + +1. ...3-4 (0.3) +2. 3-3...3-2 (0.5) +3. 6-4...7-4 (0.9) +4. 7-3...6-5 (0.3) +5. 8-4...6-3 (0.3) +6. 5-3...6-2 (0.5) +7. 5-1...6-1 (0.4) +8. 7-1...8-3 (0.3) +9. 8-2...Forfeit +10. 4-3...5-2 (0.2) +11. 6-6...7-6 (0.3) +12. 4-1...7-5 (0.3) +13. 8-5...5-6 (0.2) +14. 4-6...4-7 (0.2) +15. 8-6...7-2 (0.1) +16. 4-2...3-1 (0.2) +17. 2-1...Forfeit +18. 8-7...7-7 (1.5) +19. 8-1...2-2 (0.1) +20. 1-1...2-3 (0.3) +21. 1-4...1-3 (0.3) +22. 1-2...3-5 (0.1) +23. 8-8...5-7 (0.2) +24. 5-8...7-8 (0.3) +25. 6-8...4-8 (0.1) +26. 6-7...Forfeit +27. 3-8...3-7 (0.1) +28. 2-8...2-7 (0.1) +29. 1-7...Forfeit +30. 2-4...2-5 (0.4) +31. 3-6...2-6 (0.2) +32. 1-6...1-5 (0.1) +33. Forfeit...1-8 (0.1) + +51-13 + AS Nov 11 1977 12:22:07 + +1. ...3-4 (0.4) +2. 3-3...3-2 (0.5) +3. 3-5...3-6 (0.4) +4. 4-6...6-5 (0.3) +5. 6-4...6-6 (0.4) +6. 5-6...4-7 (0.4) +7. 5-7...7-3 (0.5) +8. 7-4...8-3 (0.8) +9. 2-4...5-3 (1.3) +10. 5-2...3-7 (1.1) +11. 7-5...4-3 (1.1) +12. 8-4...8-5 (1.3) +13. 3-8...6-3 (2.2) +14. 4-2...2-3 (1.8) +15. 6-2...7-6 (2.3) +16. 3-1...1-4 (2.0) +17. 8-7...6-7 (2.2) +18. 6-8...2-5 (2.5) +19. 2-6...4-8 (2.3) +20. 5-8...6-1 (1.6) +21. 5-1...1-7 (1.2) +22. 1-2...4-1 (0.7) +23. 7-1...2-7 (0.4) +24. 2-1...2-8 (0.4) +25. 1-8...8-6 (0.3) +26. 8-2...2-2 (0.7) +27. 1-1...7-2 (1.4) +28. 8-1...7-7 (0.5) +29. 1-3...1-5 (0.1) +30. 1-6...Forfeit +31. 7-8...8-8 (0.1) + +52-12 + RAMESH Nov 12 1977 11:20:04 + +1. ...4-3 (0.3) +2. 3-3...2-3 (0.5) +3. 4-6...4-7 (0.8) +4. 3-7...5-6 (0.3) +5. 4-8...3-6 (0.3) +6. 3-5...2-4 (0.5) +7. 3-4...3-8 (0.4) +8. 2-8...Forfeit +9. 6-4...6-5 (0.3) +10. 6-6...5-7 (0.4) +11. 1-4...6-3 (0.7) +12. 2-6...7-6 (0.7) +13. 8-6...2-5 (0.7) +14. 5-8...5-3 (0.7) +15. 7-5...6-8 (0.5) +16. 7-8...1-6 (0.8) +17. 1-3...1-5 (0.5) +18. 1-7...6-7 (0.3) +19. 1-2...8-4 (0.3) +20. 7-4...8-5 (0.2) +21. 8-3...7-3 (0.2) +22. 8-2...7-2 (1.5) +23. 8-1...7-1 (0.2) +24. 6-1...5-2 (0.2) +25. 6-2...4-2 (0.2) +26. 3-1...3-2 (0.3) +27. 2-1...2-7 (2.1) +28. 1-8...2-2 (0.6) +29. 1-1...8-7 (0.4) +30. 8-8...Forfeit +31. 7-7...Forfeit +32. 4-1...5-1 (0.1) + +52-12 + RSP Nov 12 1977 12:38:39 + +1. ...4-3 (0.3) +2. 3-3...2-3 (0.5) +3. 4-6...4-7 (0.8) +4. 3-7...6-6 (0.3) +5. 6-4...6-5 (0.3) +6. 4-8...7-4 (0.3) +7. 7-3...6-3 (0.2) +8. 5-3...8-3 (0.5) +9. 3-4...2-4 (0.4) +10. 3-5...5-6 (0.4) +11. 1-3...2-6 (0.6) +12. 4-2...3-6 (1.2) +13. 7-5...5-2 (1.5) +14. 2-5...1-6 (1.9) +15. 1-5...4-1 (1.7) +16. 1-2...1-4 (1.8) +17. 1-7...3-2 (1.3) +18. 6-1...8-6 (1.5) +19. 6-2...7-6 (1.3) +20. 2-1...3-8 (1.1) +21. 2-8...5-7 (0.9) +22. 5-8...6-7 (1.1) +23. 6-8...3-1 (1.0) +24. 5-1...7-2 (1.0) +25. 7-1...2-7 (0.2) +26. 8-5...8-4 (0.3) +27. 1-8...7-8 (1.8) +28. 8-8...8-7 (0.6) +29. 7-7...Forfeit +30. 2-2...Forfeit +31. 8-1...Forfeit +32. 8-2 +55-8 + RSP Nov 12 1977 15:15:33 + +1. 3-5...3-6 (0.2) +2. 4-6...5-6 (0.2) +3. 6-5...3-4 (1.0) +4. 5-3...6-4 (0.4) +5. 6-3...7-5 (0.4) +6. 6-6...7-6 (0.5) +7. 3-7...4-7 (0.5) +8. 8-5...7-3 (0.6) +9. 3-8...6-7 (1.0) +10. 6-8...7-4 (0.9) +11. 5-7...4-2 (0.8) +12. 8-6...6-2 (0.8) +13. 8-4...4-8 (0.7) +14. 5-8...4-3 (0.5) +15. 6-1...5-1 (0.7) +16. 4-1...5-2 (0.6) +17. 8-3...3-1 (0.3) +18. 2-1...8-7 (1.3) +19. 8-8...7-8 (0.1) +20. 7-1...7-2 (0.1) +21. 8-2...2-7 (0.1) +22. 7-7...2-8 (0.1) +23. 1-8...Forfeit +24. 1-7...Forfeit +25. 8-1...2-6 (0.1) +26. 1-6...Forfeit +27. 3-2...Forfeit +28. 3-3...2-5 (0.3) +29. 1-5 +57-0 + RSP Nov 12 1977 17:58:27 + +1. ...5-6 (0.3) +2. 6-6...7-6 (0.7) +3. 5-3...5-2 (0.6) +4. 6-2...4-3 (0.3) +5. 5-1...6-3 (0.3) +6. 6-4...6-1 (0.5) +7. 7-1...7-4 (0.3) +8. 6-5...7-3 (0.2) +9. 8-4...7-5 (0.3) +10. 4-6...8-3 (0.4) +11. 8-2...4-7 (0.2) +12. 8-5...8-6 (0.2) +13. 8-7...7-2 (0.1) +14. 4-1...4-2 (0.1) +15. 8-1...7-7 (0.1) +16. 8-8...5-7 (0.2) +17. 3-1...7-8 (0.2) +18. 6-8...3-2 (0.1) +19. 6-7...Forfeit +20. 5-8...Forfeit +21. 2-3...2-2 (0.1) +22. 1-2...2-1 (0.1) +23. 1-1...1-4 (0.1) +24. 3-3...3-4 (0.1) +25. 1-3...Forfeit +26. 2-4...Forfeit +27. 1-5...Forfeit +28. 4-8...3-7 (0.6) +29. 2-8 +55-0 + RSP Nov 13 1977 20:27:44 + +1. ...3-4 (0.3) +2. 3-3...3-2 (0.5) +3. 6-4...7-4 (0.9) +4. 5-3...6-3 (0.4) +5. 7-3...5-2 (0.4) +6. 8-4...7-5 (0.5) +7. 4-3...4-2 (0.8) +8. 6-5...7-6 (0.6) +9. 5-1...6-2 (0.6) +10. 4-1...8-3 (0.6) +11. 8-2...6-1 (0.4) +12. 7-1...5-6 (0.2) +13. 3-1...7-2 (0.1) +14. 8-5...Forfeit +15. 8-1...Forfeit +16. 8-6...Forfeit +17. 6-6...6-7 (0.2) +18. 6-8...7-7 (0.2) +19. 2-1...5-7 (0.3) +20. 8-7...Forfeit +21. 5-8...4-6 (0.3) +22. 3-6...4-8 (0.3) +23. 3-8...3-5 (0.2) +24. 4-7...7-8 (0.2) +25. 8-8...2-6 (0.1) +26. 1-6...3-7 (0.1) +27. 2-8...1-7 (3.1) +28. 1-8...2-7 (0.1) +29. 1-5...2-5 (0.1) +30. 1-4...2-4 (0.1) +31. 1-3...2-3 (0.1) +32. 2-2...1-2 (0.1) +33. 1-1 +57-7 + WJL Nov 14 1977 15:14:47 + +1. ...4-3 (0.3) +2. 3-5...6-6 (0.8) +3. 6-3...4-6 (0.9) +4. 5-6...6-7 (1.1) +5. 3-3...6-4 (0.4) +6. 5-3...3-4 (0.4) +7. 3-6...5-2 (0.5) +8. 6-5...7-3 (0.8) +9. 8-3...7-4 (0.9) +10. 5-1...6-2 (0.8) +11. 5-7...3-2 (1.1) +12. 7-8...5-8 (1.2) +13. 6-1...7-5 (1.2) +14. 8-4...7-6 (1.2) +15. 8-5...2-6 (0.6) +16. 4-2...4-1 (0.5) +17. 3-1...7-2 (0.3) +18. 7-1...Forfeit +19. 2-1...2-2 (0.1) +20. 1-1...1-2 (0.3) +21. 1-3...2-3 (0.2) +22. 1-4...Forfeit +23. 2-4...2-5 (0.1) +24. 1-6...1-5 (0.2) +25. 8-1...1-7 (0.1) +26. 8-2...Forfeit +27. 1-8...Forfeit +28. 2-7...3-7 (0.1) +29. 2-8...3-8 (0.1) +30. 4-8...6-8 (0.6) +31. 4-7...8-8 (0.2) +32. 8-6...7-7 (0.1) +33. 8-7 +56-8 + RAMESH Nov 14 1977 16:28:56 + +1. ...5-6 (0.3) +2. 6-6...7-6 (0.7) +3. 5-3...5-2 (0.6) +4. 6-4...6-3 (0.4) +5. 6-2...7-4 (0.4) +6. 5-1...3-4 (0.5) +7. 8-5...6-1 (0.4) +8. 7-1...4-3 (0.3) +9. 3-5...3-3 (0.4) +10. 3-2...4-2 (0.5) +11. 7-3...8-4 (0.5) +12. 8-3...4-1 (0.5) +13. 3-1...2-6 (0.4) +14. 6-5...7-5 (0.4) +15. 8-6...2-3 (0.4) +16. 1-3...7-2 (2.0) +17. 8-7...2-2 (0.2) +18. 8-2...2-4 (0.3) +19. 2-1...7-7 (0.1) +20. 1-4...1-5 (0.3) +21. 1-6...2-5 (0.2) +22. 8-1...1-2 (0.1) +23. 1-1...Forfeit +24. 3-7...2-7 (0.1) +25. 2-8...1-7 (0.1) +26. 1-8...4-8 (0.1) +27. 8-8...7-8 (4.0) +28. 6-8...6-7 (1.1) +29. 5-8...4-6 (0.1) +30. 3-8...Forfeit +31. 3-6...4-7 (0.1) +32. 5-7 +53-11 + RSP Nov 14 1977 23:49:19 + +1. 3-5...3-6 (0.2) +2. 4-6...3-4 (0.2) +3. 4-3...5-6 (1.3) +4. 6-4...5-3 (0.4) +5. 6-3...6-2 (0.4) +6. 6-1...7-5 (0.5) +7. 6-5...7-4 (0.4) +8. 6-6...7-3 (0.6) +9. 3-3...4-2 (0.7) +10. 5-1...3-1 (0.7) +11. 5-2...6-7 (0.8) +12. 8-3...3-2 (0.6) +13. 8-4...7-2 (0.2) +14. 7-1...Forfeit +15. 8-5...8-6 (0.2) +16. 8-7...7-6 (0.1) +17. 6-8...5-7 (0.3) +18. 5-8...4-8 (0.3) +19. 3-8...4-7 (0.2) +20. 3-7...7-8 (1.2) +21. 8-8...2-7 (1.5) +22. 2-8...Forfeit +23. 8-1...8-2 (0.1) +24. 7-7...Forfeit +25. 1-8...2-6 (0.1) +26. 1-5...1-6 (0.2) +27. 1-7...2-5 (3.3) +28. 1-4...Forfeit +29. 4-1...Forfeit +30. 2-4...2-2 (0.4) +31. 1-1...1-2 (0.2) +32. 2-1...2-3 (0.1) +33. 1-3 +59-5 +  \ No newline at end of file diff --git a/src/as/o/o8.rel b/src/as/o/o8.rel new file mode 100644 index 00000000..d06255e2 Binary files /dev/null and b/src/as/o/o8.rel differ diff --git a/src/as/o/ob.h b/src/as/o/ob.h new file mode 100644 index 00000000..4cd96bae --- /dev/null +++ b/src/as/o/ob.h @@ -0,0 +1,68 @@ +#define MAXEXIT 12 +#define MAXNODE 2200 +#define NOT_EVAL -1000 +#include "o.h" + +typedef int rotation; + +struct _exit { + int data; + + /* encoded as follows: + + bit 23:17 - position + bit 16 - goodness flag + bit 15:4 - next bnode (number) + bit 3:0 - rotation factor for viewing next node + */ + + }; + +#define getpos(e) (((e)->data>>17) & 0177) +#define getnext(e) (((e)->data>>4) & 07777) +#define getgood(e) (((e)->data>>16) & 01) +#define getrot(e) ((e)->data & 017) + +#define consexit(e,pos,good,rot,next)((e)->data=((((((pos<<1)|good)<<12)|next)<<4)|rot)) +#define setgood(e) ((e)->data =| (1<<16)) + +struct _bnode { + int nodenum; /* node number - for identification */ + int nmoves; /* number of exiting moves */ + +# ifdef GENBOOK + int eval; /* evaluation (NOT_EVAL if not evalled) */ + int depth; /* depth of node in search tree */ + board b; /* current position */ + color c; /* side to move */ +# endif + + struct _exit moves[MAXEXIT]; /* the exits */ + /* must be last */ + }; + +typedef struct _exit exit; +typedef struct _bnode bnode; + +# define R0 0 +# define R90 1 +# define R180 2 +# define R270 3 +# define H0 4 +# define H90 5 +# define H180 6 +# define H270 7 +# define V0 8 +# define V90 9 +# define V180 10 +# define V270 11 + +extern bnode *bnlist[MAXNODE]; +extern bnode *curbn; +extern bnode *bnfind(); +extern rotation currot; +extern int nnodes; +extern position movlst[]; + +# define forallpos(p,pp) for(pp=movlst;(p = *pp++)>=0;) + \ No newline at end of file diff --git a/src/as/o/ob1.c b/src/as/o/ob1.c new file mode 100644 index 00000000..0d675c5b --- /dev/null +++ b/src/as/o/ob1.c @@ -0,0 +1,613 @@ +#define GENBOOK 1 +#include "ob.h" + +/********************************************************************** + + bk_read (fd) read book from file + bk_write (fd) write book to file + bk_parse (fd) read book in readable form + bk_print (fd) print book in readable form + bk_clear (c) reset to beginning of game + bk_move (p) make move at p + bk_lookup (t, tp) -> k return current book move(s) + + bk_grow (n) grow n nodes + bn_grow (b) grow successors to node b + +**********************************************************************/ + +bnode *bnlist[MAXNODE]; +int nnodes 0; +extern bnode *curbn; +extern rotation currot; +int book[]; + +bnode *bnfind(), *extrace(); +position rotate(); + +position movlst[] { + pos(3,3), pos(3,4), pos(4,3), pos(4,4), + pos(2,3), pos(2,4), pos(3,2), pos(3,5), + pos(4,2), pos(4,5), pos(5,3), pos(5,4), + pos(7,3), pos(7,4), pos(7,5), pos(7,6), + pos(2,2), pos(2,5), pos(5,2), pos(5,5), + pos(0,0), pos(0,7), pos(7,0), pos(7,7), + pos(0,1), pos(0,2), pos(0,3), pos(0,4), + pos(0,5), pos(0,6), pos(1,0), pos(1,7), + pos(2,0), pos(2,7), pos(3,0), pos(3,7), + pos(4,0), pos(4,7), pos(5,0), pos(5,7), + pos(6,0), pos(6,7), pos(7,1), pos(7,2), + pos(1,2), pos(1,3), pos(1,4), pos(1,5), + pos(2,1), pos(2,6), pos(3,1), pos(3,6), + pos(4,1), pos(4,6), pos(5,1), pos(5,6), + pos(6,2), pos(6,3), pos(6,4), pos(6,5), + pos(1,1), pos(1,6), pos(6,1), pos(6,6), + -1 + }; + +bnode *bnalloc () + + {return (calloc (sizeof (*curbn)/sizeof (0)));} + +bnode *bntrim (bn) + bnode *bn; + + {bnode *nn; + int save, sz, *d, *s; + if (bn->nmoves == MAXEXIT) return (bn); + sz = sizeof (bn->moves[0]); + save = sz * (MAXEXIT - bn->nmoves); + sz = ((sizeof (*curbn) - save)/sizeof(0)); + nn = calloc (sz); + s = bn; + d = nn; + while (--sz >= 0) *d++ = *s++; + bnlist[nn->nodenum] = nn; + cfree (bn); + return (nn); + } + +bnode *bnexpand (bn) + bnode *bn; + + {bnode *nn; + int save, sz, *d, *s; + if (bn->nmoves == MAXEXIT) return (bn); + sz = sizeof (bn->moves[0]); + save = sz * (MAXEXIT - bn->nmoves); + sz = ((sizeof (*curbn) - save)/sizeof(0)); + nn = calloc (sizeof (*curbn)/sizeof(0)); + s = bn; + d = nn; + while (--sz >= 0) *d++ = *s++; + bnlist[nn->nodenum] = nn; + cfree (bn); + return (nn); + } + +bnode *bnuniq (b, pr) + bnode *b; + rotation *pr; + + {int i; + *pr = R0; + for (i=1;i<=nnodes;++i) + {bnode *ob; + ob = bnlist[i]; + if (ob == b) return (ob); + if (ob) + {rotation r; + if ((r = bncompare (b, ob)) >= 0) + {*pr = r; + cfree (b); + return (ob); + } + } + } + b->nodenum = ++nnodes; + bnlist[nnodes] = b; + return (bntrim (b)); + } + +rotation bncompare (b1, b2) + bnode *b1, *b2; + + {rotation r; + int *bd1, *bd2; + if (b1->c != b2->c) return (-1); + bd1 = b1->b; + bd2 = b2->b; + if (bscore (bd1, WHITE) != bscore (bd2, WHITE)) return (-1); + if (bscore (bd1, BLACK) != bscore (bd2, BLACK)) return (-1); + for (r=0;r<12;++r) if (brcomp (bd1, bd2, r)) return (r); + return (-1); + } + +int brcomp (b1, b2, r) + board b1, b2; + rotation r; + + {position p, *pp; + forallpos (p, pp) + if (b1[p] != b2[rotate(p,r)]) return (FALSE); + return (TRUE); + } + +# ifdef GENBOOK + +/********************************************************************** + + bk_grow + +**********************************************************************/ + +bk_grow (n) + + {int depth, count; + if (nnodes == 0) + {int i; + bnode *b; + b = bnalloc (); + clrbrd (b->b); + b->c = BLACK; + b->nmoves = 0; + b->depth = 1; + b->eval = NOT_EVAL; + bnuniq (b, &i); + } + depth = 1; + count = 0; + show (count); + while (TRUE) + {int i; + bnode *b; + for (i=1;i<=nnodes;++i) + {b = bnlist[i]; + if (b && b->depth == depth && b->nmoves == 0) + {bn_grow (b); + ++count; + show (count); + if (count >= n) return; + if ((count%10)==0) savbook (); + } + } + if (count == 0 && depth == 12) return; + ++depth; + } + } + +bk_eval (n) + + {int i, count; + + count = 0; + show (count); + for (i=1;i<=nnodes;++i) + {bnode *b; + b = bnfind (i); + if (b && b->eval == NOT_EVAL && b->nmoves==0) + {b->eval = geval (b->b, b->c); + ++count; + show (count); + if (count >= n) return; + if ((count%10)==0) savbook (); + } + } + } + +bk_clean () + + {int i; + + for (i=1;i<=nnodes;++i) + {bnode *b; + b = bnfind (i); + if (b) b->eval = NOT_EVAL; + } + } + +# endif + +static int wrcount; + +bk_write (fd) + int fd; + + {int i, maxn, o[MAXNODE]; + maxn = 0; + wrcount = 1; + cprint (fd, "int book[] {0, "); + for (i=1;i<=nnodes;++i) + {bnode *bn; + o[i] = wrcount; + bn = bnfind (i); + if (bn && bn->nmoves>0) + {bn_write (bn, fd); + maxn = i; + } + } + cprint (fd, "};\nint *bnlist[] {0, "); + for (i=1;i<=maxn;++i) + {bnode *bn; + bn = bnfind (i); + if (bn && bn->nmoves>0) + cprint (fd, "%d", o[i]); + else cprint (fd, "0"); + if (i < maxn) + {if ((i%10) == 0) cprint (fd, ",\n"); + else cprint (fd, ", "); + } + } + cprint (fd, "};\n"); + cprint (fd, "int nnodes {%d};\n", maxn); + } + +bn_write (bn, fd) + bnode *bn; + + {int i; + + cprint (fd, "%d, %d", bn->nodenum, bn->nmoves); + wrcount =+ 2; + for (i=0;inmoves;++i) + {exit *e, temp; + bnode *b; + int next, sz, *p; + e = &bn->moves[i]; + next = getnext(e); + b = bnfind (next); + if (!b || b->nmoves == 0) next = 0; + {position ep; + rotation er; + int eg; + ep = getpos (e); + er = getrot (e); + eg = getgood (e); + consexit (&temp, ep, eg, er, next); + } + p = &temp; + sz = sizeof(temp)/sizeof(0); + while (--sz >= 0) + {cprint (fd, ", %d", *p++); + ++wrcount; + } + } + cprint (fd, ",\n"); + } + +bk_print (fd) + int fd; + + {int i; + for (i=1;i<=nnodes;++i) + {bnode *bn; + bn = bnfind (i); + if (bn) bn_print (bn, fd); + } + } + +bn_print (b, fd) + bnode *b; + + {int j, nmoves; +#ifdef GENBOOK + if (b->depth==0) return; +#endif + cprint (fd, "%3d: ", b->nodenum); + j = b->eval; + if (j != NOT_EVAL) + cprint (fd, "[%d] ", j); + nmoves = b->nmoves; + for (j=0;jmoves[j]; + cprint (fd, " "); + prpos (getpos(e), fd); + if (getrot(e) != R0) + {cprint (fd, " "); + prrot (getrot(e), fd); + } + cprint (fd, " %d", getnext(e)); + if (getgood(e)) cprint (fd, "g"); + if (jnodenum = bnum; + if (bnum > nnodes) nnodes = bnum; + bnlist[bnum] = b; + b->nmoves = 0; + b->eval = NOT_EVAL; +# ifdef GENBOOK + b->depth = 0; + b->c = EMPTY; +# endif + if (scanc (fd, ':') == FALSE) return (FALSE); + if (scanc (fd, '[')) + {b->eval = scani (fd); + scanc (fd, ']'); + } + i = 0; + while (bkpex (fd, b, i)) ++i; + bntrim (b); + return (TRUE); + } + +/********************************************************************** + + parse exit + +**********************************************************************/ + +int bkpex (fd, b, i) + int fd; + bnode *b; + int i; + + {position p; + rotation r; + int bnnum; + + p = scanpos (fd); + if (p>=0) + {r = scanrot (fd); + bnnum = scani (fd); + if (bnnum>=0) + {int good; + good = scanc (fd, 'g'); + consexit (&b->moves[i],p,good,r,bnnum); + ++b->nmoves; + if (scanc (fd, ',')) return (TRUE); + } + } + skipc (fd, ';'); + return (FALSE); + } + +/********************************************************************** + + skipc - skip to a character + +**********************************************************************/ + +skipc (fd, match) + int fd; + char match; + + {int c; + while (TRUE) + {c = cgetc (fd); + if (c <= 0 && ceof (fd)) return; + if (c == match) return; + } + } + +/********************************************************************** + + scanc - scan for a character + +**********************************************************************/ + +int scanc (fd, match) + int fd; + char match; + + {int c; + c = skipb (fd); + if (c==match) return (TRUE); + ungetc (c, fd); + return (FALSE); + } + +/********************************************************************** + + skipb - skip blanks + +**********************************************************************/ + +int skipb (fd) + + {int c; + while (TRUE) + {c = cgetc (fd); + if (c<=0 && ceof(fd)) return (0); + if (c==' ' || c=='\t' || c=='\n') continue; + return (c); + } + } + +/********************************************************************** + + skipw - skip a word and its terminator + +**********************************************************************/ + +skipw (fd) + + {int c; + while (TRUE) + {c = cgetc (fd); + if (c<=0 && ceof(fd)) return; + if (c==' ' || c=='\t' || c=='\n') return; + } + } + +/********************************************************************** + + scani - read an integer + +**********************************************************************/ + +int scani (fd) + int fd; + + {int c, sum, negflag; + sum = -1; + + negflag = FALSE; + c = skipb (fd); + if (c == '-') + {negflag = TRUE; + c = cgetc (fd); + } + if (c >= '0' && c <= '9') + {sum = 0; + while (c >= '0' && c <= '9') + {sum = (sum * 10) + c-'0'; + c = cgetc (fd); + } + if (negflag) sum = -sum; + } + if (c > 0) ungetc (c, fd); + return (sum); + } + +position scanpos (fd) + int fd; + + {int x, y; + if (scanc (fd, 'f')) + {skipw (fd); + return (0); + } + x = scani (fd); + if (x<0) return (-1); + if (scanc (fd, '-') == FALSE) return (-1); + y = scani (fd); + if (y<0) return (-1); + return (pos (x-1, y-1)); + } + +prpos (p, fd) + position p; + + {if (p==0) cprint (fd, "forfeit"); + else cprint (fd, "%d-%d",posx(p)+1,posy(p)+1); + } + +rotation scanrot (fd) + int fd; + + {if (scanc (fd, 'r')) + return (scani (fd)/90); + if (scanc (fd, 'h')) + return (4 + scani (fd)/90); + if (scanc (fd, 'v')) + return (8 + scani (fd)/90); + return (0); + } + +prrot (r, fd) + rotation r; + + {switch (r/4) { + case 0: cprint (fd, "r"); break; + case 1: cprint (fd, "h"); break; + case 2: cprint (fd, "v"); break; + } + cprint (fd, "%d", 90*(r%4)); + } + +# ifdef GENBOOK + +/********************************************************************** + + bn_grow (b) + +**********************************************************************/ + +bn_grow (b) + bnode *b; + + {position p, *pp; + if (b->nmoves > 0) return; + b = bnexpand (b); + forallpos (p, pp) if (!adjcorner(p) && ismove (b->b, b->c, p)) + {bnode *nb; + rotation r; + if (b->nmoves == MAXEXIT) + {cprint ("Node %d too many exits.\n", b->nodenum); + return; + } + nb = bnalloc (); + nb->depth = b->depth + 1; + nb->c = oppcolor (b->c); + nb->nmoves = 0; + nb->eval = NOT_EVAL; + cpybrd (nb->b, b->b); + putmov (nb->b, b->c, p); + nb = bnuniq (nb, &r); + consexit (&b->moves[b->nmoves],p,FALSE,r,nb->nodenum); + ++b->nmoves; + } + bntrim (b); + } + +bkfixup () + + {board b; + clrbrd (b); + bkfxnode (bnfind (1), 1, b, BLACK); + } + +bkfxnode (bn, depth, b, c) + bnode *bn; + board b; + color c; + + {int i; + color o; + if (bn == 0) return; + if (bn->c != EMPTY) return; + if (bn->depth != 0) return; + bn->c = c; + bn->depth = depth; + cpybrd (bn->b, b); + ++depth; + o = oppcolor (c); + i = bn->nmoves; + while (--i >= 0) if (getrot(&bn->moves[i]) == R0) + {board a; + position p; + bnode *next; + p = getpos (&bn->moves[i]); + if (!ismove (b, c, p)) + {cprint ("Node %d move at "); + prpos (p); + cprint (" is not legal.\n"); + return; + } + cpybrd (a, b); + putmov (a, c, p); + next = extrace (bn, i); + bkfxnode (next, depth, a, o); + } + } + +# endif + \ No newline at end of file diff --git a/src/as/o/ob1.rel b/src/as/o/ob1.rel new file mode 100644 index 00000000..018dc724 Binary files /dev/null and b/src/as/o/ob1.rel differ diff --git a/src/as/o/ob2.c b/src/as/o/ob2.c new file mode 100644 index 00000000..23f19ed6 --- /dev/null +++ b/src/as/o/ob2.c @@ -0,0 +1,107 @@ +#define GENBOOK 1 +#include "ob.h" + +int gmdepth 0; +int gmmdepth 4; + +int geval (b,c) + board b; + color c; + + {color o; + o = oppcolor (c); + return (gmeval (b,c,o)); + } + +int gmeval (b,c,o) + board b; + color c, o; + + {int myscore; + if (++gmdepth == gmmdepth) myscore = gseval (b,c); + else + {register position *pp, p; + myscore = -1000; + forallpos (p, pp) if (ismove (b,c,p)) + {register int temp; + board a; + cpybrd (a,b); + putmov (a,c,p); + temp = -gmeval(a,o,c); + if (temp>myscore) myscore=temp; + } + } + --gmdepth; + return (myscore); + } + +gseval (b, c) + board b; + color c; + + {color o; + position p, *pp; + int nmymoves, nopmoves, s, myscore; + + o = oppcolor (c); + s = -1; + nopmoves = nmymoves = 0; + forallpos (p, pp) + {if (ismove (b,c,p)) + {register int temp; + temp = sqeval (b,c,o,p); + if (temp > 2 && temp != 5) /* count only good moves */ + {++nmymoves; + if (edge (p)) nmymoves=+2; /* count edges higher */ + } + } + if (ismove (b,o,p)) + {register int temp; + temp = sqeval (b,o,c,p); + if (temp > 2 && temp != 5) /* count only good moves */ + {++nopmoves; + if (edge (p)) nopmoves=+2; /* count edges higher */ + } + if (temp>s) {s=temp;} + } + } + myscore = nmymoves-nopmoves; + if (nmymoves<6) myscore =- (6-nmymoves)*2; + if (nopmoves<6) myscore =+ (6-nopmoves)*2; + if (s == CORNERVALUE) myscore =- 100; + return (myscore); + } + +bkminimax () + + {bkmxnode (bnfind (1)); + } + +bkmxnode (bn) + bnode *bn; + + {int i, myscore; + if (bn == 0) return; + i = bn->nmoves; + if (i == 0) return; + myscore = NOT_EVAL; + while (--i >= 0) + {bnode *next; + int temp; + next = extrace (bn, i); + bkmxnode (next); + temp = -(next->eval); + if (temp > myscore) myscore = temp; + } + bn->eval = myscore; + i = bn->nmoves; + while (--i >= 0) + {bnode *next; + int temp; + next = extrace (bn, i); + temp = -(next->eval); + if (temp == myscore) setgood (&bn->moves[i]); + } + } + + \ No newline at end of file diff --git a/src/as/o/ob2.rel b/src/as/o/ob2.rel new file mode 100644 index 00000000..df07c7f8 Binary files /dev/null and b/src/as/o/ob2.rel differ diff --git a/src/as/o/ob3.c b/src/as/o/ob3.c new file mode 100644 index 00000000..48727af4 --- /dev/null +++ b/src/as/o/ob3.c @@ -0,0 +1,2 @@ +#define GENBOOK 1 +#include "obk.code" diff --git a/src/as/o/ob3.rel b/src/as/o/ob3.rel new file mode 100644 index 00000000..9168b681 Binary files /dev/null and b/src/as/o/ob3.rel differ diff --git a/src/as/o/obk.code b/src/as/o/obk.code new file mode 100644 index 00000000..4dec17e6 --- /dev/null +++ b/src/as/o/obk.code @@ -0,0 +1,151 @@ +#include "ob.h" + +extern bnode *bnlist[MAXNODE]; +extern int nnodes; +bnode *curbn; +bnode *bnfind(); +rotation currot; + +/********************************************************************** + + rotation code + +**********************************************************************/ + +position rotate (p, r) + position p; + rotation r; + + {int x, y; + + x = posx (p); + y = posy (p); + switch (r/4) { + case 0: break; + case 1: y = 7 - y; break; + case 2: x = 7 - x; break; + default: cprint ("bad flip"); + } + r =% 4; + while (--r >= 0) + {int temp; + temp = y; + y = 7 - x; + x = temp; + } + return (pos (x, y)); + } + +rotation rotadd (r1, r2) + rotation r1, r2; + + {int flip1, flip2; + + if (r1 == R0) return (r2); + if (r2 == R0) return (r1); + flip1 = r1 / 4; + r1 = r1 % 4; + flip2 = r2 / 4; + r2 = r2 % 4; + if (flip2==0) + return (flip1*4 + ((r1 + r2) % 4)); + if ((r1 % 2) != 0) flip2 = oppflip (flip2); + return (rotadd (flipadd (flip1, flip2), (r1 + r2) % 4)); + } + +rotation flipadd (f1, f2) + + {if (f1 == f2) return (R0); + if (f1 == 0) return (f2*4); + if (f2 == 0) return (f1*4); + return (R180); + } + +int oppflip (f1) + + {if (f1 == 0) return (0); + return (3 - f1); + } + +/********************************************************************** + + bk_clear + +**********************************************************************/ + +bk_init () + + {int i; + extern int book[]; + for (i=1;imoves[n]), currot));} + +bk_move (p) + + {bnode *extrace (); + if (curbn) + {int n; + n = curbn->nmoves; + while (--n >= 0) + {if (p == bkmvn (n)) + {currot = rotadd (getrot (&curbn->moves[n]), currot); + curbn = extrace (curbn, n); + return; + } + } + curbn = 0; + } + } + +bnode *extrace (bn, n) + bnode *bn; + + {return (bnfind (getnext (&bn->moves[n]))); + } + +int bk_lookup (t, tp) + struct mt t[64], *tp[64]; + + {int n, k; + if (curbn == 0) return (0); + + k = 0; + n = curbn->nmoves; + while (--n >= 0) + {if (getgood (&curbn->moves[n])) + {t[k].p = bkmvn (n); + tp[k] = &t[k]; + ++k; + } + } + return (k); + } + +bnode *bnfind (n) + + {if (n>0 && n<=nnodes) return (bnlist[n]); + return (0); + } + + \ No newline at end of file diff --git a/src/as/o/obktst.c b/src/as/o/obktst.c new file mode 100644 index 00000000..6bb9de6e --- /dev/null +++ b/src/as/o/obktst.c @@ -0,0 +1,191 @@ +#include "o.h" +#include "c/c.defs" +int eflag 0, debug 0, endgame 0, stdout, printf, fprintf; +int movnum 15; +int mvnhack 1; +int handicap 0; + +#define USNAME 016 +static int oldsname; +extern int cin, cout; + +main () + + {oldsname = rsuset (USNAME); + rdbook ("book"); + while (TRUE) docommand (); + } + +rdbook (s) + char *s; + + {int fd; + fd = xopen (s, 'r'); + if (fd <= 0) return; + bk_parse (fd); + cclose (fd); + } + +int xopen (fname, mode) + char *fname; + + {int fd, temp; + temp = rsuset (USNAME); + wsuset (USNAME, oldsname); + fd = copen (fname, mode); + wsuset (USNAME, temp); + return (fd); + } + +int xdelete (fname) + char *fname; + + {int temp; + temp = rsuset (USNAME); + wsuset (USNAME, oldsname); + delete (fname); + wsuset (USNAME, temp); + } + +savbook () + + {int fd, n; + filespec fs; + char *itoa (); + static char fnbuf[20] {'b', 'o', 'o', 'k', '.'}; + + fd = xopen ("book", 'w'); + if (fd <= 0) {cprint ("Can't save book.\n"); cexit ();} + filnam (itschan (fd), &fs); + c6tos (fs.fn2, fnbuf+5); + n = atoi (fnbuf+5); + bk_print (fd); + cclose (fd); + n = n - 4; + itoa (n, fnbuf+5); + xdelete (fnbuf); + } + +docommand () + + {int c; + putchar ('%'); + c = utyi (); + switch (c) { + case 'g': cprint ("Grow tree\n"); dogrow (); break; + case 'e': cprint ("Evaluate\n"); doeval (); break; + case 'f': cprint ("Flush evaluations\n"); doflush (); break; + case 'm': cprint ("Minimax\n"); bkminimax(); break; + case 't': cprint ("Test moves\n"); testmoves(); return; + case 'w': cprint ("Write tree\n"); dowrite(); return; + default: putchar ('?'); return; + } + savbook (); + } + +dowrite () + + {int fd; + fd = xopen ("cbook", 'w'); + if (fd != OPENLOSS) + {bk_write (fd); + cclose (fd); + } + else cprint ("Cant write file\n"); + } + +dogrow () + + {int n; + cprint ("Enter number of leaf nodes to grow: "); + n = scani (cin); + if (n<=0) return; + bk_grow (n); + } + +doeval () + + {int n; + cprint ("Enter number of leaf nodes to evaluate: "); + n = scani (cin); + if (n<=0) return; + bk_eval (n); + } + +doflush () + + {bk_clean (); + } + +show (n) + + {char buf[20]; + int fd, w; + + fd = copen (buf, 'w', "s"); + cprint (fd, "%d", n); + cclose (fd); + w = csto6 (buf); + wsuset (USNAME, w); + } + +testmoves () + + {cprint ("Black moving first:\n"); + bk_clear (BLACK); + tmoves (BLACK); + cprint ("White moving first:\n"); + bk_clear (WHITE); + tmoves (WHITE); + } + +tmoves (c) + color c; + + {while (TRUE) + {position p; + struct mt t[64], *tp[64]; + int k, i; + + k = bk_lookup (t, tp); + if (k == 0) + {cprint ("Book has no moves.\n"); + return; + } + if (c==BLACK) cprint ("Moves for * are: "); + else cprint ("Moves for @ are: "); + for (i=0;ip; + cprint (" "); + prpos (p, cout); + cprint (","); + } + cprint ("\n"); + cprint ("Move: "); + p = scanpos (cin); + if (p < 0 || p > 100) return; + bk_move (p); + c = oppcolor (c); + } + } + +atoi (s) +char *s; + + {int n, c; + n = 0; + while (c = *s++) n = (n * 10) + (c - '0'); + return (n); + } + +char *itoa (n, s) +char *s; + + {int a; + if (n<0) n=0; + if (a = (n / 10)) s = itoa (a, s); + *s++ = '0' + n%10; + *s = 0; + return (s); + } + \ No newline at end of file diff --git a/src/as/o/obktst.rel b/src/as/o/obktst.rel new file mode 100644 index 00000000..7c4b7a8e Binary files /dev/null and b/src/as/o/obktst.rel differ diff --git a/src/as/o/obktst.stinkr b/src/as/o/obktst.stinkr new file mode 100644 index 00000000..db3de634 --- /dev/null +++ b/src/as/o/obktst.stinkr @@ -0,0 +1,12 @@ +x c/clib +l blt +l ismove +l o2 +l o3 +l o4 +l o5 +l obktst +l ob1 +l ob2 +l ob3 +o ts obktst diff --git a/src/as/o/oprint.c b/src/as/o/oprint.c new file mode 100644 index 00000000..a1936578 --- /dev/null +++ b/src/as/o/oprint.c @@ -0,0 +1,167 @@ +# include "o.h" + +int movnum; + +# define FORFEIT 1000 +# define NOMOVE 1001 +# define ILLEGAL 1002 + +main (argc, argv) + char *argv[]; + + {char *infn, *outfn; + int in, out; + ++argv; + --argc; + if (argc != 2) + {puts ("Usage: oprint in.file out.file"); + return; + } + infn = argv[0]; + outfn = argv[1]; + in = copen (infn, 'r'); + if (in == -1) + {cprint ("Can't open input: %s\n", infn); + return; + } + out = copen (outfn, 'w'); + if (out == -1) + {cprint ("Can't open output: %s\n", outfn); + return; + } + oprint (in, out); + cclose (in); + cclose (out); + } + +oprint (in, out) + + {board b; + + clrbrd (b); + movnum = 1; + while (domove (b, in, out)); + op_score (b, out); + } + +domove (b, in, out) + board b; + + {position p1, p2; + board b1; + + rmovnum (in); + p1 = doply (b, in, BLACK); + if (p1 == ILLEGAL) return (0); + cpybrd (b1, b); + if (p1 < FORFEIT) putmov (b1, BLACK, p1); + p2 = doply (b1, in, WHITE); + if (p2 == ILLEGAL) return (0); + prbrds (b, b1, out); + prmvs (p1, p2, out); + cpybrd (b,b1); + if (p2 < FORFEIT) putmov (b, WHITE, p2); + ++movnum; + return (p2 != NOMOVE); + } + +position doply (b, in, cc) + board b; + color cc; + + {int c; + position p; + + p = ILLEGAL; + c = cgetc (in); + if (c <= 0) return (NOMOVE); + while (c == ' ' || c == '\t') c = cgetc (in); + if (c == 'F' && !anymvs (b, cc)) p = FORFEIT; + else if (c == '.' && movnum == 1 && cc == BLACK) p = NOMOVE; + else if (c >= '1' && c <= '8') + {int x, y; + x = c - '1'; + c = cgetc (in); + if (c == '-') + {c = cgetc (in); + if (c >= '1' && c <= '8') + {position p1; + y = c - '1'; + p1 = pos (x, y); + if (ismove (b, cc, p1)) p = p1; + } + } + } + while (c != ' ' && c != '\n' && c) + {if (c == '.') + {cgetc (in); + cgetc (in); + break; + } + c = cgetc (in); + } + if (c == '\n' && cc == BLACK) ungetc (0, in); + if (p == ILLEGAL) cprint ("Move %d is illegal.\n", movnum); + return (p); + } + +prbrds (b, b1, out) + board b, b1; + + {int x, y; + cprint (out, " 1 2 3 4 5 6 7 8\t 1 2 3 4 5 6 7 8\n"); + for (x=0;x<8;++x) + {cprint (out, "%d", x+1); + for (y=0;y<8;++y) opsq (b,x,y,out); + cprint (out, "\t%d", x+1); + for (y=0;y<8;++y) opsq (b1,x,y,out); + cputc ('\n', out); + } + cputc ('\n', out); + } + +prmvs (p1, p2, out) + position p1, p2; + + {cprint (out, "%d. ", movnum); + prmv (p1, out); + cprint (out, " ... "); + prmv (p2, out); + cputc ('\n', out); + if ((movnum % 5) == 0) cputc ('\p', out); + else cputc ('\n', out); + } + +prmv (p, out) + position p; + + {switch (p) { + case NOMOVE: cprint (out, " "); return; + case FORFEIT: cprint (out, "Forfeit"); return; + case ILLEGAL: return; + } + cprint (out, "%d-%d", posx(p)+1, posy(p)+1); + } + +opsq (b, x, y, out) + board b; + position x, y; + + {register int z; + extern char pcolor[]; + cputc (' ', out); + z = b[pos(x,y)]; + if (z<=2) z = pcolor[z]; + cputc(z,out); + } + +rmovnum (in) + + {int c; + c = cgetc (in); + while (c != ' ' && c != '\t' && c) c = cgetc (in); + } + +op_score (b, out) + {;} + \ No newline at end of file diff --git a/src/as/o/oprint.rel b/src/as/o/oprint.rel new file mode 100644 index 00000000..c4b7cc50 Binary files /dev/null and b/src/as/o/oprint.rel differ diff --git a/src/as/o/oprint.stinkr b/src/as/o/oprint.stinkr new file mode 100644 index 00000000..74433d7f --- /dev/null +++ b/src/as/o/oprint.stinkr @@ -0,0 +1,10 @@ +x c/clib +l blt +l ismove +l o2 +l o3 +l o4 +l o5 +l oprint +o ts oprint + \ No newline at end of file diff --git a/src/as/o/ostat.c b/src/as/o/ostat.c new file mode 100644 index 00000000..2b0d8211 --- /dev/null +++ b/src/as/o/ostat.c @@ -0,0 +1,577 @@ +# include "c/c.defs" +# include "c/its.bits" +# define MAXUSER 300 +# define FNSIZE 40 + +/********************************************************************** + + Incremental Statistics Generator -- Othello + +**********************************************************************/ + +/********************************************************************** + + The following code is per-program: + +**********************************************************************/ + +# define BUFSIZ 20 +# define statfilename "/c/_    o.stat" +# define sumfilename "/common/o.stats" +# define accfilename "/dm/c/_    o. state" +# define oldfilename "/dm/c/_    o.ostat" + +char *mlist[] { + "dm", + "ml", + "ai", + "mc" + }; + +int pflag {TRUE}; /* default is to print accumulated stats */ + +struct _stat { + int name; /* user name - in SIXBIT */ + int user; /* user score */ + int machine; /* machine score */ + int hcap; /* handicap */ + int aflag; /* too much help? */ + int color; /* either 0, 1=*, or 2=@ */ + }; + +struct _user { + int name; /* must be first */ + int total; + int totalpercent; + int won[3]; + int cheat[3]; + int lost[3]; + int drawn[3]; + int percent[3]; /* must be last */ + }; + +/********************************************************************** + + The following code is common. + +**********************************************************************/ + +typedef struct _stat stat; +typedef struct _user user; + +user usertab[MAXUSER], *cuser, *euser; +extern int cout; +cal thetime; +int usersize; +int changed; + +main (argc, argv) + char *argv[]; + + {int addstat(), wsummary(); + if (!wizard()) + {cprint ("Please do not run this program;\n"); + cprint ("you may screw up a permanent data base.\n"); + cprint ("Thank you for your cooperation.\n"); + return; + } + now (&thetime); + usersize = sizeof (*cuser) / sizeof (pflag); + changed = FALSE; + cuser = usertab; + euser = usertab+MAXUSER; + if (argc>1 && stcmp (argv[1], "-p")) pflag = !pflag; + foreach (addstat); + if (!changed) + {cprint ("No recent statistics.\n"); + rdacc (); + sortuser (); + } + foreach (wsummary); + if (pflag) wfacc (cout, FALSE); + } + +foreach (f) + int (*f)(); + + {int n; + char **p; + n = sizeof(mlist)/sizeof(mlist[0]); + p = mlist; + while (--n >= 0) + (*f)(*p++); + } + +wsummary (s) char *s; + + {char *t, buf[FNSIZE]; + t = stcpy ("/", buf); + t = stcpy (s, t); + stcpy (sumfilename, t); + wfnacc (buf, FALSE); + } + +char stfname[FNSIZE]; + +int wizard () + + {int xuname, option; + xuname = rsuset (UXUNAME); + option = rsuset (UOPTION); + return (!(option & (010000<<18)) & (xuname == csto6 ("AS"))); + } + +addstat (s) char *s; + + {char *t; + t = stcpy ("/", stfname); + t = stcpy (s, t); + stcpy (statfilename, t); + if (yexists ()) /* if YSTAT file exists */ + {apy2o (s); /* append YSTAT file to OSTAT file */ + dely (); /* delete YSTAT file */ + changed = TRUE; + } + if (!xexists ()) /* if XSTAT file doesn't exist */ + {rns2x (); /* rename STAT file to XSTAT */ + if (!xexists ()) /* if XSTAT file doesn't exist */ + return; + } + changed = TRUE; + rdacc (); /* read accumulated stats */ + rdxstat (); /* read XSTAT file - add to acc stats */ + sortuser (); /* sort accumulated stats */ + wfnacc (accfilename, TRUE); /* update accumulated stats */ + rnx2y (); /* rename XSTAT file to YSTAT file */ + apy2o (s); /* print YSTAT and append to OSTAT file */ + dely (); /* delete YSTAT file */ + } + +int xexists () + + {char buf[FNSIZE]; + int fd; + apfname (buf, stfname, "xstat"); + fd = copen (buf, 'r'); + if (fd != OPENLOSS) + {cclose (fd); + return (TRUE); + } + return (FALSE); + } + +int yexists () + + {char buf[FNSIZE]; + int fd; + apfname (buf, stfname, "ystat"); + fd = copen (buf, 'r'); + if (fd != OPENLOSS) + {cclose (fd); + return (TRUE); + } + return (FALSE); + } + +rns2x () + + {char buf[FNSIZE]; + apfname (buf, stfname, "xstat"); + rename (stfname, buf); + } + +rnx2y () + + {char buf1[FNSIZE], buf2[FNSIZE]; + apfname (buf1, stfname, "xstat"); + apfname (buf2, stfname, "ystat"); + rename (buf1, buf2); + } + +rdacc () + + {int fd, rc; + + fd = copen (accfilename, 'r'); + if (fd == OPENLOSS) + {cprint ("Can't read stats file: %s\n", accfilename); + cexit (1); + } + rc = rdfacc (fd); + cclose (fd); + if (rc) + {cprint ("Error in reading stats file: %s\n", accfilename); + cexit (1); + } + } + +rdxstat () + + {int fd, n, unk; + char buf[FNSIZE]; + stat cstat; + + apfname (buf, stfname, "xstat"); + fd = copen (buf, 'r'); + if (fd == OPENLOSS) + {cprint ("Cant open %s\n", buf); + cexit (1); + } + n = 0; + unk = csto6 ("?"); + while (!ceof (fd)) + {++n; + if (rdstat (fd, &cstat)) continue; + if (cstat.name == unk) + cprint ("File %s stat %d unknown user\n", buf, n); + enterstat (&cstat); + } + cclose (fd); + } + +wfnacc (s, full) + + {int fd; + fd = copen (s, 'w'); + if (fd == OPENLOSS) + {if (!full) cprint ("Warning: "); + cprint ("Cant write stats file: %s\n", s); + if (full) cexit (1); + return; + } + wfacc (fd, full); + cclose (fd); + } + +apy2o (s) + char *s; + + {char buf[FNSIZE]; + int fin, fout, c; + + apfname (buf, stfname, "ystat"); + fin = copen (buf, 'r'); + if (fin == OPENLOSS) + {cprint ("Cant read YSTAT file: %s\n", buf); + cexit (1); + } + fout = copen (oldfilename, 'a'); + if (fout == OPENLOSS) + {cprint ("Cant append to OSTAT file: %s\n", buf); + cexit (1); + } + cprint ("\n %s:\n\n", s); + while (c = cgetc (fin)) + {cputc (c, fout); + putchar (c); + } + putchar ('\n'); + cclose (fin); + cclose (fout); + } + +dely () + + {char buf[FNSIZE]; + + apfname (buf, stfname, "ystat"); + delete (buf); + } + +getfield (fd, s, n) + char s[]; + + {char *ebuf; + int c; + + ebuf = s + (n-1); + c = cgetc (fd); + while (c == ' ' || c == '\t') c = cgetc (fd); + while (TRUE) + {if (c == ' ' || c == '\t') + {*s = 0; + return (0); + } + if (c == '\n' || c <= 0) return (1); + if (s < ebuf) *s++ = c; + c = cgetc (fd); + } + return (1); + } + +/********************************************************************** + + GETLINE - Read a line into a buffer. + Return 1 if EOF detected. + +**********************************************************************/ + +getline (fd, s, n) + char *s; + + {return (scan (fd, s, n, '\n'));} + +scan (fd, s, n, tc) char *s; + + {char *ebuf; + int c; + + ebuf = s + (n-1); + while (c = cgetc (fd)) + {if (c == tc) + {*s = 0; + return (0); + } + if (c == '\n') return (1); + if (s < ebuf) *s++ = c; + } + return (1); + } + +int atoi (s) char s[]; + + {int i, sign, c; + + if (!s) return (0); + i = 0; + sign = 1; + while (*s == '-') {++s; sign = -sign;} + while ((c = *s++)>='0' && c<='9') i = i*10 + c-'0'; + if (i<0) + {i = -i; + if (i<0) + if (sign>0) return (-(i+1)); + else return (i); + } + return (sign*i); + } + +rename (s1, s2) char *s1, *s2; + + {filespec f1, f2; + fparse (s1, &f1); + fparse (s2, &f2); + sysrnm (&f1, &f2); + } + +int rd60th (s) + char *s; + + {int sum, done, n; + char *e; + + sum = 0; + e = s; + done = FALSE; + while (!done) + {while (*e != ':' && *e != '.' && *e) ++e; + done = !*e; + *e = 0; + n = atoi (s); + sum = sum * 60 + n; + s = e+1; + e = s; + } + return (sum); + } + +/********************************************************************** + + particular code + +**********************************************************************/ + +sortuser () + + {user *up, *up1; + + for (up=usertab;upwon[i] + up->lost[i]; + totaltotal =+ total; + totalwin =+ up->won[i]; + up->percent[i] = up->won[i]*1000/total; + } + up->totalpercent = totalwin*1000/totaltotal; + } + for (up=usertab;uptotalpercent < up->totalpercent) continue; + if (up1->totalpercent == up->totalpercent) + if (up1->total <= up->total) continue; + sz = sizeof(temp)/sizeof(0); + s = up; d = &temp; n = sz; + while (--n >= 0) *d++ = *s++; + s = up1; d = up; n = sz; + while (--n >= 0) *d++ = *s++; + s = &temp; d = up1; n = sz; + while (--n >= 0) *d++ = *s++; + } + } + +wfacc (fd, full) + + {if (full) wrall (fd); + else wrsum (fd); + } + +wrall (fd) + + {user *up; + + for (up=usertab;upname, buf); + cprint (fd, "%s", buf); + sz = sizeof(*up)/sizeof(0); + p = up; + ++p; --sz; + while (--sz >= 0) cprint (fd, " %d", *p++); + cputc ('\n', fd); + } + } + +wrsum (fd) + + {user *up; + int cutoff, twon, tcheat, tlost, tdrawn, tpercent; + int nuser, spercent; + + cutoff = 4; + twon = tcheat = tlost = tdrawn = nuser = spercent = 0; + cprint (fd, "Othello Statistics as of "); + prcal (&thetime, fd); + cprint (fd, "\n\n note: cheat = win, but used analysis more than 10 times\n"); + cprint (fd, " users playing %d games or fewer not included\n", cutoff); + cprint (fd, + "\n\nuser\t won cheat lost drawn win %% win %% win %%\n"); + cprint (fd, "\t black white total\n\n"); + for (up=usertab;uptotal > cutoff) + { + int swon, scheat, slost, sdrawn; + ++nuser; + twon =+ (swon = up->won[0]+up->won[1]+up->won[2]); + tcheat =+ (scheat = up->cheat[0]+up->cheat[1]+up->cheat[2]); + tlost =+ (slost = up->lost[0]+up->lost[1]+up->lost[2]); + tdrawn =+ (sdrawn = up->drawn[0]+up->drawn[1]+up->drawn[2]); + spercent =+ up->totalpercent; + c6tos (up->name, buf); + cprint (fd, "%s\t%5d%8d%8d%8d", buf, swon, + scheat, slost, sdrawn); + prpercent (fd, up->percent[1]); + prpercent (fd, up->percent[2]); + prpercent (fd, up->totalpercent); + cputc ('\n', fd); + } + } + cprint (fd, "\ntotals\t%5d%8d%8d%8d", twon, tcheat, tlost, tdrawn); + tpercent = twon*1000/(twon+tlost); + cprint (fd, "%22d.%d\n", tpercent/10, tpercent%10); + spercent = spercent/nuser; + cprint (fd, "average\t%51d.%d\n", spercent/10, tpercent%10); + } + +prpercent (fd, n) + {cprint (fd, "%6d.%d", n/10, n%10); + } + +enterstat (p) stat *p; + + {user *up; + + up = ulookup (p->name); + if (up && p->hcap == 0) + {if (p->user > p->machine) + if (!p->aflag) ++up->won[p->color]; + else ++up->cheat[p->color]; + else if (p->user < p->machine) ++up->lost[p->color]; + else ++up->drawn[p->color]; + ++up->total; + } + } + +ulookup (n) + + {user *up; + + for (up=usertab;upname == n) return (up); + if (cuser < euser) + {int i; + cuser->name = n; + cuser->total = 0; + for (i=0;i<=2;++i) + {cuser->won[i] = 0; + cuser->lost[i] = 0; + cuser->cheat[i] = 0; + cuser->drawn[i] = 0; + } + return (cuser++); + } + return (0); + } + +rdstat (fd, p) stat *p; + + {char buf[BUFSIZ], *s; + + if (scan (fd, buf, BUFSIZ, '\t')) return (1); + p->name = csto6 (buf); + if (scan (fd, buf, BUFSIZ, '-')) return (1); + p->user = atoi (buf); + if (scan (fd, buf, BUFSIZ, '\t')) return (1); + p->machine = atoi (buf); + if (scan (fd, buf, BUFSIZ, '\t')) return (1); + + s = buf; + p->color = 0; + if (*s == '*') {p->color = 1; ++s;} + else if (*s == '@') {p->color = 2; ++s;} + p->aflag = FALSE; + if (*s == 'a') {p->aflag = TRUE; ++s;} + else if (*s == 'r') {p->user = 0; p->machine = 100; ++s;} + p->hcap = atoi (s); + + if (scan (fd, buf, BUFSIZ, '\n')) return (1); + return (0); + } + +rdfacc (fd) + + {cuser = usertab; + while (rduser (fd)); + return (0); + } + +int rduser (fd) + + {char buf[BUFSIZ]; + int name, sz, *p; + user *up; + + if (getfield (fd, buf, BUFSIZ)) return (0); + if (buf[0] == 0) return (0); + name = csto6 (buf); + up = ulookup (name); + if (up->total) + {c6tos (name, buf); + cprint ("Duplicate stats entry for %s\n", buf); + } + sz = sizeof(*up)/sizeof(0); + p = up; + ++p; --sz; sz =- 3; /* ignore percent fields */ + while (--sz >= 0) + {if (getfield (fd, buf, BUFSIZ)) return (0); + *p++ = atoi (buf); + } + if (getline (fd, buf, BUFSIZ)) return (0); + return (1); + } diff --git a/src/as/o/oxgp.c b/src/as/o/oxgp.c new file mode 100644 index 00000000..961d2237 --- /dev/null +++ b/src/as/o/oxgp.c @@ -0,0 +1,508 @@ +# include "c/c.defs" +# define FORFEIT 'F' + +char *filename; +char *itoa(); + +int formno; /* 0=old form (backwards init position), + 1=new form */ + +main (argc, argv) +int argc; +char *argv[]; + + {int fout, fin, n; + static char opnstr[13] + {'o', 'g', 'a', 'm', 'e', '.', '1' }; + fout = copen("o.xgp",'w'); /* open output file */ + prxgpheader (fout); + --argc; + ++argv; + n = 0; + if (argc == 0) + {filename = opnstr; + fin = copen ("ogame.<", 'r'); + if (fin > 0) + {filespec fs; + filnam (itschan (fin), &fs); + c6tos (fs.fn2, opnstr+6); + n = atoi (opnstr+6); + cclose (fin); + while (TRUE) + {fin = copen (opnstr, 'r'); + if (fin > 0) dofile (fin, fout, opnstr); + else break; + ++n; + itoa (n, opnstr+6); + } + } + } + else + {while (--argc >= 0) + {filename = *argv; + fin = copen (*argv, 'r'); + if (fin > 0) dofile (fin, fout, *argv); + ++argv; + } + } + cclose(fout); + } + +prxgpheader (fout) + {cprint(fout,";SKIP 1\n;VSP 0\n;LFTMAR 96\n;TOPMAR 0\n;BOTMAR 0\n"); + cprint(fout,";KSET DSK:FONTS1;O20,DSK:FONTS1;METM,DSK:FONTS;20FG\n"); + } + +dofile(fin,fout,fname) + char *fname; + + {while (dogame (fin, fout, fname)); + cclose(fin); + } + +dogame (fin, fout, fname) + char *fname; + + {char board [8] [8] [8]; + char movstr [8][4], gmstr[200], title[100]; + int m, blen, scores [8][2], bnum; + blen = parse(fin, gmstr, title); + if (blen < 0) return (0); + cprint(fout, "\p\n\400`%s (%s)\n\n\412", title, fname); + initboard (board, scores); + bnum=0; + for (m=0;m= 0) + cprint(fout, xgpst1[i] , ++bnum, movstr [i], + scores [i] [0], scores [i] [1]); + else + {if (movstr[i] [0] == -1) + cprint(fout, xgpst2[i], ++bnum); + else break; + } + if (movstr[++i] [0] >= 0) + cprint(fout, xgpst1[i] , movstr [i], + scores [i] [0], scores [i] [1]); + else + {if (movstr[i] [0] == -1) + cprint(fout, xgpst2[i]); + else break; + } + } + cprint(fout, "\n\"\412\400"); + } + + /* print the eight board positions */ + +pr8pos (fout, movstr, board) + char board[8] [8] [8]; + char movstr [8][4]; + + {register int i, j, k; + + for(j=0; j<8; ++j) + {for (i=0;i<8;++i) + {if (movstr[i] [0] == -2) break; + for (k=0; k<8; ++k) + cputc(board [i] [j] [k], fout); + cputc(' ', fout); + if (movstr [++i] [0] == -2) break; + for (k=0; k<8; ++k) + cputc(board [i] [j] [k], fout); + cprint(fout, " "); + } + cprint(fout, "\n"); + } + } + + /* print the bottom line */ + +prbottom (fout, movstr) + char movstr[8][4]; + + {register int j; + char static *xgpst3[7] + {"", " ", " \\", " ", + " X", " \p", " \tT", " "}; + + for(j=0; j<8; ++j) + {if (movstr[j][0] == -2) break; + cprint(fout, "%s!j\"", xgpst3[j]); + } + } + +int makmv(board, color, hpos, vpos, movstr) +char board [8] [8]; +char movstr[4]; +int color, hpos, vpos; + + {int i,j,ocolor; + int nchng; + + movstr[0] = hpos; + movstr[1] = '-'; + movstr[2] = vpos; + movstr[3] = '\0'; + hpos = hpos - '0'; + vpos = vpos - '0'; + + if (board[--hpos][--vpos] !='_') return(0); + + nchng = 0; + ocolor = 'B'; + if (color=='B') ocolor = 'W'; + + if ((hpos>1) && (board [hpos-1] [vpos] == ocolor)) + { + {for (i=hpos-2; + (i>=0)&&(board[i] [vpos]==ocolor); + --i) ; + } + if ((i>=0)&&(board[i][vpos]==color)) + {nchng = nchng+(hpos-(++i)); + do board [i] [vpos] = color; + while (++i < hpos); + } + } + + if ((hpos>1) && (vpos>1) && (board [hpos-1] [vpos-1] == ocolor)) + { + {for (i=hpos-2, j=vpos-2; + (i>=0)&&(j>=0)&&(board[i] [j]==ocolor); + --i, --j) ; + } + if ((i>=0)&&(j>=0)&&(board[i][j]==color)) + {nchng = nchng+(hpos-(++i)); + do board[i][++j]=color; + while (++i < hpos); + } + } + + if ((vpos>1) && (board [hpos] [vpos-1] == ocolor)) + { + {for (j=vpos-2; + (j>=0)&&(board[hpos] [j]==ocolor); + --j) ; + } + if ((j>=0)&&(board[hpos][j]==color)) + {nchng = nchng+(vpos-(++j)); + do board [hpos] [j] = color; + while (++j < vpos); + } + } + + if ((hpos<6) && (vpos>1) && (board [hpos+1] [vpos-1] == ocolor)) + { + {for (i=hpos+2, j=vpos-2; + (i<=7)&&(j>=0)&&(board[i] [j]==ocolor); + ++i, --j) ; + } + if ((i<=7)&&(j>=0)&&(board[i][j]==color)) + {nchng = nchng+((--i)-hpos); + do board [i][++j] = color; + while (--i > hpos); + } + } + + if ((hpos<6) && (board [hpos+1] [vpos] == ocolor)) + { + {for (i=hpos+2; + (i<=7)&&(board[i] [vpos]==ocolor); + ++i) ; + } + if ((i<=7)&&(board[i][vpos]==color)) + {nchng = nchng+((--i)-hpos); + do board [i] [vpos] = color; + while (--i > hpos); + } + } + + if ((hpos<6) && (vpos<6) && (board [hpos+1] [vpos+1] == ocolor)) + { + {for (i=hpos+2, j=vpos+2; + (i<=7)&&(j<=7)&&(board[i] [j]==ocolor); + ++i, ++j) ; + } + if ((i<=7)&&(j<=7)&&(board[i][j]==color)) + {nchng = nchng+((--i)-hpos); + do board[i][--j] = color; + while (--i > hpos); + } + } + + if ((vpos<6) && (board [hpos] [vpos+1] == ocolor)) + { + {for (j=vpos+2; + (j<=7)&&(board[hpos] [j]==ocolor); + ++j) ; + } + if ((j<=7)&&(board[hpos][j]==color)) + {nchng = nchng+((--j)-vpos); + do board [hpos] [j] = color; + while(--j > vpos); + } + } + + if ((hpos>1) && (vpos<6) && (board [hpos-1] [vpos+1] == ocolor)) + { + {for (i=hpos-2, j=vpos+2; + (i>=0)&&(j<=7)&&(board[i] [j]==ocolor); + --i, ++j) ; + } + if ((i>=0)&&(j<=7)&&(board[i][j]==color)) + {nchng = nchng+(hpos-(++i)); + do board [i] [--j] = color; + while(++i < hpos); + } + } + + if (nchng) board [hpos] [vpos] = color; + return(nchng); + } + +int parse (fin, gmstr, title) +int fin; +char gmstr[], title[]; + + {int n, i, c; + if (ceof (fin)) return (-1); + formno = 0; + c = cgetc (fin); + if (c && c != '1') + {while (c && c == ' ') c = cgetc (fin); + while (c && c != '\n' && c != '\p') + {*title++ = c; + if (c == '(') formno = 1; + c = cgetc (fin); + } + if (c != '\n') return (-1); + while (c != '1' && c) c = cgetc (fin); + } + *title = 0; + + if (ceof (fin)) return (-1); + n = 0; + do + {i = rdline (fin, gmstr, n); + n =+ i; + } + while (i == 4); + while (gmstr[n-2] == FORFEIT) n =- 2; + return (n); + } + +int rdline (fin, gmstr, n) +char gmstr[]; + + {int chr; + + gmstr[n] = gmstr[n+2] = FORFEIT; + if (ceof (fin)) return (0); + if (n>0) /* initial 1 already read */ + {cgetc(fin); + if (n>=((10-1)*4)) cgetc(fin); + } + if (cgetc(fin) != '.') + {pskip (fin); + return (0); + } + cgetc (fin); + if ((chr=cgetc(fin)) == 'F') skip (fin, 6); + else if (chr=='R') + {pskip (fin); + return (0); + } + else + {gmstr[n] = chr; + cgetc(fin); + gmstr[n+1] = cgetc(fin); + } + chr = cgetc (fin); + if (chr == ' ') + {chr = cgetc (fin); + if (chr == '(') + {do chr=cgetc (fin); + while (chr && chr != '\n' && chr != '\p' + && chr != ')'); + if (chr==')') chr=cgetc (fin); + } + } + if (chr != '.') + {pskip (fin); + return (2); + } + skip (fin, 2); + if ((chr=cgetc(fin)) == 'F') skip (fin, 6); + else if (chr=='R') + {pskip (fin); + return (2); + } + else + {gmstr[n+2] = chr; + cgetc(fin); + gmstr[n+3] = cgetc(fin); + } + while ((chr=cgetc(fin)) != '\n' && chr != '\p' && chr); + return (4); + } + +skip (f, n) + {while (--n>=0) cgetc (f); + } + +pskip (f) + {int c; + while (((c = cgetc (f)) != '\p') && c); + } + +atoi (s) +char *s; + + {int n, c; + n = 0; + while (c = *s++) n = (n * 10) + (c - '0'); + return (n); + } + +char *itoa (n, s) +char *s; + + {int a; + if (n<0) n=0; + if (a = (n / 10)) s = itoa (a, s); + *s++ = '0' + n%10; + *s = 0; + return (s); + } + \ No newline at end of file diff --git a/src/as/o/random.1 b/src/as/o/random.1 new file mode 100644 index 00000000..9a610876 --- /dev/null +++ b/src/as/o/random.1 @@ -0,0 +1,30 @@ +; +; RANDOM NUMBER GENERATOR (STOLEN FROM MUDDLE) +; +RELOCATABLE +TITLE RANDOM +.INSRT C;NC INSERT +.INSRT C;NM INSERT + +CENTRY SRAND,[SEED] + MOVE A,SEED + ROT A,-1 + MOVEM A,RLOW + RETURN + +CENTRY RAND + + MOVE A,RHI + MOVE B,RLOW + MOVEM A,RLOW ;Update Low seed + LSHC A,-1 ;Shift both right one bit + XORB B,RHI ;Generate output and update High seed + MOVE A,B + RETURN + +.IDATA +RHI: 267762113337 +RLOW: 155256071112 +.PDATA + +END diff --git a/src/as/o/random.rel b/src/as/o/random.rel new file mode 100644 index 00000000..39c0983b Binary files /dev/null and b/src/as/o/random.rel differ diff --git a/src/as/o/stdio.c b/src/as/o/stdio.c new file mode 100644 index 00000000..564feae0 --- /dev/null +++ b/src/as/o/stdio.c @@ -0,0 +1,69 @@ +# include "c/c.defs" +int stdin, stdout; +extern int cin, cout; + +stdio () + + {stdin = cin; stdout = cout; + on (ctrlg_interrupt, INT_IGNORE); + } + +flopen (name, mode) char *name, *mode; + + {int f; + f = copen (name, mode[0]); + if (f == OPENLOSS) return (0); + return (f); + } + +printf (a, b, c, d, e, f, g) + {cprint (cout, a, b, c, d, e, f, g);} + +fprintf (a, b, c, d, e, f, g) + {cprint (a, b, c, d, e, f, g);} + +strcmp (s1, s2) {return (stcmp (s2, s2));} + +fclose (f) {cclose (f);} + +fread (f, buf, size, number) char buf[]; + + {int n; + n = size * number; + while (--n >= 0) *buf++ = cgetc (f); + } + +freopen (name, mode, f) char *name, *mode; + + {int i; + cclose (f); + i = copen (name, *mode); + return (i); + } + +getuid () {return (rsuset (074));} + +getpw (w, buf) char *buf; + {c6tos (w, buf);} + +nowtime (tv) int tv[]; + {cal foo; + now (&foo); + tv[0] = tv[1] = cal2f (&foo); + } + +char *ctime (tv) int tv[]; + {static char buf[100]; + cal foo; + int f; + f2cal (tv[0], &foo); + f = copen (buf, 'w', "s"); + prcal (&foo, f); + cputc ('\n', f); + cclose (f); + return (buf); + } + +unlink (s) {delete (s);} +exit (cc) {cexit (cc);} + \ No newline at end of file diff --git a/src/as/o/stdio.rel b/src/as/o/stdio.rel new file mode 100644 index 00000000..801e4c63 Binary files /dev/null and b/src/as/o/stdio.rel differ diff --git a/src/as/o/test.book b/src/as/o/test.book new file mode 100644 index 00000000..e74b408c --- /dev/null +++ b/src/as/o/test.book @@ -0,0 +1,10 @@ +1: 3-5 2, 4-6 v270 2, 5-3 v90 2, 6-4 r180 2g; +2: 3-6 3g, 3-4 999, 5-6 999; +3: 3-7 999, 4-6 4g, 5-3 999, 6-4 999; +4: 3-4 5g, 5-6 h90 5; +5: +6: +7: +8: +9: +10:  \ No newline at end of file