WPBDC 2013.2.1 → 2014.3.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/ext/WPBDC/WPBDC.c +10 -0
- data/ext/WPBDC/analysis.c +104 -3
- data/ext/WPBDC/bridge.c +4 -4
- data/ext/WPBDC/bridge_parser.c +0 -2
- data/ext/WPBDC/bridge_sketch.c +1 -1
- data/ext/WPBDC/internal.h +11 -10
- data/ext/WPBDC/judge.c +54 -12
- data/ext/WPBDC/judge.h +6 -3
- data/ext/WPBDC/proto.h +3 -0
- data/ext/WPBDC/scenario.c +6 -397
- data/ext/WPBDC/scenario_descriptors.h +394 -0
- data/lib/WPBDC.rb +3 -0
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
Y2JiOTA2NjQ1OTI2YmRhZmJiYTJmMjZhZjNiNmMyMGFkOTY5OWQzNQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZWU4NDFmMmNmMjBjODVlNjUwYjUzYjM3MDBmNWU0ZDQ1MTM3ZTMyZQ==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
YTQ4YmE4NjRiMTUxOTRlNTgwNTAzMzVkNGYxYjg3NjQyMzU5MTUzMTJhNjZl
|
10
|
+
NmQ0OTNmZGY0NWM3ZTZkOTNmZDc0YWQ2NmRmMGEyYTQzZDAxZmVmYjEwZGRl
|
11
|
+
N2FiOTEwNWU4YTQxZGFlYWYyMmVmNTliZTNlNmRmN2ZjNTRiNDU=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
M2ZmNTVjNTQ3YjA3Y2JhZjAyYWFjZjM2ZDYyOTU3YjRkZjg2MmY4M2Y5ODg0
|
14
|
+
Nzk4NjlmYjVkMjAxM2M5NTVmZjVlZmUyZGZhNmI0YjIyNmZjYjRmOTZlODZk
|
15
|
+
MjhiMTg4Y2I5MzAwZjM5Y2FmNTA1ZDNlODAzYjkwZjA0YTEwNWU=
|
data/ext/WPBDC/WPBDC.c
CHANGED
@@ -154,6 +154,15 @@ static VALUE rb_api_analysis_table(VALUE self, VALUE bridge_as_string)
|
|
154
154
|
return c_str_to_value(result);
|
155
155
|
}
|
156
156
|
|
157
|
+
static VALUE rb_api_analysis_log(VALUE self, VALUE bridge_as_string)
|
158
|
+
#define ARGC_analysis_log 1
|
159
|
+
{
|
160
|
+
Check_Type(bridge_as_string, T_STRING);
|
161
|
+
INIT_STRING_FROM_VALUE(bridge_internal_string, bridge_as_string);
|
162
|
+
char *result = analysis_log(bridge_internal_string);
|
163
|
+
return c_str_to_value(result);
|
164
|
+
}
|
165
|
+
|
157
166
|
static VALUE rb_api_local_contest_number_to_id(VALUE self, VALUE number_as_string)
|
158
167
|
#define ARGC_local_contest_number_to_id 1
|
159
168
|
{
|
@@ -180,6 +189,7 @@ static struct ft_entry {
|
|
180
189
|
FUNCTION_TABLE_ENTRY(perturbation),
|
181
190
|
FUNCTION_TABLE_ENTRY(sketch),
|
182
191
|
FUNCTION_TABLE_ENTRY(analysis_table),
|
192
|
+
FUNCTION_TABLE_ENTRY(analysis_log),
|
183
193
|
FUNCTION_TABLE_ENTRY(local_contest_number_to_id),
|
184
194
|
};
|
185
195
|
|
data/ext/WPBDC/analysis.c
CHANGED
@@ -465,7 +465,6 @@ char *analysis_to_html(TAnalysis *analysis,
|
|
465
465
|
char *rtn, *p;
|
466
466
|
char buf[1024];
|
467
467
|
unsigned member_index;
|
468
|
-
TLoadScenario *ls;
|
469
468
|
|
470
469
|
#define Append(S) do { \
|
471
470
|
char *q = (S); \
|
@@ -495,8 +494,6 @@ char *analysis_to_html(TAnalysis *analysis,
|
|
495
494
|
assert(params);
|
496
495
|
// result is optional
|
497
496
|
|
498
|
-
ls = &bridge->load_scenario;
|
499
|
-
|
500
497
|
// Allocate an initial return buffer.
|
501
498
|
New(140, rtn, rtn_size, char);
|
502
499
|
p = rtn;
|
@@ -614,6 +611,110 @@ char *analysis_to_html(TAnalysis *analysis,
|
|
614
611
|
return rtn;
|
615
612
|
}
|
616
613
|
|
614
|
+
char *analysis_to_text(TAnalysis *analysis,
|
615
|
+
TBridge *bridge,
|
616
|
+
TGeometry *geometry,
|
617
|
+
TLoading *loading,
|
618
|
+
TParams *params,
|
619
|
+
struct analysis_result_t *result)
|
620
|
+
{
|
621
|
+
size_t rtn_size = 1024 * 8;
|
622
|
+
char *rtn, *p;
|
623
|
+
char buf[1024];
|
624
|
+
unsigned member_index;
|
625
|
+
|
626
|
+
assert(analysis);
|
627
|
+
assert(bridge);
|
628
|
+
assert(geometry);
|
629
|
+
assert(loading);
|
630
|
+
assert(params);
|
631
|
+
// result is optional
|
632
|
+
|
633
|
+
// Allocate an initial return buffer.
|
634
|
+
New(145, rtn, rtn_size, char);
|
635
|
+
p = rtn;
|
636
|
+
|
637
|
+
if (analysis->error) {
|
638
|
+
sprintf(buf, "Analysis error: %d\n", analysis->error);
|
639
|
+
Append(buf);
|
640
|
+
return rtn;
|
641
|
+
}
|
642
|
+
|
643
|
+
#define AppendTab Append("\t")
|
644
|
+
#define AppendNewline Append("\n")
|
645
|
+
|
646
|
+
// Header
|
647
|
+
AppendInt(bridge->n_design_iterations);
|
648
|
+
AppendTab;
|
649
|
+
Append(bridge->scenario_descriptor.id);
|
650
|
+
AppendTab;
|
651
|
+
Append(bridge->scenario_descriptor.number);
|
652
|
+
AppendTab;
|
653
|
+
if (result)
|
654
|
+
AppendFloat(result->cost/100, 2);
|
655
|
+
else
|
656
|
+
AppendFloat(bridge_cost(bridge, geometry, params), 2);
|
657
|
+
AppendNewline;
|
658
|
+
for (member_index = 1; member_index <= bridge->n_members; member_index++) {
|
659
|
+
TXSection *xs = &bridge->members[member_index].x_section;
|
660
|
+
TFloat compressive = analysis->member_strength[member_index].compressive;
|
661
|
+
TFloat tensile = analysis->member_strength[member_index].tensile;
|
662
|
+
AppendInt(member_index);
|
663
|
+
AppendTab;
|
664
|
+
Append(params->shapes[xs->section][xs->size].name);
|
665
|
+
AppendTab;
|
666
|
+
Append(section_str(xs->section));
|
667
|
+
AppendTab;
|
668
|
+
Append(params->materials[xs->material].short_name);
|
669
|
+
AppendTab;
|
670
|
+
AppendFloat(geometry->length[member_index], 6);
|
671
|
+
AppendTab;
|
672
|
+
AppendFloat(analysis->max_forces[member_index].compression, 6);
|
673
|
+
AppendTab;
|
674
|
+
AppendFloat(compressive, 6);
|
675
|
+
AppendTab;
|
676
|
+
if (compressive > 0)
|
677
|
+
AppendFloat(analysis->max_forces[member_index].compression/compressive, 6);
|
678
|
+
else
|
679
|
+
Append("oo");
|
680
|
+
AppendTab;
|
681
|
+
switch (analysis->member_strength[member_index].compressive_fail_mode) {
|
682
|
+
case FailModeNone:
|
683
|
+
Append("OK");
|
684
|
+
break;
|
685
|
+
case FailModeSlenderness:
|
686
|
+
Append("Slenderness");
|
687
|
+
break;
|
688
|
+
default:
|
689
|
+
Append("Fail");
|
690
|
+
break;
|
691
|
+
}
|
692
|
+
AppendTab;
|
693
|
+
AppendFloat(analysis->max_forces[member_index].tension, 6);
|
694
|
+
AppendTab;
|
695
|
+
AppendFloat(tensile, 6);
|
696
|
+
AppendTab;
|
697
|
+
if (tensile > 0)
|
698
|
+
AppendFloat(analysis->max_forces[member_index].tension/tensile, 6);
|
699
|
+
else
|
700
|
+
Append("oo");
|
701
|
+
AppendTab;
|
702
|
+
switch (analysis->member_strength[member_index].tensile_fail_mode) {
|
703
|
+
case FailModeNone:
|
704
|
+
Append("OK");
|
705
|
+
break;
|
706
|
+
case FailModeSlenderness:
|
707
|
+
Append("Slenderness");
|
708
|
+
break;
|
709
|
+
default:
|
710
|
+
Append("Fail");
|
711
|
+
break;
|
712
|
+
}
|
713
|
+
AppendNewline;
|
714
|
+
}
|
715
|
+
return rtn;
|
716
|
+
}
|
717
|
+
|
617
718
|
static char *test_status_str[] = {
|
618
719
|
"Unrecorded",
|
619
720
|
"Untested",
|
data/ext/WPBDC/bridge.c
CHANGED
@@ -242,10 +242,10 @@ void canonicalize(TBridge *dst, TBridge *src)
|
|
242
242
|
|
243
243
|
// Ignore joints that are outside the rectangular extent of the member.
|
244
244
|
joint = &dst->joints[joint_index];
|
245
|
-
if (start->x > joint->x && end->x > joint->x ||
|
246
|
-
start->x < joint->x && end->x < joint->x ||
|
247
|
-
start->y > joint->y && end->y > joint->y ||
|
248
|
-
start->y < joint->y && end->y < joint->y)
|
245
|
+
if ((start->x > joint->x && end->x > joint->x) ||
|
246
|
+
(start->x < joint->x && end->x < joint->x) ||
|
247
|
+
(start->y > joint->y && end->y > joint->y) ||
|
248
|
+
(start->y < joint->y && end->y < joint->y))
|
249
249
|
continue;
|
250
250
|
|
251
251
|
// Check if the joint is on the line struck by the member ends.
|
data/ext/WPBDC/bridge_parser.c
CHANGED
@@ -1059,7 +1059,6 @@ void pack_bridge(STRING *in_str, STRING *out_str,
|
|
1059
1059
|
{
|
1060
1060
|
TBridge bridge[1];
|
1061
1061
|
char *mutable_copy;
|
1062
|
-
char *rtn = 0;
|
1063
1062
|
|
1064
1063
|
init_bridge(bridge);
|
1065
1064
|
|
@@ -1091,7 +1090,6 @@ void unpack_bridge(STRING *in_str, STRING *out_str,
|
|
1091
1090
|
{
|
1092
1091
|
TBridge bridge[1];
|
1093
1092
|
char *mutable_copy;
|
1094
|
-
char *rtn = 0;
|
1095
1093
|
|
1096
1094
|
init_bridge(bridge);
|
1097
1095
|
|
data/ext/WPBDC/bridge_sketch.c
CHANGED
@@ -54,7 +54,7 @@ void do_sketch(TBridge *bridge,
|
|
54
54
|
{
|
55
55
|
IMAGE image[1];
|
56
56
|
static RGB_TRIPLE white[1] = {{255, 255, 255}};
|
57
|
-
static RGB_TRIPLE black[1] = {{0, 0, 0}};
|
57
|
+
//static RGB_TRIPLE black[1] = {{0, 0, 0}};
|
58
58
|
static RGB_TRIPLE gray[1] = {{192, 192, 192}};
|
59
59
|
RGB_TRIPLE color[1];
|
60
60
|
UNSIGNED bridge_width_grids;
|
data/ext/WPBDC/internal.h
CHANGED
@@ -283,8 +283,8 @@ typedef struct params_t {
|
|
283
283
|
{ /* [1] */ \
|
284
284
|
"Case B (Heavy Deck, Heavy Truck)", \
|
285
285
|
DEAD_LOAD_FACTOR * 120.265 + 33.097, /* TFloat point_dead_load; */ \
|
286
|
-
|
287
|
-
|
286
|
+
120, /* TFloat front_axle_load; */ \
|
287
|
+
120, /* TFloat rear_axle_load; */ \
|
288
288
|
}, \
|
289
289
|
{ /* [2] */ \
|
290
290
|
"Case C (Light Deck, Light Truck)", \
|
@@ -295,11 +295,11 @@ typedef struct params_t {
|
|
295
295
|
{ /* [3] */ \
|
296
296
|
"Case D (Light Deck, Heavy Truck)", \
|
297
297
|
DEAD_LOAD_FACTOR * 82.608 + 33.097, /* TFloat point_dead_load; */ \
|
298
|
-
|
299
|
-
|
298
|
+
120, /* TFloat front_axle_load; */ \
|
299
|
+
120, /* TFloat rear_axle_load; */ \
|
300
300
|
}, \
|
301
301
|
}, \
|
302
|
-
|
302
|
+
500, /* TFloat connection_cost; */ \
|
303
303
|
1000, /* TFloat ordering_fee; */ \
|
304
304
|
{ /* TMaterial materials[NMaterials]; */ \
|
305
305
|
{ \
|
@@ -309,7 +309,7 @@ typedef struct params_t {
|
|
309
309
|
250000, /* TFloat Fy; */ \
|
310
310
|
7850, /* TFloat density; */ \
|
311
311
|
{ /* TFloat cost[NSections]; */ \
|
312
|
-
|
312
|
+
4.50, /* Bar */ \
|
313
313
|
6.30, /* Tube */ \
|
314
314
|
} \
|
315
315
|
}, \
|
@@ -320,8 +320,8 @@ typedef struct params_t {
|
|
320
320
|
345000, /* TFloat Fy; */ \
|
321
321
|
7850, /* TFloat density; */ \
|
322
322
|
{ /* TFloat cost[NSections]; */ \
|
323
|
-
|
324
|
-
7.
|
323
|
+
5.00, /* Bar */ \
|
324
|
+
7.00, /* Tube */ \
|
325
325
|
} \
|
326
326
|
}, \
|
327
327
|
{ \
|
@@ -331,8 +331,8 @@ typedef struct params_t {
|
|
331
331
|
485000, /* TFloat Fy; */ \
|
332
332
|
7850, /* TFloat density; */ \
|
333
333
|
{ /* TFloat cost[NSections]; */ \
|
334
|
-
5.
|
335
|
-
7.
|
334
|
+
5.55, /* Bar */ \
|
335
|
+
7.75, /* Tube */ \
|
336
336
|
} \
|
337
337
|
}, \
|
338
338
|
} \
|
@@ -427,6 +427,7 @@ void clear_analysis(TAnalysis *anal);
|
|
427
427
|
void setup_analysis(TAnalysis *anal, TBridge *bridge, TGeometry *geometry, TLoading *loading, TParams *params);
|
428
428
|
void do_analyze(STRING *bridge_as_string, TAnalysis *analysis, TBridge *bridge, TGeometry *geometry, TLoading *loading, TParams *params, struct analysis_result_t *result);
|
429
429
|
char *analysis_to_html(TAnalysis *analysis, TBridge *bridge, TGeometry *geometry, TLoading *loading, TParams *params, struct analysis_result_t *result);
|
430
|
+
char *analysis_to_text(TAnalysis *analysis, TBridge *bridge, TGeometry *geometry, TLoading *loading, TParams *params, struct analysis_result_t *result);
|
430
431
|
void print_analysis(FILE *f, TAnalysis *anal, TBridge *bridge, TGeometry *geometry, TLoading *loading, TParams *params);
|
431
432
|
/* bridge.c */
|
432
433
|
void init_bridge(TBridge *bridge);
|
data/ext/WPBDC/judge.c
CHANGED
@@ -25,8 +25,8 @@
|
|
25
25
|
// External interface.
|
26
26
|
#include "judge.h"
|
27
27
|
|
28
|
-
#if BD_VERSION !=
|
29
|
-
#error Wrong BD_VERSION. Should be
|
28
|
+
#if BD_VERSION != 0x414c
|
29
|
+
#error Wrong BD_VERSION. Should be 0x414c.
|
30
30
|
#endif
|
31
31
|
|
32
32
|
// Extension stubs --------------------------------------------------------------
|
@@ -171,8 +171,6 @@ void sketch(STRING *bridge_as_string,
|
|
171
171
|
|
172
172
|
char *get_local_contest_number(STRING *number_as_string)
|
173
173
|
{
|
174
|
-
char *rtn;
|
175
|
-
|
176
174
|
if (number_as_string->size != SCENARIO_NUMBER_SIZE)
|
177
175
|
return NULL;
|
178
176
|
return local_contest_number_to_id(number_as_string->ptr);
|
@@ -201,15 +199,39 @@ char *analysis_table(STRING *bridge_as_string)
|
|
201
199
|
return rtn;
|
202
200
|
}
|
203
201
|
|
202
|
+
char *analysis_log(STRING *bridge_as_string)
|
203
|
+
{
|
204
|
+
TBridge bridge[1];
|
205
|
+
TParams params[1];
|
206
|
+
TGeometry geometry[1];
|
207
|
+
TLoading loading[1];
|
208
|
+
TAnalysis analysis[1];
|
209
|
+
struct analysis_result_t result[1];
|
210
|
+
char *rtn = 0;
|
211
|
+
|
212
|
+
do_analyze(bridge_as_string, analysis, bridge, geometry, loading, params, result);
|
213
|
+
if (!bridge->error)
|
214
|
+
rtn = analysis_to_text(analysis, bridge, geometry, loading, params, result);
|
215
|
+
|
216
|
+
clear_analysis(analysis);
|
217
|
+
clear_bridge(bridge);
|
218
|
+
clear_geometry(geometry);
|
219
|
+
clear_loading(loading);
|
220
|
+
clear_params(params);
|
221
|
+
|
222
|
+
return rtn;
|
223
|
+
}
|
224
|
+
|
204
225
|
#if defined(NATIVE_TEST) && !defined(CPROTO)
|
205
226
|
|
206
227
|
//#define WRITE_EXAMPLES
|
207
228
|
|
208
229
|
#ifdef WRITE_EXAMPLES
|
230
|
+
#define PREVIOUS_YEAR_DELTA 2
|
209
231
|
#define EG_DIR "../../test/eg/2012"
|
210
|
-
#define NEW_EG_DIR "../../test/eg/
|
232
|
+
#define NEW_EG_DIR "../../test/eg/2014"
|
211
233
|
#else
|
212
|
-
#define EG_DIR "../../test/eg/
|
234
|
+
#define EG_DIR "../../test/eg/2014"
|
213
235
|
#endif
|
214
236
|
|
215
237
|
#ifdef WINDOWS
|
@@ -219,6 +241,7 @@ char *analysis_table(STRING *bridge_as_string)
|
|
219
241
|
#include <sys/types.h>
|
220
242
|
#include <sys/stat.h>
|
221
243
|
#include <dirent.h>
|
244
|
+
#include <unistd.h>
|
222
245
|
|
223
246
|
void strcpyn(char *dst, char *src, int n)
|
224
247
|
{
|
@@ -229,7 +252,6 @@ void strcpyn(char *dst, char *src, int n)
|
|
229
252
|
|
230
253
|
void split_path(char *path, char *drv, char *dir, char *fname, char *ext)
|
231
254
|
{
|
232
|
-
int len = strlen(path);
|
233
255
|
char *colon, *slash, *dot;
|
234
256
|
|
235
257
|
colon = strchr(path, ':');
|
@@ -305,7 +327,7 @@ int main(int argc, char* argv[])
|
|
305
327
|
TLoading loading[1];
|
306
328
|
TAnalysis anal[1];
|
307
329
|
int i, n, test_case;
|
308
|
-
long h;
|
330
|
+
//long h;
|
309
331
|
COMPRESSED_IMAGE compressed_image[1];
|
310
332
|
|
311
333
|
#ifdef WRITE_EXAMPLES
|
@@ -355,8 +377,10 @@ int main(int argc, char* argv[])
|
|
355
377
|
continue;
|
356
378
|
|
357
379
|
// SINGLE TEST CASE!
|
380
|
+
/*
|
358
381
|
if (strcmp(dir_ent->d_name, "semis-01.bdc") != 0)
|
359
382
|
continue;
|
383
|
+
*/
|
360
384
|
|
361
385
|
printf("Test case %d (%s):\n", test_case, dir_ent->d_name);
|
362
386
|
sprintf(fname, EG_DIR "/%s", dir_ent->d_name);
|
@@ -381,7 +405,7 @@ int main(int argc, char* argv[])
|
|
381
405
|
#ifdef WRITE_EXAMPLES
|
382
406
|
|
383
407
|
// Set the parser to look for last year's bridges.
|
384
|
-
contest_year = CONTEST_YEAR -
|
408
|
+
contest_year = CONTEST_YEAR - PREVIOUS_YEAR_DELTA;
|
385
409
|
#endif
|
386
410
|
|
387
411
|
// Try a parse.
|
@@ -401,7 +425,7 @@ int main(int argc, char* argv[])
|
|
401
425
|
|
402
426
|
if (!strstr(dir_ent->d_name, "failed")) {
|
403
427
|
|
404
|
-
struct
|
428
|
+
struct stat stat_buf[1];
|
405
429
|
|
406
430
|
n_examples_read++;
|
407
431
|
|
@@ -432,7 +456,7 @@ int main(int argc, char* argv[])
|
|
432
456
|
// Write a failed version of this bridge for future testing.
|
433
457
|
printf("writing failed version\n");
|
434
458
|
sprintf(fname, NEW_EG_DIR "/" "%s-failed%s", name, ext);
|
435
|
-
if (
|
459
|
+
if (stat(fname, stat_buf) != 0 && induce_failure(copy, bridge, 0) == 0) {
|
436
460
|
text = unparse_bridge(copy);
|
437
461
|
copy_str->ptr = text;
|
438
462
|
copy_str->size = strlen(text);
|
@@ -546,7 +570,7 @@ int main(int argc, char* argv[])
|
|
546
570
|
text = analysis_table(bridge_str);
|
547
571
|
|
548
572
|
if (text) {
|
549
|
-
printf("writing analysis...");
|
573
|
+
printf("writing analysis table...");
|
550
574
|
split_path(dir_ent->d_name, 0, path, name, ext);
|
551
575
|
sprintf(buf, "Debug/html/%s.htm", name);
|
552
576
|
f = fopen(buf, "w");
|
@@ -566,6 +590,24 @@ int main(int argc, char* argv[])
|
|
566
590
|
Safefree(text);
|
567
591
|
}
|
568
592
|
|
593
|
+
// Do an analysis log.
|
594
|
+
text = analysis_log(bridge_str);
|
595
|
+
|
596
|
+
if (text) {
|
597
|
+
printf("writing analysis log...");
|
598
|
+
split_path(dir_ent->d_name, 0, path, name, ext);
|
599
|
+
sprintf(buf, "Debug/text/%s.txt", name);
|
600
|
+
f = fopen(buf, "w");
|
601
|
+
if (!f) {
|
602
|
+
fprintf(stderr, "can't open %s for output", buf);
|
603
|
+
return 4;
|
604
|
+
}
|
605
|
+
fputs(text, f);
|
606
|
+
fclose(f);
|
607
|
+
|
608
|
+
Safefree(text);
|
609
|
+
}
|
610
|
+
|
569
611
|
//print_analysis(stdout, anal, bridge, geometry, loading, params);
|
570
612
|
//printf("Cost = $%.2lf\n", (double)bridge_cost(bridge, geometry, params));
|
571
613
|
|
data/ext/WPBDC/judge.h
CHANGED
@@ -11,7 +11,7 @@
|
|
11
11
|
#include "rubydefs.h"
|
12
12
|
#include "sketch.h"
|
13
13
|
|
14
|
-
#define CONTEST_YEAR
|
14
|
+
#define CONTEST_YEAR 2014
|
15
15
|
#define YEAR_TO_VERSION(Y) (((((Y) % 100) / 10) << 8) | (((Y) % 10) << 4) | 0x400c)
|
16
16
|
#define BD_VERSION YEAR_TO_VERSION(CONTEST_YEAR)
|
17
17
|
|
@@ -19,8 +19,8 @@
|
|
19
19
|
#define NULL_SEMIFINAL_SCENARIO_ID "0000000000"
|
20
20
|
|
21
21
|
// When you set this, you _must_ change the scenario table so its record is in sorted order!
|
22
|
-
|
23
|
-
|
22
|
+
//#define SEMIFINAL_SCENARIO_ID "3100003100"
|
23
|
+
#define SEMIFINAL_SCENARIO_ID NULL_SEMIFINAL_SCENARIO_ID
|
24
24
|
|
25
25
|
// Status returns from analyze().
|
26
26
|
#define BRIDGE_OK 0
|
@@ -142,6 +142,9 @@ void sketch(STRING *bridge_as_string,
|
|
142
142
|
// Return HTML for a table of analysis data.
|
143
143
|
char *analysis_table(STRING *bridge_as_string);
|
144
144
|
|
145
|
+
// Return tab-delimited text for a table of analysis data.
|
146
|
+
char *analysis_log(STRING *bridge_as_string);
|
147
|
+
|
145
148
|
// Accept a string containing a scenario number.
|
146
149
|
// Return a pointer to the 3-character local contest code or null if no match.
|
147
150
|
char *get_local_contest_number(STRING *number_as_string);
|