diff options
| author | Richard Qin <richard.qin.x@gmail.com> | 2025-10-14 12:57:38 +0000 |
|---|---|---|
| committer | Richard Qin <richard.qin.x@gmail.com> | 2025-10-14 12:57:38 +0000 |
| commit | 275e2ca033a880fe959e7eb4e83268a70318ba57 (patch) | |
| tree | 312cad2e9d0dbeb608fdd300061b854e4cfa891b /btest.h | |
| download | datalab2026-275e2ca033a880fe959e7eb4e83268a70318ba57.tar.gz datalab2026-275e2ca033a880fe959e7eb4e83268a70318ba57.tar.xz | |
Initial commit
Diffstat (limited to 'btest.h')
| -rw-r--r-- | btest.h | 20 |
1 files changed, 20 insertions, 0 deletions
@@ -0,0 +1,20 @@ +typedef int (*funct_t)(void); +typedef int (*funct1_t)(int); +typedef int (*funct2_t)(int, int); +typedef int (*funct3_t)(int, int, int); + +/* Combine all the information about a function and its tests as structure */ +typedef struct { + char* name; /* String name */ + funct_t solution_funct; /* Function */ + funct_t test_funct; /* Test function */ + int args; /* Number of function arguments */ + char* ops; /* List of legal operators. Special case: "$" for floating point */ + int op_limit; /* Max number of ops allowed in solution */ + int rating; /* Problem rating (1 -- 4) */ + int arg_ranges[3][2]; /* Argument ranges. Always defined for 3 args, even if */ + /* the function takes fewer. Special case: First arg */ + /* must be set to {1,1} for f.p. puzzles */ +} test_rec, *test_ptr; + +extern test_rec test_set[]; |
