1
0
mirror of https://github.com/openbsd/src.git synced 2025-01-10 06:47:55 -08:00

Sometimes, the computer's move was printed, but the computer's men didn't

actually move.  This happened when "swap" was called earlier, and then
later in the final call to makmove(), swapping back would have been
required, but was erroneously denied.  Patch sent in pjanzen@.

It looks like the bug was already present in the original version
in 4.1a BSD in 1982.
This commit is contained in:
schwarze 2015-07-20 23:04:17 +00:00
parent c35d6329d1
commit 485fcb80c1

View File

@ -1,4 +1,4 @@
/* $OpenBSD: one.c,v 1.5 2009/10/27 23:59:23 deraadt Exp $ */
/* $OpenBSD: one.c,v 1.6 2015/07/20 23:04:17 schwarze Exp $ */
/*
* Copyright (c) 1980, 1993
@ -51,11 +51,8 @@ makmove(i)
} else {
if (n == max ? D0 < n && D1 < n : D0 != n && D1 != n)
return(checkd(d) + 1);
if (n == max ? D0 < n : D0 != n) {
if (d0)
return (checkd(d) + 1);
if (n == max ? D0 < n : D0 != n)
swap;
}
}
if (g[i] == home && *offptr < 0)
return(checkd(d) + 4);