| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: comp.c,v 1.12 2009/05/25 23:34:50 dholland Exp $ */ | | 1 | /* $NetBSD: comp.c,v 1.13 2009/05/25 23:44:04 dholland Exp $ */ |
2 | | | 2 | |
3 | /* | | 3 | /* |
4 | * Copyright (c) 1982, 1993 | | 4 | * Copyright (c) 1982, 1993 |
5 | * The Regents of the University of California. All rights reserved. | | 5 | * The Regents of the University of California. All rights reserved. |
6 | * | | 6 | * |
7 | * Redistribution and use in source and binary forms, with or without | | 7 | * Redistribution and use in source and binary forms, with or without |
8 | * modification, are permitted provided that the following conditions | | 8 | * modification, are permitted provided that the following conditions |
9 | * are met: | | 9 | * are met: |
10 | * 1. Redistributions of source code must retain the above copyright | | 10 | * 1. Redistributions of source code must retain the above copyright |
11 | * notice, this list of conditions and the following disclaimer. | | 11 | * notice, this list of conditions and the following disclaimer. |
12 | * 2. Redistributions in binary form must reproduce the above copyright | | 12 | * 2. Redistributions in binary form must reproduce the above copyright |
13 | * notice, this list of conditions and the following disclaimer in the | | 13 | * notice, this list of conditions and the following disclaimer in the |
14 | * documentation and/or other materials provided with the distribution. | | 14 | * documentation and/or other materials provided with the distribution. |
| @@ -24,46 +24,46 @@ | | | @@ -24,46 +24,46 @@ |
24 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | | 24 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
25 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | | 25 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
26 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | | 26 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
27 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | | 27 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
28 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | | 28 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
29 | * SUCH DAMAGE. | | 29 | * SUCH DAMAGE. |
30 | */ | | 30 | */ |
31 | | | 31 | |
32 | #include <sys/cdefs.h> | | 32 | #include <sys/cdefs.h> |
33 | #ifndef lint | | 33 | #ifndef lint |
34 | #if 0 | | 34 | #if 0 |
35 | static char sccsid[] = "@(#)comp.c 8.1 (Berkeley) 5/31/93"; | | 35 | static char sccsid[] = "@(#)comp.c 8.1 (Berkeley) 5/31/93"; |
36 | #else | | 36 | #else |
37 | __RCSID("$NetBSD: comp.c,v 1.12 2009/05/25 23:34:50 dholland Exp $"); | | 37 | __RCSID("$NetBSD: comp.c,v 1.13 2009/05/25 23:44:04 dholland Exp $"); |
38 | #endif | | 38 | #endif |
39 | #endif /* not lint */ | | 39 | #endif /* not lint */ |
40 | | | 40 | |
41 | #include "mille.h" | | 41 | #include "mille.h" |
42 | | | 42 | |
43 | /* | | 43 | /* |
44 | * @(#)comp.c 1.1 (Berkeley) 4/1/82 | | 44 | * @(#)comp.c 1.1 (Berkeley) 4/1/82 |
45 | */ | | 45 | */ |
46 | | | 46 | |
47 | #define V_VALUABLE 40 | | 47 | #define V_VALUABLE 40 |
48 | | | 48 | |
49 | void | | 49 | void |
50 | calcmove(void) | | 50 | calcmove(void) |
51 | { | | 51 | { |
52 | CARD card; | | 52 | CARD card; |
53 | int *value; | | 53 | int *value; |
54 | PLAY *pp, *op; | | 54 | PLAY *pp, *op; |
55 | bool foundend, cango, canstop, foundlow; | | 55 | bool foundend, cango, canstop, foundlow; |
56 | unsgn int i, count200, badcount, nummin, nummax, diff; | | 56 | unsigned int i, count200, badcount, nummin, nummax, diff; |
57 | int curmin, curmax; | | 57 | int curmin, curmax; |
58 | CARD safe, oppos; | | 58 | CARD safe, oppos; |
59 | int valbuf[HAND_SZ], count[NUM_CARDS]; | | 59 | int valbuf[HAND_SZ], count[NUM_CARDS]; |
60 | bool playit[HAND_SZ]; | | 60 | bool playit[HAND_SZ]; |
61 | | | 61 | |
62 | wmove(Score, ERR_Y, ERR_X); /* get rid of error messages */ | | 62 | wmove(Score, ERR_Y, ERR_X); /* get rid of error messages */ |
63 | wclrtoeol(Score); | | 63 | wclrtoeol(Score); |
64 | pp = &Player[COMP]; | | 64 | pp = &Player[COMP]; |
65 | op = &Player[PLAYER]; | | 65 | op = &Player[PLAYER]; |
66 | safe = 0; | | 66 | safe = 0; |
67 | cango = 0; | | 67 | cango = 0; |
68 | canstop = FALSE; | | 68 | canstop = FALSE; |
69 | foundend = FALSE; | | 69 | foundend = FALSE; |