Rev 33 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 33 | Rev 108 | ||
|---|---|---|---|
| Line 16... | Line 16... | ||
| 16 | * it were played out as well. * |
16 | * it were played out as well. * |
| 17 | * * |
17 | * * |
| 18 | ******************************************************************************* |
18 | ******************************************************************************* |
| 19 | */ |
19 | */ |
| 20 | void ResignOrDraw(TREE * RESTRICT tree, int value) { |
20 | void ResignOrDraw(TREE * RESTRICT tree, int value) { |
| 21 | int result = 0; |
21 | int v, result = 0; |
| 22 | 22 | ||
| 23 | /* |
23 | /* |
| 24 | ************************************************************ |
24 | ************************************************************ |
| 25 | * * |
25 | * * |
| 26 | * If the game is a technical draw, where there are no * |
26 | * If the game is a technical draw, where there are no * |
| Line 107... | Line 107... | ||
| 107 | if (audible_alarm) |
107 | if (audible_alarm) |
| 108 | printf("%c", audible_alarm); |
108 | printf("%c", audible_alarm); |
| 109 | if (speech) { |
109 | if (speech) { |
| 110 | char announce[128]; |
110 | char announce[128]; |
| 111 | 111 | ||
| 112 |
|
112 | strcpy(announce, "./speak "); |
| 113 |
|
113 | strcat(announce, "Resign"); |
| 114 | system(announce); |
114 | v = system(announce); |
| - | 115 | if (v <= 0) |
|
| - | 116 | perror("ResignOrDraw() system() error: "); |
|
| 115 | } |
117 | } |
| 116 | if (crafty_is_white) { |
118 | if (crafty_is_white) { |
| 117 | Print(4095, "0-1 {White resigns}\n"); |
119 | Print(4095, "0-1 {White resigns}\n"); |
| 118 |
|
120 | strcpy(pgn_result, "0-1"); |
| 119 | } else { |
121 | } else { |
| 120 | Print(4095, "1-0 {Black resigns}\n"); |
122 | Print(4095, "1-0 {Black resigns}\n"); |
| 121 |
|
123 | strcpy(pgn_result, "1-0"); |
| 122 | } |
124 | } |
| 123 | } |
125 | } |
| 124 | if (offer_draws && result == 2) { |
126 | if (offer_draws && result == 2) { |
| 125 | draw_offered = 1; |
127 | draw_offered = 1; |
| 126 | if (!xboard) { |
128 | if (!xboard) { |
| 127 | Print( |
129 | Print(1, "\nI offer a draw.\n\n"); |
| 128 | if (audible_alarm) |
130 | if (audible_alarm) |
| 129 | printf("%c", audible_alarm); |
131 | printf("%c", audible_alarm); |
| 130 | if (speech) { |
132 | if (speech) { |
| 131 | char announce[128]; |
133 | char announce[128]; |
| 132 | 134 | ||
| 133 |
|
135 | strcpy(announce, "./speak "); |
| 134 |
|
136 | strcat(announce, "Drawoffer"); |
| 135 | system(announce); |
137 | v = system(announce); |
| - | 138 | if (v <= 0) |
|
| - | 139 | perror("ResignOrDraw() system() error: "); |
|
| 136 | } |
140 | } |
| 137 | } else if (xboard) |
141 | } else if (xboard) |
| 138 | Print(4095, "offer draw\n"); |
142 | Print(4095, "offer draw\n"); |
| 139 | else |
143 | else |
| 140 | Print(4095, "\n*draw\n"); |
144 | Print(4095, "\n*draw\n"); |