* Copyright (c) 1980 Regents of the University of California.
* Redistribution and use in source and binary forms are permitted
* provided that this notice is preserved and that due credit is given
* to the University of California at Berkeley. The name of the University
* may not be used to endorse or promote products derived from this
* software without specific prior written permission. This software
* is provided ``as is'' without express or implied warranty.
static char sccsid
[] = "@(#)one.c 5.2 (Berkeley) %G%";
max
= (*offptr
< 0? 7: last());
if (board
[p
[i
]]*cturn
<= 0)
if (g
[i
] != home
&& board
[g
[i
]]*cturn
< -1)
if (n
== max
? D1
< n
: D1
!= n
)
if (n
== max
? D0
< n
&& D1
< n
: D0
!= n
&& D1
!= n
)
if (n
== max
? D0
< n
: D0
!= n
) {
if (g
[i
] == home
&& *offptr
< 0)
if (board
[g
[i
]] == -cturn
) {
if (abs(home
-g
[i
]) < 7 && abs(home
-p
[i
]) > 6) {
for (j
= 0; j
<= i
; j
++) {
for (i
= home
-6*cturn
; i
!= home
; i
+= cturn
)
for (j
= i
-1; j
>= 0; j
--)
if (abs(g
[i
]-home
) < 7 && abs(p
[i
]-home
) > 6) {
if (*inptr
+*offptr
< 15 && *offptr
>= 0)